Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3690609pxb; Sun, 24 Oct 2021 08:38:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxCmoshbYvDX29K0W1Gyq9a9tulJ6a4LYE2LNe/Wv30i2AfoWYMQbHZFjbmBTdDCR5ZixHV X-Received: by 2002:a17:90b:4ac9:: with SMTP id mh9mr29394289pjb.173.1635089931764; Sun, 24 Oct 2021 08:38:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635089931; cv=none; d=google.com; s=arc-20160816; b=Rk+62H9iUopDSLgYX5BIcNI6geFna11Ux3GPBCbe8Fovb7095teat3R5wITWS0ea5q TnT1Mk8rV56EbteMHh3jZgc39cSez1vfQNpr24g1KCKh0OxcuSlG5mXV8gI5Yy81q/jP vXPIPdoqJ6z/jThmZOuxbbVUmZtu7DjJh5ZxtHTk3dlUf4SjBjGFxOpRbHGMOZrlW/LA sMuh7oMollsVO6E0RkZCRaHZoDZTBhFBdtX+hPRvLwQDV1npo1PVth5a1E/fAONPFIwi Iry8Uceqg0UlX9N+7RFL/cerMIl67MBjYvoTrsM+GMsdw5KMBjiZfCmnKQVo0AiGKGYy eUgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=5ZMSbU4dOuzYT7alpgLppyyW5+z+OvvoSJhmIs361Zc=; b=plc46E9/mgTzCWO4mdDz7FEjqgRHh6eLoaDwQhhMknbAHEMvR/hLVQrQ/jeQd+NZXF YAntdqpgVOEn0YG2qwPprCOZY0nvBUz5EGWJWZ3KhdUb12aJPhhIgUNJ6aNXtoeGi0+6 yARvksCZaigM+g4Adp3F1KiFkoulJdEe0O9mQH2Cr7usSHelzJ+9v3DJKY7Mf887+d54 aNpMEfVWWsU7eE8cUiErXM8qmsv+ECFYd4DnODQuETGeVvKL9YhB4xUaUjPJybU6QFnZ 4XUDMbOmOR2f+yyCGRW8IKQ7ftOHXYyW5GBTiYmvyM/djiC3PkbLK4XmyjOlVIxDdW2w Mmug== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o12si20299952pgb.105.2021.10.24.08.38.39; Sun, 24 Oct 2021 08:38:51 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231812AbhJXPjx (ORCPT + 99 others); Sun, 24 Oct 2021 11:39:53 -0400 Received: from elvis.franken.de ([193.175.24.41]:37604 "EHLO elvis.franken.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231534AbhJXPjs (ORCPT ); Sun, 24 Oct 2021 11:39:48 -0400 Received: from uucp (helo=alpha) by elvis.franken.de with local-bsmtp (Exim 3.36 #1) id 1mefYp-0006bc-03; Sun, 24 Oct 2021 17:37:23 +0200 Received: by alpha.franken.de (Postfix, from userid 1000) id EA281C265F; Sun, 24 Oct 2021 17:27:45 +0200 (CEST) Date: Sun, 24 Oct 2021 17:27:45 +0200 From: Thomas Bogendoerfer To: "Eric W. Biederman" Cc: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, Linus Torvalds , Oleg Nesterov , Al Viro , Kees Cook , Maciej Rozycki , linux-mips@vger.kernel.org Subject: Re: [PATCH 05/20] signal/mips: Update (_save|_restore)_fp_context to fail with -EFAULT Message-ID: <20211024152745.GD4721@alpha.franken.de> References: <87y26nmwkb.fsf@disp2133> <20211020174406.17889-5-ebiederm@xmission.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211020174406.17889-5-ebiederm@xmission.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 20, 2021 at 12:43:51PM -0500, Eric W. Biederman wrote: > When an instruction to save or restore a register from the stack fails > in _save_fp_context or _restore_fp_context return with -EFAULT. This > change was made to r2300_fpu.S[1] but it looks like it got lost with > the introduction of EX2[2]. This is also what the other implementation > of _save_fp_context and _restore_fp_context in r4k_fpu.S does, and > what is needed for the callers to be able to handle the error. > > Furthermore calling do_exit(SIGSEGV) from bad_stack is wrong because > it does not terminate the entire process it just terminates a single > thread. > > As the changed code was the only caller of arch/mips/kernel/syscall.c:bad_stack > remove the problematic and now unused helper function. > > Cc: Thomas Bogendoerfer > Cc: Maciej Rozycki > Cc: linux-mips@vger.kernel.org > [1] 35938a00ba86 ("MIPS: Fix ISA I FP sigcontext access violation handling") > [2] f92722dc4545 ("MIPS: Correct MIPS I FP sigcontext layout") > Fixes: f92722dc4545 ("MIPS: Correct MIPS I FP sigcontext layout") > Signed-off-by: "Eric W. Biederman" > --- > arch/mips/kernel/r2300_fpu.S | 4 ++-- > arch/mips/kernel/syscall.c | 9 --------- > 2 files changed, 2 insertions(+), 11 deletions(-) Acked-by: Thomas Bogendoerfer -- Crap can work. Given enough thrust pigs will fly, but it's not necessarily a good idea. [ RFC1925, 2.3 ]