Received: by 10.223.148.5 with SMTP id 5csp6107825wrq; Wed, 17 Jan 2018 09:27:18 -0800 (PST) X-Google-Smtp-Source: ACJfBouILDWAfN1sS9PzjyI8oVdtCJw4hyWV99HhBXGOu10AyBCF8WbFbnwjkRcrS6gjDXiGyKrL X-Received: by 10.84.235.11 with SMTP id o11mr18160885plk.109.1516210038325; Wed, 17 Jan 2018 09:27:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516210038; cv=none; d=google.com; s=arc-20160816; b=TjrF7yyehSTCdy/o48mR9vpSyQ91yH6m3GRdZ9ruAAiLwWlS8JtapvtDJDw1PoNLUw m4P3DwemHyJHa+0slagiy3X+wVLiOntvWbwBgcQ57jiv0jx7r5bgVDt7N8Eh4u2ttOeb 26Bz74cIHGaMH1jvg/0uV/mwNBWPVmvaEtEVIz9Melr+IADOXTjlUUd8W9LZiD4+PKdX AeznhZA5KKiak278Z1x6XfUSXCQFLWdYxYwcp9GDSuGqt4/Ter7GsEck5NOpOvjdaZdf lz9bNeH6pzJMJVGiJ3DwIs9qQ8LFNnU1thBop73yp5/Y6S7n8+bczguA3gIYfqWE5f97 uPMQ== 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=Ybza7uD8pqk0H4xZaNw9ppByAWOgcbOxlsH5ljOM5Bw=; b=R7js0bK2eG22XtfrobZtji6nXeU8RPwgHiv4PdRUs4SfgDE3zqp/SwYqDCnQmXBJs1 Zj+fekhcKIZ0VC7qa0W1FU28eapOyhRI/kFvAKfVs5KBHQw4NF7VonPA14rdIs9aw5QX 9thag+o5+pKIki3TlzUuYW/8kC4zSZ1grFNR2ml2Tab2LWeUcqGSP+oTghrm/hKVGfbW flF6bmClxMXQuxTuFuMOKNSNlpsOtng0YRvpr+m9W8B0rijBv4km4aZpqXl5IPjcgwE3 jfSN3mL0MSLfPNDww+THBVfSpVDb50T3A3BqsW/ffFiLwpYvBeZUvswBowblv/6OSoOT PGyg== 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 k196si4300986pgc.385.2018.01.17.09.27.03; Wed, 17 Jan 2018 09:27:18 -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 S1754124AbeAQRZF (ORCPT + 99 others); Wed, 17 Jan 2018 12:25:05 -0500 Received: from out03.mta.xmission.com ([166.70.13.233]:38788 "EHLO out03.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753142AbeAQRZB (ORCPT ); Wed, 17 Jan 2018 12:25:01 -0500 Received: from in01.mta.xmission.com ([166.70.13.51]) by out03.mta.xmission.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.87) (envelope-from ) id 1ebrSN-0005kN-LE; Wed, 17 Jan 2018 10:24:59 -0700 Received: from 97-121-73-102.omah.qwest.net ([97.121.73.102] 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 1ebrSM-0004mF-UO; Wed, 17 Jan 2018 10:24:59 -0700 From: ebiederm@xmission.com (Eric W. Biederman) To: Dave Martin 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 References: <87373b6ghs.fsf@xmission.com> <20180112005940.23279-7-ebiederm@xmission.com> <20180115163028.GU22781@e103592.cambridge.arm.com> <87h8rnox3c.fsf@xmission.com> <20180117171729.GJ22781@e103592.cambridge.arm.com> Date: Wed, 17 Jan 2018 11:24:06 -0600 In-Reply-To: <20180117171729.GJ22781@e103592.cambridge.arm.com> (Dave Martin's message of "Wed, 17 Jan 2018 17:17:29 +0000") Message-ID: <87h8rkflft.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=1ebrSM-0004mF-UO;;;mid=<87h8rkflft.fsf@xmission.com>;;;hst=in01.mta.xmission.com;;;ip=97.121.73.102;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX1+MGQrt+sQMUbJ34qrOnuN0ojfCFHREdz4= X-SA-Exim-Connect-IP: 97.121.73.102 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on sa06.xmission.com X-Spam-Level: ** X-Spam-Status: No, score=2.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,XMNoVowels,XMSubLong autolearn=disabled version=3.4.1 X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 1.5 XMNoVowels Alpha-numberic number with no vowels * 0.7 XMSubLong Long Subject * 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 * [sa06 1397; Body=1 Fuz1=1 Fuz2=1] * 0.0 T_TooManySym_02 5+ unique symbols in subject * 0.0 T_TooManySym_01 4+ unique symbols in subject X-Spam-DCC: XMission; sa06 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: **;Dave Martin X-Spam-Relay-Country: X-Spam-Timing: total 268 ms - load_scoreonly_sql: 0.03 (0.0%), signal_user_changed: 2.4 (0.9%), b_tie_ro: 1.74 (0.7%), parse: 0.73 (0.3%), extract_message_metadata: 10 (3.9%), get_uri_detail_list: 1.74 (0.6%), tests_pri_-1000: 6 (2.3%), tests_pri_-950: 1.20 (0.4%), tests_pri_-900: 1.04 (0.4%), tests_pri_-400: 25 (9.2%), check_bayes: 24 (8.8%), b_tokenize: 8 (3.0%), b_tok_get_all: 8 (3.2%), b_comp_prob: 2.4 (0.9%), b_tok_touch_all: 2.8 (1.1%), b_finish: 0.53 (0.2%), tests_pri_0: 215 (80.2%), check_dkim_signature: 0.48 (0.2%), check_dkim_adsp: 2.7 (1.0%), tests_pri_500: 3.9 (1.5%), rewrite_mail: 0.00 (0.0%) Subject: Re: [PATCH 07/11] signal/arm64: Document conflicts with SI_USER and SIGFPE, SIGTRAP, SIGBUS 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 Dave Martin writes: > 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? I know what x86 does in a similar case is it uses force_sig instead of force_sig_info. Then the generic code gets to worry about If the appropriate paths generic paths get to worry about what siginfo to fill in in that case. Which for SI_KERNEL is zero for everything except the si_code and the si_signo. That seems perfectly reasonable. Eric