Skip to content
  • Will Deacon's avatar
    ipc/shm: Fix order of parameters when calling copy_compat_shmid_to_user · 58aff0af
    Will Deacon authored
    Commit 553f770e
    
     ("ipc: move compat shmctl to native") moved the
    compat IPC syscall handling into ipc/shm.c and refactored the struct
    accessors in the process. Unfortunately, the call to
    copy_compat_shmid_to_user when handling a compat {IPC,SHM}_STAT command
    gets the arguments the wrong way round, passing a kernel stack address
    as the user buffer (destination) and the user buffer as the kernel stack
    address (source).
    
    This patch fixes the parameter ordering so the buffers are accessed
    correctly.
    
    Cc: Al Viro <viro@zeniv.linux.org.uk>
    Cc: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
    Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
    58aff0af