From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CA53BC282E1 for ; Wed, 24 Apr 2019 12:53:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 997C1218B0 for ; Wed, 24 Apr 2019 12:53:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730379AbfDXMxZ (ORCPT ); Wed, 24 Apr 2019 08:53:25 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:47860 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727518AbfDXMxZ (ORCPT ); Wed, 24 Apr 2019 08:53:25 -0400 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 4F810A734847D57D26AE; Wed, 24 Apr 2019 20:53:23 +0800 (CST) Received: from SZXY1W004751141.china.huawei.com (10.40.99.192) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.439.0; Wed, 24 Apr 2019 20:53:14 +0800 From: Zhenliang Wei To: , , , , , , , , CC: , , Subject: [PATCH v4] signal: trace_signal_deliver when signal_group_exit Date: Wed, 24 Apr 2019 20:52:38 +0800 Message-ID: <20190424125238.83264-1-weizhenliang@huawei.com> X-Mailer: git-send-email 2.14.1.windows.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.40.99.192] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In the fixes commit, removing SIGKILL from each thread signal mask and executing "goto fatal" directly will skip the call to "trace_signal_deliver". At this point, the delivery tracking of the SIGKILL signal will be inaccurate. Therefore, we need to add trace_signal_deliver before "goto fatal" after executing sigdelset. Note: SEND_SIG_NOINFO matches the fact that SIGKILL doesn't have any info. Acked-by: Christian Brauner Reviewed-by: Oleg Nesterov Cc: Fixes: cf43a757fd4944 ("signal: Restore the stop PTRACE_EVENT_EXIT") Reported-by: kbuild test robot Signed-off-by: Zhenliang Wei --- kernel/signal.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/signal.c b/kernel/signal.c index 227ba170298e..3edf526db7c6 100644 --- a/kernel/signal.c +++ b/kernel/signal.c @@ -2441,6 +2441,8 @@ bool get_signal(struct ksignal *ksig) if (signal_group_exit(signal)) { ksig->info.si_signo = signr = SIGKILL; sigdelset(¤t->pending.signal, SIGKILL); + trace_signal_deliver(SIGKILL, SEND_SIG_NOINFO, + &sighand->action[signr - 1]); recalc_sigpending(); goto fatal; } -- 2.14.1.windows.1