From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E4451212D93 for ; Fri, 10 Jan 2025 16:14:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736525658; cv=none; b=cbaPvpZnmKsJ5AVy0LKA3djHh+vOxrtYxQQMPVWG4pq1FvCPofcZZrSaARR0ybKOh7LXlHtAURKzNDemUAwTJFeGEmSEkZgHBOg3sxv+1vTN/qmp76OHfE3j8UJgTuLWlE3ravtjmTNcTVK4e7zbqU/9zmetsIEo29AU+Xq3Ks8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736525658; c=relaxed/simple; bh=jODUdTuI/kb9IOJIByeTUUzqs7Mufjx9nQsqGYrOkX4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=km1UGSwEXmxMveMe4UP0PD2UjxTBmJVVnXRnto0bq679ft4Pra9dw3IdOUmelCBbki1KWmXjoesgbdxFshkJntByyB1JZWWRLnQWUHJEg8xr1peBwW0DtA4sd8O7fx4uAqJk1WWGn3bKKrJ1npFZZpPBydlPQ5eH/H7LvYewEzI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=XU/NhqeC; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="XU/NhqeC" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=XSCNiXwkbrrGwO+bOa8mwcTbDPY8LHdCB1Ovt5uFNgI=; b=XU/NhqeCXyehlV6Meqp7Yuqquu 7NN7yvKZoODFxn6XFrtcZBV3cQKzXpZ35AE4Kg2SrhLpApKxu/iiKWR4EeEfKuEXPxgnREzBjekuZ V8BMIUAKSzMPdJMchkzfpSuQTYlbOsvElau1o0JHvv3WGFhEJmIdbr31MWdJ1nRkOJhl+IEuc9Vlv tvie5/B+hGmn5shEyyv4ZwyGm9jPQ3L7wxKqnVTQtsXqytzC9gio+NB9rlUxUoiKfzSO1cmoM8Ump HJli6BKEpTdMtDTlFEgLFiLxCY0b/THIgsTIUgsfCvj+pqUeBsekzykbGEG3IAiU8WHFTpQqqSBNa XndsZGcg==; Received: from willy by casper.infradead.org with local (Exim 4.98 #2 (Red Hat Linux)) id 1tWHe8-0000000E1F9-09BX; Fri, 10 Jan 2025 16:14:04 +0000 Date: Fri, 10 Jan 2025 16:14:03 +0000 From: Matthew Wilcox To: David Hildenbrand Cc: syzbot , akpm@linux-foundation.org, hdanton@sina.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, syzkaller-bugs@googlegroups.com Subject: Re: [syzbot] [mm?] WARNING in __folio_rmap_sanity_checks (2) Message-ID: References: <676fee37.050a0220.2f3838.0497.GAE@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Fri, Jan 10, 2025 at 04:48:03PM +0100, David Hildenbrand wrote: > On 28.12.24 13:25, syzbot wrote: > > syzbot has found a reproducer for the following issue on: > > > > HEAD commit: 8155b4ef3466 Add linux-next specific files for 20241220 > > git tree: linux-next > > console output: https://syzkaller.appspot.com/x/log.txt?x=1661050f980000 > > kernel config: https://syzkaller.appspot.com/x/.config?x=9c90bb7161a56c88 > > dashboard link: https://syzkaller.appspot.com/bug?extid=c0673e1f1f054fac28c2 > > compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40 > > syz repro: https://syzkaller.appspot.com/x/repro.syz?x=17438af8580000 > > C reproducer: https://syzkaller.appspot.com/x/repro.c?x=101006df980000 > > > > Downloadable assets: > > disk image: https://storage.googleapis.com/syzbot-assets/98a974fc662d/disk-8155b4ef.raw.xz > > vmlinux: https://storage.googleapis.com/syzbot-assets/2dea9b72f624/vmlinux-8155b4ef.xz > > kernel image: https://storage.googleapis.com/syzbot-assets/593a42b9eb34/bzImage-8155b4ef.xz > > mounted in repro: https://storage.googleapis.com/syzbot-assets/5f780361c9ef/mount_0.gz > > > > IMPORTANT: if you fix the issue, please add the following tag to the commit: > > Reported-by: syzbot+c0673e1f1f054fac28c2@syzkaller.appspotmail.com > > > > xfs_vn_setattr+0x25d/0x320 fs/xfs/xfs_iops.c:1065 > > notify_change+0xbca/0xe90 fs/attr.c:552 > > do_truncate+0x220/0x310 fs/open.c:65 > > do_ftruncate+0x4a1/0x540 fs/open.c:192 > > do_sys_ftruncate fs/open.c:207 [inline] > > __do_sys_ftruncate fs/open.c:212 [inline] > > __se_sys_ftruncate fs/open.c:210 [inline] > > __x64_sys_ftruncate+0x94/0xf0 fs/open.c:210 > > do_syscall_x64 arch/x86/entry/common.c:52 [inline] > > do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 > > entry_SYSCALL_64_after_hwframe+0x77/0x7f > > ------------[ cut here ]------------ > > WARNING: CPU: 1 PID: 11276 at ./include/linux/rmap.h:217 __folio_rmap_sanity_checks+0x369/0x590 include/linux/rmap.h:217 > > Modules linked in: > > CPU: 1 UID: 0 PID: 11276 Comm: syz-executor139 Not tainted 6.13.0-rc3-next-20241220-syzkaller #0 > > Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 > > RIP: 0010:__folio_rmap_sanity_checks+0x369/0x590 include/linux/rmap.h:217 > > Code: 0f 0b 90 e9 e9 fd ff ff e8 64 cb ab ff 48 ff cb e9 34 fe ff ff e8 57 cb ab ff 4c 89 e7 48 c7 c6 e0 a7 15 8c e8 08 a4 f5 ff 90 <0f> 0b 90 e9 25 fe ff ff e8 3a cb ab ff 4c 89 e7 48 c7 c6 40 a9 15 > > RSP: 0018:ffffc9000e67efd8 EFLAGS: 00010246 > > RAX: 8577b516ce8a9400 RBX: ffffea0001a58080 RCX: ffffc9000e67eb03 > > RDX: 0000000000000005 RSI: ffffffff8c0aaba0 RDI: ffffffff8c5fed00 > > RBP: 00000000000024c0 R08: ffffffff901ab1f7 R09: 1ffffffff203563e > > R10: dffffc0000000000 R11: fffffbfff203563f R12: ffffea0001a50000 > > R13: ffffea0001a55c00 R14: 0000000000000000 R15: 0000000000000093 > > FS: 00007f885c85f6c0(0000) GS:ffff8880b8700000(0000) knlGS:0000000000000000 > > CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 > > CR2: 00007f88545b7000 CR3: 000000007fea2000 CR4: 00000000003526f0 > > DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 > > DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 > > Call Trace: > > > > __folio_add_rmap mm/rmap.c:1170 [inline] > > __folio_add_file_rmap mm/rmap.c:1489 [inline] > > folio_add_file_rmap_ptes+0x82/0x380 mm/rmap.c:1511 > > set_pte_range+0x30c/0x750 mm/memory.c:5136 > > If I would have to guess, I would assume that we have a refcount issue such > that we succeed in splitting a folio while concurrently mapping it. That would seem hard to accomplish, because both hold the folio lock, so it wouldn't be just a refcount bug but also a locking bug. Not sure what this is though.