Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1463096iob; Fri, 29 Apr 2022 06:01:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwJb4hpR0YQHnRdcbedegV8LE2PdU8AZyii0AnRZGF+1oQe68WpP0rv7SnaEgcVA9eBJi5z X-Received: by 2002:a2e:5cc1:0:b0:24b:112f:9b36 with SMTP id q184-20020a2e5cc1000000b0024b112f9b36mr25222020ljb.337.1651237308394; Fri, 29 Apr 2022 06:01:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651237308; cv=none; d=google.com; s=arc-20160816; b=XxJLW/n3X7hGMIUgtkeAf5TV69uPafUHDV0TqEk+MO6mzQJlCbUTvHsuh7/nfVTJxz 01cjZhHA7/qmwzacjIbEqI2g/4ziqnVEC+PZMk1ZwYtNn0Xjqm59z+NgJ3WCqdpSbHqL Q6g2wJgKnyItvsYZGsjFWZo+DB1Glpgf+XvtNnHnNb2YTBFPnFf3QIMfeyj+y+Yt+3wZ qpWjQykCd8e9zVyD6lMOsnyij/vVaF476ctXwc1SePFdK5A8UIL9DjcjZq3kvPpBAGTH X2jlIWWWyw7drkeJ448fg6RD8dIl/Z/aZH7ecrXYoGH6DXDaWCAg1R4dRh2P8cW2zt4u 9nfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=AhbgCqd7BwFlFPAKluXkLDE2fbuPOLW8BZP+83SCshw=; b=Nr+UOMBuHsLVaYccdJtFVqc6JZyREkQBNCW11vdbjqCCrT55TK56ZGdol1baORiifZ JzTTtTASaz4MmuXF3x8zaWUUWBID2Swsn3G7goqNc2t2GfSZ2PT4sDJE5oyn5mJdXUlP JlzZRN9jLWGxB//60LbvQt0Cn/sc9BMsy7xE6uF19ZSlwdrpOF3VdBbUaAoGLYFfMxd3 /LYmy3j1cnTuxaoWDvO9O9l2W+NUL/mOrrvSUvkwCGLvEsPbycWi/DBNXayOC2YrqMK6 D6WA54tvvQla5nQ8HXclmmvfZvcraI4ZjWCwG5EIsgT10t7xINKsq2RFs4v0dSZdeqhF yljg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b="l3v//duE"; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i6-20020a056512340600b0047205414ce6si1954423lfr.412.2022.04.29.06.01.18; Fri, 29 Apr 2022 06:01:48 -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; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b="l3v//duE"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240792AbiD1Klm (ORCPT + 99 others); Thu, 28 Apr 2022 06:41:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44908 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238851AbiD1Klk (ORCPT ); Thu, 28 Apr 2022 06:41:40 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A85586A410; Thu, 28 Apr 2022 03:38:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=AhbgCqd7BwFlFPAKluXkLDE2fbuPOLW8BZP+83SCshw=; b=l3v//duEcO+RAy1rHKqKk/42N0 F9QSzG5+uLtUycqoNrYxD5YjchOb96Z/44n5Gv9NHciZfZXvt6EXsJ6pdaUapRb4eTsA3U7Zg2Cc/ yYnGDsOIyG4Zv5yvxP6TqhzFpu530iCkMZZswEugAIO3P93SdG1HNT0iViDrNiJ/gTzuiNg1a8RUb VGI5fyQOb1/Ak1qlbdBglhHzmuzMcXEKUGaJza2YLsZod+FT8aK9IlV87j1zt118M0DqfNK3uh+ZK qFRBNB/WtTMCpV1AyoxvfpJdb74tBHXM4hlWQrAF+lp9IXHA3PDrF/TjeQNDDzuPACDtHiaun52k3 eT4DZpLA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1nk1XE-009K05-7g; Thu, 28 Apr 2022 10:38:08 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 9745A3001EA; Thu, 28 Apr 2022 12:38:07 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 7ABEE2029F872; Thu, 28 Apr 2022 12:38:07 +0200 (CEST) Date: Thu, 28 Apr 2022 12:38:07 +0200 From: Peter Zijlstra To: "Eric W. Biederman" Cc: linux-kernel@vger.kernel.org, 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, Richard Weinberger , Anton Ivanov , Johannes Berg , linux-um@lists.infradead.org, Chris Zankel , Max Filippov , inux-xtensa@linux-xtensa.org, Kees Cook , Jann Horn Subject: Re: [PATCH 6/9] signal: Always call do_notify_parent_cldstop with siglock held Message-ID: References: <878rrrh32q.fsf_-_@email.froward.int.ebiederm.org> <20220426225211.308418-6-ebiederm@xmission.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220426225211.308418-6-ebiederm@xmission.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 26, 2022 at 05:52:08PM -0500, Eric W. Biederman wrote: > Now that siglock keeps tsk->parent and tsk->real_parent constant > require that do_notify_parent_cldstop is called with tsk->siglock held > instead of the tasklist_lock. > > As all of the callers of do_notify_parent_cldstop had to drop the > siglock and take tasklist_lock this simplifies all of it's callers. > > Signed-off-by: "Eric W. Biederman" > --- > kernel/signal.c | 156 +++++++++++++++++------------------------------- > 1 file changed, 55 insertions(+), 101 deletions(-) > > diff --git a/kernel/signal.c b/kernel/signal.c > index 72d96614effc..584d67deb3cb 100644 > --- a/kernel/signal.c > +++ b/kernel/signal.c > @@ -2121,11 +2121,13 @@ static void do_notify_parent_cldstop(struct task_struct *tsk, > bool for_ptracer, int why) > { > struct kernel_siginfo info; > - unsigned long flags; > struct task_struct *parent; > struct sighand_struct *sighand; > + bool lock; > u64 utime, stime; > > + assert_spin_locked(&tsk->sighand->siglock); lockdep_assert_held() please...