diff options
author | Heiko Carstens <heiko.carstens@de.ibm.com> | 2014-01-27 20:07:19 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-02-13 16:48:00 -0500 |
commit | 060168af7cbbade31561f3a1efbc1bac91ee2166 (patch) | |
tree | 72f4d7c12a4e2cb513175aad07990aff33a41708 | |
parent | 1ea15c440a24bc3f3f091e8867412c96b6efac82 (diff) |
compat: fix sys_fanotify_mark
commit 592f6b842f64e416c7598a1b97c649b34241e22d upstream.
Commit 91c2e0bcae72 ("unify compat fanotify_mark(2), switch to
COMPAT_SYSCALL_DEFINE") added a new unified compat fanotify_mark syscall
to be used by all architectures.
Unfortunately the unified version merges the split mask parameter in a
wrong way: the lower and higher word got swapped.
This was discovered with glibc's tst-fanotify test case.
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Reported-by: Andreas Krebbel <krebbel@linux.vnet.ibm.com>
Cc: "James E.J. Bottomley" <jejb@parisc-linux.org>
Acked-by: "David S. Miller" <davem@davemloft.net>
Acked-by: Al Viro <viro@ZenIV.linux.org.uk>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | fs/notify/fanotify/fanotify_user.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanotify_user.c index 77cc85dd0db0..f1680cdbd88b 100644 --- a/fs/notify/fanotify/fanotify_user.c +++ b/fs/notify/fanotify/fanotify_user.c | |||
@@ -867,9 +867,9 @@ COMPAT_SYSCALL_DEFINE6(fanotify_mark, | |||
867 | { | 867 | { |
868 | return sys_fanotify_mark(fanotify_fd, flags, | 868 | return sys_fanotify_mark(fanotify_fd, flags, |
869 | #ifdef __BIG_ENDIAN | 869 | #ifdef __BIG_ENDIAN |
870 | ((__u64)mask1 << 32) | mask0, | ||
871 | #else | ||
872 | ((__u64)mask0 << 32) | mask1, | 870 | ((__u64)mask0 << 32) | mask1, |
871 | #else | ||
872 | ((__u64)mask1 << 32) | mask0, | ||
873 | #endif | 873 | #endif |
874 | dfd, pathname); | 874 | dfd, pathname); |
875 | } | 875 | } |