signal/bpfilter: Fix bpfilter_kernl to use send_sig not force_sig
authorEric W. Biederman <ebiederm@xmission.com>
Wed, 15 May 2019 17:23:03 +0000 (12:23 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Jan 2020 13:50:51 +0000 (14:50 +0100)
commit5d1b927a652a5fb4dce8adececea8bfa0aa78020
tree81744526022ac55ddd200baa1bffd4b2b4de2d52
parentf771e86b02301bf00c92aa87e9994d974414cab7
signal/bpfilter: Fix bpfilter_kernl to use send_sig not force_sig

[ Upstream commit 1dfd1711de2952fd1bfeea7152bd1687a4eea771 ]

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: d2ba09c17a06 ("net: add skeleton of bpfilter kernel module")
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/bpfilter/bpfilter_kern.c