Received: by 10.223.185.116 with SMTP id b49csp3022798wrg; Sun, 25 Feb 2018 11:52:08 -0800 (PST) X-Google-Smtp-Source: AH8x225hOm0388TWFYsrnN8tX191LHwdYaSUALaCgMzhLa0scTv5Rt3rs9n9tBWWXgENbO4NdVv2 X-Received: by 10.98.14.70 with SMTP id w67mr8263448pfi.1.1519588328281; Sun, 25 Feb 2018 11:52:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519588328; cv=none; d=google.com; s=arc-20160816; b=msCENZohEiRNIn4YzD/ib6V8EE+P+x2Pa7q+NCXB+68gW+zTQcCQs8BYIvBJ9nUPwX ZtuChws61/5eliEQxWgKG+aGyeN7N4PqJkCk+SfVN3c0kkPYrj+OEHA1mKtxaOjWR+l/ NWTrmujs6KaAvUMOvcZIXAcjjIgP7zkDbufDt9iNTIktT2oHt4felDZqaGs8/TmoDPe0 TCVHKYJVCZW1r1UIuK1N/DG4XtfsE2mlBGmjIILgrr2hHtnciuwqduN1Dh4oxkCKZqCh UJzl5VL/f1GKHdu6XO5DQF8WZtMMw4sOwZGnHhQZxxMMC2j5BMgCWMytD/xRzAo5IwoG g2og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=+BiZNv4FPGrl538SoBUEj7ja94gEXA6dKd/GJm/wf6I=; b=ySQ4a4gA8/KQSTSr7NCFheVqd7QINK/BvXqpHQXCGyEjn2H/cIw1WmTTDhdoCpDsZ5 BElOwODxyDgKpHBlxYmVBTzy0mF4TlrG5b7WFFQCKgQFbCwin2ERGzKJBX1LA6xhiZsQ fjOF1jLGmy85g0v68eZnSzs6Hs9OdxpvntBqG/WjPn61zvzrT4UEhWCVA3aod2qEr84O a+0iRG6gGPd2VMgEy+nzFL3fNySN/Fuz1+Aata8rJYBYFEn8iF3ZB/izqmlzOdxSAGSe b8eoC10Ff62MmetyVBjC9yX8JezOX6O3dvSnM8abZizhJbehh6XfesrkPZstPb6/1IIc /bcQ== 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 c7si5515668pfi.323.2018.02.25.11.51.54; Sun, 25 Feb 2018 11:52:08 -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 S1752042AbeBYTuT (ORCPT + 99 others); Sun, 25 Feb 2018 14:50:19 -0500 Received: from mout.gmx.net ([212.227.15.15]:40487 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751921AbeBYTuP (ORCPT ); Sun, 25 Feb 2018 14:50:15 -0500 Received: from [192.168.20.60] ([89.244.180.47]) by mail.gmx.com (mrgmx003 [212.227.17.190]) with ESMTPSA (Nemesis) id 0LqALY-1eCYkT1Iki-00dlrj; Sun, 25 Feb 2018 20:49:45 +0100 Subject: Re: [PATCH 04/11] signal/parisc: Document a conflict with SI_USER with SIGFPE To: "Eric W. Biederman" Cc: linux-parisc@vger.kernel.org, James Bottomley , John David Anglin , linux-kernel@vger.kernel.org, Al Viro , Oleg Nesterov , linux-arch@vger.kernel.org References: <87373b6ghs.fsf@xmission.com> <20180112005940.23279-4-ebiederm@xmission.com> <20180112222944.GA22642@ls3530.fritz.box> <87fu5s4l4b.fsf@xmission.com> From: Helge Deller Message-ID: <68641c9e-99c6-34d3-83aa-1241bddef33c@gmx.de> Date: Sun, 25 Feb 2018 20:49:41 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <87fu5s4l4b.fsf@xmission.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:dLwrQfvOQYdESUwN7IqumebiwIU59ldNeJntMaX1X425iLhcqXH 9cP3LyOroz3+RVLpMfvn7BRtqiNH6aW82PLOCRNJVzaZuCnhkmehg7jIOumDKI9CGToMYUw p1JJQQnHv6MYvHYPB6M69OnKwCImAKByin8+VzsrpHWQn52380Msem93r+z1HEuYyizZJCq 4sovCFRSxlPI/HG5GmWMw== X-UI-Out-Filterresults: notjunk:1;V01:K0:1jGnjEx7CTc=:3mXg+l0J0VTgnsyP/txg2C 0ZYg+/7LXIIRwoWcbRUzVjjoPc1itcZQ6b4AQBrHOersxzoGHSzT0yHvLKU2cHhYUjDpjfkS9 lggYT9VZ6puOF7TPKH4qRhk3dbjyMdP9eIbsA++A3ZIcHSaoS3OZTFgRhInGjaoFjAYzV9Ooo uXNnkrKzB8CuFLvEoHDDEV0kt5l0Ldt1G3bXP7wOSMA5Q4OWiZtJaYQYK2q4mplZyP/U9zgk1 zR/FyupMOHuxhbdG6xnhxuczTR7nIMEoSg9mJw6IoDEYnPBw4giD9BvfShSvNJQgPAerUUTJh 9RSTOAiAF59vDty7PT5pXUguKJTXnn9fh8pjTUQeOzF6wniFPt/yMkHAYtHltPNWMWxBXiv2/ NC7UzMuiFQFT/QdbFHbfSCQiB3+MsX00Yn8MZJVSaE0+n1y/HDLmvuhcauEozgBPSi7y1//Gj fEWOYvF681GseZJPaZMAwPbTzvuHh8uXUFOCkiBQsH/2zh2tTKWUgrf0MmYAlj16XwrawkMQt S5UHkWcQV74YAZETw4aLq7CYKhnjcFyZScKCzGcoYNgQTXDrqvYf4QWkQXJoMCT54yo4wYkHU T7tmvLMNvDNmlAMOZBCJGLkdLeUobutkQpeOG4FUQGbOA/lUUn+nZdPJqOBS9BW/XpcPuGQs7 67gNuDijJ8U9xN3jRUREXS8PHnxFfPrjloxfNkq8OOTYMP+G8h2EUWzOVzhZymfzg0QJBl7YN I8j+0pjLwOjLuMa/3dWOzZKwcvhQnQJiSJtl10spyOkwx3CW4FZ0w4jr+pcrOczfpTEj73P2p WwRJ9DlhxaFbAPH4K3IM1D0eqUlo3W/1SHYWh3EFUyiSYzAvrY= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 23.02.2018 01:15, Eric W. Biederman wrote: > Helge Deller writes: > >> * Eric W. Biederman : >>> 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. >> >> >> I think we should fix it, even if we now break the ABI. >> >> It's about a "conditional trap" which needs to be handled by userspace. >> I doubt there is any Linux code out which is utilizing this >> parisc-specific trap. >> >> I'd suggest to add a new FPE trap si_code (e.g. FPE_CONDTRAP). >> While at it, maybe we should include the already existing FPE_MDAOVF >> from the frv architecture, so that arch/frv/include/uapi/asm/siginfo.h >> can go completely. >> >> Suggested patch is below. >> >> I'm willing to test the patch below on the parisc architecture for a few >> weeks. And it will break arch/x86/kernel/signal_compat.c which needs >> looking at then too. > > Have you managed to test this change? Sadly I haven't done any further testing yet. > I am sitting looking at another new FPE si_code and if this has been tested > I figure FPE_CONDTRAP should get the next available FPE si_code and the > other change should get the one that follows. I'm fine either way. Do you have a git tree I can pull which includes all your patches? I can then start testing. Helge