lkml.org 
[lkml]   [2014]   [Jan]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[PATCH] compat: fix sys_fanotify_mark
    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


    \
     
     \ /
      Last update: 2014-01-15 13:21    [W:0.031 / U:59.476 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site