From patchwork Fri Apr 13 16:33:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Torvalds X-Patchwork-Id: 10340423 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 F259D604D4 for ; Fri, 13 Apr 2018 16:33:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E639F288EE for ; Fri, 13 Apr 2018 16:33:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D995A28915; Fri, 13 Apr 2018 16:33:44 +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 3864B288EE for ; Fri, 13 Apr 2018 16:33:43 +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=UzjI+QkncH7gi59lLhzSSw+qOz9Zp1yMpjUU2WLGdx8=; b=ls9woTGKSGeqtYv/4xqLoUyrk Yi5r/mNkYRG1Ph2UKwBm+uBcgqxJpv6QEns01NHNhoE65Ba4l4PaySfba5E420PgO1I8O7KYKPKiz 3q6yLcBLiZdBPWOtw6jfBDH45FcYr7S3qH6716WfKSe+T9heIsL1ZsGAGiGtColvlHlKXs4Vpjzyt X7oo0Es3bNyWO5LqELQG/ZX7dYhPB7GCXAiRkeXPm1pqS8rMavjnM57kKe9BxGMtLXzYRF/tHztrs a+KpC3QyFBzljG8S5f+h63Eqa3ejGM7c9mTHPr3s94gZZ2kN/H4u3qsxPjhY6twpKRhT8+1UWxc3v z2f9awkwQ==; 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 1f71dl-0004sN-6i; Fri, 13 Apr 2018 16:33:33 +0000 Received: from mail-io0-x22d.google.com ([2607:f8b0:4001:c06::22d]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1f71dh-0004pO-KK for linux-arm-kernel@lists.infradead.org; Fri, 13 Apr 2018 16:33:31 +0000 Received: by mail-io0-x22d.google.com with SMTP id k8so79933ioc.2 for ; Fri, 13 Apr 2018 09:33:19 -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=AAt8NVnm7XEJDjAuiDF+vYwjYGN66puCHmQ5mzULfkY=; b=IeBEk0XIjJmN57whEWaHfwkFM+XkmVCVmdPF8soFBL8eyfzt+ccqw6NNt2T+5oQwCp cqDmIJgWWkD2/JF78bsKkuqx5IY00FWUN2vvlmAt8jwrJc5WDJTp4mQ+LTrj8rbi64lx BJlOZqzEbWQzk0MgsJ5v+bIZAD0HI7mR8AXF9bEAZ7u4k1fklf7zPTnCoXOXxuRH5MvQ ML+RsQOxdk9Vaomeisbb8PHfn9ZhsRhWtSdW8sjwsVINIKwf+ErJ52JH7wDYCku6QFG/ tgTzHH8zlwjtuX0RtfGJ1aTfLL40G/FNDByvRc+4UpYCvbIMVcG8i4e+YcPzQE9Jk1fT isdw== 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=AAt8NVnm7XEJDjAuiDF+vYwjYGN66puCHmQ5mzULfkY=; b=gDCmNlyppvxxylpljS1sBx73+tOj0V9BZIB/YDjN0mdxBFuQAgylhSu1BbOD5VHU7c q6ft5GmR2MywpmR3hkEdNc0+FE1RnDrnh85kZiVqWBTpnWKybvBjCV8Z6NMm0rDalroX LUP4V56LRt9mNZzLG6RyCwPXbJ1XCkc4v2WLo= 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=AAt8NVnm7XEJDjAuiDF+vYwjYGN66puCHmQ5mzULfkY=; b=kA9DUTtY4L5uYQeSirpbG2OBMtjJ10+rRr4ErBk8FP69djqvdhYqFD1m7Lgw7miCFr trzWcOW408Ej9xv48mxRNY2PnMO0UayTFdYeDDO6i7xdr9DkMwLBTxG0aH5QJw0c6evg tv0m/uXwzQ+kNCvy9m9IZFnsNosu+/9Xej/67VGVFNcl3fhPwn29lt26jyHGyFw1ItYp VhiJZjREFwRucHpPRDGT0DAfW9sruclgovOpGXB18auc1IeK0DxnwU4dDB7a2BEfQ9fc yObjtMvaLpyWlZ3SQTeq5hp7/vNeM8DvpY39FUxzFh4CvUjRg1LZ6dkR+E56NjMdiBno pubg== X-Gm-Message-State: ALQs6tDmwgvfpzJYUiPC2ZPKAhN4pTgDccCADGe0doGt1jFhS0eKq+28 +ZhM3QvckKHr3NHhagN4EO34996iS8lPvhOM6l4= X-Google-Smtp-Source: AIpwx4+Y3c+Osv4BmC0ByHEHRoI5Y7rXEqADqtp3ul9GN7RQOtRBivEazncJrBeUC09pC7+DbnFN0gA4Rl/N07oxz/w= X-Received: by 10.107.182.214 with SMTP id g205mr14774656iof.203.1523637198282; Fri, 13 Apr 2018 09:33:18 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.95.15 with HTTP; Fri, 13 Apr 2018 09:33:17 -0700 (PDT) In-Reply-To: <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> <20180413094211.GN16141@n2100.armlinux.org.uk> From: Linus Torvalds Date: Fri, 13 Apr 2018 09:33:17 -0700 X-Google-Sender-Auth: 2MKSXjfQiO6udNUqnPslwBNHHFo 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-20180413_093329_675636_4127A689 X-CRM114-Status: GOOD ( 24.37 ) 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 Fri, Apr 13, 2018 at 2:42 AM, Russell King - ARM Linux wrote: > > Yes, it does solve the problem at hand with strace - the exact patch I > tested against 4.16 is below. Ok, good. > 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. I wonder if we should even bother with FPE_FLTUNK. I suspect we might as well use FPE_FLTINV, I suspect, and not have this complexity at all. That case is not worth worrying about, since it's a "this shouldn't happen anyway" and the *real* reason will be in the kernel logs due to vfs_panic(). So it's not like this is something that the user should ever care about the si_code about. > 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. I'd much rather get rid of that FPE_FIXME, and leave that whole mess behind. So the attached patch seems simple and should work with 4.16 too. Let's not leave this as some kind of nasty maintenance issue, and just go for simple and stupid. Hmm? Linus arch/arm/include/uapi/asm/siginfo.h | 13 ------------- arch/arm/vfp/vfpmodule.c | 2 +- 2 files changed, 1 insertion(+), 14 deletions(-) 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..af4ee2cef2f9 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_FLTINV, regs); return; }