From patchwork Thu Apr 12 16:50:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Torvalds X-Patchwork-Id: 10339033 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 44002602D8 for ; Thu, 12 Apr 2018 16:50:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3358727EE2 for ; Thu, 12 Apr 2018 16:50:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 31E4327F92; Thu, 12 Apr 2018 16:50: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 8B3FC27EE2 for ; Thu, 12 Apr 2018 16:50:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:To: Subject:Message-ID:Date:From:References:In-Reply-To:MIME-Version: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=iTfYwK/ODHQPI0XYcDnizxO8Pn/r+35BJRa/8haVZHE=; b=teFmBniVGh/I9+WE07uF2NKfk h8/yuuLGAuLkd9o8t1uf2ozGnQx/YzScaPcdYXxgpIDCnTS2A9iVTkRlRk5WVecnPpUmejGJ/5GYb J5ih74BlE5Kcti3ttY2dF3iIA+Otnz0+r1VTJV1KX56j4xVOvWBFw1Ox3CL9OMGcuhZ4bIMlkBR37 D94d/aZfcfAknCvqJik2AOeDMr/M9+1gXQEBsO3eR6Y5cTk6xtHx5IIIFDGIfu3030XRsB2KOTBQD 2pukjAhqQy5ppfGPZrmfbT3aH3sMtajNp1L7GxD/qOSSkNCPiLjimCBMHfmWT99tCSMNTHm7XDh0B d1CrWPS7A==; 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 1f6fQq-0007tj-Eg; Thu, 12 Apr 2018 16:50:44 +0000 Received: from mail-io0-x22e.google.com ([2607:f8b0:4001:c06::22e]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1f6fQl-0007rx-Se for linux-arm-kernel@lists.infradead.org; Thu, 12 Apr 2018 16:50:41 +0000 Received: by mail-io0-x22e.google.com with SMTP id b20so7067204iof.5 for ; Thu, 12 Apr 2018 09:50:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=5OkWoxtSi/8jRShnJ4Gnz08RWz9oYnDpmH1zl8Gf1M4=; b=Ej+svfkz4EWVM38kKY9JyXqRzaz8G/cSwo+TXQsqKuRq7p5rP9awvnmDFxw0IyTHsA GUDB05RwnwYhGRcg1BLXdZYfwWmrs26LBEiHHLsY9NdBJC5461IX5iwq+0uzZfi/nNPi 70/1OJtY9B/HwOblevI5nFdjgUNtyDi6/PEWM16nKGfbe7yDzhH+jdmcqoYc542060qs Y98aPNUsRnQDG9juut1mwnU3v1ZAFHhuD+GZUfyfoUmNPIyH2yXTauwl/LqTHVu2J7JF VWnnYjhrK7qb55+Chdq0+YhBpfYFwB6aqBrfC+v5faEKGOhenqC7vUvSdv0rUr1M5A2Y Tv3Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=5OkWoxtSi/8jRShnJ4Gnz08RWz9oYnDpmH1zl8Gf1M4=; b=RqreR5Pl1QREL1SfHDtcB84nuvwYK5MXEVoiIy8VKiw9VC2rLyeOv2WsG4MpF7nY/H mScBSXhngnNE2ZUwkhrr8sx+KhTPA0qTdsbTlAmJEGx/TlBGlzBtmjUTFaD7soOkv4/v SjEE+p3EvISbR+h/eVRE+eJhZNz76SnyO7pqA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=5OkWoxtSi/8jRShnJ4Gnz08RWz9oYnDpmH1zl8Gf1M4=; b=Jrj+dul/J00NjdP0duLT2abJsoLhymBTbJh2rld6fhadCH5n3y4ReIZj4fLyZETOYS F4sNW3t5D6Y/nBfMhGvpqkDWGdq54K31iRaOcynJi3nypMIfUlTgSaU/4rm0V3dSYAkW 8lN6O1ihYVE8mKBS/GsHk+JPnZgpwvWsVOSjIuUFnuDGlnF4P7isMULmz72tDKLoqvJY 8NDNt7FlPzxUbiIKNa29U33KVXuypmP5cwuErN+TSLfOzJH+Yreji7M9l/YVDGEzhtNS DTzVy4Ifdj1T97nf8Eixkyhpx8PbftyyZ7ra8R6z23JAHjtjUt923tp9ecUZ05SRKN5R JnOA== X-Gm-Message-State: ALQs6tC1KRoMMRkN/TvF74Rxg3Zh9G7B8Ss/QPRZ0RfDhvHqcSCTs+77 CJUfavp2+N6whohd4qfYQvQy0Cb1pxwM8Y5hkLA= X-Google-Smtp-Source: AIpwx4+Iod0hwv2/+7pCR1i6M36IlIE23fs83NIcWNe9Nl8O/V4jnBNyrgA5ha1tl3CUpWJtGjVycGqolHXYNmtqXa4= X-Received: by 10.107.182.214 with SMTP id g205mr10400314iof.203.1523551827493; Thu, 12 Apr 2018 09:50:27 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.95.15 with HTTP; Thu, 12 Apr 2018 09:50:26 -0700 (PDT) In-Reply-To: <20180412131404.GE16141@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> From: Linus Torvalds Date: Thu, 12 Apr 2018 09:50:26 -0700 X-Google-Sender-Auth: wFyfWXyp-VN6ptEMKyRrxEiTY1k Message-ID: Subject: Re: sparc/ppc/arm compat siginfo ABI regressions: sending SIGFPE via kill() returns wrong values in si_pid and si_uid To: Russell King - ARM Linux X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180412_095039_948983_C6AED82E X-CRM114-Status: GOOD ( 18.92 ) 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 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 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; 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; }