public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [syzbot] [wireguard?] WARNING: locking bug in try_to_wake_up
@ 2024-05-15 18:41 syzbot
  2024-09-30 23:39 ` [syzbot] [kernel] " syzbot
  0 siblings, 1 reply; 6+ messages in thread
From: syzbot @ 2024-05-15 18:41 UTC (permalink / raw)
  To: Jason, davem, edumazet, kuba, linux-kernel, netdev, pabeni,
	syzkaller-bugs, wireguard

Hello,

syzbot found the following issue on:

HEAD commit:    cf87f46fd34d Merge tag 'drm-fixes-2024-05-11' of https://g..
git tree:       upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=16b04970980000
kernel config:  https://syzkaller.appspot.com/x/.config?x=6d14c12b661fb43
dashboard link: https://syzkaller.appspot.com/bug?extid=8aaf2df2ef0164ffe1fb
compiler:       Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/1aa5ad92dfce/disk-cf87f46f.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/67c336f7c1c7/vmlinux-cf87f46f.xz
kernel image: https://storage.googleapis.com/syzbot-assets/bb5b717bd2b8/bzImage-cf87f46f.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+8aaf2df2ef0164ffe1fb@syzkaller.appspotmail.com

=============================
[ BUG: Invalid wait context ]
6.9.0-rc7-syzkaller-00183-gcf87f46fd34d #0 Not tainted
-----------------------------
kworker/0:5/10404 is trying to lock:
ffff8880b953e698 (iattr_mutex){+.+.}-{3:3}, at: raw_spin_rq_lock_nested+0x2a/0x140 kernel/sched/core.c:559
other info that might help us debug this:
context-{4:4}
5 locks held by kworker/0:5/10404:
 #0: ffff888069fd5d48 ((wq_completion)wg-crypt-wg0#12){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3242 [inline]
 #0: ffff888069fd5d48 ((wq_completion)wg-crypt-wg0#12){+.+.}-{0:0}, at: process_scheduled_works+0x8e0/0x17c0 kernel/workqueue.c:3348
 #1: ffffc9000a4b7d00 ((work_completion)(&({ do { const void *__vpp_verify = (typeof((worker) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __ptr = (unsigned long) ((typeof(*((worker))) *)((worker))); (typeof((typeof(*((worker))) *)((worker)))) (__ptr + (((__per_cpu_offset[(cpu)])))); }); })->work)){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3243 [inline]
 #1: ffffc9000a4b7d00 ((work_completion)(&({ do { const void *__vpp_verify = (typeof((worker) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __ptr = (unsigned long) ((typeof(*((worker))) *)((worker))); (typeof((typeof(*((worker))) *)((worker)))) (__ptr + (((__per_cpu_offset[(cpu)])))); }); })->work)){+.+.}-{0:0}, at: process_scheduled_works+0x91b/0x17c0 kernel/workqueue.c:3348
 #2: ffffffff8e334da0 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:329 [inline]
 #2: ffffffff8e334da0 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:781 [inline]
 #2: ffffffff8e334da0 (rcu_read_lock){....}-{1:2}, at: __queue_work+0x198/0xef0 kernel/workqueue.c:2337
 #3: ffff8880b953de18 (&pool->lock){-.-.}-{2:2}, at: __queue_work+0x6ec/0xef0
 #4: ffff8880206b6410 (&p->pi_lock){-.-.}-{2:2}, at: class_raw_spinlock_irqsave_constructor include/linux/spinlock.h:553 [inline]
 #4: ffff8880206b6410 (&p->pi_lock){-.-.}-{2:2}, at: try_to_wake_up+0xb0/0x1470 kernel/sched/core.c:4262
stack backtrace:
CPU: 0 PID: 10404 Comm: kworker/0:5 Not tainted 6.9.0-rc7-syzkaller-00183-gcf87f46fd34d #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024
Workqueue: wg-crypt-wg0 wg_packet_encrypt_worker
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114
 print_lock_invalid_wait_context kernel/locking/lockdep.c:4751 [inline]
 check_wait_context kernel/locking/lockdep.c:4821 [inline]
 __lock_acquire+0x1507/0x1fd0 kernel/locking/lockdep.c:5087
 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754
 _raw_spin_lock_nested+0x31/0x40 kernel/locking/spinlock.c:378
 raw_spin_rq_lock_nested+0x2a/0x140 kernel/sched/core.c:559
 raw_spin_rq_lock kernel/sched/sched.h:1387 [inline]
 rq_lock kernel/sched/sched.h:1701 [inline]
 ttwu_queue kernel/sched/core.c:4055 [inline]
 try_to_wake_up+0x7d3/0x1470 kernel/sched/core.c:4378
 kick_pool+0x45c/0x620 kernel/workqueue.c:1288
 __queue_work+0xc30/0xef0 kernel/workqueue.c:2414
 queue_work_on+0x14f/0x250 kernel/workqueue.c:2448
 wg_queue_enqueue_per_peer_tx+0x21f/0x4b0 drivers/net/wireguard/queueing.h:188
 wg_packet_encrypt_worker+0x1240/0x1610 drivers/net/wireguard/send.c:305
 process_one_work kernel/workqueue.c:3267 [inline]
 process_scheduled_works+0xa12/0x17c0 kernel/workqueue.c:3348
 worker_thread+0x86d/0xd70 kernel/workqueue.c:3429
 kthread+0x2f2/0x390 kernel/kthread.c:388
 ret_from_fork+0x4d/0x80 arch/x86/kernel/process.c:147
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
 </TASK>


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzkaller@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [syzbot] [kernel] WARNING: locking bug in try_to_wake_up
  2024-05-15 18:41 [syzbot] [wireguard?] WARNING: locking bug in try_to_wake_up syzbot
@ 2024-09-30 23:39 ` syzbot
  2024-10-01  1:49   ` Hillf Danton
  2024-10-01  8:31   ` Hillf Danton
  0 siblings, 2 replies; 6+ messages in thread
