3.12-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Heiko Carstens <heiko.carst...@de.ibm.com>

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.carst...@de.ibm.com>
Reported-by: Andreas Krebbel <kreb...@linux.vnet.ibm.com>
Cc: "James E.J. Bottomley" <j...@parisc-linux.org>
Acked-by: "David S. Miller" <da...@davemloft.net>
Acked-by: Al Viro <v...@zeniv.linux.org.uk>
Cc: Benjamin Herrenschmidt <b...@kernel.crashing.org>
Cc: Ingo Molnar <mi...@redhat.com>
Cc: Ralf Baechle <r...@linux-mips.org>
Signed-off-by: Andrew Morton <a...@linux-foundation.org>
Signed-off-by: Linus Torvalds <torva...@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gre...@linuxfoundation.org>

---
 fs/notify/fanotify/fanotify_user.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/fs/notify/fanotify/fanotify_user.c
+++ b/fs/notify/fanotify/fanotify_user.c
@@ -888,9 +888,9 @@ COMPAT_SYSCALL_DEFINE6(fanotify_mark,
 {
        return sys_fanotify_mark(fanotify_fd, flags,
 #ifdef __BIG_ENDIAN
-                               ((__u64)mask1 << 32) | mask0,
-#else
                                ((__u64)mask0 << 32) | mask1,
+#else
+                               ((__u64)mask1 << 32) | mask0,
 #endif
                                 dfd, pathname);
 }


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to