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 X-Spam-Level: X-Spam-Status: No, score=-13.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B8D6FC07E95 for ; Mon, 19 Jul 2021 22:42:55 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 426FD61004 for ; Mon, 19 Jul 2021 22:42:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 426FD61004 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id D0CB48D0002; Mon, 19 Jul 2021 18:42:55 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CE37F8D0001; Mon, 19 Jul 2021 18:42:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B5D998D0002; Mon, 19 Jul 2021 18:42:55 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0203.hostedemail.com [216.40.44.203]) by kanga.kvack.org (Postfix) with ESMTP id 8DB358D0001 for ; Mon, 19 Jul 2021 18:42:55 -0400 (EDT) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 1B3848248047 for ; Mon, 19 Jul 2021 22:42:54 +0000 (UTC) X-FDA: 78380813868.04.8E24033 Received: from mail-oi1-f182.google.com (mail-oi1-f182.google.com [209.85.167.182]) by imf16.hostedemail.com (Postfix) with ESMTP id D1A17F00008E for ; Mon, 19 Jul 2021 22:42:53 +0000 (UTC) Received: by mail-oi1-f182.google.com with SMTP id t143so22499727oie.8 for ; Mon, 19 Jul 2021 15:42:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:in-reply-to:message-id:references :mime-version; bh=f/G8JnA7NX/TtTOKj6FC6NRy0M5gvoR58tDLE3Aw14Q=; b=C551OdhGQ0uykOv6206Sh6PTiMhgMg1Akl3zPCljODmfQP6sn9UExXntqhPKoaLV0e sfMZ6aYeWnpQOxrreeH0qXYWDCYGnlClWc+P43PWqUslE5ZDvwt8KdOMga/era+mWX96 EnZikhd/4CglIEPWf08YiUn7L7l0ogWGsWH6pZVRJUmyLoadKivj8dcqRetrE1o7f/QB PIFLHlaV8chmUe5h32iomyZW8kvRRrY1HoH841q6JJAJ3cYpvv4lxcgH+Y93fNvYnNOF D/dgu+/P++/Ok5LS9bqOLyM4KDwR7ln0JcnX1NycErFBlxzvf9q5kqqfVlqWMUCoysGF wddQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:mime-version; bh=f/G8JnA7NX/TtTOKj6FC6NRy0M5gvoR58tDLE3Aw14Q=; b=UJ/TlydyEWuGK2JEoAR3fLVt5SC3wB3pjluYS8omN3047xkdkz0I5v9eNyKs8IV3HC fvOnbWb15qee8nk1m4QWED0wYlH6YfKxM56cScI5A1Dxlqh8Q3zXO78y+FLtccjCYScx PQ+LJbTCsEIyJoqWB3ceD7OUsTcZZsg38D0aglAqrJWY/kBLIj9+wvnn2YBjm2SaAntY iYz3mpoTsKBlssMxCScvKQM/uuLVmz6E3D/WoQYku65KKsXsLFCBCDocw8IIA3rSkMuE BnWHNq+8A/f/pg0BDCtdt/XKUl103eWK6AQ/UBI3zuJG1UbWFUH6AExk37wutvolzBde jV+w== X-Gm-Message-State: AOAM5308JAP4nu76vQK9hBHupB9AcAeaqPpy4z0ayEPe2rrEwsYCVoB0 42rFZRNKMmQVwYbso1hHINGVQQ== X-Google-Smtp-Source: ABdhPJyGX6Vy1sF89iw5VcheDYlHQBmEysaEk4/Sik2Spb7PESfktnalequKj9NGcyEkjid1aLHy6w== X-Received: by 2002:aca:1101:: with SMTP id 1mr18913804oir.53.1626734572967; Mon, 19 Jul 2021 15:42:52 -0700 (PDT) Received: from ripple.attlocal.net (172-10-233-147.lightspeed.sntcca.sbcglobal.net. [172.10.233.147]) by smtp.gmail.com with ESMTPSA id z3sm3845582otp.32.2021.07.19.15.42.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Jul 2021 15:42:51 -0700 (PDT) Date: Mon, 19 Jul 2021 15:42:41 -0700 (PDT) From: Hugh Dickins X-X-Sender: hugh@ripple.anvils To: Peter Xu cc: Hugh Dickins , Igor Raits , Andrew Morton , Hillf Danton , Axel Rasmussen , linux-mm@kvack.org Subject: Re: kernel BUG at include/linux/swapops.h:204! In-Reply-To: Message-ID: <757b684a-67b5-999b-7f2d-b55fb1c61fd8@google.com> References: <4c9e24db-29d5-5bbb-17ae-8dc32ceb66ed@google.com> <796cbb7-5a1c-1ba0-dde5-479aba8224f2@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=google.com header.s=20161025 header.b=C551OdhG; spf=pass (imf16.hostedemail.com: domain of hughd@google.com designates 209.85.167.182 as permitted sender) smtp.mailfrom=hughd@google.com; dmarc=pass (policy=reject) header.from=google.com X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: D1A17F00008E X-Stat-Signature: ittgt8mqgt97ubypahrpd1u1wnyjeumy X-HE-Tag: 1626734573-660332 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000002, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, 19 Jul 2021, Peter Xu wrote: > On Mon, Jul 19, 2021 at 12:11:21PM -0700, Hugh Dickins wrote: > > > > But I'm confident that 8f34f1eac382 will prove to be the fix, so Peter > > please prepare some backports of that for the various stable/longterm > > kernels that need it - I've not looked into whether it applies cleanly, > > or depends on other commits too. You fixed several related but different > > things in that commit: but this one is the worst, because it can corrupt > > even those who are not using UFFD_WP at all. > > Looks right to me, b569a1760782 ("userfaultfd: wp: drop _PAGE_UFFD_WP properly > when fork", 2020-04-07) seems to be the culprit. I didn't notice the side > effect in the bug or in the fix, or it should have already land stables. I am > very sorry for such a preliminary bug that caused this fallout - I really can't > tell why I completely didn't look at is_swap_pte() that's so obvious indeed. > > I checked it up, 5.6.y doesn't have the issue commit yet as it's not marked as > "fixes". It started to show up in 5.7.y~5.13.y. 5.14-rc1 has 8f34f1eac382 which > is the fix. So I think we need the fix or equivalent fix for 5.7.y~5.13.y. > > 5.12.y & 5.13.y can pick up the fix 8f34f1eac382 cleanly. For the olders > (5.7.y~5.11.y) they can't. I plan to revert b569a1760782 instead. > ... > > Please let me know if there's any comment on the backport plan above, or I'll > prepare the patches for all the branches before tomorrow. Thanks for getting on to it so quickly, Peter. The only non-EOL stable/longterm releases are then 5.13, 5.12 and 5.10. I have no appreciation of the importance of UFFD_EVENT_FORK support for uffd-wp. And no appreciation of the importance of the other bugs you fixed in 8f34f1eac382, and other uffd-wp fixes you may have made recently, some backported, some not. But I think it is worth giving 5.10, the longterm, a little more consideration: don't be driven by whether 8f34f1eac382 applies cleanly (all 5.13 and 5.12 would require then is a mail to GregKH Cc stable asking him to add that commit), but by how important the support is to users of 5.10, and how far away from working safely it is - maybe a 5.10-specific patch would be worthwhile, maybe not, I cannot judge. Hugh