From: syzbot @ 2024-09-30 23:39 UTC (permalink / raw)
  To: clm, davem, dsterba, edumazet, jason, josef, kuba, linux-btrfs,
	linux-kernel, netdev, pabeni, syzkaller-bugs, wireguard

syzbot has found a reproducer for the following issue on:

HEAD commit:    9852d85ec9d4 Linux 6.12-rc1
git tree:       upstream
console+strace: https://syzkaller.appspot.com/x/log.txt?x=16c0ddd0580000
kernel config:  https://syzkaller.appspot.com/x/.config?x=1f009dd80b3799c2
dashboard link: https://syzkaller.appspot.com/bug?extid=8aaf2df2ef0164ffe1fb
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=12017d07980000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=13ad839f980000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/3a7fe74d3205/disk-9852d85e.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/0332f06aa08e/vmlinux-9852d85e.xz
kernel image: https://storage.googleapis.com/syzbot-assets/58ddf291e00e/bzImage-9852d85e.xz
mounted in repro #1: https://storage.googleapis.com/syzbot-assets/7b9a21b4b8c9/mount_0.gz
mounted in repro #2: https://storage.googleapis.com/syzbot-assets/e0b9c39ab630/mount_2.gz
mounted in repro #3: https://storage.googleapis.com/syzbot-assets/6d11f8e19e12/mount_10.gz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+8aaf2df2ef0164ffe1fb@syzkaller.appspotmail.com

==================================================================
BUG: KASAN: slab-use-after-free in __lock_acquire+0x77/0x2050 kernel/locking/lockdep.c:5065
Read of size 8 at addr ffff8880272a8a18 by task kworker/u8:3/52

CPU: 1 UID: 0 PID: 52 Comm: kworker/u8:3 Not tainted 6.12.0-rc1-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
Workqueue: btrfs-fixup btrfs_work_helper
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
 __lock_acquire+0x77/0x2050 kernel/locking/lockdep.c:5065
 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5825
 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
 _raw_spin_lock_irqsave+0xd5/0x120 kernel/locking/spinlock.c:162
 class_raw_spinlock_irqsave_constructor include/linux/spinlock.h:551 [inline]
 try_to_wake_up+0xb0/0x1480 kernel/sched/core.c:4154
 btrfs_writepage_fixup_worker+0xc16/0xdf0 fs/btrfs/inode.c:2842
 btrfs_work_helper+0x390/0xc50 fs/btrfs/async-thread.c:314
 process_one_work kernel/workqueue.c:3229 [inline]
 process_scheduled_works+0xa63/0x1850 kernel/workqueue.c:3310
 worker_thread+0x870/0xd30 kernel/workqueue.c:3391
 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>

