Received: by 10.223.148.5 with SMTP id 5csp6096131wrq; Wed, 17 Jan 2018 09:18:16 -0800 (PST) X-Google-Smtp-Source: ACJfBouujA04mIcwhHGTB+bWfd0byEoewXL8/mR/F0nJwVJ5ntBTCggKihmaqQ1/cqRLIWMtx+m0 X-Received: by 10.98.245.214 with SMTP id b83mr29123912pfm.85.1516209496696; Wed, 17 Jan 2018 09:18:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516209496; cv=none; d=google.com; s=arc-20160816; b=IIhqEJ717kYP5vP/tj8rYE3slNonmY+gCfm0dA2QN5FZb3T1Yk0LUZM08Qs6mPq7QO nctAD+OxHkJk2/bz/QDjZpOXdxy4BOZddxZczyqOaQAQR6sLMkURCjVgZTskH1JIE8tO +xlbXUiLdqfCKnjHyaXEjGmnR2sHRCiHt8A9NilBtTuZBJIlI353MiR1TzujdKVMnU4/ W1vyai0yZLFO0+sqM3xiXL1+YsGXWMAbqO+lvvGrWgpLRJUVyMP0wMJ8u1AZi4shMXGH yKGMbF4cYn0ex+D9biVLtW8fdgKwMi0m+GiDcmMA5Ck0xDm4OcS4Fi+GaM330MbtYgSJ C4+w== 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=XYAIImdhMf9BJ0TBWWrlzD3laq0p6ajH7WP0H+u8gLs=; b=Ozzi2kVTujuC7nugLvhHFh6nZb8/MhxyLYuvTtvoIARc5damjZOvwYxitwyytnsynJ dEW2YY5dEkFPdrcluGn5G3COgf/Hh6Spki5DxRdDWxMf+xpKgtvj4pbbBDWEeajFnSqj uKhMY6kv7dy5VtpBUHouV1LdYbpHJgql5qjGVfCkUO5vk8n/Mz6Y9Awp9xaayUrAUenC gt8F3/8YEOkjoCTCEvqMXSQjZ1wkcknpL9Xeaunp7BibM8qjxR6t+v9lX5hmvLDP3tKd Qt8c4puYEocPPqQhgC3WzD4mhM7nnDxMj4L5sjDaJmCVh3476y8sTyDpFMmcu2g9iUDP 295w== 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 p16si4912560plr.191.2018.01.17.09.18.02; Wed, 17 Jan 2018 09:18:16 -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 S1754013AbeAQRRi (ORCPT + 99 others); Wed, 17 Jan 2018 12:17:38 -0500 Received: from foss.arm.com ([217.140.101.70]:44504 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752806AbeAQRRf (ORCPT ); Wed, 17 Jan 2018 12:17:35 -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 9937780D; Wed, 17 Jan 2018 09:17:34 -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 1A02A3F53D; Wed, 17 Jan 2018 09:17:31 -0800 (PST) Date: Wed, 17 Jan 2018 17:17:29 +0000 From: Dave Martin To: "Eric W. Biederman" Cc: linux-arch@vger.kernel.org, Arnd Bergmann , Nicolas Pitre , Tony Lindgren , Catalin Marinas , Tyler Baicar , Will Deacon , linux-kernel@vger.kernel.org, Oleg Nesterov , James Morse , Al Viro , Olof Johansson , Santosh Shilimkar , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH 07/11] signal/arm64: Document conflicts with SI_USER and SIGFPE, SIGTRAP, SIGBUS Message-ID: <20180117171729.GJ22781@e103592.cambridge.arm.com> References: <87373b6ghs.fsf@xmission.com> <20180112005940.23279-7-ebiederm@xmission.com> <20180115163028.GU22781@e103592.cambridge.arm.com> <87h8rnox3c.fsf@xmission.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87h8rnox3c.fsf@xmission.com> 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 11:23:03AM -0600, Eric W. Biederman wrote: > Dave Martin writes: > > > On Thu, Jan 11, 2018 at 06:59:36PM -0600, Eric W. Biederman wrote: [...] > >> Possible ABI fixes include: > >> - 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 > > > > I think a mixture of these two is the best approach. > > > > In any case, si_code == 0 here doesn't seem to have any explicit meaning. > > I think we can translate all of the arm64 faults to proper si_codes -- > > see my sketch below. Probably means a bit more thought though. [...] > >> diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c [...] > >> @@ -607,70 +607,70 @@ static int do_sea(unsigned long addr, unsigned int esr, struct pt_regs *regs) > >> } > >> > >> static const struct fault_info fault_info[] = { > >> - { do_bad, SIGBUS, 0, "ttbr address size fault" }, > >> - { do_bad, SIGBUS, 0, "level 1 address size fault" }, > >> - { do_bad, SIGBUS, 0, "level 2 address size fault" }, > >> - { do_bad, SIGBUS, 0, "level 3 address size fault" }, If I convert this kind of thing to SIGKILL there really is nothing sensible to put in si_code, except possibly SI_KERNEL (indicating that the kill did not come from userspace). Even so, it hardly seems worth filling in fields like si_pid and si_uid just to make this "correct". In any case, if siginfo is never seen by userspace for SIGKILL this is moot. Obviously, siginfo is never copied to the user stack in that case, but is it also guaranteed not to be visible to userspace by other means? For ptrace I'm hoping not, since SIGKILL should nuke the tracee immediately instead of being reported to the tracer as a signal-delivery-stop -- so the tracer should get WIFSIGNALED() && WTERMSIG() == SIGKILL. A subsequent PTRACE_GETSIGINFO would fail with ESRCH. Does that match your understanding? If so, there is some merit in not pretending to pass a reall value for si_code. Should si_code simply be ignored for the SIGKILL case? Cheers ---Dave