Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp774220pxb; Thu, 21 Oct 2021 09:13:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyQ4ANdSRKXs2uO3NGYjMyxY0N3mFmKyH5aDuYklbJ5epBYO4XWdDF/aanuUBNlcikhFrpZ X-Received: by 2002:a17:90a:c78b:: with SMTP id gn11mr1859981pjb.87.1634832799607; Thu, 21 Oct 2021 09:13:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634832799; cv=none; d=google.com; s=arc-20160816; b=Q6LdjmfcA25aYyT+5EmNyziFu/N6Xb0l7lTLPXT+Uc2lWJH62RIpHMH7cYU5WWA+r8 ic3rqC6gwdGIIUnKrfTFJLCAeodbcHIEc4bBVkwd0lzpgBYPq3owFQk2hgT6dHhzdfGc foDX5y6s4y5DqKqfKGFpFgS0tNzbS5b1KW+odt8lvPqEQLSbhMwst7wgTDYVXIc/RFhJ /hLl3cT0/w2tkY5Q7KcYZXs/ToXqT53PKU/VCZ+jHrAEv30ZL3HRjeflLwfEpsPJdLVN W7m0xajP+PDkm1gNFe2Ds7bA7mIURqjWPxSEVNlSarI1RtjYv4Hi75/sVq8R3Bf3ojq3 0fbQ== 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=9F/2GwBSv+wmck4DeHeGUmQJiNkhxnagoawd2JRdH8I=; b=NtE4XqDokWStJ/D7Mgv3zbLONSFspqiJ8i4NX0Pl3g24a47dGEem8sY7hvhCJBOq+N PPnocNtC1o5Nn0O6CHhbXp2xNe5vJKvumWKBb5tIuleahoXX8QHgkuA6mqagF0VWAWxX p0qeNh31sik23iiFc68ND0i/5avDnVBkB+mLLwTABS+8SAZs8XupKxHvjjyQAo1smlWc +zB9RdhC2E5PTX5wOKTVNpXz2Kg5vxQQ+Dg8E0UcR9cb/F8iazmH0UnOaQlN6M8hVa12 NS2t2gWZNcjjvA0p0aOTmYU8l51Cal2i/hep6L+gWglYMgLkWDT/VnpdEunjwsfmTU+i nnsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=aYS4Hl3T; 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 ha2si8131380pjb.67.2021.10.21.09.12.39; Thu, 21 Oct 2021 09:13:19 -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=aYS4Hl3T; 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 S231616AbhJUQMC (ORCPT + 99 others); Thu, 21 Oct 2021 12:12:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35272 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229702AbhJUQMB (ORCPT ); Thu, 21 Oct 2021 12:12:01 -0400 Received: from mail-pg1-x535.google.com (mail-pg1-x535.google.com [IPv6:2607:f8b0:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8DDC2C061764 for ; Thu, 21 Oct 2021 09:09:45 -0700 (PDT) Received: by mail-pg1-x535.google.com with SMTP id h193so770125pgc.1 for ; Thu, 21 Oct 2021 09:09:45 -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=9F/2GwBSv+wmck4DeHeGUmQJiNkhxnagoawd2JRdH8I=; b=aYS4Hl3TAQ6+l8a1NwGwRJW1wfXBykLV8Ng2Ki4cDwOzEV2Bq494FF2RnGdoqzmZru h2CA0xmwYI0j1RnrpSzOjCuwxghZRlujRdtN5MJu5Q9ompbrEvzpNz2/MLcIa3J/XVHT 6ENhFUr4+Cm8aLnVavjthSt3hxefaRSnx2rFo= 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=9F/2GwBSv+wmck4DeHeGUmQJiNkhxnagoawd2JRdH8I=; b=mfdhR0KO2KqqjBSpcDSUHmM4K6Uuv05OXqSbqROkYnJiP0CnLvQDu9jPKmCNLyqM1F tML14vfXUaqU7rJQGfEk9j30Jj4kd7PUDm2HUSpwvZ0Gpj726x2pICg5UXPxExVzUD4z 9wYfCahNo9AySXNvm6OUOX7DH2bPct7Y0Lxau2fcMhYlsoKOU2Kq+A37VcfB9oTu7RAP 9NmoCuICR4DnXH5exAMpTJyUMHvZA2hVX8WDP+K/bkNqD7s9AvNpu32XQC+3s7cXzgbZ 1y8gIgyghZCYJ3bjOctO0Tk0VAKPbvdrtCZNpQDttIBC0QVhb4CjWx8szVgCQ77Q+/N/ gSVA== X-Gm-Message-State: AOAM531utVG0Xaaqvy0xptTk205S51G8LuwIAb1rjY3CslM+yZuk1IXA COBqysNR+Lu1yrSsE4E2OrFAFA== X-Received: by 2002:a05:6a00:140e:b0:444:b077:51ef with SMTP id l14-20020a056a00140e00b00444b07751efmr6469571pfu.61.1634832583972; Thu, 21 Oct 2021 09:09:43 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id x20sm6226101pjp.48.2021.10.21.09.09.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Oct 2021 09:09:43 -0700 (PDT) Date: Thu, 21 Oct 2021 09:09:42 -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 , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , linuxppc-dev@lists.ozlabs.org Subject: Re: [PATCH 07/20] signal/powerpc: On swapcontext failure force SIGSEGV Message-ID: <202110210909.895B8A5A58@keescook> References: <87y26nmwkb.fsf@disp2133> <20211020174406.17889-7-ebiederm@xmission.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211020174406.17889-7-ebiederm@xmission.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 20, 2021 at 12:43:53PM -0500, Eric W. Biederman wrote: > If the register state may be partial and corrupted instead of calling > do_exit, call force_sigsegv(SIGSEGV). Which properly kills the > process with SIGSEGV and does not let any more userspace code execute, > instead of just killing one thread of the process and potentially > confusing everything. > > Cc: Michael Ellerman > Cc: Benjamin Herrenschmidt > Cc: Paul Mackerras > Cc: linuxppc-dev@lists.ozlabs.org > History-tree: git://git.kernel.org/pub/scm/linux/kernel/git/tglx/history.git > Fixes: 756f1ae8a44e ("PPC32: Rework signal code and add a swapcontext system call.") > Fixes: 04879b04bf50 ("[PATCH] ppc64: VMX (Altivec) support & signal32 rework, from Ben Herrenschmidt") > Signed-off-by: "Eric W. Biederman" This looks right to me. Reviewed-by: Kees Cook -- Kees Cook