Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4383176ybl; Mon, 13 Jan 2020 12:43:52 -0800 (PST) X-Google-Smtp-Source: APXvYqwdspmuBeVNUekZRhL4JEdUlXjKxatxf9N/Td8kYYgQ9HKlVKUi8otR0QIXtILjAMVzENfl X-Received: by 2002:a54:468b:: with SMTP id k11mr13500778oic.134.1578948232659; Mon, 13 Jan 2020 12:43:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578948232; cv=none; d=google.com; s=arc-20160816; b=VB6sSpieGZIheUyLH+S8i5pjjX/cKocVQt5wJTHOp9PXqB9mKYwlo8Bl0KVTuhAhJu 5juPiFZO7QuWUZi8sRnCLDzGZmSihW/TcLQsMICYyW8Wku+/qTSIX/x1+YcCllkmQdyF hERNLtot+NO5pL0XAKGkmg+rHK6JmUfHxD6qlkBD8Y1xosvzPGDvCHqX2Y4yHK/FjOqX 8ovMrtEfLXfds4UVdmm9z3mBBjSxL5i2PaIMOr9HeDnSuoVEJtDEq4e7sYYCUYZacrfq ZU1IPC7yDeMrfBN15UfUvkKYJ1xArX0NsoQGEYEVwqbX/tcyTaYswed/z2oEQduGIVbs Er/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=lB4mD1Q4vmjrsip0/VaDwRICbEeOFrQosH7OdBS9FLw=; b=myjbAAfcYCxz+vLyqCoKAFQ4eSlG+PxMF7iaG6nDiR9qSJcQRHa9yKb83PzxmfEnpr p97RTxNG0eLSNwQz9bK7XpKw3mXWr79yp42AdDhV4pb7co0C6AGyj5Gc6sBviL2odbtC shfNOZ2Ji4coFhjwmNb8Bbzp1FLTyWQq4mPKlqxxW/fR0MfepNQDX6PlOYrm0CWNfS64 5e2ccU1xhnHueGbrMexbEcW4uYUGetxUsB/JgCpUyeRoQxDeDLjQlFHgT6ZqgTzUhO0/ 9b09vmNojnzlatS6p6E6GYxvnhQcBFYYlcL5m2SUCvyOoVyXSv29/B3HnOwhS/YZ8b6c fptQ== 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 z62si6342005oiz.271.2020.01.13.12.43.40; Mon, 13 Jan 2020 12:43:52 -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 S1728516AbgAMUmo (ORCPT + 99 others); Mon, 13 Jan 2020 15:42:44 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:52283 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726086AbgAMUmo (ORCPT ); Mon, 13 Jan 2020 15:42:44 -0500 Received: from ip5f5bd663.dynamic.kabel-deutschland.de ([95.91.214.99] helo=wittgenstein) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1ir6Xm-0004SH-UB; Mon, 13 Jan 2020 20:42:39 +0000 Date: Mon, 13 Jan 2020 21:42:37 +0100 From: Christian Brauner To: Daniel Colascione Cc: Minchan Kim , Kirill Tkhai , Michal Hocko , Andrew Morton , LKML , linux-mm , Linux API , oleksandr@redhat.com, Suren Baghdasaryan , Tim Murray , Sandeep Patil , Sonny Rao , Brian Geffon , Johannes Weiner , Shakeel Butt , John Dias Subject: Re: [PATCH 2/4] mm: introduce external memory hinting API Message-ID: <20200113204237.ew6nn4ohxu7auw3u@wittgenstein> References: <20200110213433.94739-1-minchan@kernel.org> <20200110213433.94739-3-minchan@kernel.org> <56ea0927-ad2e-3fbd-3366-3813330f6cec@virtuozzo.com> <20200113104256.5ujbplyec2sk4onn@wittgenstein> <20200113184408.GD110363@google.com> <20200113191046.2tidyvc544zvchek@wittgenstein> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 13, 2020 at 11:27:03AM -0800, Daniel Colascione wrote: > On Mon, Jan 13, 2020 at 11:10 AM Christian Brauner > wrote: > > This does not > > affect the permission checking you're performing here. > > Pidfds-as-capabilities sounds like a good change. Can you clarify what > you mean here though? Do you mean that in order to perform some > process-directed operation X on process Y, the pidfd passed to X must > have been opened with PIDFD_CAP_X *and* the process *using* the pidfds > must be able to perform operation X on process Y? Or do pidfds in this > model "carry" permissions in the same way that an ordinary file > descriptor "carries" the ability to write to a file if it was opened > with O_WRONLY even if the FD is passed to a process that couldn't > otherwise write to that file? Right now, pidfds are identity-only and > always rely on the caller's permissions. I like the capability bit > model because it makes pidfds more consistent with other file > descriptors and enabled delegation of capabilities across the system. I'm going back and forth on this. My initial implementation has it that you'd need both, PIDFD_FLAG/CAP_X and the process using the pidfd must be able to perform the operation X on process Y. The alternative becomes tricky for e.g. anything that requires ptrace_may_access() permissions such as getting an fd out from another task based on its pidfd and so on. Christian