]> git.baikalelectronics.ru Git - kernel.git/commit
ipc/shm.c: use ERR_CAST() for shm_lock() error return
authorKees Cook <keescook@chromium.org>
Fri, 5 Oct 2018 22:51:48 +0000 (15:51 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 5 Oct 2018 23:32:04 +0000 (16:32 -0700)
commitbaa42a15857b77e1152570d0aa2e87bb7eb52492
tree0c62dcc4bffed5289923ac1f4212cd7f93911d4c
parentbaa424a9185865f5127913355b31c3f21b41e3ea
ipc/shm.c: use ERR_CAST() for shm_lock() error return

This uses ERR_CAST() instead of an open-coded cast, as it is casting
across structure pointers, which upsets __randomize_layout:

ipc/shm.c: In function `shm_lock':
ipc/shm.c:209:9: note: randstruct: casting between randomized structure pointer types (ssa): `struct shmid_kernel' and `struct kern_ipc_perm'

  return (void *)ipcp;
         ^~~~~~~~~~~~

Link: http://lkml.kernel.org/r/20180919180722.GA15073@beast
Fixes: 165cf7bfc2f8 ("ipc: drop ipc_lock()")
Signed-off-by: Kees Cook <keescook@chromium.org>
Cc: Davidlohr Bueso <dbueso@suse.de>
Cc: Manfred Spraul <manfred@colorfullife.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
ipc/shm.c