Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp548852yba; Wed, 24 Apr 2019 05:55:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqxb7z7Da26fY5SG/eHboYXweukiyTacQWJeYYfifoiOfPK8MrCRQlB3KcOQanC2hfrXrZ4g X-Received: by 2002:a63:5d44:: with SMTP id o4mr30470532pgm.15.1556110518539; Wed, 24 Apr 2019 05:55:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556110518; cv=none; d=google.com; s=arc-20160816; b=BHTIRh/icbNaviPYKwUzdfcEFHCeZlA6z8V+zZ13Z8jj93QMwzynf7bP8YjdjNs6CM c44Q7wOHMIyp2cv9qs3ELJh+1FpskQEwjKE4LcXy1SI7KA3AUAR2SaxMmU1n3FUN+6F1 sXb0S/9re1R+wifv7eND61jqOhvWY5At4LoovQWshJ8r5ln5BX1z6TsA2DSEwVEIwxDs Ka6rkDPUDrylx4hccLOaUFiJ+7CyusmuFb6k4CHYthJGyvdmVaABmnTpSLU1bNNZtVHf cbum1+Y2c9Wj6+dVjoYt+rz6gw/yVkTHmSvqqH5Iz6JoPWUsHOOKv/m7gA/2zzGic3kk S9rw== 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=K4LiG8/wo1T1RDsFp6JDSon9No23adB1VWD3LpwDfCQ=; b=g6VEhBziRAa+bVdbAvPueDoFzvgZwv39XMxQquGouixneaKNlhoW9CfQXQNYz5igoe 7wGHo3EjaEthU4SNF6WRlDHlp+eiePXZsiIQn7N5q3o9yVCQLz364qGdz/qcfP8IIr7c p39A8dBrFa5wKAmxdnvy//9I5g7FdnBXUtc0llqueFzioiCnc+yki6h86YMuZ9L3cY0n LdM216p7nxvEvmUgJSn9bWUw+PqEZWoqwPxtyrSsSVWaE5+Xa7CnowbbiFwJvcEWh7cd Vru+8BuPfayzgbpB6+b1+pe3UlznIggWDui59To7MVNWSpp5/+Old8OWmSRQb6YtWZBX nfsg== 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 d6si19640317pfh.177.2019.04.24.05.55.03; Wed, 24 Apr 2019 05:55:18 -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 S1730352AbfDXMxZ (ORCPT + 99 others); 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