Received: by 10.223.176.46 with SMTP id f43csp912630wra; Fri, 19 Jan 2018 04:07:40 -0800 (PST) X-Google-Smtp-Source: ACJfBotSLlHd0FpeMPn0gVi7EsUQJWW+tt0SnH0XUykYmS4u8Ju/7L9uJNjL+DUXHiifTtR0mJau X-Received: by 2002:a17:902:b2c1:: with SMTP id x1-v6mr1490127plw.85.1516363660463; Fri, 19 Jan 2018 04:07:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516363660; cv=none; d=google.com; s=arc-20160816; b=UtqqHWRP35ntoFL39VzJh0AvywQDPfhXx7FUSybvNooORlVAQ5j0oq1hy9m40tXd9Y 8/yFgGUCscD+3B58l+ghaPg1dVG2PUaPwdxLhGUtcq/ux2NAtDqNkkYObXVreisHiysp TaR2X4WRhw+yvEBQOa164vF56zbNz5cLtD1R6gjhvI3b8JzxfPEElfRdcHxr/J7gQD7r DUc9tefZBTbnRCQxOqQN6FLi6MhTLG1f08z2m2R1yEApvuH+MqzHKFPKh7+iUu39t4PY BvXC6GLc4RKpFxQajvaaQRRcSgfbo7Xty8Dl8BWFXQ1GYuB0eo8E6dKvb3DguzJaWfyA MKCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=2gjrbUFu1HL/kVFsn+G4B/PFJCc9var39bcHbbRLikU=; b=BIwOc51OEF/WSgq4bzl0n4a/7LyFmD1gzNasFPwNoa2RNZIDJk18dvQMgR0rpk1zZl mXmqo+zh9xD4colr6C3D6hqennohRJpe7yarMBZvsSq0IHZTWt0DN24wd6nqlM2+yEKp UBdQMNURdKN26KjZGH64TieltT4RqR3+mV7+PlqfmUdsD2yLD1hHghKBwc9B+CLaR+sP 0tobilqk8pL2xp2OIPP2wtPT25xQ+sr6CzlWJSgrY8yIK6ffzuvGfO7nljC4vhV0MSCr S7NtNYYAY/bAXNcXS5H1Igw2SKmwQrIoBhlGAcS52/lAtZ7cFfsR7cmFJxWhfr7JDrvB OZ+A== 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 t20si9715240pfl.26.2018.01.19.04.07.23; Fri, 19 Jan 2018 04:07:40 -0800 (PST) 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 S1755088AbeASMFj (ORCPT + 99 others); Fri, 19 Jan 2018 07:05:39 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:37794 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754719AbeASMFb (ORCPT ); Fri, 19 Jan 2018 07:05:31 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 61A4F80D; Fri, 19 Jan 2018 04:05:31 -0800 (PST) Received: from e103592.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 0A62A3F487; Fri, 19 Jan 2018 04:05:29 -0800 (PST) Date: Fri, 19 Jan 2018 12:05:27 +0000 From: Dave Martin To: Russell King - ARM Linux Cc: "Eric W. Biederman" , linux-arch@vger.kernel.org, Al Viro , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Oleg Nesterov Subject: Re: [PATCH 08/11] signal/arm: Document conflicts with SI_USER and SIGFPE Message-ID: <20180119120525.GN22781@e103592.cambridge.arm.com> References: <87373b6ghs.fsf@xmission.com> <20180112005940.23279-8-ebiederm@xmission.com> <20180115174947.GH17719@n2100.armlinux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180115174947.GH17719@n2100.armlinux.org.uk> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 15, 2018 at 05:49:47PM +0000, Russell King - ARM Linux wrote: > On Thu, Jan 11, 2018 at 06:59:37PM -0600, Eric W. Biederman wrote: > > 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 be reliably copied. > > So what do you suggest when none of the SIGFPE FPE_xxx codes match the > condition that "we don't know what happened" ? Raise a SIGKILL instead > maybe? We will have dumped the VFP state into the kernel log at this > point, things are pretty much fscked. > > It's probably an impossible condition unless the hardware has failed, > no one has knowingly reported getting such a dump in their kernel log, > so it's something that could very likely be changed in some way > without anyone noticing. Relating to this, what's your view on how to clean up the si_code zeros in fsr-2level.c and fsr-3level.c? Due to the historical evolution of the fault codes I'm less confident of getting these right than for arm64. Many are things that shouldn't happen and likely indicate a kernel bug or system failure if they do, so at least some of the { do_bad, SIGxxx, 0, ... } entries can probably be changed to { do_bad, SIGKILL, SI_KERNEL, ... } with no ill effects. But there are many fault codes whose meaning has changed over time. Cheers ---Dave