diff options
author | Guenter Roeck <linux@roeck-us.net> | 2014-08-10 23:50:30 -0400 |
---|---|---|
committer | Kees Cook <keescook@chromium.org> | 2014-08-11 16:29:12 -0400 |
commit | 69f6a34bdeea4fec50bb90619bc9602973119572 (patch) | |
tree | 8fb595069ac3490438244ca28076b7c1837f93d8 /kernel/fork.c | |
parent | c8d6637d0497d62093dbba0694c7b3a80b79bfe1 (diff) |
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>
Diffstat (limited to 'kernel/fork.c')
-rw-r--r-- | kernel/fork.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/fork.c b/kernel/fork.c index 1380d8ace334..0cf9cdb6e491 100644 --- a/kernel/fork.c +++ b/kernel/fork.c | |||
@@ -1105,7 +1105,7 @@ static void copy_seccomp(struct task_struct *p) | |||
1105 | * needed because this new task is not yet running and cannot | 1105 | * needed because this new task is not yet running and cannot |
1106 | * be racing exec. | 1106 | * be racing exec. |
1107 | */ | 1107 | */ |
1108 | BUG_ON(!spin_is_locked(¤t->sighand->siglock)); | 1108 | assert_spin_locked(¤t->sighand->siglock); |
1109 | 1109 | ||
1110 | /* Ref-count the new filter user, and assign it. */ | 1110 | /* Ref-count the new filter user, and assign it. */ |
1111 | get_seccomp_filter(current); | 1111 | get_seccomp_filter(current); |