Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp3249170imd; Mon, 29 Oct 2018 04:18:56 -0700 (PDT) X-Google-Smtp-Source: AJdET5eFZ4CP1m2AiiZbylD5ySkJFan101v77iTwHAkLAEbOd61OqMmdFZhr8gfjmnKkqQSI529R X-Received: by 2002:a62:a116:: with SMTP id b22-v6mr14439576pff.99.1540811936058; Mon, 29 Oct 2018 04:18:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540811936; cv=none; d=google.com; s=arc-20160816; b=RcAD/EAnUmq6ev6A/OtWuxWirt0GhzYNvguqoCOBlaSBzn+wCCXSxFYhlwCkh/5v3g t5IXSRZmv+fvdbO2jwNb/cgPrRVyFVi8+YBpBvBMWdIYoDFf3rjHgqaMEI0JzUHbJC3e fRQIMeALXAIxygdZXWjl3AJpVrGWIWtFd32GjGDvxzS9C9upDixWVt/BgLaE+gFz4mR0 rdTiiPA9UfyYQC361YUlfbflEc408CvlQOR40Ls0twd/KR0EQRFU2yjiMF/6pjaY6GPe wILWHrAXoUhCfvzVL5iV3zg02Qpf7ctfEzcrt/DTJ6Pd29xfZhkYO1vRiSFEpZT+Ml7E ijtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=KyBrujF81VO3rXGzg+OWmDPZ4n2mcnoFurJojzzRiIU=; b=I+pLpV1uVv0tsjdYFIxL3w+raco7Ahhd6LT2JcudBAayt7pmHtcYcvT+u9EMK8ikIr xNT27qJT3r2vFutQJQWZYiDfnolnPhzFTxQnE3mYJFc3p1/XXOz3Ito5nb9YjBAvun5f Fp9wOUyVmNJNENiRo7RtWjAQ2FwRkMRWvs0xcpvGFUb9S3Bw2q9wYXOfFIhM9Vd/5FIk FfS6TwuCBBiDfV4/M3MA2Ii+eL69TlY+r121quQMzDt5MBIKFPzZfUVeKiGsa1vRHSi5 Si6v+S1cd/YZqRnckMP2VjMH06Ge9Y9gfIW4LOnFc6hRV0y8XkMhLzgEljsTnolqB7U2 zzNg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x186-v6si20179902pfx.19.2018.10.29.04.18.40; Mon, 29 Oct 2018 04:18:56 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728146AbeJ2UGa (ORCPT + 99 others); Mon, 29 Oct 2018 16:06:30 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46392 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726720AbeJ2UGa (ORCPT ); Mon, 29 Oct 2018 16:06:30 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 22468305B884; Mon, 29 Oct 2018 11:18:14 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.34.27.30]) by smtp.corp.redhat.com (Postfix) with SMTP id D81105D969; Mon, 29 Oct 2018 11:18:05 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Mon, 29 Oct 2018 12:18:13 +0100 (CET) Date: Mon, 29 Oct 2018 12:18:05 +0100 From: Oleg Nesterov To: Enke Chen Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Peter Zijlstra , Arnd Bergmann , "Eric W. Biederman" , Khalid Aziz , Kate Stewart , Helge Deller , Greg Kroah-Hartman , Al Viro , Andrew Morton , Christian Brauner , Catalin Marinas , Will Deacon , Dave Martin , Mauro Carvalho Chehab , Michal Hocko , Rik van Riel , "Kirill A. Shutemov" , Roman Gushchin , Marcos Paulo de Souza , Dominik Brodowski , Cyrill Gorcunov , Yang Shi , Jann Horn , Kees Cook , x86@kernel.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, "Victor Kamensky (kamensky)" , xe-linux-external@cisco.com, Stefan Strogin Subject: Re: [PATCH v4] kernel/signal: Signal-based pre-coredump notification Message-ID: <20181029111804.GA24820@redhat.com> References: <458c04d8-d189-4a26-729a-bb1d1d751534@cisco.com> <7741efa7-a3f8-62a1-ba52-613883164643@cisco.com> <84460a77-a111-404e-4bad-88104a6e246e@cisco.com> <20181026082812.GA10581@redhat.com> <21f678a8-4001-df36-c26e-e96cf203b1b1@cisco.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <21f678a8-4001-df36-c26e-e96cf203b1b1@cisco.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Mon, 29 Oct 2018 11:18:16 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 10/26, Enke Chen wrote: > > This is really a good idea given that "parent" is declared as RCU-protected. > Just a bit odd, though, that the "parent" has not been accessed this way in > the code base. It is acccessed when possible, > So just to confirm: the revised code would look like the following: > > static void do_notify_parent_predump(void) > { > struct task_struct *parent; > int sig; > > rcu_read_lock(); > parent = rcu_dereference(current->parent); > sig = parent->signal->predump_signal; > if (sig != 0) > do_send_sig_info(sig, SEND_SIG_NOINFO, parent, PIDTYPE_TGID); > rcu_read_unlock(); > } Yes, this is what I meant. But I still think do_notify_parent_predump() should notify ->real_parent, not ->parent. Oleg.