Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp490021ima; Fri, 26 Oct 2018 01:29:01 -0700 (PDT) X-Google-Smtp-Source: AJdET5cgyL28+ljbbp1KZw7dO7VvmVLfPASV+IsRjxKz8y5o2ClN6i0QEQfu+DN4N81n5JzZ/6lG X-Received: by 2002:a17:902:780f:: with SMTP id p15-v6mr2536552pll.197.1540542540958; Fri, 26 Oct 2018 01:29:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540542540; cv=none; d=google.com; s=arc-20160816; b=lduXAfM8e1QXRxWewKgXShEXPQ7OTd9fJSnmA/aEWS3i9crNHHNI8z0wgeAR8ZigHI lKM1vf0aXThbYadSIPTlWIYpiicK9yho7W1lPniz92aCQKEPXp5NUOter7JJi5LH61Pw kpIOrlOt+6FcjupyCMSbtdMbfW3yM86LywwSrNKg9wIjlVn0sm5mViVMm/Ka0loD04Qr qroeyct8whIvyXDUN4iCek2iNorTV8/2nrX+EXpazejb/B8uO8u9UBNiOY0xGUVX+MUL NmPALgejWsz5r8hCFNd6iV1BO7U39ctjEtbNW5AVjDyk30ACixaGMDmv6m7Vb0zhBpzr WWoQ== 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=YK7k2XXBCcpH15SAYxeeM69alXVgxtSeOfxdoIyEMO4=; b=Nbg+ISdFVcJTSkQdapODrfyqi7xiZcBgK4dVHw+6gkTypa1LzTGowSbKtcAUY81Try oPDuHDJdLuw6n8Had6fHmsxypeqKG5nBot6H9IkbWRn8OZnHnocFK6ZU5cL28GsCrGKq wgHrpVHCJ/jtRMQlnHju+j5SSkJOYN+QjjQZd+fqhCo1T1Jqen9wzz4KLR1UnWcW5fI/ 2AIzR9qsulIXe6ktDX7FcM2YU1Ghb9YdB5C038s6DDWaprmoblTGVwDQwIQDg3QU+8/K 0cfQElUiVvF6pYQzgJA1LjxwKh6AHnP0tKixUky1HJfpNrC/SRXgiYaomZOpngJ9+lRa psHQ== 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 i19-v6si3414097pfo.189.2018.10.26.01.28.45; Fri, 26 Oct 2018 01:29:00 -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 S1726180AbeJZRE3 (ORCPT + 99 others); Fri, 26 Oct 2018 13:04:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45724 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725914AbeJZRE3 (ORCPT ); Fri, 26 Oct 2018 13:04:29 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 53462308A943; Fri, 26 Oct 2018 08:28:22 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.43.17.106]) by smtp.corp.redhat.com (Postfix) with SMTP id 21815100164A; Fri, 26 Oct 2018 08:28:13 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Fri, 26 Oct 2018 10:28:22 +0200 (CEST) Date: Fri, 26 Oct 2018 10:28:13 +0200 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: <20181026082812.GA10581@redhat.com> References: <458c04d8-d189-4a26-729a-bb1d1d751534@cisco.com> <7741efa7-a3f8-62a1-ba52-613883164643@cisco.com> <84460a77-a111-404e-4bad-88104a6e246e@cisco.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <84460a77-a111-404e-4bad-88104a6e246e@cisco.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Fri, 26 Oct 2018 08:28:23 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/25, Enke Chen wrote: > > +static void do_notify_parent_predump(void) > +{ > + struct task_struct *parent; > + int sig; > + > + read_lock(&tasklist_lock); > + parent = current->parent; > + sig = parent->signal->predump_signal; > + if (sig != 0) > + do_send_sig_info(sig, SEND_SIG_NOINFO, parent, PIDTYPE_TGID); > + read_unlock(&tasklist_lock); Ah. It is strange I didn't think about this before... Please, do not take tasklist_lock, use rcu_read_lock() instead. do_send_sig_info() uses the rcu-friendly lock_task_sighand(), so rcu_dereference(parent) should work fine. Oleg.