Message ID | 20230417195317.898696-1-peterx@redhat.com |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2368871vqo; Mon, 17 Apr 2023 12:58:47 -0700 (PDT) X-Google-Smtp-Source: AKy350bGz0HEN49KHR3ELE7DaH3hnQDNyUobjEL66Ak5o/9OVuo9OIYfhENVJbDAfIqYhbLgo0YM X-Received: by 2002:a05:6a20:9295:b0:e3:8710:6848 with SMTP id q21-20020a056a20929500b000e387106848mr14357750pzg.41.1681761527234; Mon, 17 Apr 2023 12:58:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681761527; cv=none; d=google.com; s=arc-20160816; b=jEudjQqWx6yfPAfcIhHV+6bB//Gx0IXjBdqDNGZmG0fVntOzYL2hwMFbWEL+FtljXa rW3fUbSc64B5zshzvBBRZQRFMnaiyU8FhsCqeLAnWgTqja0+pPiuVcN4OiMsPYKShci5 qQ9IGBRDUG/D7hOhMc2cRCfLidzPrka6qy9U93LqqOkkEQvWi26Up9+o7OId3zCTkFjP 4QgAhVNDh9zans6RuHjLzNwO//i2ypEh9L2bvwkP6FloeIst7oPHwJpIVwwBPDadTiud 3K6IbbXBxQnyBvhBiMCmEY2sI2brmb/l5/iBzrSushRo7Va28LuonNf7ANwtxb0wV3Mz LtTQ== 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=ebFG+472EPgV/DQISB+I4k3P3R91wLCZUBIgWp1pKI8=; b=H4ZpuJeCnwY6QgSSadbJk/DcA1EmnqNMDROnIsprjiaIpVWIq865+W41BWL8FOm3jk WwV55E2TnSYZiFMbgA3bDq3j7X3f6dtTVRImgMtrnkltltBbz8fEeZrDpfHlxmGhL2jA soS7K/ofmLRQTuj82cVUaIR3u/JtCDj2KXoQkvGy743wMYNc8QoT1RjAdrlBle3ITrcq zowTyk/F2lOt/O65Mek4zvTQiBd9fkdwUKKtOVSPQumMyd1pvy8TyvGagcba8Cs5P3// NVI8pS5kmgNIardtay8XtURzsuQsBc6phIxyk7CrKANUJJNdwgbwdxBP/kFy+7cLPn5U WeAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=isxPKGPV; 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 a21-20020a63e855000000b004fb33a76e2csi12874632pgk.834.2023.04.17.12.58.32; Mon, 17 Apr 2023 12:58:47 -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=isxPKGPV; 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 S229830AbjDQTyV (ORCPT <rfc822;leviz.kernel.dev@gmail.com> + 99 others); Mon, 17 Apr 2023 15:54:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33184 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229515AbjDQTyU (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 17 Apr 2023 15:54:20 -0400 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 3F35159E8 for <linux-kernel@vger.kernel.org>; Mon, 17 Apr 2023 12:53:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1681761202; 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=ebFG+472EPgV/DQISB+I4k3P3R91wLCZUBIgWp1pKI8=; b=isxPKGPVkPx5j8RX5RPo3mH1eXcYY0Gd+oHPlKHHsBubU1H5Kp79MlUX9zvKn4OTc8ZjPG 7GEAwyJccjoWt+KIUCMVjCOEI4rjhJ1Gg5fEGbcCbiOOefGW5SNfbnOBmKNYzy75SiZhvq bTfNfMWMS3uKD3lTVh5GvBM2FfIe3tU= Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com [209.85.160.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-186-UVKm5D07MYu31SCrmKTefA-1; Mon, 17 Apr 2023 15:53:21 -0400 X-MC-Unique: UVKm5D07MYu31SCrmKTefA-1 Received: by mail-qt1-f199.google.com with SMTP id d75a77b69052e-3ef3116d1dcso1936911cf.1 for <linux-kernel@vger.kernel.org>; Mon, 17 Apr 2023 12:53:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681761200; x=1684353200; 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=ebFG+472EPgV/DQISB+I4k3P3R91wLCZUBIgWp1pKI8=; b=E9BC8hjC0LUoje1NMgnMFO6LPEsuvfx30MOue2xbN4GzNFEhKmGM+nTaSTJPr/grO3 3iL2FamspD/ZPZdVAQvd5Kpg4TdsUxE78lKBe3HNzP3BHQKS1zITHZvS2zNb8s7MJ/Sh VSJWV/TecxcxMcRre9PtMGcrFn0iutGMWd49ixQMSq8IsTdLYdkgna5KVD5wSoR0YU4N 7U38JT3Q+qlur5Dll7ND0PKPH/rkcp+6zQyRT+WKEwxJY4DGXut2mxK7+oDmx9iisnJL J1kMCZQoNpxMFir0BaCPxTW+J+h/5hP8742u2UKVJvMQH52zek2kK9cBuRw7QTrIEK8G +9XA== X-Gm-Message-State: AAQBX9d7Gu0ibgItuLMFDkz90gaxD2JtMHwt8i80JaNBZnVQ3IjETdti Nd9vN/2Ydk+ldgQK8X1p/cQtsWUzD2EFUPH9gn/3HaOUlUnLyPVwvK7PN1ZA39s0rpM9XdQxuX+ Xcc4EOpwE4KREJdvca9bypH9RraTVr4bcAhuE3tYDXMwlU74k3wu8vwigB7nksQGtThg8kwBsZR YVSeJ65A== X-Received: by 2002:ac8:5e0b:0:b0:3ee:5637:29be with SMTP id h11-20020ac85e0b000000b003ee563729bemr9983926qtx.5.1681761200087; Mon, 17 Apr 2023 12:53:20 -0700 (PDT) X-Received: by 2002:ac8:5e0b:0:b0:3ee:5637:29be with SMTP id h11-20020ac85e0b000000b003ee563729bemr9983891qtx.5.1681761199702; Mon, 17 Apr 2023 12:53:19 -0700 (PDT) Received: from x1n.redhat.com (bras-base-aurron9127w-grc-40-70-52-229-124.dsl.bell.ca. [70.52.229.124]) by smtp.gmail.com with ESMTPSA id r17-20020ac87ef1000000b003edfb5d7637sm1731278qtc.73.2023.04.17.12.53.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Apr 2023 12:53:19 -0700 (PDT) From: Peter Xu <peterx@redhat.com> To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: Mike Kravetz <mike.kravetz@oracle.com>, Andrea Arcangeli <aarcange@redhat.com>, =?utf-8?q?Mika_Penttil=C3=A4?= <mpenttil@redhat.com>, Andrew Morton <akpm@linux-foundation.org>, peterx@redhat.com, Axel Rasmussen <axelrasmussen@google.com>, Nadav Amit <nadav.amit@gmail.com>, David Hildenbrand <david@redhat.com> Subject: [PATCH v2 0/6] mm/hugetlb: More fixes around uffd-wp vs fork() / RO pins Date: Mon, 17 Apr 2023 15:53:11 -0400 Message-Id: <20230417195317.898696-1-peterx@redhat.com> X-Mailer: git-send-email 2.39.1 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 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,T_SCC_BODY_TEXT_LINE 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763454774761688033?= X-GMAIL-MSGID: =?utf-8?q?1763454774761688033?= |
Series |
mm/hugetlb: More fixes around uffd-wp vs fork() / RO pins
|
|
Message
Peter Xu
April 17, 2023, 7:53 p.m. UTC
v2: - Added R-bs - Fix patch 1 issue on hugetlb swap entry [Mika] This is a follow up of previous discussion here: https://lore.kernel.org/r/20230324222707.GA3046@monkey There, Mike correctly pointed out that uffd-wp bit can get lost too when Copy-On-Read triggers. Last time we didn't have a reproducer, I finally wrote a reproducer and attached as the last patch. When at it, I decided to also add some more uffd-wp tests against fork(), and I found more bugs. None of them were reported by anyone probably because none of us cares, but since they're still bugs and can be reproduced by the unit test I fixed them too in another patch. The initial patch 1-2 are fixes to bugs, copied stable. The rest patches 3-6 introduces unit tests to verify (based on the recent rework on uffd unit test). Note that not all the bugfixes in patch 1 is verified (e.g. on changes to hugetlb hwpoison / migration entries), but I assume they can be reviewed with careful eyes. Thanks, Peter Xu (6): mm/hugetlb: Fix uffd-wp during fork() mm/hugetlb: Fix uffd-wp bit lost when unsharing happens selftests/mm: Add a few options for uffd-unit-test selftests/mm: Extend and rename uffd pagemap test selftests/mm: Rename COW_EXTRA_LIBS to IOURING_EXTRA_LIBS selftests/mm: Add tests for RO pinning vs fork() mm/hugetlb.c | 31 +- tools/testing/selftests/mm/Makefile | 8 +- tools/testing/selftests/mm/check_config.sh | 4 +- tools/testing/selftests/mm/uffd-unit-tests.c | 318 +++++++++++++++++-- 4 files changed, 314 insertions(+), 47 deletions(-)