+ fs-make-generic_block_fiemap-sig-tolerant.patch added to -mm tree

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

 



The patch titled
     Subject: fsioctl.c: make generic_block_fiemap() signal-tolerant
has been added to the -mm tree.  Its filename is
     fs-make-generic_block_fiemap-sig-tolerant.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/fs-make-generic_block_fiemap-sig-tolerant.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/fs-make-generic_block_fiemap-sig-tolerant.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Dmitry Monakhov <dmonakhov@xxxxxxxxxx>
Subject: 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 <dmonakhov@xxxxxxxxxx>
Cc: Theodore Ts'o <tytso@xxxxxxx>
Cc: Al Viro <viro@xxxxxxxxxxxxxxxxxx>
Cc: Michael Kerrisk <mtk.manpages@xxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 fs/ioctl.c |    5 +++++
 1 file changed, 5 insertions(+)

diff -puN fs/ioctl.c~fs-make-generic_block_fiemap-sig-tolerant fs/ioctl.c
--- a/fs/ioctl.c~fs-make-generic_block_fiemap-sig-tolerant
+++ a/fs/ioctl.c
@@ -379,6 +379,11 @@ int __generic_block_fiemap(struct 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 */
_

Patches currently in -mm which might be from dmonakhov@xxxxxxxxxx are

origin.patch
fs-make-generic_block_fiemap-sig-tolerant.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux