]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/3.10.30/compat-fix-sys_fanotify_mark.patch
5.1-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 3.10.30 / compat-fix-sys_fanotify_mark.patch
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
5
6 From: Heiko Carstens <heiko.carstens@de.ibm.com>
7
8 commit 592f6b842f64e416c7598a1b97c649b34241e22d upstream.
9
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.
13
14 Unfortunately the unified version merges the split mask parameter in a
15 wrong way: the lower and higher word got swapped.
16
17 This was discovered with glibc's tst-fanotify test case.
18
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>
30
31 ---
32 fs/notify/fanotify/fanotify_user.c | 4 ++--
33 1 file changed, 2 insertions(+), 2 deletions(-)
34
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,
38 {
39 return sys_fanotify_mark(fanotify_fd, flags,
40 #ifdef __BIG_ENDIAN
41 - ((__u64)mask1 << 32) | mask0,
42 -#else
43 ((__u64)mask0 << 32) | mask1,
44 +#else
45 + ((__u64)mask1 << 32) | mask0,
46 #endif
47 dfd, pathname);
48 }