Received: by 10.213.65.68 with SMTP id h4csp503104imn; Tue, 20 Mar 2018 08:22:58 -0700 (PDT) X-Google-Smtp-Source: AG47ELuz26kQrMxz7Gf4H+ZLXio0F5drQy2iSGlTo15QGON6pIllOkaGgct3DNLkIIhn0cylMKxH X-Received: by 2002:a17:902:51ca:: with SMTP id y68-v6mr11185557plh.25.1521559378380; Tue, 20 Mar 2018 08:22:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521559378; cv=none; d=google.com; s=arc-20160816; b=Zm7VkKOQa6W8ZEEj6RYL+As6R8Et6iZUPHVlpnddmyWyqYnBG+vbpXwaOYAOZ1DO8Y Z/RntVmIuWZQwW759biUWtnVMH5gLKUj3qR+cjYNWTLsqh7AxVF/E8NjRehGXQNtmPD3 9pMzc3bw2UEcOAgByfXkDPN3fxWtygVcHvoZ8mK4QwdWQ8Ksb8sb3pSdFKokKEpPF2ZU 3ugE6HkTjRUqs70h/7LLKjALIFyCVOXFZecEkBnIg9cMfOu9DSmCZJ2eHSX9yOkYB6nb U0SBHiLoztBgxN6beu6ej8JyNm/36e7fRYCpUNfr1cPr0zu8T7gZRmPsXE/e/+a5PXCF XB4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:mime-version:user-agent :message-id:in-reply-to:date:references:cc:to:from :arc-authentication-results; bh=rBZRwUYmAZtrhHAx+1Da5NRC9G5uH04LACCi7hbtFgY=; b=nSsrs5nlDZvYIbR1VXq3AgQCsy4t/3mgwXd8Wi2CgTZhmgF0mu8s7sFIsh1ArOCia8 tK2MO/WpdB8lYamX3npuV0Vh9qY3xvVrnAMvEkRH3C1Bn2UjobvB6CuOWvJJVtSYZrse qlYer29g1WqStflZp7GV6PYimvSMvqv+UgXyu/HjOSnmFJ6D3kgCMwJ5CxYbyRpaO/KA 0CUyHjqkENPdCE/Z2dyL8hRIqupy8A88pxPlK2YCOI2jgi55XwyVwKPMBvH4PRXWyj/h 4ec+tCAUDWt2m8rQJ7dze0QLvsqu8o2EcSAAC1P6FtoEfuu3FERpCDxgZS4jkGkzleL+ QaNg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w1-v6si1667589plk.597.2018.03.20.08.22.43; Tue, 20 Mar 2018 08:22:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751815AbeCTPVV (ORCPT + 99 others); Tue, 20 Mar 2018 11:21:21 -0400 Received: from out02.mta.xmission.com ([166.70.13.232]:51156 "EHLO out02.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751186AbeCTPVR (ORCPT ); Tue, 20 Mar 2018 11:21:17 -0400 Received: from in01.mta.xmission.com ([166.70.13.51]) by out02.mta.xmission.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.87) (envelope-from ) id 1eyJ4d-00020l-RS; Tue, 20 Mar 2018 09:21:15 -0600 Received: from 97-119-121-173.omah.qwest.net ([97.119.121.173] helo=x220.xmission.com) by in01.mta.xmission.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.87) (envelope-from ) id 1eyJ4c-0003n4-U1; Tue, 20 Mar 2018 09:21:15 -0600 From: ebiederm@xmission.com (Eric W. Biederman) To: Sasha Levin Cc: "linux-kernel\@vger.kernel.org" , "stable\@vger.kernel.org" , "James E.J. Bottomley" , Helge Deller , "linux-parisc\@vger.kernel.org" References: <20180319154645.11350-1-alexander.levin@microsoft.com> <20180319154645.11350-118-alexander.levin@microsoft.com> Date: Tue, 20 Mar 2018 10:20:21 -0500 In-Reply-To: <20180319154645.11350-118-alexander.levin@microsoft.com> (Sasha Levin's message of "Mon, 19 Mar 2018 15:49:14 +0000") Message-ID: <87zi327ozu.fsf@xmission.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-XM-SPF: eid=1eyJ4c-0003n4-U1;;;mid=<87zi327ozu.fsf@xmission.com>;;;hst=in01.mta.xmission.com;;;ip=97.119.121.173;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX1/K36541h1GfHwcUPLQjbvz4xJX3IZw/sw= X-SA-Exim-Connect-IP: 97.119.121.173 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on sa05.xmission.com X-Spam-Level: **** X-Spam-Status: No, score=4.0 required=8.0 tests=ALL_TRUSTED,BAYES_50, DCC_CHECK_NEGATIVE,TVD_RCVD_IP,T_TM2_M_HEADER_IN_MSG,T_TooManySym_01, T_TooManySym_02,XMSubLong,XMSubMetaSx_00,XMWhlSbjSex autolearn=disabled version=3.4.1 X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 0.7 XMSubLong Long Subject * 2.5 XMWhlSbjSex Whole Obfuscated Subjects * 0.0 TVD_RCVD_IP Message was received from an IP address * 0.0 T_TM2_M_HEADER_IN_MSG BODY: No description available. * 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% * [score: 0.5000] * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa05 1397; Body=1 Fuz1=1 Fuz2=1] * 0.0 T_TooManySym_01 4+ unique symbols in subject * 0.0 T_TooManySym_02 5+ unique symbols in subject * 1.0 XMSubMetaSx_00 1+ Sexy Words X-Spam-DCC: XMission; sa05 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: ****;Sasha Levin X-Spam-Relay-Country: X-Spam-Timing: total 494 ms - load_scoreonly_sql: 0.05 (0.0%), signal_user_changed: 7 (1.5%), b_tie_ro: 6 (1.2%), parse: 1.28 (0.3%), extract_message_metadata: 26 (5.3%), get_uri_detail_list: 4.7 (1.0%), tests_pri_-1000: 14 (2.9%), tests_pri_-950: 1.40 (0.3%), tests_pri_-900: 1.12 (0.2%), tests_pri_-400: 30 (6.2%), check_bayes: 29 (5.9%), b_tokenize: 11 (2.3%), b_tok_get_all: 9 (1.8%), b_comp_prob: 3.2 (0.6%), b_tok_touch_all: 3.7 (0.7%), b_finish: 0.58 (0.1%), tests_pri_0: 223 (45.2%), check_dkim_signature: 0.55 (0.1%), check_dkim_adsp: 3.3 (0.7%), tests_pri_500: 185 (37.4%), poll_dns_idle: 175 (35.5%), rewrite_mail: 0.00 (0.0%) Subject: Re: [PATCH AUTOSEL for 4.15 118/124] signal/parisc: Document a conflict with SI_USER with SIGFPE X-Spam-Flag: No X-SA-Exim-Version: 4.2.1 (built Thu, 05 May 2016 13:38:54 -0600) X-SA-Exim-Scanned: Yes (on in01.mta.xmission.com) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Sasha Levin writes: What is the justification for backporting this and the other similar Documentation commits? These commits just introduce a define _FIXME with value of 0, to document that the userspace ABI was handled incorrectly long ago. These commits do not fix anything. Thes commits do not change anything except a little how they are handled in siginfo_layout. And I don't see the changes that introduce siginfo_layout in kernel/signal.c being backported. Further these commits don't even have a fixes tag so I am curious what is triggering them for backport. Eric > From: "Eric W. Biederman" > > [ Upstream commit b5daf2b9d1c9a2b4f03ca93f75913ba2da3b3eaa ] > > Setting si_code to 0 results in a userspace seeing an si_code of 0. > This is the same si_code as SI_USER. Posix and common sense requires > that SI_USER not be a signal specific si_code. As such this use of 0 > for the si_code is a pretty horribly broken ABI. > > Further use of si_code == 0 guaranteed that copy_siginfo_to_user saw a > value of __SI_KILL and now sees a value of SIL_KILL with the result > that uid and pid fields are copied and which might copying the si_addr > field by accident but certainly not by design. Making this a very > flakey implementation. > > Utilizing FPE_FIXME siginfo_layout will now return SIL_FAULT and the > appropriate fields will reliably be copied. > > This bug is 13 years old and parsic machines are no longer being built > so I don't know if it possible or worth fixing it. But it is at least > worth documenting this so other architectures don't make the same > mistake. > > Possible ABI fixes includee: > - Send the signal without siginfo > - Don't generate a signal > - Possibly assign and use an appropriate si_code > - Don't handle cases which can't happen > > Cc: "James E.J. Bottomley" > Cc: Helge Deller > Cc: linux-parisc@vger.kernel.org > Ref: 313c01d3e3fd ("[PATCH] PA-RISC update for 2.6.0") > Histroy Tree: https://git.kernel.org/pub/scm/linux/kernel/git/tglx/history.git > Signed-off-by: "Eric W. Biederman" > Signed-off-by: Sasha Levin > --- > arch/parisc/include/uapi/asm/siginfo.h | 7 +++++++ > arch/parisc/kernel/traps.c | 2 +- > 2 files changed, 8 insertions(+), 1 deletion(-) > > diff --git a/arch/parisc/include/uapi/asm/siginfo.h b/arch/parisc/include/uapi/asm/siginfo.h > index 4a1062e05aaf..be40331f757d 100644 > --- a/arch/parisc/include/uapi/asm/siginfo.h > +++ b/arch/parisc/include/uapi/asm/siginfo.h > @@ -8,4 +8,11 @@ > > #include > > +/* > + * SIGFPE si_codes > + */ > +#ifdef __KERNEL__ > +#define FPE_FIXME 0 /* Broken dup of SI_USER */ > +#endif /* __KERNEL__ */ > + > #endif > diff --git a/arch/parisc/kernel/traps.c b/arch/parisc/kernel/traps.c > index 8453724b8009..c919e6c0a687 100644 > --- a/arch/parisc/kernel/traps.c > +++ b/arch/parisc/kernel/traps.c > @@ -629,7 +629,7 @@ void notrace handle_interruption(int code, struct pt_regs *regs) > si.si_signo = SIGFPE; > /* Set to zero, and let the userspace app figure it out from > the insn pointed to by si_addr */ > - si.si_code = 0; > + si.si_code = FPE_FIXME; > si.si_addr = (void __user *) regs->iaoq[0]; > force_sig_info(SIGFPE, &si, current); > return;