提交 4b0dcd07 编写于 作者: E Eric W. Biederman 提交者: Yang Yingliang

signal/bpfilter: Fix bpfilter_kernl to use send_sig not force_sig

stable inclusion
from linux-4.19.99
commit 5d1b927a652a5fb4dce8adececea8bfa0aa78020

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

[ Upstream commit 1dfd1711 ]

The locking in force_sig_info is not prepared to deal with
a task that exits or execs (as sighand may change).  As force_sig
is only built to handle synchronous exceptions.

Further the function force_sig_info changes the signal state if the
signal is ignored, or blocked or if SIGNAL_UNKILLABLE will prevent the
delivery of the signal.  The signal SIGKILL can not be ignored and can
not be blocked and SIGNAL_UNKILLABLE won't prevent it from being
delivered.

So using force_sig rather than send_sig for SIGKILL is pointless.

Because it won't impact the sending of the signal and and because
using force_sig is wrong, replace force_sig with send_sig.

Cc: Alexei Starovoitov <ast@kernel.org>
Cc: David S. Miller <davem@davemloft.net>
Fixes: d2ba09c1 ("net: add skeleton of bpfilter kernel module")
Signed-off-by: N"Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
Signed-off-by: NLi Aichun <liaichun@huawei.com>
Reviewed-by: Nguodeqing <geffrey.guo@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 a816c557
......@@ -25,7 +25,7 @@ static void shutdown_umh(struct umh_info *info)
return;
tsk = get_pid_task(find_vpid(info->pid), PIDTYPE_PID);
if (tsk) {
force_sig(SIGKILL, tsk);
send_sig(SIGKILL, tsk, 1);
put_task_struct(tsk);
}
fput(info->pipe_to_umh);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册