From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756398AbdKCSmc (ORCPT ); Fri, 3 Nov 2017 14:42:32 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35084 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756367AbdKCSma (ORCPT ); Fri, 3 Nov 2017 14:42:30 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 72875C04AC54 Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=oleg@redhat.com Date: Fri, 3 Nov 2017 19:42:27 +0100 From: Oleg Nesterov To: Andrew Morton , "Eric W. Biederman" Cc: security@kernel.org, "Robert O'Callahan" , Kees Cook , Andy Lutomirski , Dmitry Vyukov , Kyle Huey , linux-kernel@vger.kernel.org Subject: [PATCH 2/3] protect the SIGNAL_UNKILLABLE tasks from !sig_kernel_only() signals Message-ID: <20171103184227.GC21036@redhat.com> References: <20171102160705.GA11973@redhat.com> <20171103184144.GA21036@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171103184144.GA21036@redhat.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Fri, 03 Nov 2017 18:42:30 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Change sig_task_ignored() to drop the SIG_DFL && !sig_kernel_only() signals even if force == T. This simplifies the next change and this matches the same check in get_signal() which will drop these signals anyway. Signed-off-by: Oleg Nesterov --- kernel/signal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/signal.c b/kernel/signal.c index b9aebe1..8fc0182 100644 --- a/kernel/signal.c +++ b/kernel/signal.c @@ -78,7 +78,7 @@ static int sig_task_ignored(struct task_struct *t, int sig, bool force) handler = sig_handler(t, sig); if (unlikely(t->signal->flags & SIGNAL_UNKILLABLE) && - handler == SIG_DFL && !force) + handler == SIG_DFL && !(force && sig_kernel_only(sig))) return 1; return sig_handler_ignored(handler, sig); -- 2.5.0