syzbot


BUG: spinlock bad magic in release_metapage

Status: upstream: reported C repro on 2024/09/10 08:16
Subsystems: jfs
[Documentation on labels]
Reported-by: syzbot+e380443eaa59bfb75a84@syzkaller.appspotmail.com
First crash: 25d, last: 15h33m
Cause bisection: the issue happens on the oldest tested release (bisect log)
Crash: general protection fault in release_metapage (log)
Repro: C syz .config
  
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [jfs?] BUG: spinlock bad magic in release_metapage 0 (1) 2024/09/10 08:16
Similar bugs (7)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-5.15 BUG: spinlock bad magic in release_metapage origin:upstream C 12 2d02h 19d 0/3 upstream: reported C repro on 2024/09/15 11:43
upstream BUG: unable to handle kernel paging request in take_dentry_name_snapshot reiserfs overlayfs C error done 30 181d 673d 0/28 closed as dup on 2023/10/04 08:35
linux-6.1 BUG: spinlock bad magic in release_metapage 24 10h31m 20h24m 0/3 upstream: reported on 2024/10/04 04:01
upstream BUG: spinlock bad magic in lock_sock_nested (2) bluetooth 1 990d 990d 0/28 auto-closed as invalid on 2022/04/18 01:34
upstream BUG: spinlock bad magic in lock_sock_nested bluetooth 26 1132d 1487d 0/28 auto-closed as invalid on 2021/12/27 15:41
upstream BUG: spinlock bad magic in btrfs_stop_all_workers btrfs 5 108d 108d 26/28 fixed on 2024/07/31 03:12
upstream BUG: spinlock bad magic in skb_queue_tail afs net 1 655d 651d 0/28 auto-obsoleted due to no activity on 2023/03/19 17:50

Sample crash report:
BUG: spinlock bad magic on CPU#1, jfsCommit/113
==================================================================
BUG: KASAN: slab-out-of-bounds in string_nocheck lib/vsprintf.c:646 [inline]
BUG: KASAN: slab-out-of-bounds in string+0x218/0x2b0 lib/vsprintf.c:728
Read of size 1 at addr ffff8880787b3780 by task jfsCommit/113

CPU: 1 UID: 0 PID: 113 Comm: jfsCommit Not tainted 6.12.0-rc1-syzkaller-00046-g7ec462100ef9 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:94 [inline]
 dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120
 print_address_description mm/kasan/report.c:377 [inline]
 print_report+0x169/0x550 mm/kasan/report.c:488
 kasan_report+0x143/0x180 mm/kasan/report.c:601
 string_nocheck lib/vsprintf.c:646 [inline]
 string+0x218/0x2b0 lib/vsprintf.c:728
 vsnprintf+0x1101/0x1da0 lib/vsprintf.c:2803
 vprintk_store+0x480/0x1160 kernel/printk/printk.c:2260
 vprintk_emit+0x271/0xa10 kernel/printk/printk.c:2383
 _printk+0xd5/0x120 kernel/printk/printk.c:2432
 spin_dump kernel/locking/spinlock_debug.c:64 [inline]
 spin_bug+0x13b/0x1d0 kernel/locking/spinlock_debug.c:78
 debug_spin_lock_before kernel/locking/spinlock_debug.c:86 [inline]
 do_raw_spin_lock+0x209/0x370 kernel/locking/spinlock_debug.c:115
 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:111 [inline]
 _raw_spin_lock_irqsave+0xe1/0x120 kernel/locking/spinlock.c:162
 __wake_up_common_lock+0x25/0x1e0 kernel/sched/wait.c:105
 unlock_metapage fs/jfs/jfs_metapage.c:39 [inline]
 release_metapage+0xb2/0x960 fs/jfs/jfs_metapage.c:763
 xtTruncate+0x1006/0x3270
 jfs_free_zero_link+0x46e/0x6e0 fs/jfs/namei.c:759
 jfs_evict_inode+0x35f/0x440 fs/jfs/inode.c:153
 evict+0x4e8/0x9b0 fs/inode.c:723
 txUpdateMap+0x931/0xb10 fs/jfs/jfs_txnmgr.c:2367
 txLazyCommit fs/jfs/jfs_txnmgr.c:2664 [inline]
 jfs_lazycommit+0x49a/0xb80 fs/jfs/jfs_txnmgr.c:2733
 kthread+0x2f0/0x390 kernel/kthread.c:389
 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
 </TASK>

The buggy address belongs to the object at ffff8880787b3750
 which belongs to the cache jfs_ip of size 2232
The buggy address is located 48 bytes inside of
 allocated 2232-byte region [ffff8880787b3750, ffff8880787b4008)

