Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp3625239img; Mon, 25 Mar 2019 14:16:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqwF9q9WJjl5qlX21DFmbfqcFx/OK4HbjfELhIbjIg6P5tHeMBdn8QvFgPeiAMIwAowUDLCC X-Received: by 2002:a63:ef0d:: with SMTP id u13mr2688947pgh.450.1553548568663; Mon, 25 Mar 2019 14:16:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553548568; cv=none; d=google.com; s=arc-20160816; b=lmT+g5ZkyrOAdiFL4tgSrHEKZ4s+yFZoCTS0T/g83i/ep/1d63IqJ4y2HlhW2qM+j8 QacgVRPechbCXWqaou+4h4ST5unR/7/ct00wYGPdUv2YoqJ+ar/PPzCfGsXbh5XWj2Z7 1Em425IzJ40HF+tdvmPsiM0OwjebrlzX4V4sYs8WfV36oPug4ybMCQ88CqcOy7mRIZgq 0I+HtT+p196EZeNdHCQMLtmLluCNMf52+ggRx4JeVOidiGEKvxVafUqUr2e0/MAhlRqg TAuyYjF30PJ1zmEpI+vxbwwvd8E8T3GWAH4GOGYgJEENuv0JvxcJQWni4sqhGXQ3J44t YXQQ== 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=TOB0oYz+728BPsAdJuQbmMh9f8lOi7seLXMKgApZGOA=; b=lmb1pQps6n4A6NQPKEO/TOQ88hIT9cjbpnuRIXdOYt0wZcoZWvNOkXNAvPano2HVyH 9yK6Hhxrbuj4xty8erAyL0q/NMI9SVTf1Ob8Le/EVUmVZ1VSXIQqKeoTGPhOce3tZIGh 74fnvSyhbTQehlQK10J5GAV7I9iTvuUBHRQZtPQZJMVeDnpCA0ItJ5yzm7CUrLrCNxIu dj4r1EAC2F3h8/3dUG+vRwzPWkHg+KPb7/MT6p4iYEjpsF5Wx2J5GM9o/T6fVJzmPpa4 +cz+3Gw8zybBFfNZ/LQi5WGGM+On5DJGKoZcC0bQmDgWikPHNRg8fs/jWPiX3mFLF0sS Betw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=uTA1MZBZ; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z20si14825421pgf.324.2019.03.25.14.15.52; Mon, 25 Mar 2019 14:16:08 -0700 (PDT) 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=@gmail.com header.s=20161025 header.b=uTA1MZBZ; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730285AbfCYVPK (ORCPT + 99 others); Mon, 25 Mar 2019 17:15:10 -0400 Received: from mail-qt1-f194.google.com ([209.85.160.194]:36865 "EHLO mail-qt1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729297AbfCYVPJ (ORCPT ); Mon, 25 Mar 2019 17:15:09 -0400 Received: by mail-qt1-f194.google.com with SMTP id z16so12167213qtn.4; Mon, 25 Mar 2019 14:15:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=TOB0oYz+728BPsAdJuQbmMh9f8lOi7seLXMKgApZGOA=; b=uTA1MZBZV/6qeT6HsBg92eQPdJKcDv3y0w9z66V9rzVK1pLf4LWmkiMlithQIcXI0N vYrO/LTnv0kUF3Y46qRGxjWvs6WL0cSrOepUmJTgSBJB4uW331jPMUTEpq1w15mLVqnt oRJFpgkLTw1LY0PlluWYvhmUg8/BNEzp8vHqXThq4bBuiJQSy0kLHX//yXPu0d7oS8tK 7UVS3QzcSyAmoAmarySC7cdt47fX1W9nZLn7lIw6KElDb4ONQ6qlomhHU1JEW13l4G3U KJgpJBQy+2XL822S5sZcDOD4T2wgv7yYWCFdiIs1e0J42qflI+Amm/Jwj/3qKDZhd5Ti NAbw== 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=TOB0oYz+728BPsAdJuQbmMh9f8lOi7seLXMKgApZGOA=; b=QfEz3d+PEv1zV6YEneqhfNLS72WwKPrnIUBal7mqWyMb97npv21XGGliTFUSlMaNsV Q74KF87FAHcpG6Trk1Y5jan5FCQynQn84S2gIrXH03A4bGosgqqmMTyOOsYYkm1rPENY 3BccOw5qRyra+X1/j9ZtLaqI9euD9mfSptLg9mYlMQE+jF1Bb3/iExYV+UEUPXmyoNDZ o7v+O2oTQNdqi02n1gIE6g9ELvP96ocdeROeBP7I80rd2ePnT2h/7kk13/oddb5dABTg VwTXAhoynR8v993GuS25+kCZQSUOSlZnuPH2bv3lVWndAHBKJYXsbI/HSTWTKBiJeLFt kdgw== X-Gm-Message-State: APjAAAXB/vSu7DEwqKpXOdCl2/HtCimOcgceJ0IBkBoGv4+QLf4y/Pp2 44MSYd8SmGj9s3It4a8weJE3SnXjiH4jIP48WjI= X-Received: by 2002:a0c:8445:: with SMTP id l63mr22492411qva.187.1553548508460; Mon, 25 Mar 2019 14:15:08 -0700 (PDT) MIME-Version: 1.0 References: <20190325162052.28987-1-christian@brauner.io> <20190325173614.GB25975@google.com> In-Reply-To: From: Jonathan Kowalski Date: Mon, 25 Mar 2019 21:14:54 +0000 Message-ID: Subject: Re: [PATCH 0/4] pid: add pidctl() To: Jann Horn Cc: Daniel Colascione , Joel Fernandes , Christian Brauner , Konstantin Khlebnikov , Andy Lutomirski , David Howells , "Serge E. Hallyn" , "Eric W. Biederman" , Linux API , linux-kernel , Arnd Bergmann , Kees Cook , Alexey Dobriyan , Thomas Gleixner , Michael Kerrisk-manpages , "Dmitry V. Levin" , Andrew Morton , Oleg Nesterov , Nagarathnam Muthusamy , Aleksa Sarai , Al Viro 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 Also, extending this further, instead of new ioctl flags over to translate a tidfd one might introduce later for thread targetted signals (which would still be a pidfd in the struct pid terms, but with a bit set in its reference to target the selected TID in particular), you could resolve this neatly to the proc entry of the task itself, which would be subject to restrictions similar to a regular open call, minus all the races involved. This also means you can get rid of having to support the /proc/ dir fd in pidfd_send_signal, because there is no incentive to, any longer. The kernel now has just one pidfd object, well scoped in its purpose, and this "feature" is tied to procfs itself, disabling which takes away the feature as well. Otherwise, the ioctl will be conditionally available and/or work only when procfs is present, and you'd tie procfs to pidfds eternally as ABI.