]> git.baikalelectronics.ru Git - kernel.git/commit
ipc: fix sparc64 ipc() wrapper
authorArnd Bergmann <arnd@arndb.de>
Thu, 5 Sep 2019 14:48:38 +0000 (16:48 +0200)
committerArnd Bergmann <arnd@arndb.de>
Sat, 7 Sep 2019 19:42:25 +0000 (21:42 +0200)
commit181e0aa8b593e1ec96bddb183ed894f3a070ad96
treeec74cca6e1cb4ccd8516491822bb76fd9ff94996
parent11d35a99e5a616ad268962c03bb0db5f60cf2b21
ipc: fix sparc64 ipc() wrapper

Matt bisected a sparc64 specific issue with semctl, shmctl and msgctl
to a commit from my y2038 series in linux-5.1, as I missed the custom
sys_ipc() wrapper that sparc64 uses in place of the generic version that
I patched.

The problem is that the sys_{sem,shm,msg}ctl() functions in the kernel
now do not allow being called with the IPC_64 flag any more, resulting
in a -EINVAL error when they don't recognize the command.

Instead, the correct way to do this now is to call the internal
ksys_old_{sem,shm,msg}ctl() functions to select the API version.

As we generally move towards these functions anyway, change all of
sparc_ipc() to consistently use those in place of the sys_*() versions,
and move the required ksys_*() declarations into linux/syscalls.h

The IS_ENABLED(CONFIG_SYSVIPC) check is required to avoid link
errors when ipc is disabled.

Reported-by: Matt Turner <mattst88@gmail.com>
Fixes: cd27f1e47bdb ("ipc: rename old-style shmctl/semctl/msgctl syscalls")
Cc: stable@vger.kernel.org
Tested-by: Matt Turner <mattst88@gmail.com>
Tested-by: Anatoly Pugachev <matorola@gmail.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
arch/sparc/kernel/sys_sparc_64.c
include/linux/syscalls.h
ipc/util.h