The buggy address belongs to the physical page:
page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x787b0
head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff)
page_type: f5(slab)
raw: 00fff00000000040 ffff888146ab2140 dead000000000122 0000000000000000
raw: 0000000000000000 00000000800d000d 00000001f5000000 0000000000000000
head: 00fff00000000040 ffff888146ab2140 dead000000000122 0000000000000000
head: 0000000000000000 00000000800d000d 00000001f5000000 0000000000000000
head: 00fff00000000003 ffffea0001e1ec01 ffffffffffffffff 0000000000000000
head: 0000000000000008 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 3, migratetype Reclaimable, gfp_mask 0xd2050(__GFP_IO|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_RECLAIMABLE), pid 5227, tgid 5227 (syz-executor957), ts 72544639764, free_ts 23223129084
 set_page_owner include/linux/page_owner.h:32 [inline]
 post_alloc_hook+0x1f3/0x230 mm/page_alloc.c:1537
 prep_new_page mm/page_alloc.c:1545 [inline]
 get_page_from_freelist+0x3039/0x3180 mm/page_alloc.c:3457
 __alloc_pages_noprof+0x256/0x6c0 mm/page_alloc.c:4733
 alloc_pages_mpol_noprof+0x3e8/0x680 mm/mempolicy.c:2265
 alloc_slab_page+0x6a/0x120 mm/slub.c:2413
 allocate_slab+0x5a/0x2f0 mm/slub.c:2579
 new_slab mm/slub.c:2632 [inline]
 ___slab_alloc+0xcd1/0x14b0 mm/slub.c:3819
 __slab_alloc+0x58/0xa0 mm/slub.c:3909
 __slab_alloc_node mm/slub.c:3962 [inline]
 slab_alloc_node mm/slub.c:4123 [inline]
 kmem_cache_alloc_lru_noprof+0x1c5/0x2b0 mm/slub.c:4154
 jfs_alloc_inode+0x28/0x70 fs/jfs/super.c:105
 alloc_inode fs/inode.c:263 [inline]
 new_inode_pseudo fs/inode.c:1102 [inline]
 new_inode+0x6e/0x310 fs/inode.c:1121
 jfs_fill_super+0x408/0xc50 fs/jfs/super.c:544
 mount_bdev+0x20a/0x2d0 fs/super.c:1679
 legacy_get_tree+0xee/0x190 fs/fs_context.c:662
 vfs_get_tree+0x90/0x2b0 fs/super.c:1800
 do_new_mount+0x2be/0xb40 fs/namespace.c:3507
page last free pid 1 tgid 1 stack trace:
 reset_page_owner include/linux/page_owner.h:25 [inline]
 free_pages_prepare mm/page_alloc.c:1108 [inline]
 free_unref_page+0xcd0/0xf00 mm/page_alloc.c:2638
 free_contig_range+0x152/0x550 mm/page_alloc.c:6748
 destroy_args+0x8a/0x840 mm/debug_vm_pgtable.c:1017
 debug_vm_pgtable+0x4be/0x550 mm/debug_vm_pgtable.c:1397
 do_one_initcall+0x248/0x880 init/main.c:1269
 do_initcall_level+0x157/0x210 init/main.c:1331
 do_initcalls+0x3f/0x80 init/main.c:1347
 kernel_init_freeable+0x435/0x5d0 init/main.c:1580
 kernel_init+0x1d/0x2b0 init/main.c:1469
 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244

Memory state around the buggy address:
 ffff8880787b3680: 00 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc
 ffff8880787b3700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff8880787b3780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
                   ^
 ffff8880787b3800: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff8880787b3880: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================

