Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp10890797imu; Thu, 6 Dec 2018 08:19:46 -0800 (PST) X-Google-Smtp-Source: AFSGD/V3tUbT1+QcZVMXLPdJQedBLkxFrNbAkxjFhjSwRN/eo3+S2toKabxG8v7dzlVsjSexFPGI X-Received: by 2002:a17:902:48:: with SMTP id 66mr27664672pla.68.1544113186897; Thu, 06 Dec 2018 08:19:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544113186; cv=none; d=google.com; s=arc-20160816; b=0MHk+8Chwx2tct09bJgPMFnsVaXv9vPyXoKB1Vc8RQXVaz5do/uYXqElV2bep9rCFP QUTVrcTV6BRO7Bw7sxPDCkx4aLQNCMGLgf3v9mtzqQqqdmHf+m/j1zlxU+wbe25DXQVZ HuaA/ux7TYw9tnOV1gUhRnq0aKylz45hmMx8lRc1yr0LE10sEaOwTHNM7HtfvhG5HUUw AFrgPyMRScPa3fK2j35/i07drrvjvE/v6mhf/Zz5DLT1fjwa+PUIxpfUjcfOHX6jRQ0A YLAcI0TZfYSEs1IpojCv3waPhkQajwZ45LveodQfxZqBJFI+S605FPUrOxgzYxA1jGu0 Gn4A== 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=iydoUaKnECal97zKodAjnGwDbheh8CCIMkvtG0Rihzo=; b=UzahP9S4+0v9V+PbimTWod/owZvOQC93nEvk0xN9G7hcJb26/HWD0w1WvY14p9cnw4 8w8e2/gBihfX3DsmLWocb7JjUmxcEL6F2BKo3ApYR9M6hJOJKFvjloBWtjL0cBjDTf6v ZSAzNH7eBJXN1g3LXjy5YctgkO3fVBN/OEnu5JmBlFqIyj0KOv4jV7FRLB56W/j3z3c2 OhtrVbXN++CHTBcLMuzA4AtKvusuKVJcXo6yTugItImtdyWNyJ20Hkzp1JzMRhvs2Qpc 6ezFyjLqiPH06veC1pRhzs2TOhDT3d/oTPYxBmN0ab9nVAiiIRekauAOG0hhUQr23yQS HKMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=nabL5K7l; 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 p3si551921pgi.0.2018.12.06.08.19.08; Thu, 06 Dec 2018 08:19:46 -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=nabL5K7l; 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 S1726182AbeLFQRd (ORCPT + 99 others); Thu, 6 Dec 2018 11:17:33 -0500 Received: from mail-vs1-f68.google.com ([209.85.217.68]:36561 "EHLO mail-vs1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725970AbeLFQRd (ORCPT ); Thu, 6 Dec 2018 11:17:33 -0500 Received: by mail-vs1-f68.google.com with SMTP id v205so623252vsc.3 for ; Thu, 06 Dec 2018 08:17:32 -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=iydoUaKnECal97zKodAjnGwDbheh8CCIMkvtG0Rihzo=; b=nabL5K7lyZfrbMbCTyxakS/qo9eBpyBVzxbHoNbV5SmiTvTQZzwFHm9yFisc9iYVvE aF4T/pXSjDJ71IlIkzQ2wNLuwV81y2XNSpWljXBsOmS7XYI484S2OD2erUehbbBZRK0G /oN4zbDdhM38zCJt0cBMUOmUzzRdosfAB6vmHYicssPyXMe9mUVmmpCwPyCSj6M7J6p6 Ze0CHzCpHR0me33z1gzN+A/I1eTcxozl5/Baf2QwECh75Ne8UBekatrJZMZqmRfTyKTD GXkJw59tPmTi2Fr0b4kM4WtqbbUTk4+0t+ch3XJiqNAyma2iKui1Fa10bBKKC7I4EqZO 5p0A== 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=iydoUaKnECal97zKodAjnGwDbheh8CCIMkvtG0Rihzo=; b=fdvUw62B0Gcn26gq72eAHzJc89yUQRQrPPwEzHycG9Nb290uGq2RoADOcMYAO4dEDm gDKECIHnbnR0GnbihklAc5aPN+JN23SWHg9ZIC602G3GuIALMM2GWff1UnTzPVtZl6wO Li+QZcNZmQoMnGtXYb3ZZ++PqOTInjgjb5ArlczcJ2TpxTWSX7IONdxkUu4vDKgUZDGc hVfr+23eYLbCO50MeDZculPVg7IN9n/kCMJ9W0MG1Tpdlr8eegrEOlgRW40KTenfd1fW DpMC06/neAXTV2188ZgBxgsiPjSGvUCYX4hgAGJlB5HQeKfbtUeTpYg9IUjmUx8FX6Nu 0cuQ== X-Gm-Message-State: AA+aEWZbHXpmzHHneQ5Z0KVgnb11NjQhQ5/0cK50lyB8TJIxHNTnz3FB GrrtG1xz4TM4NS1il53tn2WpNdXBy/5fyJTktFU8icUHxcM= X-Received: by 2002:a67:105:: with SMTP id 5mr12576458vsb.183.1544113051175; Thu, 06 Dec 2018 08:17:31 -0800 (PST) MIME-Version: 1.0 References: <20181206121858.12215-1-christian@brauner.io> <87sgzahf7k.fsf@xmission.com> In-Reply-To: <87sgzahf7k.fsf@xmission.com> From: Daniel Colascione Date: Thu, 6 Dec 2018 08:17:18 -0800 Message-ID: Subject: Re: [PATCH v4] signal: add taskfd_send_signal() syscall To: "Eric W. Biederman" Cc: Christian Brauner , linux-kernel , Linux API , Andy Lutomirski , Arnd Bergmann , "Serge E. Hallyn" , 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 7:02 AM Eric W. Biederman wrote: > > Christian Brauner writes: > > > The kill() syscall operates on process identifiers (pid). After a process > > has exited its pid can be reused by another process. If a caller sends a > > signal to a reused pid it will end up signaling the wrong process. This > > issue has often surfaced and there has been a push [1] to address this > > problem. > > > > This patch uses file descriptors (fd) from proc/ as stable handles on > > struct pid. Even if a pid is recycled the handle will not change. The fd > > can be used to send signals to the process it refers to. > > Thus, the new syscall taskfd_send_signal() is introduced to solve this > > problem. Instead of pids it operates on process fds (taskfd). > > I am not yet thrilled with the taskfd naming. Both the old and new names were fine. Do you want to suggest a name at this point? You can't just say "I don't like this. Guess again" forever. > Is there any plan to support sesssions and process groups? Such a thing could be added with flags in the future. Why complicate this patch? > I am concerned about using kill_pid_info. It does this: > > > rcu_read_lock(); > p = pid_task(pid, PIDTYPE_PID); > if (p) > error = group_send_sig_info(sig, info, p, PIDTYPE_TGID); > rcu_read_unlock(); > > That pid_task(PIDTYPE_PID) is fine for existing callers that need bug > compatibility. For new interfaces I would strongly prefer pid_task(PIDTYPE_TGID). What is the bug that PIDTYPE_PID preserves?