Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1774932imu; Sun, 18 Nov 2018 08:35:02 -0800 (PST) X-Google-Smtp-Source: AJdET5epsGl2FLKgN2pApQR3ohcKoW4VxYu/o3czh9b/9VbuDXQGfDgcz/1lPtsNU4Y8UeOkFptn X-Received: by 2002:a65:4646:: with SMTP id k6mr16790498pgr.153.1542558902711; Sun, 18 Nov 2018 08:35:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542558902; cv=none; d=google.com; s=arc-20160816; b=gemusReyqsDgAHGSZ2EzyuD0W63L0gmCvj9CxSajSF17Rvz3U0ZH0uIPZetwABtyaZ 4gFX2Au+rlwht34isLDrHy1wXAL9wfVpKx0iw7oQP5U9nE4n/aCONkG+xE2bF2t+lm4e V30QjStgOLZsk/ezlCSSglLZuuhKxWVIPKpJmEbuC1pscpTg0W2mhLnPmcoflaLEVgl3 7dJxxFagf/alg4D48ks2cu/OgbujfLxH14Tw6bZZT6ZL9nFSKY72TS9BjeIluyIjcZRB OcaEIqIqw09TS8270VFxrLHeD8+nrj+3tSHx/BfwIJxCNycKlOgEXFGvh/1tRK12081q dlYw== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=U8eIa1z1+dT1TtrG9VGPf0BEtG1aN+76TqLDjy2k6Ok=; b=Y/mipkGo/XgTj6YPDwp22Kf/NfMBs6dYBoAHA46qoB88uFsoUA/FhRkg4bVp9cHY6V o5P7F9nuzfQVhmLAOH+INflpgII66Dpi4Ef6GKfUkvD0cLGxbgrau0U22YYD9o7mFmVN l1BmjV2wwbdpqZIZnJ2WkeZH/xGuD5w79Lc/eRRW4LXUffLrnaI7m2u458EAqfHdMfUu ZsoSnsoIv9mxvlQ3R2xETrt+Wj5r63xSMjfbi7ZL13jsiRDjokl3gF3mhZEXBdmtNzxM cRf4xyOeBphVobIWvqu8/q3ARIbfPEQtc8A9CsUe9eqvRCje00ZqaBtogMV09sURhVbM UzXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=VNxIJ0ob; 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 j34si34442463pgj.557.2018.11.18.08.34.47; Sun, 18 Nov 2018 08:35:02 -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=fail header.i=@infradead.org header.s=merlin.20170209 header.b=VNxIJ0ob; 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 S1727468AbeKSCyu (ORCPT + 99 others); Sun, 18 Nov 2018 21:54:50 -0500 Received: from merlin.infradead.org ([205.233.59.134]:41838 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726804AbeKSCyu (ORCPT ); Sun, 18 Nov 2018 21:54:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To:Subject:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=U8eIa1z1+dT1TtrG9VGPf0BEtG1aN+76TqLDjy2k6Ok=; b=VNxIJ0obTFAzVkha/Mu5BtC3mS b/hzsF7oJpf5IcNhyuS6fFGRVWFzwEJj92CMSMpcWu1HVwgEuMMqXfj0XJ3l2r//2GT8Vwlw4n0ED fPbBJvzoxYim87ol7UdccVxS2l76yUQvphxefrq67ha+j6gx7WoUn4HbPoTA4fpoi53KbR0x+Eyl4 srgP2FKhKLmV0Om23z9RL4QvCNMmHi57Q6ao72JaqRKzGQhM8DBtjPpuPzZG3Zvhkmo4p5yzpZFYk 4RtlZ07H9XzGz+mmkV9uwBqnht5VK7yUeiAHnYwBupwzxrGS5CklmJqfvmuAILzntbatZuJGj4OGd UGYSsmbQ==; Received: from static-50-53-52-16.bvtn.or.frontiernet.net ([50.53.52.16] helo=midway.dunlab) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1gOQ1F-0000tb-W8; Sun, 18 Nov 2018 16:33:58 +0000 Subject: Re: [PATCH] proc: allow killing processes via file descriptors To: Andy Lutomirski , Daniel Colascione Cc: Christian Brauner , "Eric W. Biederman" , LKML , "Serge E. Hallyn" , Jann Horn , Andrew Morton , Oleg Nesterov , Aleksa Sarai , Al Viro , Linux FS Devel , Linux API , Tim Murray , Kees Cook , Jan Engelhardt References: <20181118111751.6142-1-christian@brauner.io> From: Randy Dunlap Message-ID: Date: Sun, 18 Nov 2018 08:33:52 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/18/18 8:17 AM, Andy Lutomirski wrote: > On Sun, Nov 18, 2018 at 7:53 AM Daniel Colascione wrote: >> >> On Sun, Nov 18, 2018 at 7:38 AM, Andy Lutomirski wrote: >>> I fully agree that a more comprehensive, less expensive API for >>> managing processes would be nice. But I also think that this patch >>> (using the directory fd and ioctl) is better from a security >>> perspective than using a new file in /proc. >> >> That's an assertion, not an argument. And I'm not opposed to an >> operation on the directory FD, now that it's clear Linus has banned >> "write(2)-as-a-command" APIs. I just insist that we implement the API >> with a system call instead of a less-reliable ioctl due to the >> inherent namespace collision issues in ioctl command names. > > Linus banned it because of bugs iike the ones in the patch. > >> >>> I have an old patch to make proc directory fds pollable: >>> >>> https://lore.kernel.org/patchwork/patch/345098/ >>> >>> That patch plus the one in this thread might make a nice addition to >>> the kernel even if we expect something much better to come along >>> later. >> >> I've always commented on that patch. You never addressed my technical >> objections. Why are you bringing up this patch again as if that >> discussion had never happened? To review, that patch has various race >> conditions > > I don't think I ever saw that review. > >> and even if it were technically correct, it'd be an abuse >> of directory objects (in what other circumstance do we poll >> directories?) and not logically generalizable to a model in which we >> expose process exit status via the exit-monitoring API. > > I agree it's weird. It might be better to have /proc/PID/exit_status > and make *that* pollable. > If there is a new exit_status file, it could even be more than 8 bits of exit status: See https://lore.kernel.org/lkml/alpine.LSU.2.20.1507091257010.9602@nerf40.vanv.qr/T/#u and http://austingroupbugs.net/view.php?id=594#c1317 -- ~Randy