From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D7FE3C433EF for ; Thu, 21 Oct 2021 16:09:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C0444611CB for ; Thu, 21 Oct 2021 16:09:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231835AbhJUQMC (ORCPT ); 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-Google-Smtp-Source: ABdhPJxzbAc2D1JMb8+9E7mH1eq28U/EyWOkUl6R9VQiQguRGvwbTILm2E62IEg+CGS2JEIWYVT7XQ== 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 45B08C433F5 for ; Thu, 21 Oct 2021 16:10:28 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8E68060FC0 for ; Thu, 21 Oct 2021 16:10:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 8E68060FC0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.ozlabs.org Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4HZsrx66prz3cHf for ; Fri, 22 Oct 2021 03:10:25 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=aYS4Hl3T; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=chromium.org (client-ip=2607:f8b0:4864:20::433; helo=mail-pf1-x433.google.com; envelope-from=keescook@chromium.org; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=aYS4Hl3T; dkim-atps=neutral Received: from mail-pf1-x433.google.com (mail-pf1-x433.google.com [IPv6:2607:f8b0:4864:20::433]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4HZsrC3b6Xz2xtc for ; Fri, 22 Oct 2021 03:09:46 +1100 (AEDT) Received: by mail-pf1-x433.google.com with SMTP id m14so1052911pfc.9 for ; Thu, 21 Oct 2021 09:09:46 -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=Jl6Ub2nLDXY4XAsiWd8qcKtrIR80EBgIWZqT3Z1fGAO3ATUVPrxIdRnRVXNxSn18oz kDe/WnCrOhZqmgAM9/D153NfTuwy6T2UR9ddEO21K5rSG6coSKO9W8t1B/2v6yfLc/ZD mYslKfF/xep0nvnfFQ4koHQ9nQr1tp7IjNaE2frKsrF+FEeVlHRszXD8kf6QzfhY/OEv Xu5Ucbla+cEponLSPWk8JYrA1AYXYr3leedXMHF0dK+rmHFdjOPqpMMw8YxXIRvyNOuh olS/dNxxFrqFPgnE+3UtR4fLqjYs3KL3Cv6wsFC5tC+9ohPOyo9AU4D5p5oxZMVbfA1A Dh+A== X-Gm-Message-State: AOAM5316raRRs6amIbD9/1ac/h67C8tjdXfxL6dwsGcx0P8xKFZRrZwX EQ94tWrGjOYlrCKP20f9WBwoMw== X-Google-Smtp-Source: ABdhPJxzbAc2D1JMb8+9E7mH1eq28U/EyWOkUl6R9VQiQguRGvwbTILm2E62IEg+CGS2JEIWYVT7XQ== 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" 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> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Oleg Nesterov , Paul Mackerras , Al Viro , Linus Torvalds Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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