From mboxrd@z Thu Jan 1 00:00:00 1970 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 7BCA8C4332F for ; Sun, 13 Nov 2022 22:33:59 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8AC956B0071; Sun, 13 Nov 2022 17:33:58 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 85C086B0072; Sun, 13 Nov 2022 17:33:58 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 723D58E0001; Sun, 13 Nov 2022 17:33:58 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 624866B0071 for ; Sun, 13 Nov 2022 17:33:58 -0500 (EST) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 30254140B7E for ; Sun, 13 Nov 2022 22:33:58 +0000 (UTC) X-FDA: 80129872956.29.5013385 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf17.hostedemail.com (Postfix) with ESMTP id C2CC340009 for ; Sun, 13 Nov 2022 22:33:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1668378837; 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=O2hoXnIfgvOzO3T+U/es9J0VUcpxguVgLPnnVOVorDE=; b=WGZYI9TOpdsXvMCJx1R1rOx/u5f4ixHCDoCEXIIqxniyRI0V2QgCvnLodpSJdmQSxwscC2 3K6GW8fvt5Zj8HtrXAJRActfMkyp2Mutj7SoPz2zAcJc0tjSkYXHeGHNk2nfitRo5r0aXI V8DiPAFxqR7YOc+t/Q6qfd3wToK6sd4= Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-231-oGa6lUTlOluNy8joaPI56g-1; Sun, 13 Nov 2022 17:33:55 -0500 X-MC-Unique: oGa6lUTlOluNy8joaPI56g-1 Received: by mail-qk1-f198.google.com with SMTP id i21-20020a05620a405500b006fb25ba3e00so8742683qko.1 for ; Sun, 13 Nov 2022 14:33:55 -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=O2hoXnIfgvOzO3T+U/es9J0VUcpxguVgLPnnVOVorDE=; b=Bg0LoHAuuySiOse2VYXV9l63CPeHoF+rSpuIsf+vEYJEx8G7/6Oxn/0bGnsLQgM8ex Jok3+ZeVlyEcs1VjpHWCWRnRx6LiUCOEQGQvAjz/rG0Rj5EgMqSPz64wpjqH8tI+7VtF XD4HaUKfrXIqY9dtRyoKWPKf55LuJ4FZ/qFdZY2VSiNGaxwV1Z+LAF1mVCJWEdr60TNx fhbgrIQiWWgdrMcbEF7VlnP2TBA3TyDrTWt+U4cM/8cDv7hLzxxER6aCPQeqqva96ktG ErIvl9xk9yYgJWzvPkTVVnYhmRcnC5f6PcTZRJKg66l0tiL5sulZ3yNF+acfk9bv61LE vQ6Q== X-Gm-Message-State: ANoB5pl48Zn/Dj25vTc3Mk7Av3hGxyDNRKm4MU6fF/koah1tiFjcT5n4 65PCyHmcjck2zzGYJXQeO2ARsiYHML3jv8qeZWeyiBylFRU80fc0+GDM/xskyC9+MUFIyp6k03x DqNCd4DceS3A= X-Received: by 2002:a37:9343:0:b0:6ce:7d05:9f9e with SMTP id v64-20020a379343000000b006ce7d059f9emr8998651qkd.409.1668378835412; Sun, 13 Nov 2022 14:33:55 -0800 (PST) X-Google-Smtp-Source: AA0mqf4eJQTFSP4CzAmOQbZu+GqM4Y5Eujvu4hcxKqkfEMsWacfjNBl7Li5FqqZNL/1wBRHLo8rusw== X-Received: by 2002:a37:9343:0:b0:6ce:7d05:9f9e with SMTP id v64-20020a379343000000b006ce7d059f9emr8998637qkd.409.1668378835195; Sun, 13 Nov 2022 14:33:55 -0800 (PST) Received: from x1n (bras-base-aurron9127w-grc-46-70-31-27-79.dsl.bell.ca. [70.31.27.79]) by smtp.gmail.com with ESMTPSA id g26-20020ac8469a000000b003a5416da03csm4745644qto.96.2022.11.13.14.33.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Nov 2022 14:33:54 -0800 (PST) Date: Sun, 13 Nov 2022 17:33:52 -0500 From: Peter Xu To: kernel test robot Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, oe-kbuild-all@lists.linux.dev, Andrea Arcangeli , Axel Rasmussen , Ives van Hoorne , Nadav Amit , Andrew Morton , Mike Rapoport Subject: Re: [PATCH v2 2/2] mm/uffd: Sanity check write bit for uffd-wp protected ptes Message-ID: References: <20221110203132.1498183-3-peterx@redhat.com> <202211120515.eqlTdrD3-lkp@intel.com> MIME-Version: 1.0 In-Reply-To: <202211120515.eqlTdrD3-lkp@intel.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1668378837; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=O2hoXnIfgvOzO3T+U/es9J0VUcpxguVgLPnnVOVorDE=; b=RZCAa88X0VvL1WFWJ+Uv8BOkKaMMiIenLDB5m+sagrLpKh8DJrzhCC4di/uW7d/ZD9S4Up LN50lDS4w5dvX4YjoT0LBRYqiSykbOrxl9hygLcCOyoWTXplIu3OWntqJ9h8xJxcGpBU++ rjE3HC2L5swcra2hckrjyrZz74NvBso= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=WGZYI9TO; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf17.hostedemail.com: domain of peterx@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=peterx@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1668378837; a=rsa-sha256; cv=none; b=bwTjjJTJ4Msx96JTZzouiGOKGrTPBigTCSuBtThJh2t1IO1TfJHCntCsF68t7hyFfaKjNU jFfQRsr8H7CCY5mOPSpRsKeDw2YnGLCo/NKyGJUvOgt8XCtVAR7vncjv21+5Zi9GwdrdtU kO7K1jtFfeutHOHwWI27lTaSFVCkOog= X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: C2CC340009 X-Rspam-User: Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=WGZYI9TO; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf17.hostedemail.com: domain of peterx@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=peterx@redhat.com X-Stat-Signature: rw1fjwe9yndgyphri4xr35rsyerebdfy X-HE-Tag: 1668378837-306599 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: On Sat, Nov 12, 2022 at 06:06:22AM +0800, kernel test robot wrote: > vim +306 arch/x86/include/asm/pgtable.h > > 290 > 291 #ifdef CONFIG_HAVE_ARCH_USERFAULTFD_WP > 292 static inline int pte_uffd_wp(pte_t pte) > 293 { > 294 bool wp = pte_flags(pte) & _PAGE_UFFD_WP; > 295 > 296 /* > 297 * Having write bit for wr-protect-marked present ptes is fatal, > 298 * because it means the uffd-wp bit will be ignored and write will > 299 * just go through. > 300 * > 301 * Use any chance of pgtable walking to verify this (e.g., when > 302 * page swapped out or being migrated for all purposes). It means > 303 * something is already wrong. Tell the admin even before the > 304 * process crashes. We also nail it with wrong pgtable setup. > 305 */ > > 306 VM_WARN_ON_ONCE(wp && pte_write(pte)); I just saw the comment in check_pgprot() right below: /* mmdebug.h can not be included here because of dependencies */ #ifdef CONFIG_DEBUG_VM ... #endif I'll repost, will be the same as v1 code-wise. -- Peter Xu