Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5015492imu; Sat, 1 Dec 2018 07:29:46 -0800 (PST) X-Google-Smtp-Source: AFSGD/VcR1sYQSt+B7Hj99D6sUVdco3c0fPqaXZRt/GflTPRmz83nKMy/tN1a+1m8Ohcy4+99CD0 X-Received: by 2002:a62:6f88:: with SMTP id k130mr9519181pfc.234.1543678186880; Sat, 01 Dec 2018 07:29:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543678186; cv=none; d=google.com; s=arc-20160816; b=CAv6gXRH7zYWUPFjZCwVrXwsYNztW3EqFE8WD9B/wli5WZnKbHn3gfMr3JKePgxFaq tNL1mPYOz1Zc+xaXtMRQhz6adMETCkurv2OSpYVuHxcQEzSYFk5z3DIIxgObw1+dg+IJ yCFOL3N0pTa65ziXih6wHMuRUKD7Rt3RF/sG9TWZKVGFZzgS9hTkUEHutCvWFN8VsxgF xsejfTf/V2y9VXxd17xcSN4uBUAEfKZXt2Etuq5dklIh0wGRYnBZJyOJDmcsxhnFHjZF oIVPefFF5OfdOf7sP4sXk6YO/Hqy+81Qe7CVyMgIOgJh/4Xu3r3F01DReuxRqII2LKBX mSqw== 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; bh=VVXnqtUW1SB/oXNk8VvLsBQ/H2BCgYUCD59COwNnBPQ=; b=U7j5eDj0qxYQAQ5/enZVI5H9eGPoCH/kiK63DYMLTi4jJAVqIOxeFf1f4/B2ZsknQv 7Q+WWBACDuaZn0v+6KLlWDJbHeu8m+iS9mfewOdBX2aWU3DoHujjsLvYYXYK4jpEm4q9 7mAZtoLA0cRkGvIyd+Ui7i7aolnuZrLJV/8Uyu2pxkAQmBCP9FeWHzXI3hf6xtHsrR9X 5p6qpDDnoxL164t+CR+QmKHd4T203oGLKg45eRPFR0XoeHpDUDvmJhuiHr9A/kG34wYy 5SL2pbPEIKew/wz999ohbb+66m/McN84g6T3SiIBfEopbt2Jagwo4CtG93l/v69sPfoX qvzg== 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 l8si8753219pfc.98.2018.12.01.07.29.31; Sat, 01 Dec 2018 07:29:46 -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 S1726957AbeLBCll (ORCPT + 99 others); Sat, 1 Dec 2018 21:41:41 -0500 Received: from out03.mta.xmission.com ([166.70.13.233]:49749 "EHLO out03.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726642AbeLBClk (ORCPT ); Sat, 1 Dec 2018 21:41:40 -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 1gT7CP-0006vj-R8; Sat, 01 Dec 2018 08:28:53 -0700 Received: from ip68-227-174-240.om.om.cox.net ([68.227.174.240] 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 1gT7CO-0000Kq-Vl; Sat, 01 Dec 2018 08:28:53 -0700 From: ebiederm@xmission.com (Eric W. Biederman) To: Arnd Bergmann Cc: christian@brauner.io, Andy Lutomirski , 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> Date: Sat, 01 Dec 2018 09:28:47 -0600 In-Reply-To: <87y399s3sc.fsf@xmission.com> (Eric W. Biederman's message of "Sat, 01 Dec 2018 08:46:43 -0600") Message-ID: <87tvjxp8pc.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=1gT7CO-0000Kq-Vl;;;mid=<87tvjxp8pc.fsf@xmission.com>;;;hst=in01.mta.xmission.com;;;ip=68.227.174.240;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX19HS7qIlAIvLkTEiMgwVFpFZY2eBO7KBg4= 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 sa08.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.4998] * 0.0 T_TM2_M_HEADER_IN_MSG BODY: No description available. * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa08 1397; Body=1 Fuz1=1 Fuz2=1] * 0.0 T_TooManySym_02 5+ unique symbols in subject * 1.0 T_XMDrugObfuBody_08 obfuscated drug references * 0.0 T_TooManySym_01 4+ unique symbols in subject X-Spam-DCC: XMission; sa08 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: ;Arnd Bergmann X-Spam-Relay-Country: X-Spam-Timing: total 254 ms - load_scoreonly_sql: 0.04 (0.0%), signal_user_changed: 5.0 (2.0%), b_tie_ro: 3.6 (1.4%), parse: 1.10 (0.4%), extract_message_metadata: 3.5 (1.4%), get_uri_detail_list: 0.97 (0.4%), tests_pri_-1000: 4.3 (1.7%), tests_pri_-950: 1.43 (0.6%), tests_pri_-900: 1.26 (0.5%), tests_pri_-90: 22 (8.9%), check_bayes: 21 (8.1%), b_tokenize: 6 (2.4%), b_tok_get_all: 6 (2.5%), b_comp_prob: 1.91 (0.8%), b_tok_touch_all: 3.4 (1.3%), b_finish: 0.91 (0.4%), tests_pri_0: 197 (77.7%), check_dkim_signature: 0.43 (0.2%), check_dkim_adsp: 2.6 (1.0%), poll_dns_idle: 1.11 (0.4%), tests_pri_10: 2.0 (0.8%), tests_pri_500: 6 (2.2%), 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 in01.mta.xmission.com) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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. Eric