Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 07393C54EAA for ; Tue, 24 Jan 2023 17:27:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234079AbjAXR1B (ORCPT ); Tue, 24 Jan 2023 12:27:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58844 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233663AbjAXR07 (ORCPT ); Tue, 24 Jan 2023 12:26:59 -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 ESMTPS id 79FC54C6C0 for ; Tue, 24 Jan 2023 09:26:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1674581173; 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=x1//lKxOSoW8HByrjyrd9SNUigcEe/d5fAJWdteeAwY=; b=eA4CPmdYLdBkEdb03f5ztZPN2GoIevibFfTKykADN+rSdyfzZPZoEt9Vd/WSUajFVoRhjt Q7GCulxG8Xw5H4cd883tZGKQmZWncQuHjs/16xl5XbPKMSylU0xu6Odpb+hDwmLx59SHn4 1Gq6nj7fp3zwUN2bmbjrrw4T8HmF0Xo= Received: from mail-yb1-f197.google.com (mail-yb1-f197.google.com [209.85.219.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-558-lMNhCXBVN5GZ-dgsFJHgEQ-1; Tue, 24 Jan 2023 12:26:12 -0500 X-MC-Unique: lMNhCXBVN5GZ-dgsFJHgEQ-1 Received: by mail-yb1-f197.google.com with SMTP id k15-20020a5b0a0f000000b007eba3f8e3baso16821870ybq.4 for ; Tue, 24 Jan 2023 09:26:12 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=x1//lKxOSoW8HByrjyrd9SNUigcEe/d5fAJWdteeAwY=; b=C+Tz8By/kDK+I1Sr4tg33u7wSrZw5xIvSlPyYEn+/K/wK4o0EhJlFAuaeZYo1m2gxO 4VN9JXPxUGF7zhbZKLc17nSfrablZ1mNQanVQ6vQfZk3Nx/S5nwO+wdYW+OvAc0cAFCk rNjDEAJbmMH/HsAyfmklG4KYFAUHfz4+Gqkn6v1UfFHuTfNhaimz+Hw8OQN05Q5cCe+W awftDqYpuW6J1xaJD2tDOLh3sOTZoAm6TByNJetE6glT2adruCltnEDUj2V1rge+GLg9 7HZHQMNCj/EOklkEvJzYxcY4gJkdpYLX+5yKQmUV0/qW+gOBlyuyV6vvk+57PBeREYAv Oksg== X-Gm-Message-State: AFqh2krQqc7KPu7pp//ScvVUfn0j8HZyIlHtR44Mb8nSKyx1zw+lqzLs nCIcYmtnLaD93ORY+KMu4pwKLeh5d/0G4GsBlqPrWmNAggIZtAD/z0s7TCSxpPR820bOc5Zti5a RSSYaPU4t9Hpa0wt/9D6DPR4G X-Received: by 2002:a81:8187:0:b0:466:b529:e379 with SMTP id r129-20020a818187000000b00466b529e379mr20203136ywf.27.1674581171811; Tue, 24 Jan 2023 09:26:11 -0800 (PST) X-Google-Smtp-Source: AMrXdXuntBE/q4AbbQoO+OesA9EZ1i3Bp0xsn0vakOkRw+wyHlq3Frgixzl4rdgMcorwGfrkChzC1w== X-Received: by 2002:a81:8187:0:b0:466:b529:e379 with SMTP id r129-20020a818187000000b00466b529e379mr20203110ywf.27.1674581171581; Tue, 24 Jan 2023 09:26:11 -0800 (PST) Received: from x1n (bras-base-aurron9127w-grc-56-70-30-145-63.dsl.bell.ca. [70.30.145.63]) by smtp.gmail.com with ESMTPSA id n22-20020a05620a223600b006fa22f0494bsm1736320qkh.117.2023.01.24.09.26.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Jan 2023 09:26:10 -0800 (PST) Date: Tue, 24 Jan 2023 12:26:08 -0500 From: Peter Xu To: Muhammad Usama Anjum Cc: David Hildenbrand , Andrew Morton , =?utf-8?B?TWljaGHFgiBNaXJvc8WCYXc=?= , Andrei Vagin , Danylo Mocherniuk , Paul Gofman , Cyrill Gorcunov , Alexander Viro , Shuah Khan , Christian Brauner , Yang Shi , Vlastimil Babka , "Liam R . Howlett" , Yun Zhou , Suren Baghdasaryan , Alex Sierra , Matthew Wilcox , Pasha Tatashin , Mike Rapoport , Nadav Amit , Axel Rasmussen , "Gustavo A . R . Silva" , Dan Williams , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, Greg KH , kernel@collabora.com Subject: Re: [PATCH v7 1/4] userfaultfd: Add UFFD WP Async support Message-ID: References: <20230109064519.3555250-1-usama.anjum@collabora.com> <20230109064519.3555250-2-usama.anjum@collabora.com> <0bed5911-48b9-0cc2-dfcf-d3bc3b0e8388@collabora.com> <328f54c1-171f-22a1-10c9-8b7a25bd8027@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <328f54c1-171f-22a1-10c9-8b7a25bd8027@collabora.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 23, 2023 at 03:11:20PM +0500, Muhammad Usama Anjum wrote: > > One thing worth mention is, I think for async wp it doesn't need to be > > restricted by UFFD_USER_MODE_ONLY, because comparing to the sync messages > > it has no risk of being utilized for malicious purposes. > I think with updated handling path updated in do_wp_page() and > wp_huge_pmd() in version, UFFD_USER_MODE_ONLY will not affect us. This is more or less a comment for the design, the new code should work (by bypassing handle_userfaultfd(), where this bit was checked). We'll need an man page update if this feature will be merged [1], and if so it'll need to be updated for the UFFD_USER_MODE_ONLY section regarding to async uffd-wp support too. I think that can also be worked out after the series being accepted first, so just a heads up. [1] https://git.kernel.org/pub/scm/docs/man-pages/man-pages.git -- Peter Xu