From patchwork Mon Oct 24 19:33:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Xu X-Patchwork-Id: 13018050 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2CF47FA373F for ; Mon, 24 Oct 2022 19:33:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7AD1194000A; Mon, 24 Oct 2022 15:33:43 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 75D9C940007; Mon, 24 Oct 2022 15:33:43 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5621594000A; Mon, 24 Oct 2022 15:33:43 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 45404940007 for ; Mon, 24 Oct 2022 15:33:43 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 13E9740607 for ; Mon, 24 Oct 2022 19:33:43 +0000 (UTC) X-FDA: 80056842726.24.4C6D654 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf02.hostedemail.com (Postfix) with ESMTP id A8CBA80004 for ; Mon, 24 Oct 2022 19:33:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1666640022; 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=sZ8v+EwY2bNX8aSl1hAi5ZLb9PPb9KwOp7fvuUkZC2g=; b=Yf1vVdEDmiwLON8NcTd8HrxG+ZU020mTcoAMgcjzNFp8YPdjWXckcTnQTJYWmLQZIqFYrX XfJ+W568s3Lk2HdWyMZU2KwWTht0DSr7lMMxKH4UKAJXVHyl/9gtCQo9y+Dbbvp3BZRHQW mZAHDsaovXAXLmMU3zML4MYARdpFIX0= Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-183-vytJy8u-OqqbVhO2cYyY7A-1; Mon, 24 Oct 2022 15:33:41 -0400 X-MC-Unique: vytJy8u-OqqbVhO2cYyY7A-1 Received: by mail-qk1-f197.google.com with SMTP id h9-20020a05620a244900b006ee944ec451so9770996qkn.13 for ; Mon, 24 Oct 2022 12:33:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sZ8v+EwY2bNX8aSl1hAi5ZLb9PPb9KwOp7fvuUkZC2g=; b=MCnTQmp6bVW5QGBUA6xeDEaIti3r6Eixe/PK3458E6d4dwPQ8quTUA5/Y8SNOj6J9I vHTNPVV3TPZdyUtDnll/XSC/DzUbFTBRvCqx6h/VBGKvM+QvELTlIg2VS86P3q3GN1nw Qt4omkf9npD4mnlUQ7zVPkaWMcT2btj+Pam6nOsEjHJIK3iuUZiiGXuwvmW2OTON+wsr NEEmG+z67TYj6j1VF+vJB7p4E/Gewpkf5rXV2tA8RjoUkmlCDixJ+aoyZXpX50dVbrHS qdybb/qnMOQHS1scevENurFuZUyeW9zO/GI2gtB9KdBQoMNluX9bhD3pMgDrntqsnnob zxAA== X-Gm-Message-State: ACrzQf33wK9kb7G6X27HZhI0wlfe4cgxcuXX3XwCJvc4oj8AV4AXC6vK xici+BexOO7GGUNgpUVqU5xWQdXl2zYLQc5kyBUNZq3+dT3IoQLdkcdf0giKBzz99u7st95Qs5i TM+Kq8+EeWPdUlJRE7ds2fYGIDa9/tHQs5sS/1VErcPsmxe0QsWopaxQ8fGQh X-Received: by 2002:ac8:5dd3:0:b0:39d:1847:872a with SMTP id e19-20020ac85dd3000000b0039d1847872amr18544514qtx.645.1666640020436; Mon, 24 Oct 2022 12:33:40 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6yZixs/k9ipGQk+YxOWJ1akEpX25bTl/zf3AiVYxllzKHCwgi54KXtb6GwKtr88nUataLr5Q== X-Received: by 2002:ac8:5dd3:0:b0:39d:1847:872a with SMTP id e19-20020ac85dd3000000b0039d1847872amr18544482qtx.645.1666640020135; Mon, 24 Oct 2022 12:33:40 -0700 (PDT) Received: from x1n.redhat.com (bras-base-aurron9127w-grc-46-70-31-27-79.dsl.bell.ca. [70.31.27.79]) by smtp.gmail.com with ESMTPSA id t15-20020a05620a450f00b006cddf59a600sm545164qkp.34.2022.10.24.12.33.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Oct 2022 12:33:39 -0700 (PDT) From: Peter Xu To: linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: Axel Rasmussen , peterx@redhat.com, Andrew Morton , Andrea Arcangeli , Nadav Amit Subject: [PATCH 1/2] mm/uffd: Fix vma check on userfault for wp Date: Mon, 24 Oct 2022 15:33:35 -0400 Message-Id: <20221024193336.1233616-2-peterx@redhat.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221024193336.1233616-1-peterx@redhat.com> References: <20221024193336.1233616-1-peterx@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-type: text/plain ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1666640022; a=rsa-sha256; cv=none; b=aXWSlMDj1qhwFVobM5jDn5R45qP3ZifWsW6OQ1O+PRd41UXcMpb8CFhJs5+GCe37BjVl03 xbB+1uBwtobGjVN2bJSc7t2v+YUnXlBywDaRJZvcw9/gpVGjxKN/F5lAp28+nXqbynKG80 mD9GZSlB815U7EO1eO+gTllPbrrMku4= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Yf1vVdED; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf02.hostedemail.com: domain of peterx@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=peterx@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1666640022; h=from:from:sender: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:dkim-signature; bh=sZ8v+EwY2bNX8aSl1hAi5ZLb9PPb9KwOp7fvuUkZC2g=; b=NZmiXfV31/nZXMlPlFPKSX+/YnTsHfI3lIFJuoNpbnCMcWOK0f3lJ8Qn2/fgCnE28oyyoD ewwfsdh+45dtkuUoL5sZKVhFPnRUBL5i78DR8GSvlQQXP8YZyByElkjLq+q473U2Ip8khZ 3LQCfqD45RZt6F1q+9Jh+rCRoCOzJtc= X-Rspamd-Queue-Id: A8CBA80004 Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Yf1vVdED; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf02.hostedemail.com: domain of peterx@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=peterx@redhat.com X-Rspamd-Server: rspam12 X-Rspam-User: X-Stat-Signature: p91ondnx955bnun1j77a3sgzhrb69u5s X-HE-Tag: 1666640022-340021 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: We used to have a report that pte-marker code can be reached even when uffd-wp is not compiled in for file memories, here: https://lore.kernel.org/all/YzeR+R6b4bwBlBHh@x1n/T/#u I just got time to revisit this and found that the root cause is we simply messed up with the vma check, so that for !PTE_MARKER_UFFD_WP system, we will allow UFFDIO_REGISTER of MINOR & WP upon shmem as the check was wrong: if (vm_flags & VM_UFFD_MINOR) return is_vm_hugetlb_page(vma) || vma_is_shmem(vma); Where we'll allow anything to pass on shmem as long as minor mode is requested. Axel did it right when introducing minor mode but I messed it up in b1f9e876862d when moving code around. Fix it. Cc: Axel Rasmussen Fixes: b1f9e876862d ("mm/uffd: enable write protection for shmem & hugetlbfs") Signed-off-by: Peter Xu --- include/linux/userfaultfd_k.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/linux/userfaultfd_k.h b/include/linux/userfaultfd_k.h index f07e6998bb68..9df0b9a762cc 100644 --- a/include/linux/userfaultfd_k.h +++ b/include/linux/userfaultfd_k.h @@ -146,9 +146,9 @@ static inline bool userfaultfd_armed(struct vm_area_struct *vma) static inline bool vma_can_userfault(struct vm_area_struct *vma, unsigned long vm_flags) { - if (vm_flags & VM_UFFD_MINOR) - return is_vm_hugetlb_page(vma) || vma_is_shmem(vma); - + if ((vm_flags & VM_UFFD_MINOR) && + (!is_vm_hugetlb_page(vma) && !vma_is_shmem(vma))) + return false; #ifndef CONFIG_PTE_MARKER_UFFD_WP /* * If user requested uffd-wp but not enabled pte markers for From patchwork Mon Oct 24 19:33:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Xu X-Patchwork-Id: 13018051 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 79A45C67871 for ; Mon, 24 Oct 2022 19:33:45 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 16CD294000B; Mon, 24 Oct 2022 15:33:45 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 11D2F940007; Mon, 24 Oct 2022 15:33:45 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EB12694000B; Mon, 24 Oct 2022 15:33:44 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id D44F6940007 for ; Mon, 24 Oct 2022 15:33:44 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id ADCEE80938 for ; Mon, 24 Oct 2022 19:33:44 +0000 (UTC) X-FDA: 80056842768.11.F5A4FA5 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf16.hostedemail.com (Postfix) with ESMTP id 4D5F1180036 for ; Mon, 24 Oct 2022 19:33:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1666640023; 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=B26mrVLxvv94GHZ4EyopRcUEqjnA0ulPrAxRLMb69GQ=; b=RxsECaHEJ7WZkTOUaJPYQPO6uKMoF9WOSzPefR24oyhAePtlfaWm4pCBltJcY3cczinLfx QJb60GYa7OuJx+nxuLiUBFHZSKVN6vwDAscte2JR2lrcoX7pwLo0lRX7c8nMZPe94vfdmS 6Crna7le8j42au2JsQQ13ZvXJty/GS8= Received: from mail-qv1-f70.google.com (mail-qv1-f70.google.com [209.85.219.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-15-yhNCzWMINuaolx5v_ONgnw-1; Mon, 24 Oct 2022 15:33:42 -0400 X-MC-Unique: yhNCzWMINuaolx5v_ONgnw-1 Received: by mail-qv1-f70.google.com with SMTP id mi12-20020a056214558c00b004bb63393567so2423774qvb.21 for ; Mon, 24 Oct 2022 12:33:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=B26mrVLxvv94GHZ4EyopRcUEqjnA0ulPrAxRLMb69GQ=; b=tcEPOzr16A4ajY1I7DnC2J/KxL8Tx4xxnW4Qd2oiaZvwDkry7Lve6So6Foxj2noGjz OPq+PHdL77WXIWdFOKnw+Jt/uFgI6BybsyYB2XSffv3yqrvkuVvnhaAwzLALInZ2GyGV /E3eAFxvtqig01waeLlSl47ZWk2EsHH2mEWHWE5fJ5+DlL0ahqAlubxMO8kHQp11lB5x wn50FYhIHmGmtPwiAdL3PeNRlNOjkZwWj8nTZZJn0jn2njn8ZlOSsCbsW2+bomhoU44U L1GVWpQjLjeIsjZnvmOPHDRzok6a5FfjA6NM8ZVBqj6zAD5AXgEWddcb8Sn1p7wfpyV0 oqRA== X-Gm-Message-State: ACrzQf22HPAbMoAT48AH+pnzw9MB6czkidCM5NUali8R7yqzYpl7lRxg vGmI/lIDmceU2yknO3wq+rQFvls8M9H6bSXs667Iy0ZCaJWDmBG/q32i3u4MvDCT0p/OEH3q0DM xdqz53Cr+b3/ppaZYMXulCo3XuRxNZXzltym2vBjgAQpj6hvXASQ2oUXZBQHN X-Received: by 2002:ac8:4d5b:0:b0:39c:b6d2:b631 with SMTP id x27-20020ac84d5b000000b0039cb6d2b631mr28890950qtv.487.1666640021635; Mon, 24 Oct 2022 12:33:41 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6R9fk2GOMQDrYgO/fAupULF4Tu6JcWydWZM0pW5ldS7Wd85SIl/rXdo1urC1LqoxV/541nKg== X-Received: by 2002:ac8:4d5b:0:b0:39c:b6d2:b631 with SMTP id x27-20020ac84d5b000000b0039cb6d2b631mr28890924qtv.487.1666640021327; Mon, 24 Oct 2022 12:33:41 -0700 (PDT) Received: from x1n.redhat.com (bras-base-aurron9127w-grc-46-70-31-27-79.dsl.bell.ca. [70.31.27.79]) by smtp.gmail.com with ESMTPSA id t15-20020a05620a450f00b006cddf59a600sm545164qkp.34.2022.10.24.12.33.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Oct 2022 12:33:40 -0700 (PDT) From: Peter Xu To: linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: Axel Rasmussen , peterx@redhat.com, Andrew Morton , Andrea Arcangeli , Nadav Amit Subject: [PATCH 2/2] Revert "mm/uffd: fix warning without PTE_MARKER_UFFD_WP compiled in" Date: Mon, 24 Oct 2022 15:33:36 -0400 Message-Id: <20221024193336.1233616-3-peterx@redhat.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221024193336.1233616-1-peterx@redhat.com> References: <20221024193336.1233616-1-peterx@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-type: text/plain ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1666640024; a=rsa-sha256; cv=none; b=KdGXF3TjIuR89bDLSjiuED6Q5V9H+SbdkPGbxVLURWY2Xk4i0gMe9zGuHicf1fY7x4RhRx s5NKmqYb6dw9SFXlWuho13+HV0A7bwP9MmuBbw0kPgcOh1bijV69C3sidPAda67IgTqamu Yp6WIJLJvRgAegJrzKcbHw5Xj1nPQ3s= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=RxsECaHE; spf=pass (imf16.hostedemail.com: domain of peterx@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=peterx@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1666640024; h=from:from:sender: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:dkim-signature; bh=B26mrVLxvv94GHZ4EyopRcUEqjnA0ulPrAxRLMb69GQ=; b=CcY8bCgA5psWJmZ0gx5sdbKWRz+TYw0GaUz6S5yOvJAOZqA1yCYoTYdfiCZlOjp8xL+9R+ yeeYB1T7g2vBP+4wbT/La6/OPS5CyUaj7Gx6KmHK+PkXj+YnFTTLjGdOPIVX0eNI+Ij6Mn f7FlzvANGWV5woLK5Mt3cZl6LWd/9X4= X-Stat-Signature: cfhzb77yk6oqzssunztawnnbyttcr6kf X-Rspamd-Queue-Id: 4D5F1180036 Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=RxsECaHE; spf=pass (imf16.hostedemail.com: domain of peterx@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=peterx@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Rspam-User: X-Rspamd-Server: rspam05 X-HE-Tag: 1666640024-86493 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: With previous patch to fix the registration, we'll be safe to remove the macro hacks now. Signed-off-by: Peter Xu --- mm/hugetlb.c | 4 ---- mm/memory.c | 2 -- mm/mprotect.c | 2 -- 3 files changed, 8 deletions(-) diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 1a7dc7b2e16c..b2fcb27f268a 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -5124,7 +5124,6 @@ static void __unmap_hugepage_range(struct mmu_gather *tlb, struct vm_area_struct * unmapped and its refcount is dropped, so just clear pte here. */ if (unlikely(!pte_present(pte))) { -#ifdef CONFIG_PTE_MARKER_UFFD_WP /* * If the pte was wr-protected by uffd-wp in any of the * swap forms, meanwhile the caller does not want to @@ -5136,7 +5135,6 @@ static void __unmap_hugepage_range(struct mmu_gather *tlb, struct vm_area_struct set_huge_pte_at(mm, address, ptep, make_pte_marker(PTE_MARKER_UFFD_WP)); else -#endif huge_pte_clear(mm, address, ptep, sz); spin_unlock(ptl); continue; @@ -5165,13 +5163,11 @@ static void __unmap_hugepage_range(struct mmu_gather *tlb, struct vm_area_struct tlb_remove_huge_tlb_entry(h, tlb, ptep, address); if (huge_pte_dirty(pte)) set_page_dirty(page); -#ifdef CONFIG_PTE_MARKER_UFFD_WP /* Leave a uffd-wp pte marker if needed */ if (huge_pte_uffd_wp(pte) && !(zap_flags & ZAP_FLAG_DROP_MARKER)) set_huge_pte_at(mm, address, ptep, make_pte_marker(PTE_MARKER_UFFD_WP)); -#endif hugetlb_count_sub(pages_per_huge_page(h), mm); page_remove_rmap(page, vma, true); diff --git a/mm/memory.c b/mm/memory.c index 8e72f703ed99..25b12d1a7db0 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -1393,12 +1393,10 @@ zap_install_uffd_wp_if_needed(struct vm_area_struct *vma, unsigned long addr, pte_t *pte, struct zap_details *details, pte_t pteval) { -#ifdef CONFIG_PTE_MARKER_UFFD_WP if (zap_drop_file_uffd_wp(details)) return; pte_install_uffd_wp_if_needed(vma, addr, pte, pteval); -#endif } static unsigned long zap_pte_range(struct mmu_gather *tlb, diff --git a/mm/mprotect.c b/mm/mprotect.c index 99762403cc8f..8d770855b591 100644 --- a/mm/mprotect.c +++ b/mm/mprotect.c @@ -267,7 +267,6 @@ static unsigned long change_pte_range(struct mmu_gather *tlb, } else { /* It must be an none page, or what else?.. */ WARN_ON_ONCE(!pte_none(oldpte)); -#ifdef CONFIG_PTE_MARKER_UFFD_WP if (unlikely(uffd_wp && !vma_is_anonymous(vma))) { /* * For file-backed mem, we need to be able to @@ -279,7 +278,6 @@ static unsigned long change_pte_range(struct mmu_gather *tlb, make_pte_marker(PTE_MARKER_UFFD_WP)); pages++; } -#endif } } while (pte++, addr += PAGE_SIZE, addr != end); arch_leave_lazy_mmu_mode();