Bug 199865
Summary: | out-of-bound write in ext4_init_block_bitmap() when mounting and operating a crafted ext4 image | ||
---|---|---|---|
Product: | File System | Reporter: | Wen Xu (wen.xu) |
Component: | ext4 | Assignee: | fs_ext4 (fs_ext4) |
Status: | RESOLVED CODE_FIX | ||
Severity: | normal | CC: | tytso, wen.xu |
Priority: | P1 | ||
Hardware: | All | ||
OS: | Linux | ||
Kernel Version: | 4.17 | Subsystem: | |
Regression: | No | Bisected commit-id: | |
Attachments: |
The (compressed) crafted image which causes crash
poc.c |
Description
Wen Xu
2018-05-28 19:44:06 UTC
Created attachment 276237 [details]
The (compressed) crafted image which causes crash
Created attachment 276239 [details]
poc.c
This is no longer replicating on the tip of my ext4.git tree: # /vdb/poc/do-865 [ 25.099634] attempt to access beyond end of device [ 25.101223] loop0: rw=0, want=255510, limit=16384 [ 25.103249] EXT2-fs (loop0): error: ext2_readdir: bad page in #2 [ 25.105162] EXT2-fs (loop0): error: remounting filesystem read-only [ 25.108074] attempt to access beyond end of device [ 25.109576] loop0: rw=0, want=255510, limit=16384 Never mind; I see my mistake; I needed to force the use of ext4. The file system doesn't trigger problems on ext2. Oops, ignore comment #5; this erroneously posted to the wrong bug. Bug #199865 is triggered by the fact block group descriptors were corrupted due to the fact that one of the allocation bitmaps overlapped with the block group descriptors. Then when a block bitmap needed to be initialized, the corrupted block group descriptors resulted in the byte before the bitmap getting zero'ed. This will be fixed via these patches: ext4: always check block group bounds in ext4_init_block_bitmap() ext4: make sure bitmaps and the inode table don't overlap with bg descriptors Patchwork links: http://patchwork.ozlabs.org/patch/929237/ http://patchwork.ozlabs.org/patch/929238/ This has been assigned CVE-2018-10878 Red Hat Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1596802 |