Allocated by task 2:
 kasan_save_stack mm/kasan/common.c:47 [inline]
 kasan_save_track+0x3f/0x80 mm/kasan/common.c:68
 unpoison_slab_object mm/kasan/common.c:319 [inline]
 __kasan_slab_alloc+0x66/0x80 mm/kasan/common.c:345
 kasan_slab_alloc include/linux/kasan.h:247 [inline]
 slab_post_alloc_hook mm/slub.c:4086 [inline]
 slab_alloc_node mm/slub.c:4135 [inline]
 kmem_cache_alloc_node_noprof+0x16b/0x320 mm/slub.c:4187
 alloc_task_struct_node kernel/fork.c:180 [inline]
 dup_task_struct+0x57/0x8c0 kernel/fork.c:1107
 copy_process+0x5d1/0x3d50 kernel/fork.c:2206
 kernel_clone+0x223/0x880 kernel/fork.c:2787
 kernel_thread+0x1bc/0x240 kernel/fork.c:2849
 create_kthread kernel/kthread.c:412 [inline]
 kthreadd+0x60d/0x810 kernel/kthread.c:765
 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244

Freed by task 61:
 kasan_save_stack mm/kasan/common.c:47 [inline]
 kasan_save_track+0x3f/0x80 mm/kasan/common.c:68
 kasan_save_free_info+0x40/0x50 mm/kasan/generic.c:579
 poison_slab_object mm/kasan/common.c:247 [inline]
 __kasan_slab_free+0x59/0x70 mm/kasan/common.c:264
 kasan_slab_free include/linux/kasan.h:230 [inline]
 slab_free_hook mm/slub.c:2343 [inline]
 slab_free mm/slub.c:4580 [inline]
 kmem_cache_free+0x1a2/0x420 mm/slub.c:4682
 put_task_struct include/linux/sched/task.h:144 [inline]
 delayed_put_task_struct+0x125/0x300 kernel/exit.c:228
 rcu_do_batch kernel/rcu/tree.c:2567 [inline]
 rcu_core+0xaaa/0x17a0 kernel/rcu/tree.c:2823
 handle_softirqs+0x2c5/0x980 kernel/softirq.c:554
 __do_softirq kernel/softirq.c:588 [inline]
 invoke_softirq kernel/softirq.c:428 [inline]
 __irq_exit_rcu+0xf4/0x1c0 kernel/softirq.c:637
 irq_exit_rcu+0x9/0x30 kernel/softirq.c:649
 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1037 [inline]
 sysvec_apic_timer_interrupt+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1037
 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702

Last potentially related work creation:
 kasan_save_stack+0x3f/0x60 mm/kasan/common.c:47
 __kasan_record_aux_stack+0xac/0xc0 mm/kasan/generic.c:541
 __call_rcu_common kernel/rcu/tree.c:3086 [inline]
 call_rcu+0x167/0xa70 kernel/rcu/tree.c:3190
 context_switch kernel/sched/core.c:5318 [inline]
 __schedule+0x184b/0x4ae0 kernel/sched/core.c:6675
 schedule_idle+0x56/0x90 kernel/sched/core.c:6793
 do_idle+0x56a/0x5d0 kernel/sched/idle.c:354
 cpu_startup_entry+0x42/0x60 kernel/sched/idle.c:424
 start_secondary+0x102/0x110 arch/x86/kernel/smpboot.c:314
 common_startup_64+0x13e/0x147

The buggy address belongs to the object at ffff8880272a8000
 which belongs to the cache task_struct of size 7424
The buggy address is located 2584 bytes inside of
 freed 7424-byte region [ffff8880272a8000, ffff8880272a9d00)

The buggy address belongs to the physical page:
page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x272a8
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 ffff88801bafa500 dead000000000122 0000000000000000
raw: 0000000000000000 0000000080040004 00000001f5000000 0000000000000000
head: 00fff00000000040 ffff88801bafa500 dead000000000122 0000000000000000
head: 0000000000000000 0000000080040004 00000001f5000000 0000000000000000
head: 00fff00000000003 ffffea00009caa01 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 Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 2, tgid 2 (kthreadd), ts 71247381401, free_ts 71214998153
 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_node_noprof+0x1fe/0x320 mm/slub.c:4187
 alloc_task_struct_node kernel/fork.c:180 [inline]
 dup_task_struct+0x57/0x8c0 kernel/fork.c:1107
 copy_process+0x5d1/0x3d50 kernel/fork.c:2206
 kernel_clone+0x223/0x880 kernel/fork.c:2787
 kernel_thread+0x1bc/0x240 kernel/fork.c:2849
 create_kthread kernel/kthread.c:412 [inline]
 kthreadd+0x60d/0x810 kernel/kthread.c:765
 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
