mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
fsioctl.c: make generic_block_fiemap() signal-tolerant
__generic_block_fiemap may spin very long time for large sparse files.
Without this patch an unprivileged user may abuse system resources simply
by spawning a vast number of unkilable busyloops (works on ext2/ext3):
truncate --size 1T test
for ((i=0;i<1024;i++))
do
filefrag test > /dev/null &
done
Signed-off-by: Dmitry Monakhov <[email protected]>
Cc: Theodore Ts'o <[email protected]>
Cc: Al Viro <[email protected]>
Cc: Michael Kerrisk <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
99b8874e79
commit
913e027ca1
2 changed files with 7 additions and 1 deletions
|
|
@ -379,6 +379,11 @@ int __generic_block_fiemap(struct inode *inode,
|
|||
past_eof = true;
|
||||
}
|
||||
cond_resched();
|
||||
if (fatal_signal_pending(current)) {
|
||||
ret = -EINTR;
|
||||
break;
|
||||
}
|
||||
|
||||
} while (1);
|
||||
|
||||
/* If ret is 1 then we just hit the end of the extent array */
|
||||
|
|
|
|||
Loading…
Reference in a new issue