Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp2989517iob; Fri, 6 May 2022 15:15:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJycOCBED8qCLp8UV152kg2+0Jl2/qIcIIPTxlfaRwzwnonb5CX2bjNokPWXCwb3eIk3iZZy X-Received: by 2002:aa7:dd87:0:b0:425:c104:71bf with SMTP id g7-20020aa7dd87000000b00425c10471bfmr5837522edv.110.1651875354824; Fri, 06 May 2022 15:15:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651875354; cv=none; d=google.com; s=arc-20160816; b=iwG4JH/fH15MqBEijKZkJ3CcetqZTvkZTVIBdgWQ3X6m58FScrbx4EZEH6nUIUk6Ze 0I2V5Vvk43G2k36VsLN+CD33afz/PBNdvd2FdnzoNPtRvrrZMWMfuxtln6ybKsUYPRO6 ePe6jbC3xDuk/STV+sRcJRAs6Wrmk4arJAUNLGThqZd6/Lo3Ptynm+QXoxc7nfaRGIEx Eanizr2m46OfM0g0e3LHF+gqSWEcBwWsVjAkr+n8jS7UgO1ekLj6F753mYF8ggLGHybX XtHhZB1T5Y1njVbq9bmaFU0FZ323TQ0coSuo8XaKE1lp6x5k7jvOjxn9vXrRDtmbHCVy 3bmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:cc:to:from; bh=L0n8iGzTi9ied2++Uj+NJIl3g8Xsfh8hhcvG6eZSE7s=; b=xAKp3ZQlaLW1czrzAfXMH/TGa97ohGHyrSrgg1Ajsj2L+ePEwNEgud58KJmYMSxD3f 8zjdxIFFP9KQYopQJJ+eh4KmSGzs4B8rKWMfmaHEjQ7n71+qlkUcYWtEyst+Y30ZlUcn /+y6yJkciEstg02c1ZJb8fOzIaf6dQHleCyzZ8vh9JKsU4LQEQOSsc38qq51RR6v6NxC mgJopylnFA7asEzDpTS4CjJhgqHcXiN4bjcmL10386egNDoHOgZ0YIjxmNH4d3xlTbEc svywy+/K4htEaWZ2gBKYWYiYHKLY+u2C1J3QZg1PjeDWwiIxvGaO6gbWw3KJL827FDrV almw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=xmission.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c2-20020a1709060fc200b006df76385e42si5853994ejk.738.2022.05.06.15.15.29; Fri, 06 May 2022 15:15:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=xmission.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1384437AbiEESiF (ORCPT + 99 others); Thu, 5 May 2022 14:38:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38020 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1384213AbiEEShG (ORCPT ); Thu, 5 May 2022 14:37:06 -0400 Received: from out03.mta.xmission.com (out03.mta.xmission.com [166.70.13.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E0F795DBED; Thu, 5 May 2022 11:27:30 -0700 (PDT) Received: from in01.mta.xmission.com ([166.70.13.51]:59548) by out03.mta.xmission.com with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1nmgCI-00GUuH-0o; Thu, 05 May 2022 12:27:30 -0600 Received: from ip68-227-174-4.om.om.cox.net ([68.227.174.4]:37118 helo=localhost.localdomain) by in01.mta.xmission.com with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1nmgCG-002BtP-5H; Thu, 05 May 2022 12:27:29 -0600 From: "Eric W. Biederman" To: linux-kernel@vger.kernel.org Cc: rjw@rjwysocki.net, Oleg Nesterov , mingo@kernel.org, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, mgorman@suse.de, bigeasy@linutronix.de, Will Deacon , tj@kernel.org, linux-pm@vger.kernel.org, Peter Zijlstra , Richard Weinberger , Anton Ivanov , Johannes Berg , linux-um@lists.infradead.org, Chris Zankel , Max Filippov , linux-xtensa@linux-xtensa.org, Kees Cook , Jann Horn , linux-ia64@vger.kernel.org, "Eric W. Biederman" Date: Thu, 5 May 2022 13:26:39 -0500 Message-Id: <20220505182645.497868-6-ebiederm@xmission.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <87a6bv6dl6.fsf_-_@email.froward.int.ebiederm.org> References: <87a6bv6dl6.fsf_-_@email.froward.int.ebiederm.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-XM-SPF: eid=1nmgCG-002BtP-5H;;;mid=<20220505182645.497868-6-ebiederm@xmission.com>;;;hst=in01.mta.xmission.com;;;ip=68.227.174.4;;;frm=ebiederm@xmission.com;;;spf=softfail X-XM-AID: U2FsdGVkX1+xBxycjJYYOeyHTOMyFYs6QPKTTdJxq/c= X-SA-Exim-Connect-IP: 68.227.174.4 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-DCC: XMission; sa07 1397; Body=1 Fuz1=1 Fuz2=64 X-Spam-Combo: ***;linux-kernel@vger.kernel.org X-Spam-Relay-Country: X-Spam-Timing: total 1179 ms - load_scoreonly_sql: 0.05 (0.0%), signal_user_changed: 11 (0.9%), b_tie_ro: 10 (0.8%), parse: 0.87 (0.1%), extract_message_metadata: 15 (1.3%), get_uri_detail_list: 1.21 (0.1%), tests_pri_-1000: 18 (1.5%), tests_pri_-950: 1.23 (0.1%), tests_pri_-900: 1.08 (0.1%), tests_pri_-90: 113 (9.6%), check_bayes: 110 (9.3%), b_tokenize: 8 (0.6%), b_tok_get_all: 7 (0.6%), b_comp_prob: 2.1 (0.2%), b_tok_touch_all: 90 (7.6%), b_finish: 0.85 (0.1%), tests_pri_0: 199 (16.9%), check_dkim_signature: 0.51 (0.0%), check_dkim_adsp: 3.1 (0.3%), poll_dns_idle: 799 (67.8%), tests_pri_10: 2.0 (0.2%), tests_pri_500: 814 (69.1%), rewrite_mail: 0.00 (0.0%) Subject: [PATCH v4 06/12] signal: Use lockdep_assert_held instead of assert_spin_locked X-SA-Exim-Version: 4.2.1 (built Sat, 08 Feb 2020 21:53:50 +0000) X-SA-Exim-Scanned: Yes (on in01.mta.xmission.com) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The distinction is that assert_spin_locked() checks if the lock is held *by*anyone* whereas lockdep_assert_held() asserts the current context holds the lock. Also, the check goes away if you build without lockdep. Suggested-by: Peter Zijlstra Link: https://lkml.kernel.org/r/Ympr/+PX4XgT/UKU@hirez.programming.kicks-ass.net Signed-off-by: "Eric W. Biederman" --- kernel/signal.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/signal.c b/kernel/signal.c index 72d96614effc..3fd2ce133387 100644 --- a/kernel/signal.c +++ b/kernel/signal.c @@ -884,7 +884,7 @@ static int check_kill_permission(int sig, struct kernel_siginfo *info, static void ptrace_trap_notify(struct task_struct *t) { WARN_ON_ONCE(!(t->ptrace & PT_SEIZED)); - assert_spin_locked(&t->sighand->siglock); + lockdep_assert_held(&t->sighand->siglock); task_set_jobctl_pending(t, JOBCTL_TRAP_NOTIFY); ptrace_signal_wake_up(t, t->jobctl & JOBCTL_LISTENING); @@ -1079,7 +1079,7 @@ static int __send_signal_locked(int sig, struct kernel_siginfo *info, int override_rlimit; int ret = 0, result; - assert_spin_locked(&t->sighand->siglock); + lockdep_assert_held(&t->sighand->siglock); result = TRACE_SIGNAL_IGNORED; if (!prepare_signal(sig, t, force)) -- 2.35.3