Commit 592f6b84 authored by Heiko Carstens's avatar Heiko Carstens Committed by Linus Torvalds

compat: fix sys_fanotify_mark

Commit 91c2e0bc ("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: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
Reported-by: default avatarAndreas Krebbel <krebbel@linux.vnet.ibm.com>
Cc: "James E.J. Bottomley" <jejb@parisc-linux.org>
Acked-by: default avatar"David S. Miller" <davem@davemloft.net>
Acked-by: default avatarAl 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>
Cc: <stable@vger.kernel.org>	[3.10+]
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent b36190c5
...@@ -886,9 +886,9 @@ COMPAT_SYSCALL_DEFINE6(fanotify_mark, ...@@ -886,9 +886,9 @@ COMPAT_SYSCALL_DEFINE6(fanotify_mark,
{ {
return sys_fanotify_mark(fanotify_fd, flags, return sys_fanotify_mark(fanotify_fd, flags,
#ifdef __BIG_ENDIAN #ifdef __BIG_ENDIAN
((__u64)mask1 << 32) | mask0,
#else
((__u64)mask0 << 32) | mask1, ((__u64)mask0 << 32) | mask1,
#else
((__u64)mask1 << 32) | mask0,
#endif #endif
dfd, pathname); dfd, pathname);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment