Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp2370539pxm; Fri, 25 Feb 2022 00:08:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJz6sRoRAmNKp+zw5+NDMICgUDWaaRkgqoRTxVSFRNKt0Ro/FoU+9IKLho/DmO160cU9evYI X-Received: by 2002:a17:90b:1a81:b0:1bc:c3e5:27b2 with SMTP id ng1-20020a17090b1a8100b001bcc3e527b2mr2104105pjb.20.1645776520325; Fri, 25 Feb 2022 00:08:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645776520; cv=none; d=google.com; s=arc-20160816; b=h01B0y9kn0NEJmk16ckkW0MgjZHJKnDzYT4N1HAbVvIF4Tn9kFQu34HJwKY/qdTHwS I55ziir7BI993wu6XwRaXdOj/ha33r84+WD7FtZ7lFLkXrx3EUVBGxfrkBDN7cgutr7P DLuPCdQ8FkDwCVX4qebllEGBgK9dUOKBTlD+dlwgNCZFQLLhojI5Ne46SBnprJzcPJsJ dg1mAYcZc3LRqtvS84gVUhhNy1Ns/UsBSdVRfYeiy7D/o83xAgSI9HpX9u9mk4bO+4lz ePd4dRb6ixfG+qqA3HXsEoxuzB5uNhNbA42WSdarsSWleZwm41h7adjzT83Mz134ZR2F w5kQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=CauoURgUZ4v50QCANyExBUMWNUuGIGlFYqjgg6YLGL0=; b=HraisxMlWVlhIZot5wnkpOdr8jdSthH9XPIl8ZXGtlgGtUMtGAhkY8FPzfHhqJSH1B m0ovgC6YN3MmGrEHSV+flJsQI1te5usICy43WijsmG6qEEpxTyikzJdDm6ADmjeYxJ8+ xQxwnynOIlTKeZLVSjHKX89WOZXmMF8r/fwiSY0p5IHiuR7boQOPvn2DGWZQU85HS+7Q /z5Qa4vt9zul0u6Z7a2enDmC0/06ooPZLYVqbjWYt3o3k2jemffIL+rs0hjr3EzrYCSg x42g08HthIZKzSoN81Z8bWRUQgLyHJxRjQYG5le+hsH3xxjmrR3pE1dp7IV6cSczq0lN YZIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=FCDgNJCd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z1-20020a630a41000000b0036508fa5166si1284012pgk.14.2022.02.25.00.08.25; Fri, 25 Feb 2022 00:08:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=FCDgNJCd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236460AbiBYC7M (ORCPT + 99 others); Thu, 24 Feb 2022 21:59:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44676 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233093AbiBYC7K (ORCPT ); Thu, 24 Feb 2022 21:59:10 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id EF6441EC255 for ; Thu, 24 Feb 2022 18:58:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645757918; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=CauoURgUZ4v50QCANyExBUMWNUuGIGlFYqjgg6YLGL0=; b=FCDgNJCd/rG0tQzOcYySSapjWxF3ydBGnQB5bUSbCU7GAzInT25SFDBdwtzPakPKktCLcE NNlRmvtZIL+xUrHpD+wKUB03q0fauSgBxwDFZuZX34feRvCI9LFr0GdsStGY0kgQjcM64u YPurK4obn7lq4vmIQPLKnzFVJ4UShQY= Received: from mail-pg1-f198.google.com (mail-pg1-f198.google.com [209.85.215.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-342-5KJyPtwnPpq2tbcYy7-Ibw-1; Thu, 24 Feb 2022 21:58:37 -0500 X-MC-Unique: 5KJyPtwnPpq2tbcYy7-Ibw-1 Received: by mail-pg1-f198.google.com with SMTP id u74-20020a63794d000000b00373efe2ac5aso1953712pgc.14 for ; Thu, 24 Feb 2022 18:58:37 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=CauoURgUZ4v50QCANyExBUMWNUuGIGlFYqjgg6YLGL0=; b=G1NjSI1uWc8fXkp0/p4ngxGVt9b38h5C7TWM7KuqD2mhNVsCaMUujPgoQS+wJ45sTo +TuK+hAfO9eMdILhIfTtpbJL/ta5qmdpzCOmdHhXcetbVthHIh1KjHC6uShn9ptqmkzs YfWjLO2ppAbEHKG1lldx3m8R8HiBsG2wh8XMubjFaj/DcvyWdpGZTz0ni14E2D/nzcUs FhgR5M/e/P2GVI+RwnIMX9pqPQ5+OlYRKncVPEyvm/8VoUcb6mswDmciJvhAx9SpbMNJ 0CU8yqcenZY9nuU9rLJTPL7m7VXF8ap673o4SZv/v3UElPvgA7uiltvHNAqPUxOxMgeR aN9Q== X-Gm-Message-State: AOAM533aTgAk0D5IXZXo3A98ZGLYxpkudoJ0nDnZzkIlocMa85mu/yEN 0r+7bJBmph9rUiCB/egfLVvF592oyPYO+I2wNDmitGVMb7DP2s6jPw0r0+pJTV6ERvUymIX1qKI cSJTj0qEdanmVuRuGvHpQxNz0 X-Received: by 2002:a17:903:244a:b0:150:25d1:d2ff with SMTP id l10-20020a170903244a00b0015025d1d2ffmr1997046pls.70.1645757916653; Thu, 24 Feb 2022 18:58:36 -0800 (PST) X-Received: by 2002:a17:903:244a:b0:150:25d1:d2ff with SMTP id l10-20020a170903244a00b0015025d1d2ffmr1997024pls.70.1645757916338; Thu, 24 Feb 2022 18:58:36 -0800 (PST) Received: from xz-m1.local ([94.177.118.52]) by smtp.gmail.com with ESMTPSA id z5-20020a056a00240500b004e15d39f15fsm891513pfh.83.2022.02.24.18.58.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Feb 2022 18:58:35 -0800 (PST) Date: Fri, 25 Feb 2022 10:58:26 +0800 From: Peter Xu To: Casey Schaufler , Axel Rasmussen Cc: Axel Rasmussen , Andrea Arcangeli , Alexander Viro , Serge Hallyn , Paul Moore , Stephen Smalley , Eric Paris , Ondrej Mosnacek , "David S . Miller" , Jeremy Kerr , linux-fsdevel@vger.kernel.org, LKML , linux-security-module@vger.kernel.org, selinux@vger.kernel.org, Suren Baghdasaryan , Lokesh Gidra Subject: Re: [PATCH] userfaultfd, capability: introduce CAP_USERFAULTFD Message-ID: References: <20220224181953.1030665-1-axelrasmussen@google.com> <0f74f1e4-6374-0e00-c5cb-04eba37e4ee3@schaufler-ca.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <0f74f1e4-6374-0e00-c5cb-04eba37e4ee3@schaufler-ca.com> X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 24, 2022 at 04:39:44PM -0800, Casey Schaufler wrote: > What I'd want to see is multiple users where the use of CAP_USERFAULTD > is independent of the use of CAP_SYS_PTRACE. That is, the programs would > never require CAP_SYS_PTRACE. There should be demonstrated real value. > Not just that a compromised program with CAP_SYS_PTRACE can do bad things, > but that the programs with CAP_USERFAULTDD are somehow susceptible to > being exploited to doing those bad things. Hypothetical users are just > that, and often don't materialize. I kind of have the same question indeed.. The use case we're talking about is VM migration, and the in-question subject is literally the migration process or thread. Isn't that a trusted piece of software already? Then the question is why the extra capability (in CAP_PTRACE but not in CAP_UFFD) could bring much risk to the system. Axel, did I miss something important? Thanks, -- Peter Xu