Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5397577imu; Sat, 1 Dec 2018 16:09:40 -0800 (PST) X-Google-Smtp-Source: AFSGD/WtaTbRrQIX5wIaRiF7JKGnPW+/M/6KnlvKnJKHldTVOtt/6zBaGBtlYXnj6g1IZS3nmM2J X-Received: by 2002:a17:902:ab84:: with SMTP id f4mr10564591plr.207.1543709380613; Sat, 01 Dec 2018 16:09:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543709380; cv=none; d=google.com; s=arc-20160816; b=U0XkMabI9ZTMVk+qg6INPPXBV9eFUmrA6CQ3BeWVCDPRDdB4jFsM9tOJKnKGtBWbCu L+B9OqB0cND6qT4hRZL+yAspXKcWiToUFC73WcEPC2QL4cl167Egz397BRgzPS6PYZ4u L8khGfSc4rteQzaza3Vjn9BZF83OELiC8kt0jepTlkSa5AlKkA8p+8ajbgtqR3xgMkAk 6csIVLv/Og26fNYJAayVH4BEY0mvpsj2cohRWpc+4gq2+cZrlqWXi3AacZAJIFm/+cFS nxQ0HceCF4mob1SnXVxQvcsz5Y2qifQqqCjUqGupqT2y9VbP5t4uJs6dMYROnp8ucbm5 erdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:content-transfer-encoding :mime-version:user-agent:message-id:in-reply-to:date:references:cc :to:from; bh=PuBDj20UZEJOqEvhnAGhSZjl63Kxu4aqyx7kjBBFxnU=; b=pw9Dul3cIxAzq0h08FtRgWVGfwrMlJsPcuuI125i/BlZHWtkYofc01ccETKGJXZhaH AVpf67W8s5M25/dWw7H1T5peCskOZqZ4S+H5pMj3WT+4Y1asYTzoNe1eTX3jiY97ocYF wtZsm4uOzBxASNuU14SyRLNbgs414mA833xnWLNGf5WgpMSu4bzBJwhQrLgxku34MTTr k1/KhKUgkc9hqv4HF22auyOryI8E8NZpPEkvmtYQn2pgsJ18uFYRBaKK23ofRWo2tj9F lyGH7eUKlE0gEo766qLdQwu5/1u4jd2HVyeQnS3C2Cxm+572rp1JXZGRZMXHt+PiXpxU VB0A== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=xmission.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x3si8532527pgj.493.2018.12.01.16.08.54; Sat, 01 Dec 2018 16:09: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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=xmission.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725772AbeLBLU5 convert rfc822-to-8bit (ORCPT + 99 others); Sun, 2 Dec 2018 06:20:57 -0500 Received: from out02.mta.xmission.com ([166.70.13.232]:60636 "EHLO out02.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725757AbeLBLU5 (ORCPT ); Sun, 2 Dec 2018 06:20:57 -0500 Received: from in02.mta.xmission.com ([166.70.13.52]) by out02.mta.xmission.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.87) (envelope-from ) id 1gTFHz-0007Yf-AR; Sat, 01 Dec 2018 17:07:11 -0700 Received: from ip68-227-174-240.om.om.cox.net ([68.227.174.240] helo=x220.xmission.com) by in02.mta.xmission.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.87) (envelope-from ) id 1gTFHj-0004Ya-QX; Sat, 01 Dec 2018 17:07:11 -0700 From: ebiederm@xmission.com (Eric W. Biederman) To: Andy Lutomirski Cc: Arnd Bergmann , christian@brauner.io, Andy Lutomirski , Florian Weimer , Linux Kernel Mailing List , "Serge E. Hallyn" , Jann Horn , Andrew Morton , Oleg Nesterov , cyphar@cyphar.com, Al Viro , Linux FS-devel Mailing List , Linux API , Daniel Colascione , Tim Murray , linux-man@vger.kernel.org, Kees Cook References: <20181120105124.14733-1-christian@brauner.io> <87in0g5aqo.fsf@oldenburg.str.redhat.com> <36323361-90BD-41AF-AB5B-EE0D7BA02C21@amacapital.net> <993B98AC-51DF-4131-AF7F-7DA2A7F485F1@brauner.io> <20181129195551.woe2bl3z3yaysqb6@brauner.io> <6E21165F-2C76-4877-ABD9-0C86D55FD6AA@amacapital.net> <87y39b2lm2.fsf@xmission.com> <20181130065606.kmilbbq46oeycjp5@brauner.io> <87y399s3sc.fsf@xmission.com> <87tvjxp8pc.fsf@xmission.com> Date: Sat, 01 Dec 2018 18:06:49 -0600 In-Reply-To: (Andy Lutomirski's message of "Sat, 1 Dec 2018 07:52:37 -0800") Message-ID: <87lg58pzae.fsf@xmission.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT X-XM-SPF: eid=1gTFHj-0004Ya-QX;;;mid=<87lg58pzae.fsf@xmission.com>;;;hst=in02.mta.xmission.com;;;ip=68.227.174.240;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX18S9f52VrHTYpCcyZxpLos8/ov6OUCP+DE= X-SA-Exim-Connect-IP: 68.227.174.240 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on sa07.xmission.com X-Spam-Level: X-Spam-Status: No, score=0.8 required=8.0 tests=ALL_TRUSTED,BAYES_50, DCC_CHECK_NEGATIVE,T_TM2_M_HEADER_IN_MSG,T_TooManySym_01, T_TooManySym_02,T_XMDrugObfuBody_08 autolearn=disabled version=3.4.2 X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% * [score: 0.5000] * 0.0 T_TM2_M_HEADER_IN_MSG BODY: No description available. * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa07 1397; Body=1 Fuz1=1 Fuz2=1] * 0.0 T_TooManySym_01 4+ unique symbols in subject * 1.0 T_XMDrugObfuBody_08 obfuscated drug references * 0.0 T_TooManySym_02 5+ unique symbols in subject X-Spam-DCC: XMission; sa07 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: ;Andy Lutomirski X-Spam-Relay-Country: X-Spam-Timing: total 15038 ms - load_scoreonly_sql: 0.06 (0.0%), signal_user_changed: 3.5 (0.0%), b_tie_ro: 2.4 (0.0%), parse: 1.33 (0.0%), extract_message_metadata: 16 (0.1%), get_uri_detail_list: 1.59 (0.0%), tests_pri_-1000: 3.8 (0.0%), tests_pri_-950: 1.31 (0.0%), tests_pri_-900: 1.15 (0.0%), tests_pri_-90: 26 (0.2%), check_bayes: 24 (0.2%), b_tokenize: 8 (0.1%), b_tok_get_all: 8 (0.1%), b_comp_prob: 2.5 (0.0%), b_tok_touch_all: 3.2 (0.0%), b_finish: 0.72 (0.0%), tests_pri_0: 6307 (41.9%), check_dkim_signature: 0.62 (0.0%), check_dkim_adsp: 6007 (39.9%), poll_dns_idle: 14663 (97.5%), tests_pri_10: 2.3 (0.0%), tests_pri_500: 8673 (57.7%), rewrite_mail: 0.00 (0.0%) Subject: Re: [PATCH v2] signal: add procfd_signal() syscall 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 in02.mta.xmission.com) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Andy Lutomirski writes: >> On Dec 1, 2018, at 7:28 AM, Eric W. Biederman wrote: >> >> >> It just occurs to me that the simple way to implement >> procfd_sigqueueinfo info is like: >> >> int copy_siginfo_from_user_any(kernel_siginfo_t *info, siginfo_t *uinfo) >> { >> #ifdef CONFIG_COMPAT >> if (in_compat_syscall) >> return copy_siginfo_from_user32(info, uinfo); >> #endif >> return copy_siginfo_from_user(info, uinfo); >> } >> >> long procfd_sigqueueinfo(int fd, siginfo_t *uinfo) >> { >> kernel_siginfo info; >> >> if (copy_siginfo_from_user_any(&info, uinfo)) >> return -EFAULT; >> ...; >> } >> >> It looks like there is already a place in ptrace.c that already >> hand rolls copy_siginfo_from_user_any. >> >> So while I would love to figure out the subset of siginfo_t tha we can >> just pass through, as I think that would make a better more forward >> compatible copy_siginfo_from_user32. > > Seems reasonable to me. It’s less code overall than any other suggestion, too. > >> I think for this use case we just >> add the in_compat_syscall test and then we just need to ensure this new >> system call is placed in the proper places in the syscall table. >> >> Because we will need 3 call sights: x86_64, x32 and ia32. As the layout >> changes between those three subarchitecuters. >> >> > > If it’s done this way, it can just be “common” in the 64-bit > table. And we kick the can a bit farther down the road :) > > I’m working on patches to clean up x86’s syscall mess. It’s slow > because I keep finding new messes. So far I have rt_sigreturn working > like every other syscall — whee. > > Also, Eric, for your edification, I have a draft patch set to > radically simplify x86’s signal delivery and return. Once that’s > done, I can trivially speed up delivery by a ton by using sysret. Nice. Do we care about the performance of synchronous signal delivery (AKA hardware exceptions) vs ordinary signal delivery. I get the feeling there are serious simplifications to be had in that case. Eric