All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Monakhov <dmonakhov@openvz.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org,
	ext4 development <linux-ext4@vger.kernel.org>,
	Theodore Ts'o <tytso@mit.edu>, Al Viro <viro@ZenIV.linux.org.uk>,
	Michael Kerrisk <mtk.manpages@gmail.com>
Subject: Re: [PATCH] fs: make generic_block_fiemap sig-tolerant PING2...
Date: Fri, 19 Dec 2014 12:13:50 +0300	[thread overview]
Message-ID: <87egrwf1dd.fsf@openvz.org> (raw)
In-Reply-To: <20141218151247.b6ccd73351f40db66818c07e@linux-foundation.org>


[-- Attachment #1.1: Type: text/plain, Size: 1052 bytes --]

Andrew Morton <akpm@linux-foundation.org> writes:

> On Wed, 10 Dec 2014 16:49:18 +0300 Dmitry Monakhov <dmonakhov@openvz.org> wrote:
>
>> 
>> Hello. Someone please take care of this patch.
>> 
>> W/o that patch unprivileged user may abuse system resources simply by spawning
>> wast number of unkilable busyloops (works on ext2/ext3):
>> 
>> truncate --size 1T test
>> for ((i=0;i<1024;i++))
>> do
>>        filefrag test > /dev/null &
>> done
>> 
>> >> --- a/fs/ioctl.c
>> >> +++ b/fs/ioctl.c
>> >> @@ -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);
>> >>  
>
> Is FIEMAP documented anywhere (manpage)?  If so, that will need an
> update.
Yes you right. I just thought that it is assumed by default.
The only place I know is Documentation/filesystems/fiemap.txt
Please fold patch attached to original one.

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 472 bytes --]

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-doc-fimemap-update-signal-behaviour.patch --]
[-- Type: text/x-diff, Size: 936 bytes --]

>From f7af425b2ac920065491a478b4f4359f422b3453 Mon Sep 17 00:00:00 2001
From: Dmitry Monakhov <dmonakhov@openvz.org>
Date: Fri, 19 Dec 2014 13:11:29 +0400
Subject: [PATCH] doc: fimemap update signal behaviour


Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
---
 Documentation/filesystems/fiemap.txt |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/Documentation/filesystems/fiemap.txt b/Documentation/filesystems/fiemap.txt
index 1b805a0..f6d9c99 100644
--- a/Documentation/filesystems/fiemap.txt
+++ b/Documentation/filesystems/fiemap.txt
@@ -196,7 +196,8 @@ struct fiemap_extent_info {
 };
 
 It is intended that the file system should not need to access any of this
-structure directly.
+structure directly. Filesystem handlers should be tolerant to signals and return
+EINTR once fatal signal received.
 
 
 Flag checking should be done at the beginning of the ->fiemap callback via the
-- 
1.7.1


  reply	other threads:[~2014-12-19  9:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-17 13:24 [PATCH] fs: make generic_block_fiemap sig-tolerant Dmitry Monakhov
2014-12-02 14:43 ` [PATCH] fs: make generic_block_fiemap sig-tolerant PING Dmitry Monakhov
2014-12-10 13:49   ` [PATCH] fs: make generic_block_fiemap sig-tolerant PING2 Dmitry Monakhov
2014-12-18 23:12     ` Andrew Morton
2014-12-19  9:13       ` Dmitry Monakhov [this message]
2014-12-19 21:33         ` Andrew Morton
2014-12-19 23:38           ` Andreas Dilger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87egrwf1dd.fsf@openvz.org \
    --to=dmonakhov@openvz.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mtk.manpages@gmail.com \
    --cc=tytso@mit.edu \
    --cc=viro@ZenIV.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.