seccomp: Replace BUG(!spin_is_locked()) with assert_spin_lock
authorGuenter Roeck <linux@roeck-us.net>
Mon, 11 Aug 2014 03:50:30 +0000 (20:50 -0700)
committerLee Campbell <leecam@chromium.org>
Wed, 8 Oct 2014 21:35:33 +0000 (14:35 -0700)
commit9ac860041db860a59bfd6ac82b31d6b6f76ebb52
tree938fe3842e9ce7ea13b3b126f930b320821d507f
parentf14a5db2398afed8f416d244e6da6b23940997c6
seccomp: Replace BUG(!spin_is_locked()) with assert_spin_lock

Current upstream kernel hangs with mips and powerpc targets in
uniprocessor mode if SECCOMP is configured.

Bisect points to commit dbd952127d11 ("seccomp: introduce writer locking").
Turns out that code such as
BUG_ON(!spin_is_locked(&list_lock));
can not be used in uniprocessor mode because spin_is_locked() always
returns false in this configuration, and that assert_spin_locked()
exists for that very purpose and must be used instead.

Fixes: dbd952127d11 ("seccomp: introduce writer locking")
Cc: Kees Cook <keescook@chromium.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Kees Cook <keescook@chromium.org>
kernel/fork.c
kernel/seccomp.c