Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5068659imu; Sat, 1 Dec 2018 08:30:04 -0800 (PST) X-Google-Smtp-Source: AFSGD/UyjAVI2TL4EEbq3NnA1xoGnRhwUxyAWlq7fO4NIbSv8FGM8T1f7eRovRzsVJcIn+wZaXe2 X-Received: by 2002:a17:902:680f:: with SMTP id h15mr9652605plk.40.1543681804868; Sat, 01 Dec 2018 08:30:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543681804; cv=none; d=google.com; s=arc-20160816; b=VyUvUgn5twVfyudMgKWPG7NBC84MJ7VqOn19zRB7QcfiW2kc5OgUAdwr/YUGfjAwrd v6nZ0wjU115MoSrNANqTqHeJuZPd3lyDfN8+FObtiaozxpspDK4nHk+BMSnl+eDnmhqA G0BWSGCDZ3RbwNeF4dW1wFUjq2C4JlinDtPvk8MCP/FkuWivf/K7GJi37apOHmkqb56w jKkY3/RTuF9XfiMj16bQLWcR6Xa/ZqHAX8Edsw9kahlh5vj1c4b/CcRIArgLdxNwCXMJ u13Z3d+/aGmftiGilSFzs667BhXrrd/Cpwq/qwvivfLzjgF1uknkWlP+rZhQmYGGeoeh 5zpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:from:cc:to:subject :content-transfer-encoding:mime-version:references:in-reply-to :user-agent:date:dkim-signature; bh=Qjnvh4ajYLsVGCnXt4P8Q7SKLP5Uf/VkVaKTpjJJXlI=; b=yLDdYooEla2RJYtro3P6dw1ijdLs1ne9Z40yfAMNdXDKsQaKFwnZZMYrNgX/CkT+nQ YO+2cPdhHOBwlLMbmBW4nROan4wTAGiDOlZhHVPPoNg2YK+AS9xRAsdVTn+m5074GwvJ Xyz0+yiTUuh2LKnB+irl+sQ77pjfyHm+o0q7zxAxbbr2uaL2AvbsdO4J7JQ2zKVPPZvW AoN00Qhxv+mRqbBBmkjmoWveDyEHDUqA/QcLicGTySLwcAfzD7rH7dxjkutmSK0/YMgC Ie1XWB511VZ8hsIuNkPAR7M95qN7os7KP2Jcv12cEcFVeyL7LW0aUuVS2CLGpdckezLZ togg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@brauner.io header.s=google header.b=KYMc9rxW; 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 c6si8500209plr.414.2018.12.01.08.29.36; Sat, 01 Dec 2018 08:30:04 -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; dkim=fail header.i=@brauner.io header.s=google header.b=KYMc9rxW; 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 S1726966AbeLBDkp (ORCPT + 99 others); Sat, 1 Dec 2018 22:40:45 -0500 Received: from mail-it1-f193.google.com ([209.85.166.193]:51077 "EHLO mail-it1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726767AbeLBDkp (ORCPT ); Sat, 1 Dec 2018 22:40:45 -0500 Received: by mail-it1-f193.google.com with SMTP id z7so3206424iti.0 for ; Sat, 01 Dec 2018 08:27:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brauner.io; s=google; h=date:user-agent:in-reply-to:references:mime-version :content-transfer-encoding:subject:to:cc:from:message-id; bh=Qjnvh4ajYLsVGCnXt4P8Q7SKLP5Uf/VkVaKTpjJJXlI=; b=KYMc9rxWncaEcLe4uE7gQVyeoWQSLBE/DRRX6Y/He4wwt6DeWIHlGHmJiA2zTOSbPA yrmv4TGXcLOEHlLKVX82T2eE3zXvaDMVuy9AQyDeL+F5+kGg5UD6NLq+/2NUg6KTGQhx TDHorkU9WmxSltN1f5Apn8m4RE5/0UIWCDAyWdjcuVFI3cTcxWKMpBOqRZ/bfb+nExif bLBpSfg6weevNjUEgqdZ0TbFtJi3RK6z/dtwappf69QTYGElP5f15i/l7LPsBcbP8kDX 4x+O1zK016H6vPv82Y5zJtBE1Ciij1xZMX4/1TXo8atxzhkw258eTiKXZZ49mPgBeJVB L9XA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:user-agent:in-reply-to:references :mime-version:content-transfer-encoding:subject:to:cc:from :message-id; bh=Qjnvh4ajYLsVGCnXt4P8Q7SKLP5Uf/VkVaKTpjJJXlI=; b=C7jOkiNfNC8FOEe0U/qUDRE5YDTalHj3SIPb4tMG/E3pHhlSfEVbzQ1DzXgwiZPaOk gxtKBU8WzqGmdKOBbBgjSeNOb2WY25ga6leeyB533FqALC8yi1HMaBR+4JG+mpNy8xwR ef+N6Lw492E9yoLWpfJVv7Hps0SgrG1DfMcPtKZIu2qcZndHPGl8xvNkXzMCrEy5Q4tn lMKdJDXQsCipXNWDpaYGprNY/aB3gwu4qLOuYAS9asw6DzaRtfeYDKJFAn4zlmxrAy3d BDQkyQM9MusoH+NKpwtnJlRj02EKJfDMc0qpc90Dobp/MG2HSrFIw0yoRqYTDBe2ucpP bSIg== X-Gm-Message-State: AA+aEWbxS2JjAbsXvV1L0Wuyq8GUe+XRe69VLuI0znehO7vZFyqZDdnl wFqOMXwqUktT2tZuDWh8KLXEMg== X-Received: by 2002:a24:67c6:: with SMTP id u189mr2679135itc.106.1543681671629; Sat, 01 Dec 2018 08:27:51 -0800 (PST) Received: from [26.67.160.54] ([172.56.13.56]) by smtp.gmail.com with ESMTPSA id p74sm3454237iod.14.2018.12.01.08.27.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 01 Dec 2018 08:27:50 -0800 (PST) Date: Sun, 02 Dec 2018 05:27:40 +1300 User-Agent: K-9 Mail for Android In-Reply-To: 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> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PATCH v2] signal: add procfd_signal() syscall To: Andy Lutomirski , "Eric W. Biederman" CC: Arnd Bergmann , 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 From: Christian Brauner Message-ID: <7089A038-6685-4EB4-A67A-CE692B32147B@brauner.io> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On December 2, 2018 4:52:37 AM GMT+13:00, Andy Lutomirski wrote: > > >> On Dec 1, 2018, at 7:28 AM, Eric W=2E Biederman >wrote: >>=20 >>=20 >> It just occurs to me that the simple way to implement >> procfd_sigqueueinfo info is like: >>=20 >> 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); =20 > >> } >>=20 >> long procfd_sigqueueinfo(int fd, siginfo_t *uinfo) >> { >> kernel_siginfo info; >>=20 >> if (copy_siginfo_from_user_any(&info, uinfo)) >> return -EFAULT; >> =2E=2E=2E; =20 >> } >>=20 >> It looks like there is already a place in ptrace=2Ec that already >> hand rolls copy_siginfo_from_user_any=2E >>=20 >> 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=2E > >Seems reasonable to me=2E It=E2=80=99s less code overall than any other >suggestion, too=2E Thanks everyone, that was super helpful! All things equal I'm going to send out an updated version of the patch latest next week! > >> 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=2E >>=20 >> Because we will need 3 call sights: x86_64, x32 and ia32=2E As the >layout >> changes between those three subarchitecuters=2E >>=20 >>=20 > >If it=E2=80=99s done this way, it can just be =E2=80=9Ccommon=E2=80=9D in= the 64-bit table=2E And >we kick the can a bit farther down the road :) > >I=E2=80=99m working on patches to clean up x86=E2=80=99s syscall mess=2E = It=E2=80=99s slow >because I keep finding new messes=2E So far I have rt_sigreturn working >like every other syscall =E2=80=94 whee=2E > >Also, Eric, for your edification, I have a draft patch set to radically >simplify x86=E2=80=99s signal delivery and return=2E Once that=E2=80=99s= done, I can >trivially speed up delivery by a ton by using sysret=2E