From patchwork Fri Apr 13 09:42:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 10339733 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C38D96039A for ; Fri, 13 Apr 2018 09:42:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BE8842857E for ; Fri, 13 Apr 2018 09:42:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B305B28635; Fri, 13 Apr 2018 09:42:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 39A0528553 for ; Fri, 13 Apr 2018 09:42:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Pd3iVL7Bkk6rgs3Jm4l3rpy/wqi9nfjFI3EFDJwUYac=; b=uycQRbiQ3hO7lM 6TMV7KVnx9dOM2xh+SaiQw52iF7GXebRo3zxhgiZTPNrP1hNRHAoBoVRzK224V1RVUUORNfOWZteU vRJirgsjdw5Tu6AX67djTgy3gGHXGnb2GU0kLPGoF/v+SLvPll4V6tn0Rd37+BPOAAol8fNbF0N1o aYaJa7JvEL0ZxLGiYr2I4/2vkJbJvJMpXmRmz6Ly/16eHbTjfXcWWdclNqYZE/L14RQ1ut5kAOxbi pjjPgLBrXb9Ag6aO6FPA42F7b3NexOxo2NOoLyik4k5dhBfSWFec4gKj+joCXnbYUPhwenvqJ881f HCehT2A+FxWXL+Ikt1CQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1f6vEA-0002TJ-AH; Fri, 13 Apr 2018 09:42:42 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:3201:214:fdff:fe10:1be6]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1f6vE5-0002Pl-GZ for linux-arm-kernel@lists.infradead.org; Fri, 13 Apr 2018 09:42:39 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2014; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=mH2Q8+QlHkSQ0uz/nUXZpR/f6nzNcGl87MhI+ncdB/k=; b=pzlS85qS1lvu76tG3kDNZg8hZ V6bc6C1NRfDW+NU1yRVnpGak+uQGN0ntZ/SZ2ZNKteJEeyKvYt3w5Hc4bBYxCa9s9ThVj3TpIxvyH B2sIn19s266MIfg2iI1L5SgyD3KvuV8qsZ+XHjAlZeKT2xAufnMkpEXfmUGDdkrayQq5w=; Received: from n2100.armlinux.org.uk ([fd8f:7570:feb6:1:214:fdff:fe10:4f86]:44525) by pandora.armlinux.org.uk with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.90_1) (envelope-from ) id 1f6vDk-0007BQ-Mw; Fri, 13 Apr 2018 10:42:16 +0100 Received: from linux by n2100.armlinux.org.uk with local (Exim 4.90_1) (envelope-from ) id 1f6vDh-0005N1-9d; Fri, 13 Apr 2018 10:42:13 +0100 Date: Fri, 13 Apr 2018 10:42:11 +0100 From: Russell King - ARM Linux To: Linus Torvalds Subject: Re: sparc/ppc/arm compat siginfo ABI regressions: sending SIGFPE via kill() returns wrong values in si_pid and si_uid Message-ID: <20180413094211.GN16141@n2100.armlinux.org.uk> References: <20180409152253.GD10489@altlinux.org> <20180412013435.GA21219@altlinux.org> <20180412095811.GC16141@n2100.armlinux.org.uk> <20180412110314.GA28070@altlinux.org> <20180412121949.GD16141@n2100.armlinux.org.uk> <20180412124928.GA29458@altlinux.org> <20180412131404.GE16141@n2100.armlinux.org.uk> <20180412172051.GK16141@n2100.armlinux.org.uk> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180413_024237_582795_47C6FA13 X-CRM114-Status: GOOD ( 21.76 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Linux Kernel Mailing List , "Dmitry V. Levin" , "Eric W. Biederman" , sparclinux , ppc-dev , linux-arm-kernel Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP On Thu, Apr 12, 2018 at 10:22:15AM -0700, Linus Torvalds wrote: > On Thu, Apr 12, 2018 at 10:20 AM, Russell King - ARM Linux > wrote: > > > > This file was created to contain FPE_FIXME, by the "signal/arm: Document > > conflicts with SI_USER and SIGFPE" commit so if we're removing it, it > > would be better to remove the whole file. > > Fair enough. I'm not going to commit that anyway since I can't test > it, but yes, if it tests ok that sounds like the right thing to do. Yes, it does solve the problem at hand with strace - the exact patch I tested against 4.16 is below. Testing this exact code path (exceptions set to VFP_EXCEPTION_ERROR) is something that can only happen if the hardware does something stupid, and I don't have a way of making it do that, so the code path can't be tested. However, FPE_FLTUNK is not defined in older kernels, so while we can fix it this way for the current merge window, that doesn't help 4.16. How we solve that depends what happens with Eric's patch (266da65e9156 ("signal: Add FPE_FLTUNK si_code for undiagnosable fp exceptions")) that introduces FPE_FLTUNK - and there's also the problem of NSIGFPE, which kernel/signal.c uses in the path that selects the siginfo layout. Given that the path we're talking about is unlikely to happen (as mentioned in my second paragraph) I still think reverting Eric's patch is the right way forward for older kernels. (Note, my previous comment about the si_code initialiser was incorrect.) diff --git a/arch/arm/include/uapi/asm/siginfo.h b/arch/arm/include/uapi/asm/siginfo.h deleted file mode 100644 index d0513880be21..000000000000 --- a/arch/arm/include/uapi/asm/siginfo.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef __ASM_SIGINFO_H -#define __ASM_SIGINFO_H - -#include - -/* - * SIGFPE si_codes - */ -#ifdef __KERNEL__ -#define FPE_FIXME 0 /* Broken dup of SI_USER */ -#endif /* __KERNEL__ */ - -#endif diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c index 4c375e11ae95..8a1a5e6048d2 100644 --- a/arch/arm/vfp/vfpmodule.c +++ b/arch/arm/vfp/vfpmodule.c @@ -28,6 +28,10 @@ #include #include +#ifndef FPE_FLTUNK +#define FPE_FLTUNK 14 +#endif + #include "vfpinstr.h" #include "vfp.h" @@ -257,7 +261,7 @@ static void vfp_raise_exceptions(u32 exceptions, u32 inst, u32 fpscr, struct pt_ if (exceptions == VFP_EXCEPTION_ERROR) { vfp_panic("unhandled bounce", inst); - vfp_raise_sigfpe(FPE_FIXME, regs); + vfp_raise_sigfpe(FPE_FLTUNK, regs); return; }