Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2510069yba; Mon, 22 Apr 2019 08:06:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqyweQarv+apHQjRW47yT4M6gwZdWX2CdXtR3z4ls6QJZ++0UWeFopGEa+QIf5Mgvy8/RIBD X-Received: by 2002:a05:6a00:c1:: with SMTP id e1mr20732832pfj.143.1555945589585; Mon, 22 Apr 2019 08:06:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555945589; cv=none; d=google.com; s=arc-20160816; b=qm1/gwh4SQR4MiEZ+EWwCgF5jOo+HvXh3AR7yPt4KxSFZIGqJtqp6CDH0Ohsae9nAM ++IW16ud6KM3j5b5/zFHtOE/IUzSNxivou473woNBenzJcYevNabCzNUb6KhIbtpHzHX DPgGMZ6uTfViATgLPDTZomerHc8PGpQ6n56OV/dJhTIJqtujos7/y2ZYvLCDfNRRmU4J JQLNeRcjpyCbb0MwAUw56QKqhmro9n91tAjN4gIyR66tZrp5uCfgM1pluP1QnLN9vivF Fdy856p1KOBJ3bV+7MCShz3sN0Amd6fJYIOZKpjH412Vna2jGCqKuMrY6bNbBicc/LPN Z67w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=FR8MBh7qtaiYxQNojZyqi5T+MndGy6PHzUj2rziKvYo=; b=FHgdxqoSVMIdQ1mTuWxvMp0dF4PuvVsrf5Z4eBhK9VIKjkeFpwmXs78ZjDMEjDSN0t Yd//k1PRVZhFOFiK80pmIPPGWarWXbras0XOAoqXqN6luyrEsBZVUwjB8gcGbSpEaETJ 5jk0LUVKmFDHuDsG7dosd7kCBSET8aZv87njoHLOs7+9dZfsSv5cda30I2wmGRPKVCHl weIJCLuw0KCNWpBdLKgxvdNnP3fDpgzY5dpU17ncTIcrnqfan4hUtP6d20UPMZ7S+vrm UxCB+xo+IpFe+nSNPyumMJC0PYlEHMDbHy6EO5BOP7thqhOtCrBS8UlXRPY1Jf6V34L6 2/kw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b128si14400252pfb.141.2019.04.22.08.06.13; Mon, 22 Apr 2019 08:06:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727957AbfDVPAv (ORCPT + 99 others); Mon, 22 Apr 2019 11:00:51 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:60492 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726945AbfDVPAu (ORCPT ); Mon, 22 Apr 2019 11:00:50 -0400 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id B9DFF2399803244A4829; Mon, 22 Apr 2019 23:00:16 +0800 (CST) Received: from SZXY1W004751141.china.huawei.com (10.40.99.192) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.439.0; Mon, 22 Apr 2019 23:00:08 +0800 From: Zhenliang Wei To: , , , , , , , , CC: , , Subject: [PATCH v3] signal: trace_signal_deliver when signal_group_exit Date: Mon, 22 Apr 2019 22:59:50 +0800 Message-ID: <20190422145950.78056-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: The action[SIGKILL] must be SIG_DFL, and SEND_SIG_NOINFO matches the fact that SIGKILL doesn't have any info. Acked-by: Christian Brauner Fixes: cf43a757fd4944 ("signal: Restore the stop PTRACE_EVENT_EXIT") Signed-off-by: Zhenliang Wei --- kernel/signal.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/signal.c b/kernel/signal.c index 227ba170298e..0f69ada376ef 100644 --- a/kernel/signal.c +++ b/kernel/signal.c @@ -2441,6 +2441,7 @@ 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, SIG_DFL); recalc_sigpending(); goto fatal; } -- 2.14.1.windows.1