]> git.baikalelectronics.ru Git - kernel.git/commit
ipc/sem: avoid ipc_rcu_alloc()
authorKees Cook <keescook@chromium.org>
Wed, 12 Jul 2017 21:35:02 +0000 (14:35 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 12 Jul 2017 23:26:01 +0000 (16:26 -0700)
commit5897af1835257d619fc149aa82c8929cc3d6a464
treede85b9884a50812354b9f9ccdc3193a30239fa4d
parent74e5adcf9c8389ee25f1e0d4796c925dc2b11d45
ipc/sem: avoid ipc_rcu_alloc()

Instead of using ipc_rcu_alloc() which only performs the refcount bump,
open code it to perform better sem-specific checks.  This also allows
for sem_array structure layout to be randomized in the future.

[manfred@colorfullife.com: Rediff, because the memset was temporarily inside ipc_rcu_alloc()]
Link: http://lkml.kernel.org/r/20170525185107.12869-10-manfred@colorfullife.com
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Manfred Spraul <manfred@colorfullife.com>
Cc: Davidlohr Bueso <dave@stgolabs.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
ipc/sem.c