page last free pid 5230 tgid 5230 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
 discard_slab mm/slub.c:2678 [inline]
 __put_partials+0xeb/0x130 mm/slub.c:3146
 put_cpu_partial+0x17c/0x250 mm/slub.c:3221
 __slab_free+0x2ea/0x3d0 mm/slub.c:4450
 qlink_free mm/kasan/quarantine.c:163 [inline]
 qlist_free_all+0x9a/0x140 mm/kasan/quarantine.c:179
 kasan_quarantine_reduce+0x14f/0x170 mm/kasan/quarantine.c:286
 __kasan_slab_alloc+0x23/0x80 mm/kasan/common.c:329
 kasan_slab_alloc include/linux/kasan.h:247 [inline]
 slab_post_alloc_hook mm/slub.c:4086 [inline]
 slab_alloc_node mm/slub.c:4135 [inline]
 kmem_cache_alloc_noprof+0x135/0x2a0 mm/slub.c:4142
 getname_flags+0xb7/0x540 fs/namei.c:139
 do_sys_openat2+0xd2/0x1d0 fs/open.c:1409
 do_sys_open fs/open.c:1430 [inline]
 __do_sys_openat fs/open.c:1446 [inline]
 __se_sys_openat fs/open.c:1441 [inline]
 __x64_sys_openat+0x247/0x2a0 fs/open.c:1441
 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

Memory state around the buggy address:
 ffff8880272a8900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8880272a8980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff8880272a8a00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                            ^
 ffff8880272a8a80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8880272a8b00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================


---
If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [syzbot] [kernel] WARNING: locking bug in try_to_wake_up
  2024-09-30 23:39 ` [syzbot] [kernel] " syzbot
@ 2024-10-01  1:49   ` Hillf Danton
  2024-10-01  2:10     ` syzbot
  2024-10-01  8:31   ` Hillf Danton
  1 sibling, 1 reply; 6+ messages in thread
From: Hillf Danton @ 2024-10-01  1:49 UTC (permalink / raw)
  To: syzbot; +Cc: linux-kernel, syzkaller-bugs

On Mon, 30 Sep 2024 16:39:29 -0700
> syzbot has found a reproducer for the following issue on:
> 
> HEAD commit:    9852d85ec9d4 Linux 6.12-rc1
> git tree:       upstream
> C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=13ad839f980000

#syz test

