From patchwork Mon Oct 24 19:33:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Xu X-Patchwork-Id: 612 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp673578wru; Mon, 24 Oct 2022 15:07:18 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6iQ6pkEwRmiP4cfF63+G198rmtBug71Fd+XBjQRJrQpww7ZJZrd3xpRqrREbjSlDxsAVAF X-Received: by 2002:a17:902:bd98:b0:182:631b:7dd5 with SMTP id q24-20020a170902bd9800b00182631b7dd5mr34911748pls.165.1666649238288; Mon, 24 Oct 2022 15:07:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666649238; cv=none; d=google.com; s=arc-20160816; b=TvlCPNGXcPkp2kSeK/uYW79tqXVE3Y0uzBAVASLkJn1kMf6Ce67qs0tDwdV0tT+C4p oLw/yc6wk5ilQQeZu2SMujAVdITh1BVl476p+qOHI4uM4J6OrJaxNBRBVxZgmgzdZiao jtp/QTQ7FDfHWe44N0j4hElaPQonXrxHU5Ny6XC41rhS82H/EBWjASW9IK5YSqWDYrZR YNbllQed9pUeOWLd8FNJPROqfewJkLx04WmvG/mkT6CARNv1Hm3WUOKXRyq4XcWpMCxa QzWBo14pEf+vMhsuLMPOieT6zEW/ZU1JyP/vHo9AaGWQpUBJwVlYBzw0m2DT11HblF8W 70fQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=+oLikKrpTwfN5eZoO3ZPy9VDegRTEaRcO7+/yERF3Ng=; b=zL9rBbqwLAY/y5XI4mR33sZ5kPRyRShjXHzEnOsFDyUquIFWMcT94qpb3pclGIBX5m 1B53H9u7DAx7+te8tSpnhGxbVcyyUTmhr0oHBx6RKjuZ07gVZadpt0wpJiiYlGjiqCG2 WYbHwyELbokKnJBeXjEY+/GMK41Jrpm3XGL6LCGO5O8CecQRYZYLW2Z0/Uyff0IZNYXZ kuGgmmxT2bKHydXT9H9jukOM+Rb+zIC2O4ul9yQtipI0ly7kzWdE9mE++k/VfswJuNws edrih+9JV0Wlwg/14QLIW8BACf25MxDWNAYvCW7H99HSBkGYdPhNlXxAf6fLBy5jz8Kb 4xRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=iheMMNI2; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y4-20020a17090322c400b00176c0e055d8si1008450plg.102.2022.10.24.15.07.03; Mon, 24 Oct 2022 15:07:18 -0700 (PDT) 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=iheMMNI2; 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 S230274AbiJXWG2 (ORCPT + 99 others); Mon, 24 Oct 2022 18:06:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231895AbiJXWGH (ORCPT ); Mon, 24 Oct 2022 18:06:07 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C8F4086F8C for ; Mon, 24 Oct 2022 13:19:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1666642695; 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; bh=+oLikKrpTwfN5eZoO3ZPy9VDegRTEaRcO7+/yERF3Ng=; b=iheMMNI2V9RRqz/nwzbld6v5mNwPXjpvQ9J+3ZA8M/ssjI1pgsQ4SVX3j25mzT7LmIdIAC P/OA2OaJ/Ydo1r69oDIB8lVeKjAktLpciMyAjv7lyPH31MSK0AZbCSeerL71MkqpVTGFg5 z+ZhNwZJD6cdKaVAXAyiFzYpY7F23/8= Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-324-OKMad_OpMgevCwNq-3S7BQ-1; Mon, 24 Oct 2022 15:33:39 -0400 X-MC-Unique: OKMad_OpMgevCwNq-3S7BQ-1 Received: by mail-qt1-f198.google.com with SMTP id a19-20020a05622a02d300b0039a3711179dso7651083qtx.12 for ; Mon, 24 Oct 2022 12:33:39 -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:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=+oLikKrpTwfN5eZoO3ZPy9VDegRTEaRcO7+/yERF3Ng=; b=48odAFCI5rm8lh6t23vM4bdFI7tOpRTLVc9hPbM2oph94TisSWh5ft1GurvRdrx2lK t6Rxk8TFRiUsQ0auHHbe9DHICIvn7y6XztdzDwhsdfQxs4uEQi+VDxtYRGBk2Z3iRvFX VM4vuPhDtYL5JJM4HF90yMqYTmdhzvIp7qm3Mb9FZWLZv8XDjRujCmlFcaexTg6Cmg/c akJoFla0UTEBYQD9CkRTMoa6UAbB2grkrKd1D1H6/9W3dQ9nSOgFlmslFRx5PmFdZejg cTpA71ijuXJ2Kmge8B4gb0F2tmfK3Qxp7z3R4UWlFWU+GvAd3BuQGjLEi7VfT7zpo1l8 VMLw== X-Gm-Message-State: ACrzQf0MrWCSC2BaXN772mLzuKFUdUslKhUkPSUNfbF2w6IYPQiQ2z7p l8YAsK2/gSYWHNTDux7rWC5l4WfaNdopBWsrzmkVkDLrnyXqUmVly6oen3tcYapcWXkkm7Zr5DC Ox/WqvOpPHcXBLV747lHeIKB8 X-Received: by 2002:a05:622a:8b:b0:39c:f732:f282 with SMTP id o11-20020a05622a008b00b0039cf732f282mr29083464qtw.391.1666640018855; Mon, 24 Oct 2022 12:33:38 -0700 (PDT) X-Received: by 2002:a05:622a:8b:b0:39c:f732:f282 with SMTP id o11-20020a05622a008b00b0039cf732f282mr29083448qtw.391.1666640018605; Mon, 24 Oct 2022 12:33:38 -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.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Oct 2022 12:33:38 -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 0/2] mm/uffd: Fix vma check Date: Mon, 24 Oct 2022 15:33:34 -0400 Message-Id: <20221024193336.1233616-1-peterx@redhat.com> X-Mailer: git-send-email 2.37.3 MIME-Version: 1.0 X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=ham 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747608391835965501?= X-GMAIL-MSGID: =?utf-8?q?1747608391835965501?= I just got time to have a closer look on the uffd-wp triggering of the warning here: https://lore.kernel.org/all/YzeR+R6b4bwBlBHh@x1n/T/#u It turns out to be a wrong check on vma, and with the fix attached we should be able to remove the ugly macro checks. Sorry for the bothersome. Please have a look, thanks. Peter Xu (2): mm/uffd: Fix vma check on userfault for wp Revert "mm/uffd: fix warning without PTE_MARKER_UFFD_WP compiled in" include/linux/userfaultfd_k.h | 6 +++--- mm/hugetlb.c | 4 ---- mm/memory.c | 2 -- mm/mprotect.c | 2 -- 4 files changed, 3 insertions(+), 11 deletions(-)