linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] compat: fix sys_fanotify_mark
@ 2014-01-15 11:45 Heiko Carstens
  2014-01-16  0:53 ` David Miller
  2014-01-16  5:59 ` Al Viro
  0 siblings, 2 replies; 3+ messages in thread
From: Heiko Carstens @ 2014-01-15 11:45 UTC (permalink / raw)
  To: Al Viro, Andrew Morton
  Cc: Andreas Krebbel, James E.J. Bottomley, David S. Miller,
	Benjamin Herrenschmidt, Ingo Molnar, Ralf Baechle, linux-kernel

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.

Reported-by: Andreas Krebbel <krebbel@linux.vnet.ibm.com>
Cc: "James E.J. Bottomley" <jejb@parisc-linux.org>
Cc: "David S. Miller" <davem@davemloft.net>
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 # v3.10+
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.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 e44cb6427df3..6663511ab33a 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.4.5


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] compat: fix sys_fanotify_mark
  2014-01-15 11:45 [PATCH] compat: fix sys_fanotify_mark Heiko Carstens
@ 2014-01-16  0:53 ` David Miller
  2014-01-16  5:59 ` Al Viro
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2014-01-16  0:53 UTC (permalink / raw)
  To: heiko.carstens; +Cc: viro, akpm, krebbel, jejb, benh, mingo, ralf, linux-kernel

From: Heiko Carstens <heiko.carstens@de.ibm.com>
Date: Wed, 15 Jan 2014 12:45:57 +0100

> 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.
> 
> Reported-by: Andreas Krebbel <krebbel@linux.vnet.ibm.com>
> Cc: "James E.J. Bottomley" <jejb@parisc-linux.org>
> Cc: "David S. Miller" <davem@davemloft.net>
> 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 # v3.10+
> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>

Acked-by: David S. Miller <davem@davemloft.net>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] compat: fix sys_fanotify_mark
  2014-01-15 11:45 [PATCH] compat: fix sys_fanotify_mark Heiko Carstens
  2014-01-16  0:53 ` David Miller
@ 2014-01-16  5:59 ` Al Viro
  1 sibling, 0 replies; 3+ messages in thread
From: Al Viro @ 2014-01-16  5:59 UTC (permalink / raw)
  To: Heiko Carstens
  Cc: Andrew Morton, Andreas Krebbel, James E.J. Bottomley,
	David S. Miller, Benjamin Herrenschmidt, Ingo Molnar,
	Ralf Baechle, linux-kernel

On Wed, Jan 15, 2014 at 12:45:57PM +0100, Heiko Carstens wrote:
> 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.

Nice catch; ACK and that should go into -stable starting with 3.10.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-01-16  6:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-15 11:45 [PATCH] compat: fix sys_fanotify_mark Heiko Carstens
2014-01-16  0:53 ` David Miller
2014-01-16  5:59 ` Al Viro

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).