--- x/fs/btrfs/disk-io.c
+++ y/fs/btrfs/disk-io.c
@@ -4315,9 +4315,6 @@ void __cold close_ctree(struct btrfs_fs_
 	if (BTRFS_FS_ERROR(fs_info))
 		btrfs_error_commit_super(fs_info);
 
-	kthread_stop(fs_info->transaction_kthread);
-	kthread_stop(fs_info->cleaner_kthread);
-
 	ASSERT(list_empty(&fs_info->delayed_iputs));
 	set_bit(BTRFS_FS_CLOSING_DONE, &fs_info->flags);
 
@@ -4349,6 +4346,8 @@ void __cold close_ctree(struct btrfs_fs_
 	 */
 	invalidate_inode_pages2(fs_info->btree_inode->i_mapping);
 	btrfs_stop_all_workers(fs_info);
+	kthread_stop(fs_info->transaction_kthread);
+	kthread_stop(fs_info->cleaner_kthread);
 
 	/* We shouldn't have any transaction open at this point */
 	warn_about_uncommitted_trans(fs_info);
--

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [syzbot] [kernel] WARNING: locking bug in try_to_wake_up
  2024-10-01  1:49   ` Hillf Danton
@ 2024-10-01  2:10     ` syzbot
  0 siblings, 0 replies; 6+ messages in thread
From: syzbot @ 2024-10-01  2:10 UTC (permalink / raw)
  To: hdanton, linux-kernel, syzkaller-bugs

Hello,

syzbot has tested the proposed patch but the reproducer is still triggering an issue:
kernel BUG in close_ctree

BTRFS info (device loop0): last unmount of filesystem c9fe44da-de57-406a-8241-57ec7d4412cf
assertion failed: list_empty(&fs_info->delalloc_roots), in fs/btrfs/disk-io.c:4327
------------[ cut here ]------------
kernel BUG at fs/btrfs/disk-io.c:4327!
Oops: invalid opcode: 0000 [#1] PREEMPT SMP KASAN PTI
CPU: 1 UID: 0 PID: 5820 Comm: syz-executor Not tainted 6.12.0-rc1-syzkaller-00031-ge32cde8d2bd7-dirty #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
RIP: 0010:close_ctree+0x912/0xd20 fs/btrfs/disk-io.c:4327
Code: ff ff 90 0f 0b e8 7e d1 da f5 48 c7 c7 40 30 4c 8c 48 c7 c6 80 60 4c 8c 48 c7 c2 c0 30 4c 8c b9 e7 10 00 00 e8 0f 9d ff ff 90 <0f> 0b e8 57 d1 da f5 48 c7 c7 40 30 4c 8c 48 c7 c6 20 7c 4c 8c 48
RSP: 0018:ffffc90002f6fb60 EFLAGS: 00010246
RAX: 0000000000000052 RBX: ffff888030de0f28 RCX: 618777cd44da3000
RDX: 0000000000000000 RSI: 0000000080000000 RDI: 0000000000000000
RBP: ffffc90002f6fd00 R08: ffffffff81749d9c R09: 1ffff920005edf08
R10: dffffc0000000000 R11: fffff520005edf09 R12: ffff888030de0000
R13: dffffc0000000000 R14: 1ffff110061bc272 R15: 0000000000000000
FS:  0000555562490500(0000) GS:ffff8880b8700000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000000c00191d740 CR3: 000000007010e000 CR4: 00000000003526f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 generic_shutdown_super+0x139/0x2d0 fs/super.c:642
 kill_anon_super+0x3b/0x70 fs/super.c:1237
 btrfs_kill_super+0x41/0x50 fs/btrfs/super.c:2121
 deactivate_locked_super+0xc4/0x130 fs/super.c:473
 cleanup_mnt+0x41f/0x4b0 fs/namespace.c:1373
 task_work_run+0x24f/0x310 kernel/task_work.c:228
 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline]
 exit_to_user_mode_loop kernel/entry/common.c:114 [inline]
 exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline]
 __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline]
 syscall_exit_to_user_mode+0x168/0x370 kernel/entry/common.c:218
 do_syscall_64+0x100/0x230 arch/x86/entry/common.c:89
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f9dd257f327
Code: a8 ff ff ff f7 d8 64 89 01 48 83 c8 ff c3 0f 1f 44 00 00 31 f6 e9 09 00 00 00 66 0f 1f 84 00 00 00 00 00 b8 a6 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 01 c3 48 c7 c2 a8 ff ff ff f7 d8 64 89 02 b8
RSP: 002b:00007ffd8c162128 EFLAGS: 00000246 ORIG_RAX: 00000000000000a6
RAX: 0000000000000000 RBX: 0000000000000000 RCX: 00007f9dd257f327
RDX: 0000000000000000 RSI: 0000000000000009 RDI: 00007ffd8c1621e0
RBP: 00007ffd8c1621e0 R08: 0000000000000000 R09: 0000000000000000
R10: 00000000ffffffff R11: 0000000000000246 R12: 00007ffd8c163260
R13: 00007f9dd25f0134 R14: 000000000001c212 R15: 00007ffd8c1632a0
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:close_ctree+0x912/0xd20 fs/btrfs/disk-io.c:4327
Code: ff ff 90 0f 0b e8 7e d1 da f5 48 c7 c7 40 30 4c 8c 48 c7 c6 80 60 4c 8c 48 c7 c2 c0 30 4c 8c b9 e7 10 00 00 e8 0f 9d ff ff 90 <0f> 0b e8 57 d1 da f5 48 c7 c7 40 30 4c 8c 48 c7 c6 20 7c 4c 8c 48
RSP: 0018:ffffc90002f6fb60 EFLAGS: 00010246
RAX: 0000000000000052 RBX: ffff888030de0f28 RCX: 618777cd44da3000
RDX: 0000000000000000 RSI: 0000000080000000 RDI: 0000000000000000
RBP: ffffc90002f6fd00 R08: ffffffff81749d9c R09: 1ffff920005edf08
R10: dffffc0000000000 R11: fffff520005edf09 R12: ffff888030de0000
R13: dffffc0000000000 R14: 1ffff110061bc272 R15: 0000000000000000
FS:  0000555562490500(0000) GS:ffff8880b8600000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00005555624ab5c8 CR3: 000000007010e000 CR4: 00000000003526f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400


