NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/58388: ext2fs reads wrongly indexed group descriptors



>Number:         58388
>Category:       kern
>Synopsis:       ext2fs reads wrongly indexed group descriptors
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jul 01 22:10:00 +0000 2024
>Originator:     Taylor R Campbell
>Release:        current
>Organization:
The NetBationund
>Environment:
>Description:
Since the import of ext4 INCOMPAT_64BIT support last August, we've been loading in group descriptors wrongly indexed on some file systems: sizeof(struct ext2_gd) doubled in _memory_, but we kept passing &fs->e2fs_gd[i * fs->e2fs_bsize / sizeof(struct ext2_gd)] to e2fs_cgload and e2fs_cgsave for the same file systems on _disk_.

https://mail-index.netbsd.org/source-changes/2023/08/25/msg147220.html
https://mail-index.netbsd.org/source-changes/2023/08/27/msg147252.html
>How-To-Repeat:
mount an ext2fs file system and try to use it (preferably with rump_ext2fs)
>Fix:
Change

fs->e2fs_bsize / sizeof(struct ext2_gd)

to

fs->e2fs_bsize >> fs->e2fs_group_desc_shift

to properly compute the _on-disk_ number of group descriptors per block.



Home | Main Index | Thread Index | Old Index