Crashes (44):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/10/03 23:52 upstream 7ec462100ef9 d7906eff .config strace log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-upstream-fs BUG: spinlock bad magic in release_metapage
2024/10/01 22:04 upstream e32cde8d2bd7 ea2b66a6 .config strace log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-upstream-fs BUG: spinlock bad magic in release_metapage
2024/09/19 16:40 upstream 839c4f596f89 c673ca06 .config strace log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-upstream-fs BUG: spinlock bad magic in release_metapage
2024/09/18 13:59 upstream bdf56c7580d2 c673ca06 .config strace log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-upstream-fs BUG: spinlock bad magic in release_metapage
2024/10/02 04:45 upstream e32cde8d2bd7 ea2b66a6 .config console log report syz / log C [disk image (non-bootable)] [vmlinux] [kernel image] [mounted in repro] ci-snapshot-upstream-root BUG: spinlock bad magic in release_metapage
2024/09/21 21:02 upstream 1ec6d097897a 6f888b75 .config console log report syz / log C [disk image (non-bootable)] [vmlinux] [kernel image] [mounted in repro] ci-snapshot-upstream-root BUG: spinlock bad magic in release_metapage
2024/09/20 16:23 upstream baeb9a7d8b60 6f888b75 .config console log report syz / log C [disk image (non-bootable)] [vmlinux] [kernel image] [mounted in repro] ci-snapshot-upstream-root BUG: spinlock bad magic in release_metapage
2024/09/19 13:36 upstream 932d2d1fcb2b 6f888b75 .config console log report syz / log C [disk image (non-bootable)] [vmlinux] [kernel image] [mounted in repro] ci-snapshot-upstream-root BUG: spinlock bad magic in release_metapage
2024/09/19 13:06 upstream 932d2d1fcb2b 6f888b75 .config console log report syz / log C [disk image (non-bootable)] [vmlinux] [kernel image] [mounted in repro] ci-snapshot-upstream-root BUG: spinlock bad magic in release_metapage
2024/09/19 12:31 upstream 932d2d1fcb2b 6f888b75 .config console log report syz / log C [disk image (non-bootable)] [vmlinux] [kernel image] [mounted in repro] ci-snapshot-upstream-root BUG: spinlock bad magic in release_metapage
2024/09/09 19:28 upstream da3ea35007d0 8f722c94 .config console log report syz / log C [disk image (non-bootable)] [vmlinux] [kernel image] [mounted in repro] ci-snapshot-upstream-root BUG: spinlock bad magic in release_metapage
2024/10/04 08:34 upstream 0c559323bbaa d7906eff .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs BUG: spinlock bad magic in release_metapage
2024/10/03 23:14 upstream 7ec462100ef9 d7906eff .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs BUG: spinlock bad magic in release_metapage
2024/10/03 18:32 upstream 7ec462100ef9 d7906eff .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs BUG: spinlock bad magic in release_metapage
2024/10/03 07:13 upstream f23aa4c0761a a4c7fd36 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs BUG: spinlock bad magic in release_metapage
2024/10/02 23:55 upstream f23aa4c0761a 02f9582a .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs BUG: spinlock bad magic in release_metapage
2024/10/02 20:15 upstream e32cde8d2bd7 02f9582a .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs BUG: spinlock bad magic in release_metapage
2024/10/01 15:50 upstream e32cde8d2bd7 ea2b66a6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs BUG: spinlock bad magic in release_metapage
2024/10/01 15:50 upstream e32cde8d2bd7 ea2b66a6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs BUG: spinlock bad magic in release_metapage
2024/10/01 15:49 upstream e32cde8d2bd7 ea2b66a6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs BUG: spinlock bad magic in release_metapage
2024/10/01 15:19 upstream e32cde8d2bd7 ea2b66a6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs BUG: spinlock bad magic in release_metapage
2024/09/28 14:15 upstream ad46e8f95e93 ba29ff75 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs BUG: spinlock bad magic in release_metapage
2024/09/24 17:22 upstream abf2050f51fd 5643e0e9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs BUG: spinlock bad magic in release_metapage
2024/09/23 08:05 upstream de5cb0dcb74c 6f888b75 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs BUG: spinlock bad magic in release_metapage
2024/09/23 01:34 upstream de5cb0dcb74c 6f888b75 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs BUG: spinlock bad magic in release_metapage
2024/09/23 01:11 upstream de5cb0dcb74c 6f888b75 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs BUG: spinlock bad magic in release_metapage
2024/09/22 05:04 upstream 1ec6d097897a 6f888b75 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs BUG: spinlock bad magic in release_metapage
2024/09/20 01:12 upstream 2004cef11ea0 6f888b75 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs BUG: spinlock bad magic in release_metapage
2024/09/17 19:27 upstream 2f27fce67173 c673ca06 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs BUG: spinlock bad magic in release_metapage
2024/09/16 09:59 upstream 98f7e32f20d2 08d8a733 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs BUG: spinlock bad magic in release_metapage
2024/09/15 18:39 upstream d42f7708e27c 08d8a733 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs BUG: spinlock bad magic in release_metapage
2024/09/17 06:55 upstream a430d95c5efa c673ca06 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root BUG: spinlock bad magic in release_metapage
2024/09/09 18:46 upstream da3ea35007d0 8f722c94 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root BUG: spinlock bad magic in release_metapage
2024/10/02 22:55 linux-next fe2173353674 a4c7fd36 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root BUG: spinlock bad magic in release_metapage
2024/10/02 22:55 linux-next fe2173353674 a4c7fd36 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root BUG: spinlock bad magic in release_metapage
2024/10/02 22:54 linux-next fe2173353674 a4c7fd36 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root BUG: spinlock bad magic in release_metapage
2024/10/02 05:29 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci 5f5673607153 ea2b66a6 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 BUG: spinlock bad magic in release_metapage
2024/09/30 04:34 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci 5f5673607153 ba29ff75 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 BUG: spinlock bad magic in release_metapage
2024/09/29 18:48 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci 5f5673607153 ba29ff75 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 BUG: spinlock bad magic in release_metapage
2024/09/22 23:54 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci 5f5673607153 6f888b75 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 BUG: spinlock bad magic in release_metapage
2024/09/22 20:14 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci 5f5673607153 6f888b75 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 BUG: spinlock bad magic in release_metapage
2024/09/22 16:03 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci 5f5673607153 6f888b75 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 BUG: spinlock bad magic in release_metapage
2024/09/19 10:43 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci 5f5673607153 c673ca06 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 BUG: spinlock bad magic in release_metapage
* Struck through repros no longer work on HEAD.