Tested on:

commit:         e32cde8d Merge tag 'sched_ext-for-6.12-rc1-fixes-1' of..
git tree:       upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=1222ddd0580000
kernel config:  https://syzkaller.appspot.com/x/.config?x=1f009dd80b3799c2
dashboard link: https://syzkaller.appspot.com/bug?extid=8aaf2df2ef0164ffe1fb
compiler:       Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
patch:          https://syzkaller.appspot.com/x/patch.diff?x=169d1980580000


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [syzbot] [kernel] WARNING: locking bug in try_to_wake_up
  2024-09-30 23:39 ` [syzbot] [kernel] " syzbot
  2024-10-01  1:49   ` Hillf Danton
@ 2024-10-01  8:31   ` Hillf Danton
  2024-10-01  8:50     ` syzbot
  1 sibling, 1 reply; 6+ messages in thread
From: Hillf Danton @ 2024-10-01  8:31 UTC (permalink / raw)
  To: syzbot; +Cc: linux-kernel, syzkaller-bugs

On Mon, 30 Sep 2024 16:39:29 -0700
> syzbot has found a reproducer for the following issue on:
> 
> HEAD commit:    9852d85ec9d4 Linux 6.12-rc1
> git tree:       upstream
> C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=13ad839f980000

#syz test

--- x/fs/btrfs/disk-io.c
+++ y/fs/btrfs/disk-io.c
@@ -4316,7 +4316,6 @@ void __cold close_ctree(struct btrfs_fs_
 		btrfs_error_commit_super(fs_info);
 
 	kthread_stop(fs_info->transaction_kthread);
-	kthread_stop(fs_info->cleaner_kthread);
 
 	ASSERT(list_empty(&fs_info->delayed_iputs));
 	set_bit(BTRFS_FS_CLOSING_DONE, &fs_info->flags);
@@ -4349,6 +4348,7 @@ void __cold close_ctree(struct btrfs_fs_
 	 */
 	invalidate_inode_pages2(fs_info->btree_inode->i_mapping);
 	btrfs_stop_all_workers(fs_info);
+	kthread_stop(fs_info->cleaner_kthread);
 
 	/* We shouldn't have any transaction open at this point */
 	warn_about_uncommitted_trans(fs_info);
--

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [syzbot] [kernel] WARNING: locking bug in try_to_wake_up
  2024-10-01  8:31   ` Hillf Danton
@ 2024-10-01  8:50     ` syzbot
  0 siblings, 0 replies; 6+ messages in thread
From: syzbot @ 2024-10-01  8:50 UTC (permalink / raw)
  To: hdanton, linux-kernel, syzkaller-bugs

Hello,

syzbot has tested the proposed patch but the reproducer is still triggering an issue:
VFS: Busy inodes after unmount (use-after-free)

VFS: Busy inodes after unmount of loop0 (btrfs)
------------[ cut here ]------------
kernel BUG at fs/super.c:652!
Oops: invalid opcode: 0000 [#1] PREEMPT SMP KASAN PTI
CPU: 0 UID: 0 PID: 5883 Comm: syz-executor Not tainted 6.12.0-rc1-syzkaller-00031-ge32cde8d2bd7-dirty #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
RIP: 0010:generic_shutdown_super+0x2ca/0x2d0 fs/super.c:650
Code: 1b 48 89 d8 48 c1 e8 03 42 80 3c 28 00 74 08 48 89 df e8 39 28 ed ff 48 8b 13 48 c7 c7 40 bd 18 8c 4c 89 e6 e8 f7 65 ab 09 90 <0f> 0b 0f 1f 40 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90
RSP: 0018:ffffc90004217d10 EFLAGS: 00010246
RAX: 000000000000002f RBX: ffffffff8ee96c40 RCX: 5f1cd68d4a54fd00
RDX: 0000000000000000 RSI: 0000000080000000 RDI: 0000000000000000
RBP: 1ffff1100dde90f0 R08: ffffffff81749d9c R09: 1ffff92000842f3c
R10: dffffc0000000000 R11: fffff52000842f3d R12: ffff88806ef48668
R13: dffffc0000000000 R14: ffffffff8c4bc158 R15: ffff88806ef48780
FS:  0000555593b76500(0000) GS:ffff8880b8600000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f019f6ff866 CR3: 000000003235e000 CR4: 00000000003526f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 kill_anon_super+0x3b/0x70 fs/super.c:1237
 btrfs_kill_super+0x41/0x50 fs/btrfs/super.c:2121
 deactivate_locked_super+0xc4/0x130 fs/super.c:473
 cleanup_mnt+0x41f/0x4b0 fs/namespace.c:1373
 task_work_run+0x24f/0x310 kernel/task_work.c:228
 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline]
 exit_to_user_mode_loop kernel/entry/common.c:114 [inline]
 exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline]
 __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline]
 syscall_exit_to_user_mode+0x168/0x370 kernel/entry/common.c:218
 do_syscall_64+0x100/0x230 arch/x86/entry/common.c:89
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f9ce297f327
Code: a8 ff ff ff f7 d8 64 89 01 48 83 c8 ff c3 0f 1f 44 00 00 31 f6 e9 09 00 00 00 66 0f 1f 84 00 00 00 00 00 b8 a6 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 01 c3 48 c7 c2 a8 ff ff ff f7 d8 64 89 02 b8
RSP: 002b:00007ffedd46b3d8 EFLAGS: 00000246 ORIG_RAX: 00000000000000a6
RAX: 0000000000000000 RBX: 0000000000000000 RCX: 00007f9ce297f327
RDX: 0000000000000000 RSI: 0000000000000009 RDI: 00007ffedd46b490
RBP: 00007ffedd46b490 R08: 0000000000000000 R09: 0000000000000000
R10: 00000000ffffffff R11: 0000000000000246 R12: 00007ffedd46c510
R13: 00007f9ce29f0134 R14: 000000000001a3f1 R15: 00007ffedd46c550
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:generic_shutdown_super+0x2ca/0x2d0 fs/super.c:650
Code: 1b 48 89 d8 48 c1 e8 03 42 80 3c 28 00 74 08 48 89 df e8 39 28 ed ff 48 8b 13 48 c7 c7 40 bd 18 8c 4c 89 e6 e8 f7 65 ab 09 90 <0f> 0b 0f 1f 40 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90
RSP: 0018:ffffc90004217d10 EFLAGS: 00010246
RAX: 000000000000002f RBX: ffffffff8ee96c40 RCX: 5f1cd68d4a54fd00
RDX: 0000000000000000 RSI: 0000000080000000 RDI: 0000000000000000
RBP: 1ffff1100dde90f0 R08: ffffffff81749d9c R09: 1ffff92000842f3c
R10: dffffc0000000000 R11: fffff52000842f3d R12: ffff88806ef48668
R13: dffffc0000000000 R14: ffffffff8c4bc158 R15: ffff88806ef48780
FS:  0000555593b76500(0000) GS:ffff8880b8600000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f019f6ff866 CR3: 000000003235e000 CR4: 00000000003526f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400


Tested on:

commit:         e32cde8d Merge tag 'sched_ext-for-6.12-rc1-fixes-1' of..
git tree:       upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=13b03dd0580000
kernel config:  https://syzkaller.appspot.com/x/.config?x=1f009dd80b3799c2
dashboard link: https://syzkaller.appspot.com/bug?extid=8aaf2df2ef0164ffe1fb
compiler:       Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
patch:          https://syzkaller.appspot.com/x/patch.diff?x=10a3c777980000


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-10-01  8:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-15 18:41 [syzbot] [wireguard?] WARNING: locking bug in try_to_wake_up syzbot
2024-09-30 23:39 ` [syzbot] [kernel] " syzbot
2024-10-01  1:49   ` Hillf Danton
2024-10-01  2:10     ` syzbot
2024-10-01  8:31   ` Hillf Danton
2024-10-01  8:50     ` syzbot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox