Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp1006103imd; Thu, 1 Nov 2018 08:51:23 -0700 (PDT) X-Google-Smtp-Source: AJdET5fbw5LO4Jyuflu3patv6Wp6Xf4HiMN7jCNvA910ZOvKUdrJS2SSRFS2tw1sEt5Rk8K5A7kL X-Received: by 2002:a63:6dc8:: with SMTP id i191mr7367896pgc.215.1541087483770; Thu, 01 Nov 2018 08:51:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541087483; cv=none; d=google.com; s=arc-20160816; b=wSEenYGztBEyOd5eAvLhxAgM48wT1QouH6jo405g9lfWB5Yfhtw9jRe0QEBvLjM+/o SM55mkhtQgFJhghHwO2zlMqmm9nFkRX1WeL67qF4cOUMs0UANFl3aZAr0YFqHyjQDmoR 0KB3CVrh8ogW/9I32TUzL8s83huOcPvS9LXMfRyXOosavrCyX+WQWKWIKXZhIhliSKyK GDQPTQs+4pF7B5EYpY6TejjRBkuV8jP2+5VRIE25R/tL5al15XdDE7HR6NLtIOKC1/Cq MKHFNZ7irsSSCnGxZW/+ZkLQLvPmqUjGSWcp6xTVO2JJspYJvazCmfKixaiVkg/Fkuct zVjA== 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 :references:in-reply-to:mime-version:dkim-signature; bh=InpizKkZGP6vpOoWAuZYCvEQx7tLohXSb/i5fUYeT8A=; b=NGRhWUiV4rIL4koJCeE2+ooUffr7uiyYP67W6mFcH9TV4jL+TWRHkm0owppeiFvFq4 1yma0k+gZHjtzzESeN02Qme8zanwKnOodGYkuq95AEAGajpV/5bLGk5SVrbcChVd140m kSaOLA/+LDZdkpq4rKLDY4yFCi9kcuMsufNyt+RI+zqv/gdYKs9wEGHgYADf61YDn/4o tila3wu0an8+rVxHuehBl9YC/1/TfteLrJ1d62aXNffyRPsbvsEQ+El/Og762V01n/vs hodpyXZ/PjBdMYbiWj7f+vhkDdoTp1hgdNqNF09Jc0Sq7fkAA6aTS9dLWLh0PLqhwGbZ lxKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="c8/xKqj0"; 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 g12-v6si30153076pfi.184.2018.11.01.08.51.08; Thu, 01 Nov 2018 08:51:23 -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=@google.com header.s=20161025 header.b="c8/xKqj0"; 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 S1729059AbeKBAxy (ORCPT + 99 others); Thu, 1 Nov 2018 20:53:54 -0400 Received: from mail-vs1-f68.google.com ([209.85.217.68]:44652 "EHLO mail-vs1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727950AbeKBAxy (ORCPT ); Thu, 1 Nov 2018 20:53:54 -0400 Received: by mail-vs1-f68.google.com with SMTP id w194so12432440vsc.11 for ; Thu, 01 Nov 2018 08:50:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=InpizKkZGP6vpOoWAuZYCvEQx7tLohXSb/i5fUYeT8A=; b=c8/xKqj0IH+gqrGb5hwwbG04KG7FMeara3baRwSNywrFrOY82ho5PXUIYUuQLHWlGm FSBVTmIZvnsjPi0RHlpboSXgDlnpP4gJqbaxm9KLTFG9RiwjN+oA2/i+1eqMcZVWalRq Gdaapl6zeBfXf4aoNZKPsXsqFq3zadTyxW6e/hyiRG/GCbOXWwN5nV+tDl7TAbFbpmQe 07W7HgEOzE0x5ezXpkiQ8sgqYfH7S4fJrVn+C1h6CWDI3wQEzY2LiCUHgcC+HfihDJkz EnwxHf3SkUf9rOiEPaPT/dwKyUrkFBQAyrqK2csMboNas0/msXfdQBfzytPzwTGGFPHm TAXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=InpizKkZGP6vpOoWAuZYCvEQx7tLohXSb/i5fUYeT8A=; b=ieQymcY05QGILnNAtqNUtuceSEi11a9q4Uoxpf5/dqLFbkadESml6UHyCidvc3iC1a E1U88k54T/QsckpmWTfavgpwWaPdFNgFjAfTP5PCGLSod0rBbHHSclk+sDgbhkvWnmdu BhXoEkaS2f9nOWtaglCu4a2GimPWYvpzeCH4SJlbIOkl+k8acUcs/crvbfxb8C6uJWrM QhBiE2IHE2V3kez1nzJpFcS0o/uUwV2MT+v29n7oU0AFx81eKnf5TZf8KrwZrb5l2kN0 ouD9uBhcx7r8TEWKdOyx1IwYH+9M2s8TXIecC2yt33KfIHCFo0eX4Rcb/VmMn47YjIFQ fQYg== X-Gm-Message-State: AGRZ1gK+JxtEtWXNvfB23schzklC/+wvOH7v1rBu633AVjO6PkjZmq3J 4DTkryim6FTpgnadDnpQKHZFppllddp0Kcgqln7K2g== X-Received: by 2002:a67:105:: with SMTP id 5mr3359275vsb.183.1541087421797; Thu, 01 Nov 2018 08:50:21 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a67:f48d:0:0:0:0:0 with HTTP; Thu, 1 Nov 2018 08:50:20 -0700 (PDT) In-Reply-To: <061df748f65d41b5bbd4749074dbce29@AcuMS.aculab.com> References: <20181029221037.87724-1-dancol@google.com> <87bm7a3et9.fsf@xmission.com> <20181031124435.GA9007@redhat.com> <061df748f65d41b5bbd4749074dbce29@AcuMS.aculab.com> From: Daniel Colascione Date: Thu, 1 Nov 2018 15:50:20 +0000 Message-ID: Subject: Re: [RFC PATCH] Implement /proc/pid/kill To: David Laight Cc: Oleg Nesterov , "Eric W. Biederman" , linux-kernel , Tim Murray , Joel Fernandes , Suren Baghdasaryan , Kees Cook , Christian Brauner 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, Nov 1, 2018 at 11:53 AM, David Laight wrote: > From: Sent: 31 October 2018 13:28 > ... >> * I actually have a local variant of the patch that would have you >> open "/proc/$PID/kill/$SIGNO" instead, since different signal numbers >> have different permission checks. > > I think you'd need the open() to specify some specific unusual > open modes. > Otherwise it'll be far too easy for scripts (and people) to > accidentally send every signal to every process. I think the /proc/$PID/kill/$SIGNO idea is dead anyway, and even dead-er since Linus banned write() for commands. (Looks like we'll need a system call after all.) That said, for the record, I was talking about the *write* sending the signal, not the open, so grep of /proc wouldn't send random signals to every process. > Also think of the memory footprint. Proc inodes are created on-demand, so AIUI, the memory overhead of heaving a per-FD directory of stuff isn't very high.