Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp763910pxb; Thu, 21 Oct 2021 09:03:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJytBxLr+lJih1o3RHpZmxhTUxwSyIpg0aBh4xLt8aQSa5GuI3zxg36s0MZB3TC8t9u28XUx X-Received: by 2002:a63:a009:: with SMTP id r9mr4491212pge.172.1634832205869; Thu, 21 Oct 2021 09:03:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634832205; cv=none; d=google.com; s=arc-20160816; b=KnnTzkAZW/hVIzDkNDM7I8Py6cuEDictj9Oqx0ckCCjUsXB/giwKR/ham5MOmtDzWQ Adkyp2oyp/o+CSnY0eAbH/5pmgX8r1fPS8e3VOosScu5Xqe/dBI5Dle5OdWnjwEGHC/Y 1zGbs9ctrXe+y7DRI6N6xOQzxU5wMl+kKtCvqdeo2dOFzfGGjb9GzkDxprvesC4AQKOF K9ls8aMQdmL1TjYPr3LWb2V5/OOf41jSgqrNTjILk/tTeOkch78ddTWfIPxQof9YcekE 7KWBjT7rSaNMk6UK4DhuyPj286ZeyklZ8RAm+bVHEXq0NY0M9lcSzI3AswEj6AnksmQr xh6A== 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=aQXnGSvGwqVsJ8nP8kr+l4vStpxJv5nNjrJiBNRwZ+M=; b=xo0ir510b7D7dbP196LcL5DCQJltNzxjyP/tVSAWDw3YuVUfNjuiwT+0bSNPLaSmTH T/npuKID93Pa0ukxv9gQ3AuxOJPow6E+UNoucjjTDksgEaCD5elwbL8Cog46Bv3Ycmmh e/hqOD5Sg8W8/QXzCU8KuiCmQolmF4U2ypzHP5xwVAf6gd2KLpc56oSWA2Lv1XBZAhER sUDanVot7eVNlTBaj4sjqa9tUTXqPMvmM28YzRVv5tM5IxEM2n+3/AUBCjNDC4IqxLaf Svn3h9pzYdGPHHx4FOcPtULAMMQpdYFpd0YwXo1RRwyPS5fO0yh+dkNSMLjG+Ga1+ZJe 5Htg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=jhcXD7uX; 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 c9si7751108pgv.596.2021.10.21.09.03.13; Thu, 21 Oct 2021 09:03:25 -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=jhcXD7uX; 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 S230187AbhJUQEX (ORCPT + 99 others); Thu, 21 Oct 2021 12:04:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33478 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231566AbhJUQEW (ORCPT ); Thu, 21 Oct 2021 12:04:22 -0400 Received: from mail-pg1-x532.google.com (mail-pg1-x532.google.com [IPv6:2607:f8b0:4864:20::532]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 249B7C061220 for ; Thu, 21 Oct 2021 09:02:06 -0700 (PDT) Received: by mail-pg1-x532.google.com with SMTP id c4so706142pgv.11 for ; Thu, 21 Oct 2021 09:02:06 -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=aQXnGSvGwqVsJ8nP8kr+l4vStpxJv5nNjrJiBNRwZ+M=; b=jhcXD7uXJAO9grkMAifc99WARslOnjDNWHarUyzrdB0UVxuWb42YrgWWVyzhkJtx6N FU3tSvW3JDgvVfLXOyckE3uKTYO/9/PIzybZXNdE8CPK20RMM9jQWkTlCEogsh811zdS B6u+g+Ze6cDw7Y18Te1VGsUkKIkZoT7CpHEhs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=aQXnGSvGwqVsJ8nP8kr+l4vStpxJv5nNjrJiBNRwZ+M=; b=Thj1XtJafHT6z/8Lk9/P7agSN4wOYdAodhhqGQqO9oK4TV7aaVRR83GVy/QUsiz/fn r6Tq461gV3SmCnu3HwFD/zx1KfNY5MkT1rCD5nrGzMMRy9m99M1mUnSMsTol8ASYHtgX hRTom2ZgNStBGeNviHoHvFrOb+1NGgVUIj8jg1REVY98hLMt4Hm9pJG6dn5NjLy+jjj5 hlLTh9HhYbImCIkQonMXYBgnVvVyV7dvzNstW2cDq+Deg3PmoWr85HXDaLzox6Z7uhIP L7PQrKks0w3xSomKJn7wV5HxjjjLl+TqlLGmoNexOaNHrJ0O/NsM4elNDWNbll2IFPEP g0Mg== X-Gm-Message-State: AOAM530eFXW0UE4whjH73lZmcADXQFKGWExmWED/xS5vlP2S3TOGUtdV KOnTUrccHXh9dTDsjP8h4Shtbw== X-Received: by 2002:a63:731a:: with SMTP id o26mr5153446pgc.248.1634832125531; Thu, 21 Oct 2021 09:02:05 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id i2sm6595890pfa.34.2021.10.21.09.02.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Oct 2021 09:02:05 -0700 (PDT) Date: Thu, 21 Oct 2021 09:02:04 -0700 From: Kees Cook To: "Eric W. Biederman" Cc: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, Linus Torvalds , Oleg Nesterov , Al Viro , Jonas Bonn , Stefan Kristiansson , Stafford Horne , openrisc@lists.librecores.org, Nick Hu , Greentime Hu , Vincent Chen , Heiko Carstens , Vasily Gorbik , Christian Borntraeger , linux-s390@vger.kernel.org, Yoshinori Sato , Rich Felker , linux-sh@vger.kernel.org, linux-xtensa@linux-xtensa.org, Chris Zankel , Max Filippov Subject: Re: [PATCH 02/20] exit: Remove calls of do_exit after noreturn versions of die Message-ID: <202110210858.41719190D2@keescook> References: <87y26nmwkb.fsf@disp2133> <20211020174406.17889-2-ebiederm@xmission.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211020174406.17889-2-ebiederm@xmission.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 20, 2021 at 12:43:48PM -0500, Eric W. Biederman wrote: > On nds32, openrisc, s390, sh, and xtensa the function die never > returns. Mark die __noreturn so that no one expects die to return. > Remove the do_exit calls after die as they will never be reached. Maybe note that the "bust_spinlocks" calls are also redundant, since they're in die(). I note that is a "mismatch" between the do_kill() in die() (SIGSEGV) and after die() (SIGKILL). This patch makes no behavioral change (the first caller would "win"), but I thought I'd note it in case some architecture would prefer a different signal. Reviewed-by: Kees Cook -Kees -- Kees Cook