diff options
author | Jan Kara <jack@suse.cz> | 2013-11-05 01:15:38 +0100 |
---|---|---|
committer | Zefan Li <lizefan@huawei.com> | 2014-09-25 11:49:19 +0800 |
commit | 3a8f61352a884762e6485ab21af08054b76cff69 (patch) | |
tree | d2fd8c697703799b1eae0d0c21b1fa7c9ec5b6b0 /kernel/seccomp.c | |
parent | f79bb94b5ae6581d81f7b65cfc8f11e86bc2c8de (diff) |
ext2: Fix fs corruption in ext2_get_xip_mem()
commit 7ba3ec5749ddb61f79f7be17b5fd7720eebc52de upstream.
Commit 8e3dffc651cb "Ext2: mark inode dirty after the function
dquot_free_block_nodirty is called" unveiled a bug in __ext2_get_block()
called from ext2_get_xip_mem(). That function called ext2_get_block()
mistakenly asking it to map 0 blocks while 1 was intended. Before the
above mentioned commit things worked out fine by luck but after that commit
we started returning that we allocated 0 blocks while we in fact
allocated 1 block and thus allocation was looping until all blocks in
the filesystem were exhausted.
Fix the problem by properly asking for one block and also add assertion
in ext2_get_blocks() to catch similar problems.
Reported-and-tested-by: Andiry Xu <andiry.xu@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Cc: Wang Nan <wangnan0@huawei.com>
Signed-off-by: Zefan Li <lizefan@huawei.com>
Diffstat (limited to 'kernel/seccomp.c')
0 files changed, 0 insertions, 0 deletions