]> git.baikalelectronics.ru Git - kernel.git/commit
ipc/shm: Fix order of parameters when calling copy_compat_shmid_to_user
authorWill Deacon <will.deacon@arm.com>
Mon, 18 Sep 2017 16:47:38 +0000 (17:47 +0100)
committerAl Viro <viro@zeniv.linux.org.uk>
Thu, 21 Sep 2017 03:27:48 +0000 (23:27 -0400)
commit44d3e29d4fc55c9d778dfebfc4c2d0f7950f2d50
treee4bd9e751d8a67be3ba510d52f9decf5e7d7a2d3
parentd5a0ff980c241d03ab75fcbc34261e1a1c7b2ab9
ipc/shm: Fix order of parameters when calling copy_compat_shmid_to_user

Commit de1cbf47420e ("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: Will Deacon <will.deacon@arm.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
ipc/shm.c