Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2994803imu; Thu, 29 Nov 2018 13:41:59 -0800 (PST) X-Google-Smtp-Source: AFSGD/XmUeajZX/Uz50laaUlvB+dDVak3Yy4oTmFXZav6VDLsqN0ZsTxDaZ7WMqJl1lSmWEXcLH+ X-Received: by 2002:a63:2d46:: with SMTP id t67mr1498179pgt.140.1543527719601; Thu, 29 Nov 2018 13:41:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543527719; cv=none; d=google.com; s=arc-20160816; b=qVkrg0IlwvrN5IeocehNqZfshvXGEJ76u7vR1xyNZMHKPS19Ely4alhBOIX5mWQPkH tggA+kT2AkTXOKrukkjzprgkYCUPU74SvktNFFkMp0paHEbERtQlUEABkwapbVxJ0+Yh DBNtaRI7LWlUihiInkQvSaE1XKxgbBihdcBycqcjzuVMUFRf3dwURvBCmQhNkBNjMG15 /gHhB1JGOKq4qkmPUTm4MityJGsFVCHgcKn8ImzT169X6ncLVuguCrBl/VQr+/oHnWKK Ss7XRx1HVJYrTpnSLaif195XfPgjz4o73Gk9tjOGWdV5rLu/YloYgGda97vu2EIjEpos 5Xaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=Z0Wt85+5fhcDQJaWSJhZaQaaqLPbm2iQ+s2zFOdMVZc=; b=YO+NLINzGx9ikaSXSIovbBzYJcuVI5SgQAMTI0p/bWhjrn5iq9EAIypF2DwH9jx13E 934hcfIfdskJTOisQIZUVK4AHd4Ehp/wyspQvicSsYN9kDoUsZScgRGi1mazAQhAapYi EEyK4FWqE+L6ZTmg+5CctWAUsmlzKOKef7zXOCaSTB7cY82tTr6b+nrfDM5IMc1zMzO8 42kZI4o658BfMGKoMvkvQwWBejCPcXWxQuoQpE9G/yBMTw3fIdFCyS2AIuLz/gxm75kF XEUDoY2ZRainDKq8es4hFlp5UHHnXOHGevEzZ6FeI75aJ8e40L8SQR0lusvLXA5V1kG4 i4Sw== 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 q20si3019565pgl.268.2018.11.29.13.41.45; Thu, 29 Nov 2018 13:41:59 -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 S1726723AbeK3Ir6 (ORCPT + 99 others); Fri, 30 Nov 2018 03:47:58 -0500 Received: from mail-qt1-f194.google.com ([209.85.160.194]:35924 "EHLO mail-qt1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726264AbeK3Ir6 (ORCPT ); Fri, 30 Nov 2018 03:47:58 -0500 Received: by mail-qt1-f194.google.com with SMTP id t13so3774395qtn.3; Thu, 29 Nov 2018 13:41:08 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Z0Wt85+5fhcDQJaWSJhZaQaaqLPbm2iQ+s2zFOdMVZc=; b=bnzFXnnG6Wf4ia6fj/pe/HLQla+RkvsUKNEZ88toHx8DsIuj+iGRULDlgC56V77ZLz ckys7U7aJXG6jas4+Po6rwFxu3QUIM64tciXsnWWaYsnWzFwXo4dnjF5er7yL77XpsIi 9EWyCQZvnM4PNpjRcrSgZ0s38SFL5sYafPAJYCNvD+yLunE24YM52f8a1po1ZKlHbYPk gV6yPvypH7H3q4WhgrUAhB4EGfIbSUc9VJwYWnsblfG0+kuyQPhWRD14pDiwJO4R0DP6 XEyIWqErjdV3u6YZBENlLraaU0sy+f3eaImx54JADHkF/wmbzgjpBkBOvy0oL4L7vb4D fq6w== X-Gm-Message-State: AA+aEWa+zJOvKnkQYC9ivd809JtJkTtf2aquKD/rdoB8tVdW0Es+v+CN U2yTctONZ4QBaGfoAznzmLiAxKzXX/Izdsn0llE= X-Received: by 2002:ac8:1d12:: with SMTP id d18mr3079413qtl.343.1543527667923; Thu, 29 Nov 2018 13:41:07 -0800 (PST) MIME-Version: 1.0 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> <20181129213458.4h44dpg6ltqow4k4@brauner.io> In-Reply-To: <20181129213458.4h44dpg6ltqow4k4@brauner.io> From: Arnd Bergmann Date: Thu, 29 Nov 2018 22:40:49 +0100 Message-ID: Subject: Re: [PATCH v2] signal: add procfd_signal() syscall To: christian@brauner.io 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 Content-Type: text/plain; charset="UTF-8" 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:35 PM Christian Brauner wrote: > 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: > > > > 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? Yes. So it would currently replace rt_gsigqueueinfo() but not rt_tgsigqueueinfo(), and could be extended to do both afterwards, without making the interface ugly in any form? I suppose we can always add more flags if needed, and you already ensure that flags is zero for the moment. > > 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? I'd like to at least understand about sys_rt_sigtimedwait() before we go on, so we all know what's coming, and document the plans in the changelog. waitid() probably remains on my plate anyway, and I hope understand where we're at with it. Arnd