From patchwork Thu Apr 12 17:35:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Dmitry V. Levin" X-Patchwork-Id: 10339107 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 25DA760134 for ; Thu, 12 Apr 2018 17:36:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1171027F97 for ; Thu, 12 Apr 2018 17:36:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 05C9A27FA5; Thu, 12 Apr 2018 17:36:25 +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=ham 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 6CB2327F97 for ; Thu, 12 Apr 2018 17:36:24 +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-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-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=5L1VqQdWCrSMr8No+JxRJQPlakLo7fG8NjtUVeHNNB8=; b=EBdqFVJoNjR0jelAoAPzE7yXo DsTc5Js0rolqC+igY5GLIeWJ7nwsdtKgnUmg/S1CN0bfsAbsliTv6gKjVTFMrYoG4/qK8o4vtnhxr cdDuHe7HQm0872fDJScuzM6bDijsJH1dE4tyNd1EsEPkP3w/WBqeCdn+h1B1IhAAv9tx4rVs9EcCV VlzTXdaXaSRFefO746QR75lSJZ9VY102fln2yT8AROqIUdbPb3iBUR6YClermBqRj431IxRpPTw4e sJW8xYa2tHdGelHqdw1ObknwQ0/LdibJm/JHVyq/Vr59JOFifw71fCfAZVTDI4JVbY/vIP7JhfUye nXHTkcxXw==; 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 1f6g8w-0001vH-5i; Thu, 12 Apr 2018 17:36:18 +0000 Received: from vmicros1.altlinux.org ([194.107.17.57]) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1f6g8o-0001pt-Fb for linux-arm-kernel@lists.infradead.org; Thu, 12 Apr 2018 17:36:15 +0000 Received: from mua.local.altlinux.org (mua.local.altlinux.org [192.168.1.14]) by vmicros1.altlinux.org (Postfix) with ESMTP id 93E2E72CC32; Thu, 12 Apr 2018 20:35:58 +0300 (MSK) Received: by mua.local.altlinux.org (Postfix, from userid 508) id 86A1F7CC686; Thu, 12 Apr 2018 20:35:58 +0300 (MSK) Date: Thu, 12 Apr 2018 20:35:58 +0300 From: "Dmitry V. Levin" 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: <20180412173558.GB31781@altlinux.org> Mail-Followup-To: Linus Torvalds , Russell King - ARM Linux , "Eric W. Biederman" , sparclinux , ppc-dev , Linux Kernel Mailing List , linux-arm-kernel 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> MIME-Version: 1.0 In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180412_103610_917781_E2FE40D5 X-CRM114-Status: GOOD ( 19.84 ) 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 , Russell King - ARM Linux , "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 09:50:26AM -0700, Linus Torvalds wrote: > Does this attached patch perhaps fix the ARM case? > > It just uses FPE_FLTUNK as the default si_code for SIGFPE, which seems > sane enough. And then gets rid of FPE_FIXME, which should resolve the > nasty case. > > Hmm? Entirely untested, and I didn't really look at the test-case in > question since I can't really run it anyway. > > Well, I could run it all on x86-64, but it doesn't have that FPE_FIXME > case at all. > > Linus > arch/arm/include/uapi/asm/siginfo.h | 7 ------- > arch/arm/vfp/vfpmodule.c | 4 ++-- > 2 files changed, 2 insertions(+), 9 deletions(-) > > diff --git a/arch/arm/include/uapi/asm/siginfo.h b/arch/arm/include/uapi/asm/siginfo.h > index d0513880be21..d87beeedb4c4 100644 > --- a/arch/arm/include/uapi/asm/siginfo.h > +++ b/arch/arm/include/uapi/asm/siginfo.h > @@ -3,11 +3,4 @@ > > #include > > -/* > - * SIGFPE si_codes > - */ > -#ifdef __KERNEL__ > -#define FPE_FIXME 0 /* Broken dup of SI_USER */ > -#endif /* __KERNEL__ */ > - > #endif Looks like the whole file should go away. > diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c > index 4c375e11ae95..012c6e690303 100644 > --- a/arch/arm/vfp/vfpmodule.c > +++ b/arch/arm/vfp/vfpmodule.c > @@ -251,13 +251,13 @@ static void vfp_panic(char *reason, u32 inst) > */ > static void vfp_raise_exceptions(u32 exceptions, u32 inst, u32 fpscr, struct pt_regs *regs) > { > - int si_code = 0; > + int si_code = FPE_FLTUNK; Note that this change would affect the following code at the end of vfp_raise_exceptions: if (si_code) vfp_raise_sigfpe(si_code, regs); > pr_debug("VFP: raising exceptions %08x\n", exceptions); > > if (exceptions == VFP_EXCEPTION_ERROR) { > vfp_panic("unhandled bounce", inst); > - vfp_raise_sigfpe(FPE_FIXME, regs); > + vfp_raise_sigfpe(si_code, regs); > return; > } > To be on the safe side, I'd just change it this way: diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c index 4c375e1..66a73ba 100644 --- a/arch/arm/vfp/vfpmodule.c +++ b/arch/arm/vfp/vfpmodule.c @@ -257,7 +257,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; }