Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp85922imu; Thu, 6 Dec 2018 16:36:04 -0800 (PST) X-Google-Smtp-Source: AFSGD/UlL9P7Ql33jz9cYairmzGML0bkCq0H+sehqDw3ZIdX59FT2NhRkwzwWo0PfejRG0UwG6LT X-Received: by 2002:a62:8c11:: with SMTP id m17mr112878pfd.224.1544142964392; Thu, 06 Dec 2018 16:36:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544142964; cv=none; d=google.com; s=arc-20160816; b=Jv3n83FgpFRdOAEcZvEpNcj4M2vcZxfuiyJJL/aDAjOLeCcmaCAiQOaYQDwLZBZ8a8 V/mkQXbQOBFCBAmCIdY0eZGqIB5IyM3jAyDNpRpTiVfk/X4Ny/RXTqAs2MBqh+X2rm6i gOEptjgveXoN7pvPHm6V0nsmKk6d7oSxcQWzhXuDClnbZ7PvFPVRN50uCOctyrsTMcV/ 6JMwyRHyTPqVbsmFGYJwEpTGVPdM0OSo6sYz+0+010vC0MTkNS41MKsqRbykPdPnKNlC 09aHNA9T0ppymjXxoq1a/009+lNa9ReEytYb4SsQPzvK3BmxzeJXfZZtVCq8UlW9M+L7 G+0A== 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:dkim-signature; bh=6AWiUbgcB+1AYhEhEAdTigTRPux67uFQPFh3IOaNKtc=; b=AZMp2WrfgnmOYa+nJ3uu46CNvjH02v41KkvAHoiekO+Mwc2PVgGJGbBGKxjiD0HU/E /555bFnDxCMAgp7qtQol4XUzpJ43R7zX8Ce+irtGmYaGdSeWJCJ90XFSA9ZAX0KNNl7v A9RE9IgGnIJh/UrBZcx6vvQ9pPmOerMz2+Bo8YqqX2GDwG41ahHb4q3ZZwMa6Os4GCBn tHe0rgL8bxZEPvnf3GWYxFN0z6PcqbO0SXGMRGOxNymxmv4K5kJMQ0itWO131sG302IG p7Nfamr8hOsKZ2C5BCsNd7bwrBdGrC8RrexgafhZmTR2bS6y/7xpYJYhTQ3EfO+TsHon uVAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=st+Ksekr; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e3si1535955pfe.203.2018.12.06.16.35.49; Thu, 06 Dec 2018 16:36: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=pass header.i=@google.com header.s=20161025 header.b=st+Ksekr; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725999AbeLGAfI (ORCPT + 99 others); Thu, 6 Dec 2018 19:35:08 -0500 Received: from mail-ua1-f68.google.com ([209.85.222.68]:46604 "EHLO mail-ua1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725963AbeLGAfI (ORCPT ); Thu, 6 Dec 2018 19:35:08 -0500 Received: by mail-ua1-f68.google.com with SMTP id v24so821358uap.13 for ; Thu, 06 Dec 2018 16:35:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=6AWiUbgcB+1AYhEhEAdTigTRPux67uFQPFh3IOaNKtc=; b=st+KsekrPteo1KyInJ7JUhFD+nG/UsTb7j7/If+IUU6VMRkI23wqokeLxpVe/SEZBc TgpJO4fTk7Hc1V8UMz24jLIsaxcvsN6utytMrqZ+uY46f6z+dbqqXuJnz+c+mI0L/cUq G7hyQEo21ckeY1dIEjvMbSWiESdaLoILchnMf8uUV4U6wHEZKdZFxXDopOHhii9eGl6b EK43XdaAaQqQvLjwfbo8gzOtSaOHfJPULzWaZhW630Yo31IwbO5HBZV4SB9tGCWpn2fQ VCXeDDafN1zHSJ5txrHViNtdzRZAjETMj5yZ61njssQw5bkFve22bjC5UUCHpTg9qmWq gAkQ== 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=6AWiUbgcB+1AYhEhEAdTigTRPux67uFQPFh3IOaNKtc=; b=mLPmqiDfl0KqkQE8nv07Flcz6tZSjWalak3m6MLu65Y3G/tesUgwabLxcqeieLgtbD n+mgvcacO7D69TLJg9c69IVW3ANTkmatGqwianiwIjINJ+Jv7260Ww89xYItlDGu/FH2 kbiAeqeTmC6J/ETZOyv2X4Z+fmUdkMGp78zJH24DihniXNfuvPOG63zh/KzziWMnD+oZ /8s2Lbxpnk/+Q+YZ0+CDLoPxHb9dF4WveQDzzCtLnqeTdk+oT+Q0hdLvyxT05qpcyTQf 01fpD+uDHIK73l0K26wSDmqvZRos6HfHgjmkecAInBMgb3lOI94qcQ8/jAxDL4dop7GK UlWA== X-Gm-Message-State: AA+aEWZxi45pQ2bKLtzWeHI470vRofsp4tWX/7hPVuCvETjr0P847Mpv uX89ueZ0U+o1vxj5lytf0TdbWF749N3p1YTHxryXHg== X-Received: by 2002:ab0:225a:: with SMTP id z26mr48109uan.100.1544142906665; Thu, 06 Dec 2018 16:35:06 -0800 (PST) MIME-Version: 1.0 References: <20181206121858.12215-1-christian@brauner.io> <87sgzahf7k.fsf@xmission.com> <875zw6bh2z.fsf@xmission.com> <20181206193017.wpxls5p3zgjd6rv2@brauner.io> <871s6u9z6u.fsf@xmission.com> <20181206213152.gvci7ijr3dokew7w@brauner.io> <87o99y72gi.fsf@xmission.com> <20181206223948.gyfdtkgbhtozmpsp@brauner.io> <20181206231742.xxi4ghn24z4h2qki@brauner.io> <20181207003124.GA11160@mail.hallyn.com> In-Reply-To: <20181207003124.GA11160@mail.hallyn.com> From: Daniel Colascione Date: Thu, 6 Dec 2018 16:34:54 -0800 Message-ID: Subject: Re: [PATCH v4] signal: add taskfd_send_signal() syscall To: "Serge E. Hallyn" Cc: Christian Brauner , "Eric W. Biederman" , linux-kernel , Linux API , Andy Lutomirski , Arnd Bergmann , Jann Horn , Andrew Morton , Oleg Nesterov , Aleksa Sarai , Al Viro , Linux FS Devel , Tim Murray , linux-man , Kees Cook , Florian Weimer , tglx@linutronix.de, x86@kernel.org 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, Dec 6, 2018 at 4:31 PM Serge E. Hallyn wrote: > > On Fri, Dec 07, 2018 at 12:17:45AM +0100, Christian Brauner wrote: > > On Thu, Dec 06, 2018 at 11:39:48PM +0100, Christian Brauner wrote: > > > On Thu, Dec 06, 2018 at 03:46:53PM -0600, Eric W. Biederman wrote: > > > > Christian Brauner writes: > > > > > > > > >> Your intention is to add the thread case to support pthreads once the > > > > >> process case is sorted out. So this is something that needs to be made > > > > >> clear. Did I miss how you plan to handle threads? > > > > > > > > > > Yeah, maybe you missed it in the commit message [2] which is based on a > > > > > discussion with Andy [3] and Arnd [4]: > > > > > > > > Looking at your references I haven't missed it. You are not deciding > > > > anything as of yet to keep it simple. Except you are returning > > > > EOPNOTSUPP. You are very much intending to do something. > > > > > > That was clear all along and was pointed at every occassion in the > > > threads. I even went through the hazzle to give you all of the > > > references when there's lore.kernel.org. > > > > > > > > > > > Decide. Do you use the flags parameter or is the width of the > > > > target depending on the flags. > > > > Ok, let's try to be constructive. I understand the general concern for > > the future so let's put a contract into the commit message stating that > > the width of the target aka *what is signaled* will be based on a flag > > parameter if we ever extend it: > > > > taskfd_send_signal(fd, SIGSTOP, NULL, TASKFD_PGID); > > taskfd_send_signal(fd, SIGSTOP, NULL, TASKFD_TID); > > > > with the current default being > > > > taskfd_send_signal(fd, SIGSTOP, NULL, TASKFD_PID); > > > > This seems to me the cleanest solution as we only use one type of file > > descriptor. Can everyone be on board with this? If so I'm going to send > > out a new version of the patch. > > > > Christian > > I'm on board with this, but I think you need to also clarify what exactly > the fd stands for. I think that (a) userspace should not have to care > about the struct pid implementation, and so (b) the procfd should stand > for all the pids. So when taskfd_send_signal(fd, SIGSTOP, NULL, TASKFD_PGID) > becomes implemented, then open(/proc/5) will pin all three pids, as will > open(/proc/5/task/6). This change doesn't "pin" any PID, and it makes no sense to make a process FD stand for all its threads. What does that even mean?