Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp1900274ima; Thu, 25 Oct 2018 06:46:47 -0700 (PDT) X-Google-Smtp-Source: AJdET5ddi+BnqnQNNSK6s14JFuX7nSjvkYGGHF1kIZ5AIff/ItRlG6nVHS7sLky/XNsmWNa/tx5M X-Received: by 2002:a63:a552:: with SMTP id r18mr1563311pgu.176.1540475207142; Thu, 25 Oct 2018 06:46:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540475207; cv=none; d=google.com; s=arc-20160816; b=rrkVPC6z78UgudbZTmMOzOeY5h+FUW7KFG060uafS0k/S5trwn8P/P7M3g0zbopCqV Oo11PgxBdgGZfDNPdnySkHBNFa93WYOvhPm4Z3R2mDs+idSqH1P/fEflLtrk7Wr2oUk6 mZ1d8DY0JVvFORmL2fJuXNf72hR7ET1qTUftizbOcJ0Mrggu0duLv0MKGxi2/DU8xgY8 6pDbS3rvTWp5hnDXzTq/CBUaRF/fuSl5o6bYAMe7qoXDDZTHICzyPWyblReYmO2E84Qv PEIS1dIlJh22kNew9pbh02onxJXBmf6H3OTz3KVcE/gjNLSMsSw57utwovbZ0LWiGGPa 8QgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=CAKsmhGwphcLYdeKebciBpfeYA9rdDjFD/uow+o+w7A=; b=mAr06n2GiSimcx5cq/vnDGay+2jOsna/0RqMAJ8BDKvud6FxOfaJzbmEcuLQ1F9cAm 2XJpn0yiJmRy3JtZWN2ZRhzNGNFPr/KLuqtc24L9oabP7nIADr/39GN9l4fSDYiAaYBD ON0vwggY0tqA9Hbpe8jNusEx7yuttZhFzTwQOHqpVVLhrzt6wH39M9GrNCwAqxTMm5Vb dsxQyCvaq+b3uOr3J6aZtFaLVZuY3SHPgJKeRbX3woIgkS9HrMdth0UrOzpmwSuazuIj yDKLSDGODSjy0zoJYU0yWlgsOK61kTuCEDXjtv3PH6GifmbS17yrfJM9F8jJlF1m1hZd MM3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=GdZClevA; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o24-v6si7618256pgv.242.2018.10.25.06.46.30; Thu, 25 Oct 2018 06:46:47 -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; dkim=pass header.i=@google.com header.s=20161025 header.b=GdZClevA; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727461AbeJYWSq (ORCPT + 99 others); Thu, 25 Oct 2018 18:18:46 -0400 Received: from mail-oi1-f195.google.com ([209.85.167.195]:44246 "EHLO mail-oi1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727236AbeJYWSq (ORCPT ); Thu, 25 Oct 2018 18:18:46 -0400 Received: by mail-oi1-f195.google.com with SMTP id k19-v6so652829oic.11 for ; Thu, 25 Oct 2018 06:45:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=CAKsmhGwphcLYdeKebciBpfeYA9rdDjFD/uow+o+w7A=; b=GdZClevAy3MNu2TJeFu7kepEgmq1B32RuMQD9DsMWFqcCzRBOVYR5A8QkJ9KhxoVaD E/kVsOF0uSy+WMYG7+VqGtHJ3azsK4EKIi9U0v31VRvvvcU9WXLJqvVQsKhDap4k4MUn K7CUF2Pjcnb+fiiP8jJ4J0Cdc4msZGI4ZZ6hcAGnkWRun21IIxl3WkM9k/RiRu8VT1t0 oXqC7AgULC8Brm+hJSCQ+T8+b6NudVa2fF4al0RlWmLapodQ1xpsxZmUVXGGr7tnYZL5 MwOHoD4eponJOiaLfaN8G/5lpa7Gi0F4/YStKqZNxl4a8RtVqbXMsF5QeEJQJMi+NIJm oc5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=CAKsmhGwphcLYdeKebciBpfeYA9rdDjFD/uow+o+w7A=; b=EqUbR2ZgfwTlBIHY1SR5RWbH8KLuacG45OeQOk92JWKWiUgE9nI1tX7X7NSEJsiuZF XlQ1pUmRNWw1Q9zWp3Ej8uMTVzDnrhgGhV8dXt/uC3bnjZciuJZCGkPTo/NouQ+i8a+5 rD2ki/8jnrJwZ8LXKXJS8iLe4B8N0DnkonZonAWc+O0vmjRw+RAUemkvME1Ce0Ubo+Bs P/pVOKN/QgzsSi1v3yiT9M+ygdFeiDQLI+0nLtTK4cxHHZoC4g4bcJsmXO/6h2ufcqqE BiaUVMvPLLLpaCHtCxOoFpEF6BSITc5mhyO6ZPSbMjoV5GpZEpvbZbNB/lLhbckNdapZ 0sPg== X-Gm-Message-State: AGRZ1gIgfyvWnilMosPllowbM4/8KbTXF9WvE1xroz5DktbCTaDfyLXP bjtXwF7SGJWaiJCCm1TGizJVjOrYo6E33gVLroxmPQ== X-Received: by 2002:aca:c045:: with SMTP id q66-v6mr518965oif.22.1540475155893; Thu, 25 Oct 2018 06:45:55 -0700 (PDT) MIME-Version: 1.0 References: <458c04d8-d189-4a26-729a-bb1d1d751534@cisco.com> <87sh0vpj5q.fsf@xmission.com> In-Reply-To: <87sh0vpj5q.fsf@xmission.com> From: Jann Horn Date: Thu, 25 Oct 2018 15:45:29 +0200 Message-ID: Subject: Re: [PATCH v2] kernel/signal: Signal-based pre-coredump notification To: "Eric W. Biederman" Cc: enkechen@cisco.com, Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H . Peter Anvin" , Peter Zijlstra , Arnd Bergmann , Khalid Aziz , Kate Stewart , deller@gmx.de, Greg Kroah-Hartman , Al Viro , Andrew Morton , christian@brauner.io, Catalin Marinas , Will Deacon , Dave.Martin@arm.com, mchehab+samsung@kernel.org, Michal Hocko , Rik van Riel , "Kirill A . Shutemov" , guro@fb.com, Marcos Souza , Oleg Nesterov , linux@dominikbrodowski.net, Cyrill Gorcunov , yang.shi@linux.alibaba.com, Kees Cook , "the arch/x86 maintainers" , kernel list , linux-arch , Victor Kamensky , xe-linux-external@cisco.com, sstrogin@cisco.com Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 24, 2018 at 3:30 PM Eric W. Biederman wrote: > Enke Chen writes: > > For simplicity and consistency, this patch provides an implementation > > for signal-based fault notification prior to the coredump of a child > > process. A new prctl command, PR_SET_PREDUMP_SIG, is defined that can > > be used by an application to express its interest and to specify the > > signal (SIGCHLD or SIGUSR1 or SIGUSR2) for such a notification. A new > > signal code (si_code), CLD_PREDUMP, is also defined for SIGCHLD. > > > > Changes to prctl(2): > > > > PR_SET_PREDUMP_SIG (since Linux 4.20.x) > > Set the child pre-coredump signal of the calling process to > > arg2 (either SIGUSR1, or SIUSR2, or SIGCHLD, or 0 to clear). > > This is the signal that the calling process will get prior to > > the coredump of a child process. This value is cleared across > > execve(2), or for the child of a fork(2). > > > > When SIGCHLD is specified, the signal code will be set to > > CLD_PREDUMP in such an SIGCHLD signal. [...] > Ugh. Your test case is even using signalfd. So you don't even want > this signal to be delivered as a signal. Just to make sure everyone's on the same page: You're suggesting that it might make sense to deliver the pre-dump notification via a new type of file instead (along the lines of signalfd, timerfd, eventfd and so on)?