Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2796015imu; Mon, 19 Nov 2018 06:16:47 -0800 (PST) X-Google-Smtp-Source: AJdET5fFCP1n32cbFbcuZfUvop5XI5esMh9kx2MBUduvoLa7hzG9QAk87zQ7mmQemrFa0wdUMCVO X-Received: by 2002:a62:184e:: with SMTP id 75mr22782056pfy.28.1542637007745; Mon, 19 Nov 2018 06:16:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542637007; cv=none; d=google.com; s=arc-20160816; b=El2wmjFws3IcEuCZEo/50K9d5qLoFzqhBy7i4iC6zmJSvhNi2qpD2r0rcHqgrGYpGy QAkbbSCub7iif+Mr//cyubKZOwBIFVib0V9kOxqrC4KvDA/mw4ASH3nBA8Dp8b+QBPOf oUZ88G5dF8J6Yf6/y9bvS7q6p7jbtN0CTJT0hkiz20dm6jyjOPIAMJblfeDwGNR22u+3 7kdUVBWwXVPUVX2T1F19zjuJcpnx2BwfEaa6cH/9dCnPvRqECv5iY1WerbtkpjmFvH2W KfE3e5HcAyq8s3ReQQzHOzutnHrfQ6ArWgzdErNGtkcJRMcdZTYeMI2nUYdPSEnmVXCX YvKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from; bh=LfXWIUTBLk+t9FBQ9eUK04pGPSPGkL2ctgxqwG10b0k=; b=UJac0Ckd/EUAsA7OyPcXUPxOt18vHEbVOe7NDjH3cgMUnJUJhTjVI9AlN/V0ojfSP5 oc9vghnOddhUP5QVJStVL1rsPM9xGGQWiNTIYJA+qWr222mcTDWPHKXiRZj6vMhIUcOv tvFjno06EVX/gI2oXARff1cMWF18mVykzIPoSGWe4AW8nJQyOF/9DMIrfQauM/5R4RB1 wYDx6k7wc5REsbyU5TIDjarGXjark/x2Ihbi7DVGUzcVIA5ifV//MMx04j+9c2yF/2VE JWrO294469OOuWeQvh2UU43yvSTfNTL9bgwD7UlBuSSJ3jR823W3rcmbeXk3NzY3PbRj 7TUw== 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 4-v6si42191482pla.176.2018.11.19.06.16.32; Mon, 19 Nov 2018 06:16:47 -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 S1729443AbeKTAjN convert rfc822-to-8bit (ORCPT + 99 others); Mon, 19 Nov 2018 19:39:13 -0500 Received: from eu-smtp-delivery-151.mimecast.com ([207.82.80.151]:20423 "EHLO eu-smtp-delivery-151.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728252AbeKTAjM (ORCPT ); Mon, 19 Nov 2018 19:39:12 -0500 Received: from AcuMS.aculab.com (156.67.243.126 [156.67.243.126]) (Using TLS) by relay.mimecast.com with ESMTP id uk-mta-112-1WagJuYKPWyp2NEK7jIZzg-1; Mon, 19 Nov 2018 14:15:25 +0000 Received: from AcuMS.Aculab.com (fd9f:af1c:a25b::d117) by AcuMS.aculab.com (fd9f:af1c:a25b::d117) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Mon, 19 Nov 2018 14:15:31 +0000 Received: from AcuMS.Aculab.com ([fe80::43c:695e:880f:8750]) by AcuMS.aculab.com ([fe80::43c:695e:880f:8750%12]) with mapi id 15.00.1347.000; Mon, 19 Nov 2018 14:15:31 +0000 From: David Laight To: 'Christian Brauner' , "ebiederm@xmission.com" , "linux-kernel@vger.kernel.org" CC: "serge@hallyn.com" , "jannh@google.com" , "luto@kernel.org" , "akpm@linux-foundation.org" , "oleg@redhat.com" , "cyphar@cyphar.com" , "viro@zeniv.linux.org.uk" , "linux-fsdevel@vger.kernel.org" , "linux-api@vger.kernel.org" , "dancol@google.com" , "timmurray@google.com" , Kees Cook Subject: RE: [PATCH] proc: allow killing processes via file descriptors Thread-Topic: [PATCH] proc: allow killing processes via file descriptors Thread-Index: AQHUfzCMPJnedN49+EaYHywV7sQfyKVXJFlw Date: Mon, 19 Nov 2018 14:15:31 +0000 Message-ID: <9a269517770e4881b92756d47f17a5fd@AcuMS.aculab.com> References: <20181118111751.6142-1-christian@brauner.io> In-Reply-To: <20181118111751.6142-1-christian@brauner.io> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 X-MC-Unique: 1WagJuYKPWyp2NEK7jIZzg-1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: > Christian Brauner > Sent: 18 November 2018 11:18 > > With this patch an open() call on /proc/ will give userspace a handle > to struct pid of the process associated with /proc/. This allows to > maintain a stable handle on a process. My 3c... You need to add a version of fork() that returns an open fd to /proc/pid to the parent. Is it possible to overload fcntl() rather than ioctl() ? More interestingly what about a 'unique pid' (eg the pid extended to (say) 128 bits with a use count) that can be safely put into a /var/run/pid file for a daemon and used later in a 'kill' that will only ever reference the correct process. David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)