mirror of
https://github.com/adulau/aha.git
synced 2024-12-27 03:06:10 +00:00
hfsplus: fix possible deadlock when handling corrupted extents
A corrupted extent for the extent file itself may try to get an impossible extent, causing a deadlock if I see it correctly. Check the inode number after the first_blocks checks and fail if it's the extent file, as according to the spec the extent file should have no extent for itself. Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de> Cc: Roman Zippel <zippel@linux-m68k.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
6e71529444
commit
248736c2a5
1 changed files with 3 additions and 0 deletions
|
@ -199,6 +199,9 @@ int hfsplus_get_block(struct inode *inode, sector_t iblock,
|
|||
goto done;
|
||||
}
|
||||
|
||||
if (inode->i_ino == HFSPLUS_EXT_CNID)
|
||||
return -EIO;
|
||||
|
||||
mutex_lock(&HFSPLUS_I(inode).extents_lock);
|
||||
res = hfsplus_ext_read_extent(inode, ablock);
|
||||
if (!res) {
|
||||
|
|
Loading…
Reference in a new issue