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 2CB2ECEACD5 for ; Tue, 1 Oct 2024 15:42:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B09DA280097; Tue, 1 Oct 2024 11:42:15 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AB960280068; Tue, 1 Oct 2024 11:42:15 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 93355280097; Tue, 1 Oct 2024 11:42:15 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 71301280068 for ; Tue, 1 Oct 2024 11:42:15 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 28B0F41590 for ; Tue, 1 Oct 2024 15:42:15 +0000 (UTC) X-FDA: 82625449830.09.E652CD9 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf16.hostedemail.com (Postfix) with ESMTP id 16EE8180002 for ; Tue, 1 Oct 2024 15:42:12 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=YRtBFGAh; spf=pass (imf16.hostedemail.com: domain of peterx@redhat.com designates 170.10.133.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=1727797207; 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=QOgtr61kbIuiGWHVcnYuVXbJdTaR2cEAJDPnOspuQwQ=; b=HKPA3FObu9jEU5HJGuXq4naS26jGSkYG2RqJX4WLYOyTLQsSogMaU7xbjQLQe5jRftEE1i UZj7mMynJfQxwwsU3Z3siHykHV1FaJeLlumrjXH8hG2Ugs4s4t9g+aX9ZyL8N75rpZgkMh Lng/ldClr4ZcAC7f24uWwjjxAweEc84= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1727797207; a=rsa-sha256; cv=none; b=mYCv/R+n++0FE+vWohF3DmCP8HDKOfwXWGHB2j/s98CU/stzeECGM4roMe9UQPNyyXFuha LbiF2CdWq0qMlgAfMua1OnZMevqGRSlWP8CGtSgkVA0oANDd7/jjabsCYycNkERWN11bRz PHjxPZFUWQuKMCbBmeDewyy+914oC54= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=YRtBFGAh; spf=pass (imf16.hostedemail.com: domain of peterx@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=peterx@redhat.com; dmarc=pass (policy=none) header.from=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1727797332; 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=QOgtr61kbIuiGWHVcnYuVXbJdTaR2cEAJDPnOspuQwQ=; b=YRtBFGAhATjUA0p9TMdvpidLEFRuXG1h9QIP4L/JvxsTMyKEu2r2SzE0zlm4+uUT5RpwcT 45phiHOAoWiXELQR+lizPDJAoLcasEF+XJZ59JwKQT0Ruam41k2YUav+aaFEVxfPBAaLZh VKXom9atr/+rHPq+86oCk2vIZX4C8kU= Received: from mail-ot1-f72.google.com (mail-ot1-f72.google.com [209.85.210.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-138-Xo0Hccd2PmK6W2l-hhBMtw-1; Tue, 01 Oct 2024 11:42:11 -0400 X-MC-Unique: Xo0Hccd2PmK6W2l-hhBMtw-1 Received: by mail-ot1-f72.google.com with SMTP id 46e09a7af769-713a9fb5774so3546355a34.2 for ; Tue, 01 Oct 2024 08:42:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727797330; x=1728402130; 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=QOgtr61kbIuiGWHVcnYuVXbJdTaR2cEAJDPnOspuQwQ=; b=pg5O0jABGgMj/nI/wKwBkBEL/9YMRQygu0auwQUfxi054TG6yqU+BLfJNJPUwKNl4W 0WYMaQv5NIJz4tzxq+aKZi5cVZyQtEYcIuw+53vIm9p4eKHFbu9BqqafAdBdpqZa6Bx3 xCZ0fY9QqK+jS+jtjUve/91pyTMIxC5XusYiJlkKovEDIq6kJmsKhaNwASzQC3YAr1TJ f8TT0jDHb1+g4TxhgnOaXPNVeGiYLDV3j6CZPdwzWxRI1Asi+53wgg/sEBUiJG7jjH3z t595wuxPA10SIpGAUEAroWuoG2Ig1WiGMCbHAFAPcoVeXrzpuV/D6Z2LVn8tPy5BRS4G eEAA== X-Forwarded-Encrypted: i=1; AJvYcCViMlTn6iXhURvG+jlhpyZ7zSJgcYkCaflzNDIi5QHp7Y3hcfZsebfhXEqOzsIUCH7h0jLtQbaOLQ==@kvack.org X-Gm-Message-State: AOJu0Yxyp2n42KmcaxiFx5mb/XvbbcWvEFYWQA/mJ+c2xgxqg4YkGcWq qFwud+5uY7bAQTdynmGne9onzbtNcvFVenXjWfucD37CVf4QMCOzuW7ppUiqk/jpALYmGfR84qW Gs67iKpmXnJarLBFMUabKZ7cpOCljX/qZQb4pSKzw1Gkn7o8z X-Received: by 2002:a05:6358:9997:b0:1ad:14ec:a002 with SMTP id e5c5f4694b2df-1c0ceec6e2bmr27675855d.26.1727797330498; Tue, 01 Oct 2024 08:42:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGmPyxD6CFklCiudzk1obxaH919d6Mb8J9UTt+aH/4O1kkeVfMqwkVqswVVUeJo9i2uo6vhVQ== X-Received: by 2002:a05:6358:9997:b0:1ad:14ec:a002 with SMTP id e5c5f4694b2df-1c0ceec6e2bmr27674355d.26.1727797330157; Tue, 01 Oct 2024 08:42:10 -0700 (PDT) Received: from x1n (pool-99-254-121-117.cpe.net.cable.rogers.com. [99.254.121.117]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7ae3782b961sm514484785a.75.2024.10.01.08.42.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Oct 2024 08:42:09 -0700 (PDT) Date: Tue, 1 Oct 2024 11:42:07 -0400 From: Peter Xu To: Ryan Roberts Cc: David Hildenbrand , Mark Rutland , Linux-MM , Mike Rapoport Subject: Re: Warning on mremapped uffd-wp memory Message-ID: References: <810b44a8-d2ae-4107-b665-5a42eae2d948@arm.com> <520f4933-7164-4559-b6a9-8f28c1bff0d1@redhat.com> <7e52ca0b-39df-4979-8b16-9880e5a7149c@redhat.com> <97c7b531-daeb-468f-af2a-31980f6f6a84@redhat.com> <29404449-fcbe-4d54-85ce-44da0b202243@arm.com> <8723953e-d98b-4816-bf21-b8c76ff0999e@arm.com> MIME-Version: 1.0 In-Reply-To: <8723953e-d98b-4816-bf21-b8c76ff0999e@arm.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline X-Rspamd-Queue-Id: 16EE8180002 X-Stat-Signature: ify9rfixfz685re8ycp7p41kiss5ayiq X-Rspamd-Server: rspam09 X-Rspam-User: X-HE-Tag: 1727797332-715264 X-HE-Meta: U2FsdGVkX1+64guzoD6KRp1xDnoL/kw28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vOjjN5jugnQuMkMwOmS2vvGFJYgif+4urHO+W3J14SX8e2t7yaRpFm8rpjt7zsVsUGRxXUb/UlDDdGOMjVvenpn47HDL0XzwLFQOJDhFyF2Bai3/uGeLFtxu92ooCeLfw2AAZUVFdBZuGjeTCDMGusBA6vSwi5Bw0jbg3nAdHXouIvOu/6fiRC4TA9YN1xD/eua4gwP+Msgb7b7j290VmKTT1oK9xEWcD3yDuKEYMElDkrBiOUJNbIydaTWB9/g1wrGTYkVwFBFfOn1mGJxFEpV/BZG6GtSOIhSeKb+4awmrEOa2+nwpT37w1K7csJRGfvuTnUGI= X-Bogosity: Ham, tests=bogofilter, spamicity=0.001156, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Tue, Oct 01, 2024 at 04:31:31PM +0100, Ryan Roberts wrote: > On 01/10/2024 16:10, Peter Xu wrote: > > On Tue, Oct 01, 2024 at 03:27:48PM +0100, Ryan Roberts wrote: > >> Hi Peter, > >> > >> On 08/08/2024 12:25, Ryan Roberts wrote: > >>> On 07/08/2024 19:59, Peter Xu wrote: > >>>> On Wed, Aug 07, 2024 at 12:18:18PM +0200, David Hildenbrand wrote: > >>>>> On 07.08.24 10:58, David Hildenbrand wrote: > >>>>>> On 06.08.24 22:29, Peter Xu wrote: > >>>>>>> On Tue, Aug 06, 2024 at 06:37:55PM +0200, David Hildenbrand wrote: > >>>>>>>> On 06.08.24 17:15, Ryan Roberts wrote: > >>>>>>>>> Hi Peter, David, > >>>>>>> > >>>>>>> Hi, Ryan, > >>>>>>> > >>>>>>>>> > >>>>>>>>> syzkaller has found an issue (at least on arm64, but I suspect it will be > >>>>>>>>> visible on x86_64 too) that triggers the following warning: > >>>>>>> > >>>>>>> This is true. I can easily reproduce.. > >>>>>>> > >> > >> [...] > >> > >>>> When I'm looking at this specific issue again, it's more than ptes that > >>>> should need to remove the uffd-wp bit. We have: > >>>> > >>>> - pmd/pud/hugetlb in other paths that will need similar care.. > >>>> > >>>> - move_page_tables() smartness on HAVE_MOVE_PUD.. where we may need to > >>>> walk the pmd page removing the bits when necessary.. > >>>> > >>>> - more importantly, mremap_userfaultfd_prep() might be too late if it's > >>>> after moving pgtables.. > >>>> > >>>> - [not yet started looking] the mlock issue Ryan mentioned.. > >>>> > >>>> Looks like we'll need more things to fix and test.. > >>>> > >>>> I wished if I can simply disable UFFD_WP + EVENT_REMAP, but I think even > >>>> with that, by default when mremap() we should still logically tear down all > >>>> those uffd-wp bits which is the same as !EVENT_REMAP now.. > >>>> > >>>> Let me know if anyone would like to beat me to it on fixing the whole > >>>> thing, I'd be more than happy.. > >>> > >>> Afraid I won't be able to sign up to doing that work. > >>> > >>> Otherwise, I'll probably need to postpone > >>>> the fix of this issue for 1-2 weeks but finish some other things first.. > >> > >> I'm not sure if there was any progress on this? We are still seeing the problem > >> on v6.12-rc1. > > > > Hi, Ryan, > > > > I haven't yet got free time to look at this, sorry. I confess I didn't > > prioritize this as high, as I doubt anyone would make real use of it, or > > hit this issue in real workloads, and it'll even slow down generic > > workloads even if slightly. > > No problem, I'm acting as the middle man really, given -rc1 is out, Mark has > been running his usual fuzzing and noted that the issue still exists. So I > thought I'd just enquire to see if you were able to make any progress. I agree > its not high priority. Although for a panic_on_warn=1 kernel (which I understand > some use in deployment), this means that user space can panic the system, so I > guess it needs to be addressed eventually. > > > > > Do you want to have a look? It'll be great if so. Or I can try to find > > some time this month. > > I won't personally get time to look at this, since I'm busy with some other > commitments. But I might be able to find someone to look into it. Leave it with > me for now. Thank you! If there's patches I can definitely try to review them. Or if this won't get addressed before someone else pokes again, I'll do it. Thanks, -- Peter Xu