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: 13018049 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 9F97FC38A2D for ; Mon, 24 Oct 2022 19:33:42 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 38E35940009; Mon, 24 Oct 2022 15:33:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 33EAC940007; Mon, 24 Oct 2022 15:33:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 22D60940009; Mon, 24 Oct 2022 15:33:42 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 145A2940007 for ; Mon, 24 Oct 2022 15:33:42 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id D8B1FC0BAF for ; Mon, 24 Oct 2022 19:33:41 +0000 (UTC) X-FDA: 80056842642.08.08178A1 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf13.hostedemail.com (Postfix) with ESMTP id 636EA20011 for ; Mon, 24 Oct 2022 19:33:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1666640020; 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=AT4IdGh0SKn9o6sEl1GYi9UUqzhpvWDVdG3YTdgxf1Qv0AjpS33gEY96GZ0s+3Z4OSkL0a H+kWXs8lqNvGiunpHRr0KSihO+aEfPXVOA0fF8evadCJBoVzhk7RHFYmqtVlKQU0dVoskD ZExy0B6UkmRrKyIc+RpFVCi9+Ai9qmo= Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-487-XIF0uIwrObaWWIVI9TKvKQ-1; Mon, 24 Oct 2022 15:33:39 -0400 X-MC-Unique: XIF0uIwrObaWWIVI9TKvKQ-1 Received: by mail-qt1-f197.google.com with SMTP id k9-20020ac85fc9000000b00399e6517f9fso7611308qta.18 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=HlUGKe4JwRIojJrWQIDnazl9qsWu7eojY5fgdGyw8aPqQ0xNUrMOAkHrs9otDXDIub l8LOWPO9aXjkJ98yFvGYa/u5+g9eXeHwUmXoPzSRv6b2OjCCWVrClb/enMTppmHnOT3o +dM/D07JLqv0I7ur7JCu30io2zrs+jTjPsUHYNk59x6N8wch764cmWO9bImezaZML5K/ 4KCwJ3vXYjKf8O7mtRUBsTT3dCteAHMZiMQJY5DmyCkk/w3yDQn/Wd7pVr/JHn3NB99d uRLeSI2Vurv1dFf5I3v/VrgGjYsiKU9G6IQcovcQV+/p/AK55SVPI0PKpOLsjYh+yjJ7 LS6A== X-Gm-Message-State: ACrzQf3hWyj6tmrfW1L9PM9zb8YZUMVz4G7Wc3q8AzU12eBwyId69pMN izVMJZy4V9Wmxt94GJ1rPSxcB3wdhLA3n+ooysYY387v59FE4A5EcMRuGR104iHnOi0o7pmiZ4R xboZ7tlPphi31WBSwWR73UyukhuHcFhvEWdD2UEZvBeSl2xh6rDf0ATBuOuSL X-Received: by 2002:a05:622a:8b:b0:39c:f732:f282 with SMTP id o11-20020a05622a008b00b0039cf732f282mr29083474qtw.391.1666640018928; Mon, 24 Oct 2022 12:33:38 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6xnlmrmBflA5e08eff5fSpy4VsFWvEQXtWJgjrlbwS9+Ulhuq7Bln2MzR7zdfaCZEy1gPM9A== 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-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1666640021; a=rsa-sha256; cv=none; b=6xka0Ijjv74hazlXVsnJYGxAL5ReSUMwH0a00/hGhkuW4BR8yizVI9kmb5J4uVKqBrpZOO M9C/J3HevDlgiu4Ja3ZAVE93803Whhfuk3L+pQYK4OfHAitML0fVOxR027yCKVtO+Pw5kv O7Di+Q/TD/l/8cPNL5N9z7FtbJBMcSI= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=AT4IdGh0; spf=pass (imf13.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=1666640021; 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: references:dkim-signature; bh=+oLikKrpTwfN5eZoO3ZPy9VDegRTEaRcO7+/yERF3Ng=; b=BXf6XPE+ICU8gApIX2oWs+uCqQZoIjbzq3v/bcBbFJWpIwqdzO4LvyeR+2KOFfqWqCLI8h k4iKHZC1Xe/fQMt1RhunbEx4IruhHeHb25VXrPKBd3UGQ/FHpQj6Jw0A6IhanYMGYhQxcY j5VJ800pNSlU/bNgfJceQv2y0DLvTO4= X-Stat-Signature: 93hu3gza5sk5bagt1gb5x6zr1pnifo4r X-Rspamd-Queue-Id: 636EA20011 Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=AT4IdGh0; spf=pass (imf13.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: 1666640021-423858 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: 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(-)