Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2989788imu; Thu, 29 Nov 2018 13:36:11 -0800 (PST) X-Google-Smtp-Source: AFSGD/WpPi6B0rTP+xxMj9Ei2Wj5GBXj0iyR9h8M3qz9QAAeYAbvwFAHnCfEUQ7g8Mwr0wG1/Hrb X-Received: by 2002:aa7:8286:: with SMTP id s6mr2942961pfm.63.1543527371517; Thu, 29 Nov 2018 13:36:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543527371; cv=none; d=google.com; s=arc-20160816; b=tzvq2jFBpde1pG7Ekyclf2wywF7+vgqU0mecRzg+jUKi6oQGTOuyMNzt5Fh4igO68t Y3A1CPvRQo/Y/nmphwJGg0rZCojW31TrbTixslFCLHklU7WUwZtahSGMF2xr3PObmmVp n7WgP1ZJDHw71y6r27zasQsMrBy/D5eRIHdbzwoYbSIkr9x2kE1QGbBtapBCH9tHwpOm WO8yQX/lupQARsJfZj0dE1OMwPHQW0ibK0vv3aOZbBeSxxQ9IazM6IMipw8vOQ/d2/Ct dvEDLVMUebDrBYbfqqQwbD8BjNbJIYQegwi2Ig8YSZ2eZnYgrAD3m27d1LS5HKgMIM0z 9bHA== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=MT1oWujqp+4cAEuTrVxZsei8xOnKPWYUQitNJOOzRuo=; b=MKiw567PPcuxYHX/RXV0ELMz3R0W5RpNlL1udVxc4fmAQaEc3LYqoUrzFiDI2jSqmd jZRvtMh/7iMmEyeXggCbJ4zeivtqqLATJcBW9g9yJjKC/0TDDSp3ffm3AOc/SwxrtMft dGCw4QJfZV6Hr8TWt8RRbS3QUOv7FsF1F8Kbxl1RunsleNQAEy6Ei3SAdZKhvrwxg+cM /ak/c0pFfaUNnI/PywiEZVhxYK5U6yIfUN+HhO3Xwnk9hPOm+hhRLCXPBDwGAp/qjleM YZrcRdW8/fl2jsYG5Xc9MuzVrwW1aIt6BKtQ0AhH+cWgNENO9ft/A5Na4L/lIFiJka9c 0fNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@brauner.io header.s=google header.b="MZ8jT/pJ"; 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 v5si2957885ply.74.2018.11.29.13.35.57; Thu, 29 Nov 2018 13:36:11 -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=pass header.i=@brauner.io header.s=google header.b="MZ8jT/pJ"; 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 S1726931AbeK3ImA (ORCPT + 99 others); Fri, 30 Nov 2018 03:42:00 -0500 Received: from mail-pf1-f195.google.com ([209.85.210.195]:46564 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726374AbeK3ImA (ORCPT ); Fri, 30 Nov 2018 03:42:00 -0500 Received: by mail-pf1-f195.google.com with SMTP id c73so1656234pfe.13 for ; Thu, 29 Nov 2018 13:35:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brauner.io; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=MT1oWujqp+4cAEuTrVxZsei8xOnKPWYUQitNJOOzRuo=; b=MZ8jT/pJBbmD2Pc9+YA0R8/oKUIF0gNXmfAGhu4ITq9RVMHeqoKZ87c2AqU8ogm543 4YqFsRzJfllOM6l2CC1Q1OAm0nXBsT1YCp1aIr59fTpuAO86W1jUB7k5MF85Pz0jPaOO gy/2kgjigQaycv6JQAVUCdddyuBMURSesZqd8MVpsCVwePV58fLdWg+T6b7mXZF8g+L8 w4C3NmaNbyCDAR2tjkA8dEOphoPE31s/T/OuVs9+iGyf3a82Lux74Ct53NqGoK2myMvi +wXxpiQy21aK23OSm2xZwZSF+OnWihj2EHGvg0N62MN0MOdI95oBnreo/CY18lHTfdPz T41g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=MT1oWujqp+4cAEuTrVxZsei8xOnKPWYUQitNJOOzRuo=; b=AOy79EvnlpMIFTJx4QMAva0vMOvwRa3Ny+B+j0dBX+9b3gw3t9QoTX0ZI+A6Gq6WZS S4Tdd1LIHZn7wPyPYf9Me8Vq+89lLwHzr2J3eWDyitvN/CcHuJc4RwuTn58bRwRqqPcD tzNpImQYIxnj7dW/MZmbqmDfm7xQTUS+2EMavRr60qj/SzPROkSDyU6KIgqBKGnZboK2 aMO6YEn2/P6s7cmtfuM8zsLFa7Lr/ECNcuvfOH3ZuZVNCQj7yPfmPct+XBXJBdoHCllj uZTwS/5dw42cdO++MXDbWhktQPW+HDqwh3ietbqwiZsRpAjgnknlNKZ3UmpUAp7mfHmB UlGA== X-Gm-Message-State: AA+aEWaGdmTvx4OTCik8JpJ0modVRV3BrcRAQ1lJ8ouqm7A/Av0q7y41 3QQRf6sC9Z0ej4wLpMdp5CcxUg== X-Received: by 2002:a63:1a4b:: with SMTP id a11mr2656833pgm.254.1543527310737; Thu, 29 Nov 2018 13:35:10 -0800 (PST) Received: from brauner.io ([2404:4404:133a:4500:ad2e:14cc:5849:819]) by smtp.gmail.com with ESMTPSA id d3sm3681789pgl.64.2018.11.29.13.35.03 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 29 Nov 2018 13:35:09 -0800 (PST) Date: Thu, 29 Nov 2018 22:35:00 +0100 From: Christian Brauner To: Arnd Bergmann Cc: Andy Lutomirski , Andy Lutomirski , Florian Weimer , "Eric W . Biederman" , 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 Subject: Re: [PATCH v2] signal: add procfd_signal() syscall Message-ID: <20181129213458.4h44dpg6ltqow4k4@brauner.io> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 29, 2018 at 10:02:13PM +0100, Arnd Bergmann wrote: > On Thu, Nov 29, 2018 at 9:14 PM Andy Lutomirski wrote: > > > On Nov 29, 2018, at 11:55 AM, Christian Brauner wrote: > > >> On Thu, Nov 29, 2018 at 11:22:58AM -0800, Andy Lutomirski wrote: > > >>> On Thu, Nov 29, 2018 at 11:17 AM Christian Brauner wrote: > > >>>> On November 30, 2018 5:54:18 AM GMT+13:00, Andy Lutomirski wrote: > > >> > > >> The #1 fix would add a copy_siginfo_from_user64() or similar. > > > > > > Thanks very much! That all helped a bunch already! I'll try to go the > > > copy_siginfo_from_user64() way first and see if I can make this work. If > > > we do this I would however only want to use it for the new syscall first > > > and not change all other signal syscalls over to it too. I'd rather keep > > > this patchset focussed and small and do such conversions caused by the > > > new approach later. Does that sound reasonable? > > > > Absolutely. I don’t think we can change old syscalls — the ABI is set in stone. > > But for new syscalls, I think the always-64-bit behavior makes sense. > > It looks like we already have a 'struct signalfd_siginfo' that is defined in a > sane architecture-independent way, so I'd suggest we use that. Just so that I understand you correctly: swapping out struct signinfo for struct signalfd_siginfo in procfd_? If so that sounds great to me! > > We may then also want to make sure that any system call that takes a > siginfo has a replacement that takes a signalfd_siginfo, and that this > replacement can be used to implement the old version purely in > user space. Sounds good but is unrelated to this patchset I take it. :) > > Is the current procfd_signal() proposal (under whichever name) sufficient > to correctly implement both sys_rt_sigqueueinfo() and sys_rt_tgsigqueueinfo()? Yes, I see no reason why not. My idea is to extend it - after we have a basic version in - to also work with: /proc//task/ If I'm not mistaken this should be sufficient to get rt_tgsigqueueinfo. The thread will be uniquely identified by the tid descriptor and no combination of /proc/ and /proc//task/ is needed. Does that sound reasonable? > Can we implement sys_rt_sigtimedwait() based on signalfd()? > If yes, that would leave waitid(), which already needs a replacement > for y2038, and that should then also return a signalfd_siginfo. > My current preference for waitid() would be to do a version that > closely resembles the current interface, but takes a signalfd_siginfo > and a __kernel_timespec based rusage replacement (possibly > two of them to let us map wait6), but does not operate on procfd or > take a signal mask. That would require yet another syscall, but I > don't think I can do that before we want to have the set of y2038 > safe syscalls. All sounds reasonable to me but that's not a blocker for the current syscall though, is it? Christian