From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-co1nam03on0095.outbound.protection.outlook.com ([104.47.40.95]:16809 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1032159AbeCAP2K (ORCPT ); Thu, 1 Mar 2018 10:28:10 -0500 From: Sasha Levin To: "stable@vger.kernel.org" , "stable-commits@vger.kernel.org" CC: Oleg Nesterov , Andrew Morton , Linus Torvalds , Sasha Levin Subject: [added to the 4.1 stable tree] kernel/signal.c: protect the SIGNAL_UNKILLABLE tasks from !sig_kernel_only() signals Date: Thu, 1 Mar 2018 15:23:38 +0000 Message-ID: <20180301152116.1486-111-alexander.levin@microsoft.com> References: <20180301152116.1486-1-alexander.levin@microsoft.com> In-Reply-To: <20180301152116.1486-1-alexander.levin@microsoft.com> Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org List-ID: From: Oleg Nesterov This patch has been added to the 4.1 stable tree. If you have any objections, please let us know. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D [ Upstream commit ac25385089f673560867eb5179228a44ade0cfc1 ] Change sig_task_ignored() to drop the SIG_DFL && !sig_kernel_only() signals even if force =3D=3D T. This simplifies the next change and this matches the same check in get_signal() which will drop these signals anyway. Link: http://lkml.kernel.org/r/20171103184227.GC21036@redhat.com Signed-off-by: Oleg Nesterov Tested-by: Kyle Huey Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Sasha Levin --- kernel/signal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/signal.c b/kernel/signal.c index cbb75358f7f5..4e61b75be17a 100644 --- a/kernel/signal.c +++ b/kernel/signal.c @@ -72,7 +72,7 @@ static int sig_task_ignored(struct task_struct *t, int si= g, bool force) handler =3D sig_handler(t, sig); =20 if (unlikely(t->signal->flags & SIGNAL_UNKILLABLE) && - handler =3D=3D SIG_DFL && !force) + handler =3D=3D SIG_DFL && !(force && sig_kernel_only(sig))) return 1; =20 return sig_handler_ignored(handler, sig); --=20 2.14.1