]> git.baikalelectronics.ru Git - kernel.git/commit
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)
committerKees Cook <keescook@chromium.org>
Mon, 11 Aug 2014 20:29:12 +0000 (13:29 -0700)
commitc9b41b1f292a01c0e76b09735c9979b48bfdb200
tree8fb595069ac3490438244ca28076b7c1837f93d8
parent354cf010864f316b7d485854684f082269d2210c
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 001a8db873bb ("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: 001a8db873bb ("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