[3.11.y.z extended stable] Patch "compat: fix sys_fanotify_mark" has been added to staging queue

Luis Henriques luis.henriques at canonical.com
Wed Feb 5 13:15:29 UTC 2014


This is a note to let you know that I have just added a patch titled

    compat: fix sys_fanotify_mark

to the linux-3.11.y-queue branch of the 3.11.y.z extended stable tree 
which can be found at:

 http://kernel.ubuntu.com/git?p=ubuntu/linux.git;a=shortlog;h=refs/heads/linux-3.11.y-queue

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.11.y.z tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable

Thanks.
-Luis

------

>From 86c50f3164c8ef36ae891c6472277b133fb976af Mon Sep 17 00:00:00 2001
From: Heiko Carstens <heiko.carstens at de.ibm.com>
Date: Mon, 27 Jan 2014 17:07:19 -0800
Subject: 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 at de.ibm.com>
Reported-by: Andreas Krebbel <krebbel at linux.vnet.ibm.com>
Cc: "James E.J. Bottomley" <jejb at parisc-linux.org>
Acked-by: "David S. Miller" <davem at davemloft.net>
Acked-by: Al Viro <viro at ZenIV.linux.org.uk>
Cc: Benjamin Herrenschmidt <benh at kernel.crashing.org>
Cc: Ingo Molnar <mingo at redhat.com>
Cc: Ralf Baechle <ralf at linux-mips.org>
Signed-off-by: Andrew Morton <akpm at linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds at linux-foundation.org>
Signed-off-by: Luis Henriques <luis.henriques at canonical.com>
---
 fs/notify/fanotify/fanotify_user.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanotify_user.c
index e44cb64..6663511 100644
--- 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);
 }
--
1.8.3.2





More information about the kernel-team mailing list