Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1677798pxv; Fri, 25 Jun 2021 20:21:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzXpUvVkiLBB7vNH6v4HDe7+QhfNkXYQfiBRlhoWkAmG5+4av6zc9L7VrsIcHeg3f1D+GOC X-Received: by 2002:aa7:cfd7:: with SMTP id r23mr19111849edy.300.1624677702251; Fri, 25 Jun 2021 20:21:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624677702; cv=none; d=google.com; s=arc-20160816; b=GIyZBoFXZJujDq4vsmnTx+4peSJWX8NmF6yrgVrPw5k3BfxAZpQg23TMjyjf96YBcw dg2/ck+gonETuwMWIzPwmruqdhZdM2SrwzUJy3za1aA/A6s6V5b3scSu/DJWVp2YTmi2 vDy+hlQfEp8L8KdbquI1v6ACoubebICbMZTqK9Xt7z5dZ2s3CbjxgC/zX6ZHmIdQxGya eYb5EqWcPyf2PES5HoRHFmNEPD76DkDJ8kRcdAvgp45faEvb/fBmtGcGe61Y2UMPiruf 7Tuq7bjSpGgUKKCTUWb/22Gr+E3shUmM9ICsBi5ZvLQm26vcMs6m3dY3RlQJ+Y5qzlph 4rqg== 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=aM4y0UrWCLTv7rcBz2RIFnjL7rxnHwV/LKZu/4UV0wk=; b=pnvXvtkltJFINXMkKGC8azP9bL0g0KWLOLSNngEbk2hKmAXg0y60w/9rVAcRJzWH70 fMy2Bt2JxESsqHHW2jb23eGh5NPaqW0EJpuKNVAyS22OR6Na2yyICbEAjHwcQPTONrqw fEqOjbZYKxDsnCk5jUo18EaKomau/+AKKV8F/ENxvTY1OA2jhlVqUrpIaJozOSdiasPO qDbKs4ZHEqQ42IamTYFPqioKIQGvlp4gOlK3QvM0/TsfrRXHNdOXk/py6b2helVp2YYf aTKOmaA5ndOk63lmsCjKnZFjk8ipAc4Gh7P0EDkQQrdBu7TvjidwpYDX80/cXWGqmuju NiNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=nH6MyPY3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 24si7655036eja.677.2021.06.25.20.21.18; Fri, 25 Jun 2021 20:21:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=nH6MyPY3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230004AbhFZDUS (ORCPT + 99 others); Fri, 25 Jun 2021 23:20:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57630 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229975AbhFZDUR (ORCPT ); Fri, 25 Jun 2021 23:20:17 -0400 Received: from mail-pf1-x435.google.com (mail-pf1-x435.google.com [IPv6:2607:f8b0:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A6A6C061767 for ; Fri, 25 Jun 2021 20:17:54 -0700 (PDT) Received: by mail-pf1-x435.google.com with SMTP id x16so8950049pfa.13 for ; Fri, 25 Jun 2021 20:17:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=aM4y0UrWCLTv7rcBz2RIFnjL7rxnHwV/LKZu/4UV0wk=; b=nH6MyPY34BEZoiZq9gMd9L04Gprl6YIaeAZoBnp0GSMt6LQrC+9wF5uB7Gs9IBvMc7 YHwFB8GDL7VOOkWUb/0Ni1Z+5TYZZGjbbN6/MIr6MnfKoetN0ss2z+DZofF60z2LgDtF eWrJMT5xunVz9YpztTCkxHoQKtZEc1cqE6z1Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=aM4y0UrWCLTv7rcBz2RIFnjL7rxnHwV/LKZu/4UV0wk=; b=D1bgn3oEzXUcw/NVWp6BPEWFbb3OGfQs9JE47DGaAedYNaatWo5gwDaTNyQVSaS5VO tfhLQV93LTxzRsEAixKGhuRdbeYhWYG94TA4BeF5M5mkuotQOeZx/jxshaCAfwChSIRN qyCxOrWeJkBzISUeP0PyD0TwWXgtXYSCrhYYio9BVCk0tBWvhXUfPjRq9AocSJ35UZxl goq/wNLh1oWVGnS1Y3pGJkt1fnTSXEZowPCy2+OnzSOMsFLOU7uJ+2lNj7F1HYZcmkW3 ju9R8fPcRBF0qCTmqeoDZX1iV4i8d27gRO1V5uUKOBQhhCTuKj25QWrphmE2l8pVJ2uS kbeA== X-Gm-Message-State: AOAM532q21cNTkrOexnxxAXwFB1WQz39CP6BJrOhmHDW82bG24nkmOY9 c+QuVhYSCkqHak+pMoiuHZcilg== X-Received: by 2002:a63:4c2:: with SMTP id 185mr12584370pge.236.1624677473974; Fri, 25 Jun 2021 20:17:53 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id c2sm6473987pjv.10.2021.06.25.20.17.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Jun 2021 20:17:53 -0700 (PDT) Date: Fri, 25 Jun 2021 20:17:51 -0700 From: Kees Cook To: "Eric W. Biederman" Cc: Linus Torvalds , Al Viro , Michael Schmitz , linux-arch , Jens Axboe , Oleg Nesterov , Linux Kernel Mailing List , Richard Henderson , Ivan Kokshaysky , Matt Turner , alpha , Geert Uytterhoeven , linux-m68k , Arnd Bergmann , Ley Foon Tan , Tejun Heo Subject: Re: [PATCH 2/9] signal/seccomp: Refactor seccomp signal and coredump generation Message-ID: <202106252014.5AE600929@keescook> References: <87a6njf0ia.fsf@disp2133> <87tulpbp19.fsf@disp2133> <87zgvgabw1.fsf@disp2133> <875yy3850g.fsf_-_@disp2133> <87r1gr6qc4.fsf_-_@disp2133> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87r1gr6qc4.fsf_-_@disp2133> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 24, 2021 at 01:59:55PM -0500, Eric W. Biederman wrote: > > Factor out force_sig_seccomp from the seccomp signal generation and > place it in kernel/signal.c. The function force_sig_seccomp takes a > paramter force_coredump to indicate that the sigaction field should be > reset to SIGDFL so that a coredump will be generated when the signal > is delivered. Ah! This is the part I missed when I was originally trying to figure out the coredump stuff. It's the need for setting a default handler (i.e. doing a coredump)? > force_sig_seccomp is then used to replace both seccomp_send_sigsys > and seccomp_init_siginfo. > > force_sig_info_to_task gains an extra parameter to force using > the default signal action. > > With this change seccomp is no longer a special case and there > becomes exactly one place do_coredump is called from. Looks good to me. This may benefit from force_sig_seccomp() to be wrapped in an #ifdef CONFIG_SECCOMP. (This patch reminds me that the seccomp self tests don't check for core dumps...) -- Kees Cook