提交 4690535a 编写于 作者: E Eric W. Biederman 提交者: Zheng Zengkai

signal/seccomp: Dump core when there is only one live thread

mainline inclusion
from mainline-v5.15-rc1
commit d21918e5
category: bugfix
bugzilla: 187336, https://gitee.com/openeuler/kernel/issues/I5LLC6

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d21918e5a94a862ccb297b9f2be38574c865fda0

--------------------------------

Replace get_nr_threads with atomic_read(&current->signal->live) as
that is a more accurate number that is decremented sooner.
Acked-by: NKees Cook <keescook@chromium.org>
Link: https://lkml.kernel.org/r/87lf6z6qbd.fsf_-_@disp2133Signed-off-by: N"Eric W. Biederman" <ebiederm@xmission.com>

Conflicts:
	kernel/seccomp.c
Signed-off-by: NGONG, Ruiqi <gongruiqi1@huawei.com>
Reviewed-by: NXiu Jianfeng <xiujianfeng@huawei.com>
Reviewed-by: NWang Weiyang <wangweiyang2@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 53a0f804
无相关合并请求
......@@ -1260,7 +1260,7 @@ static int __seccomp_filter(int this_syscall, const struct seccomp_data *sd,
seccomp_log(this_syscall, SIGSYS, action, true);
/* Dump core only if this is the last remaining thread. */
if (action != SECCOMP_RET_KILL_THREAD ||
get_nr_threads(current) == 1) {
(atomic_read(&current->signal->live) == 1)) {
kernel_siginfo_t info;
/* Show the original registers in the dump. */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
反馈
建议
客服 返回
顶部