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 48362CEACD5 for ; Tue, 1 Oct 2024 15:31:39 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B9DBF280094; Tue, 1 Oct 2024 11:31:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B4B29280068; Tue, 1 Oct 2024 11:31:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A12F4280094; Tue, 1 Oct 2024 11:31:38 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 8265B280068 for ; Tue, 1 Oct 2024 11:31:38 -0400 (EDT) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 1BB94140C00 for ; Tue, 1 Oct 2024 15:31:38 +0000 (UTC) X-FDA: 82625423076.22.39574D2 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf12.hostedemail.com (Postfix) with ESMTP id EFFC640021 for ; Tue, 1 Oct 2024 15:31:35 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf12.hostedemail.com: domain of ryan.roberts@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=ryan.roberts@arm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1727796570; 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:in-reply-to:references:references; bh=8cCTZuGrEFtvObsgrUQPFAX/NNR5jEnRFfbrn9j94ag=; b=62q5iEp2aMzQ14/LlWpoENBkvBZS/L3ZHSXAjkQx2oedzdVvaLhIMJg9qiKAlBiU25jiLE PumzKmpn1RKRt6yuMXvsRPTH8tYh9BKHkgjqfaMnvmqoZLT2Axd7pdz80+y5S7OLeTri40 nINiruV5TDt94nwB8E/koxgJ3aI7Aak= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1727796570; a=rsa-sha256; cv=none; b=lXbgdhCZz+s0Ex+N6CjuQq+aZSJyDcWtBOBIuSs4InOAciRlbublgPoO1CwYimfAeyKZHr Mir/dEvKZFTMrvHDxGSkCTpBOCOLk2Ii2dwiSAPeTiPGh3oLb9VA2YKYSJCThZamBGsBvL 8pOb2dZxukiv9DiVdAS03x9TYVET7F4= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf12.hostedemail.com: domain of ryan.roberts@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=ryan.roberts@arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 69FD3339; Tue, 1 Oct 2024 08:32:03 -0700 (PDT) Received: from [10.1.27.167] (XHFQ2J9959.cambridge.arm.com [10.1.27.167]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 1D4363F64C; Tue, 1 Oct 2024 08:31:32 -0700 (PDT) Message-ID: <8723953e-d98b-4816-bf21-b8c76ff0999e@arm.com> Date: Tue, 1 Oct 2024 16:31:31 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Warning on mremapped uffd-wp memory Content-Language: en-GB To: Peter Xu Cc: David Hildenbrand , Mark Rutland , Linux-MM , Mike Rapoport 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> From: Ryan Roberts In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: EFFC640021 X-Stat-Signature: dfhdcqkr49ryft3uagfi9cfiqm1nmzn9 X-Rspamd-Server: rspam09 X-Rspam-User: X-HE-Tag: 1727796695-410815 X-HE-Meta: U2FsdGVkX1+nAjR6C4ynYNZkFoIQ1vhoVc9yoUOuop0DyleXVB4aqXaE7MBpdETq5Ra+QMPIZ/j5ddUoIy7c/6p0Bxpn6DX6wtLREu9AI0dpB1m0FF0KN+8BBIntW1Kd1JUBIwuXMYn7T0aM8EqmLkXpCYL82z6f+Un2pVwImNbTRLzv5uco5fNh+KQkFxLykFqDqqiQlEv/IqLAWuIA58O19LJlXvGw2Uw+Hn1j3Pa/EahwIYr+YLwOrLoH+KjvcbVF186PGJeAyP6FQVRiiSHYFRRY3j1+Etd4ne0FjX4OAZK551mPKvtOleVnh8Fbx02ZYGiQoe8PNDEFCYtTB/jIwWTY60KO6riIW9Y5u6jWbt8n+b5dcNkt117PGQaq3DX3j1X+NdFBQpHT/+30C/3kILuvu+jPevGHnU9Ar1ykG8AsysLjE05PAtfU0mYXQZZ9qNR5sVaYuInHpenBLpukbZrDEbbyPM6ma2a7LoTLE1xlYvRn38If99683iB/2GuzHU7g6Pfyt9DozOKwhcuTxFsGHNsjlM4pRCiAe6UrQkgeui5KGFHSVl2JHllePjn27H7TKa6wPoQ3X4cYiE7SkBUmQmf24d5mMLmEe2XEvVPaeaMpu0ljbYb9N5xKvEPfeAQoREalDIaJhU6tML5fkre6e7x4YKdRKoEKM22c+y/iH4EBAqvxhUnadcYn6wmbCpEp8HryhUrMVpNXC+tkJbWQVjnB9K6tOEKDxGMCoXeU6qar+n/APLgRqzuRkMh+DZgVfv3FBZKIBOAYipTqkJlWRrhelE6yhqBGuvLt5/eBvLOIbFHXEGJ2AW4i+MFiPS+Nt6lPR3F301TK3cQ8Ac+7LBSUWgA8VOQeHym5qe4sX9Qx73X+d35npnv++ZE0vmt+by/5Ipqo9gXxOoYxN8ODidIC/2irawmYYhPHLshIYX8PJMWHh5On/IYA2IX9T8XFMUr3UWzVTBe Q56e3xfQ PU6ysKymubFkpRHrPLSKvokaDHqJWhjVI9XXZKETh1Mw4bL0x/AK1Y/atAYIE71QXvtOcYNuVSuEqUF3hrdGWytSOLAd6RfRT3iYHVNt84MLolkxv+lFeWhnqRl+TdtRNXYtp8EAXCkIdaUI= 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: List-Subscribe: List-Unsubscribe: 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. Thanks, Ryan > > Thanks, >