Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp3786913pxb; Mon, 27 Sep 2021 02:31:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJznnvRJ0m8eqGR2EpjE3/KLsfcctB8/VKQG6OKn/iPH/AHAW2z8RiueUpsRe1j/gYCLNPuh X-Received: by 2002:a17:90a:2f24:: with SMTP id s33mr18296524pjd.132.1632735068446; Mon, 27 Sep 2021 02:31:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632735068; cv=none; d=google.com; s=arc-20160816; b=OEbIMhOrSmvpWmKKBBTYm1bgBTXLVYeN/xx2syHrn4f0QhDOszPaUoUEXbCjqPcCwP wwkArUZSSphCnCKCyQGZOjT0n3kaI3hi7LrRSexRCvqxaEK9SA+vMPdTW3praFyahxss daAsSHELv1PedZ4cR3qg9+5O+5RROqSBkQ8VBTHFB320/cVFMg44t7607zmEj5ykQJ5K d5xr8F8jztGk01Y1D6v08N9g1ZOrtxyOKSYf4yOH5FY6cG36nx/ZsY4JvAZoIGfpaylx fGBmQerf0yNnshW0p3OQAyEb1wW/Fgn5wzrfvOUyxxdprf9WK6el8/T8xr8GlRBX0hok CgIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:organization :from:references:cc:to:subject:dkim-signature; bh=XWU6LItq51baPXVuLDc5jK1prHfIfkcvrhdiTiZxj7o=; b=Smy7yMTMK7Kd0pftqkwN1qZKh14ShNGBr5OJLZokZ1oH5lQwPgBdgv3XCUCx8ZPWmc IKnpqf1vcAZ4HMOGVEr52xBL4hgE+R4pv/WoMJ74x50IemuFEfBUlvx9KlAlmo5HpOeV 73QjkKT8eR5K/2jmQmf1V07QXz2dDcrLFCLCoBKJ+kWY+MPeIpsLBFyigggAKjLX6cLk aLtzHqxMXGXp/+YpEzr3fgf+xMBNv/drsXu2JCUBqNe8Si0sS94giLaiTxbXf3VHIkr1 7TQB4MseEA5y+YMrblsh2fqQsVuKLXp8IiO6tvBlp+jFWfgD44yz7B7GI5+pZF0Al+Ii 54ug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=P5AAElLO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o22si20086937pfu.175.2021.09.27.02.30.55; Mon, 27 Sep 2021 02:31:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=P5AAElLO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S233681AbhI0Jbl (ORCPT + 99 others); Mon, 27 Sep 2021 05:31:41 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:46705 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233587AbhI0Jbk (ORCPT ); Mon, 27 Sep 2021 05:31:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1632735002; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XWU6LItq51baPXVuLDc5jK1prHfIfkcvrhdiTiZxj7o=; b=P5AAElLOkr0l5OCmYo9PNeAizRa8p0YkXjZ+WnLcsSFKzwExQUH2TtTobYbsa7tJfNW+05 X1QanW23AJnvnJwJs70WuSTqAv7tCqDJXN+11KntnKYDVJcoWv40IWdcQC+rZNhDFO9X7F v3pUsQnNyi1UPtfh2c9CnxDFgLfBWDw= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-400-kw0kEm4kPJGailDJ1ygnjA-1; Mon, 27 Sep 2021 05:30:01 -0400 X-MC-Unique: kw0kEm4kPJGailDJ1ygnjA-1 Received: by mail-wr1-f72.google.com with SMTP id l9-20020adfc789000000b00160111fd4e8so13790025wrg.17 for ; Mon, 27 Sep 2021 02:30:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=XWU6LItq51baPXVuLDc5jK1prHfIfkcvrhdiTiZxj7o=; b=RJtcCMlDyAn3CBL2OOySOgDLPivFxa/hZg2LPfKKSpJTI8ASn8Pgrq0XU/6o6IdOIU GssVyLMAwOMjJBQkDFhbFkZcJXfmf/o6/T8YIic18YGItWWuTm4tJraqfX77Rb1H5urp 0t2I84f/KVc0VIF/AWI6dXbiq4ldMcpdbEMx8faHhwugh0uIRq6aS8k8dDR2tpS/JCvt taLLWC5tkt8Og1nWrkJr/nxNWLLLeeptRDmpQAFHXxmlGTHq6CezJ5CnayfgEvp6cdLZ Oi5pTyBAzC/7+//68ubl5uSdYt6tLExXHubPdGR4YZzu0g23VNU4qwuDrCm2AnXwvpi7 OIEQ== X-Gm-Message-State: AOAM532TzAgVG2rGR3j7xmH7WwTMd/EQPh3Wh8M73CC9HKnNOBb+e3/h tL101HyN70Ctt8TaTIJgUqosy1eAr01eEvfnLZ2RP7fZDYakq+5I3MJjZ5v6PkfxssKXLYSeV6c svLSP5Qd+JHb0Lcmpg3WK6dml X-Received: by 2002:a1c:770d:: with SMTP id t13mr14635415wmi.77.1632735000384; Mon, 27 Sep 2021 02:30:00 -0700 (PDT) X-Received: by 2002:a1c:770d:: with SMTP id t13mr14635402wmi.77.1632735000231; Mon, 27 Sep 2021 02:30:00 -0700 (PDT) Received: from [192.168.3.132] (p5b0c654d.dip0.t-ipconnect.de. [91.12.101.77]) by smtp.gmail.com with ESMTPSA id k26sm12161337wms.39.2021.09.27.02.29.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 27 Sep 2021 02:29:59 -0700 (PDT) Subject: Re: [RFC PATCH] userfaultfd: support control over mm of remote PIDs To: Nadav Amit , Andrew Morton Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Nadav Amit , Andrea Arcangeli , Mike Rapoport , Peter Xu References: <20210926170637.245699-1-namit@vmware.com> From: David Hildenbrand Organization: Red Hat Message-ID: <83827672-0996-4c25-9991-697ad443b6b3@redhat.com> Date: Mon, 27 Sep 2021 11:29:59 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210926170637.245699-1-namit@vmware.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 26.09.21 19:06, Nadav Amit wrote: > From: Nadav Amit > > Non-cooperative mode is useful but only for forked processes. > Userfaultfd can be useful to monitor, debug and manage memory of remote > processes. > > To support this mode, add a new flag, UFFD_REMOTE_PID, and an optional > second argument to the userfaultfd syscall. When the flag is set, the > second argument is assumed to be the PID of the process that is to be > monitored. Otherwise the flag is ignored. > > The syscall enforces that the caller has CAP_SYS_PTRACE to prevent > misuse of this feature. What supposed to happen if the target process intents to use uffd itself? -- Thanks, David / dhildenb