diff options
author | Heinrich Schuchardt <xypron.glpk@gmx.de> | 2014-06-04 19:05:43 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-06-04 19:53:52 -0400 |
commit | cc299a98eb13a9853675a9cbb90b30b4011e1406 (patch) | |
tree | a1bcf01204e5753d1d2016e0ff9885b9f2c1a193 /fs/notify | |
parent | efa8f7e5d7bc2a6f1d1f9b43f9514d02f00b9cb1 (diff) |
fs/notify/fanotify/fanotify_user.c: fix FAN_MARK_FLUSH flag checking
If fanotify_mark is called with illegal value of arguments flags and
marks it usually returns EINVAL.
When fanotify_mark is called with FAN_MARK_FLUSH the argument flags is
not checked for irrelevant flags like FAN_MARK_IGNORED_MASK.
The patch removes this inconsistency.
If an irrelevant flag is set error EINVAL is returned.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Acked-by: Michael Kerrisk <mtk.manpages@gmail.com>
Acked-by: Jan Kara <jack@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/notify')
-rw-r--r-- | fs/notify/fanotify/fanotify_user.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanotify_user.c index f6ac6a2fa91e..9163a6ed67d2 100644 --- a/fs/notify/fanotify/fanotify_user.c +++ b/fs/notify/fanotify/fanotify_user.c | |||
@@ -776,7 +776,10 @@ SYSCALL_DEFINE5(fanotify_mark, int, fanotify_fd, unsigned int, flags, | |||
776 | case FAN_MARK_REMOVE: | 776 | case FAN_MARK_REMOVE: |
777 | if (!mask) | 777 | if (!mask) |
778 | return -EINVAL; | 778 | return -EINVAL; |
779 | break; | ||
779 | case FAN_MARK_FLUSH: | 780 | case FAN_MARK_FLUSH: |
781 | if (flags & ~(FAN_MARK_MOUNT | FAN_MARK_FLUSH)) | ||
782 | return -EINVAL; | ||
780 | break; | 783 | break; |
781 | default: | 784 | default: |
782 | return -EINVAL; | 785 | return -EINVAL; |