1 From 592f6b842f64e416c7598a1b97c649b34241e22d Mon Sep 17 00:00:00 2001
2 From: Heiko Carstens <heiko.carstens@de.ibm.com>
3 Date: Mon, 27 Jan 2014 17:07:19 -0800
4 Subject: compat: fix sys_fanotify_mark
6 From: Heiko Carstens <heiko.carstens@de.ibm.com>
8 commit 592f6b842f64e416c7598a1b97c649b34241e22d upstream.
10 Commit 91c2e0bcae72 ("unify compat fanotify_mark(2), switch to
11 COMPAT_SYSCALL_DEFINE") added a new unified compat fanotify_mark syscall
12 to be used by all architectures.
14 Unfortunately the unified version merges the split mask parameter in a
15 wrong way: the lower and higher word got swapped.
17 This was discovered with glibc's tst-fanotify test case.
19 Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
20 Reported-by: Andreas Krebbel <krebbel@linux.vnet.ibm.com>
21 Cc: "James E.J. Bottomley" <jejb@parisc-linux.org>
22 Acked-by: "David S. Miller" <davem@davemloft.net>
23 Acked-by: Al Viro <viro@ZenIV.linux.org.uk>
24 Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
25 Cc: Ingo Molnar <mingo@redhat.com>
26 Cc: Ralf Baechle <ralf@linux-mips.org>
27 Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
28 Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
29 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
32 fs/notify/fanotify/fanotify_user.c | 4 ++--
33 1 file changed, 2 insertions(+), 2 deletions(-)
35 --- a/fs/notify/fanotify/fanotify_user.c
36 +++ b/fs/notify/fanotify/fanotify_user.c
37 @@ -867,9 +867,9 @@ COMPAT_SYSCALL_DEFINE6(fanotify_mark,
39 return sys_fanotify_mark(fanotify_fd, flags,
41 - ((__u64)mask1 << 32) | mask0,
43 ((__u64)mask0 << 32) | mask1,
45 + ((__u64)mask1 << 32) | mask0,