================================================================== BUG: KASAN: slab-use-after-free in __lock_acquire+0x4208/0x5de0 kernel/locking/lockdep.c:5012 Read of size 8 at addr ffff88802747fc18 by task syz-fuzzer/5245 CPU: 1 PID: 5245 Comm: syz-fuzzer Not tainted 6.5.0-rc1-syzkaller-00259-g831fe284d827 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:364 [inline] print_report+0xc4/0x620 mm/kasan/report.c:475 kasan_report+0xda/0x110 mm/kasan/report.c:588 __lock_acquire+0x4208/0x5de0 kernel/locking/lockdep.c:5012 lock_acquire kernel/locking/lockdep.c:5761 [inline] lock_acquire+0x1ae/0x510 kernel/locking/lockdep.c:5726 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x3a/0x50 kernel/locking/spinlock.c:162 p9_tag_remove net/9p/client.c:394 [inline] p9_req_put net/9p/client.c:402 [inline] p9_req_put+0xc6/0x250 net/9p/client.c:399 req_done+0x1e7/0x2e0 net/9p/trans_virtio.c:147 vring_interrupt drivers/virtio/virtio_ring.c:2501 [inline] vring_interrupt+0x317/0x3f0 drivers/virtio/virtio_ring.c:2476 __handle_irq_event_percpu+0x22a/0x740 kernel/irq/handle.c:158 handle_irq_event_percpu kernel/irq/handle.c:193 [inline] handle_irq_event+0xab/0x1e0 kernel/irq/handle.c:210 handle_edge_irq+0x261/0xcf0 kernel/irq/chip.c:834 generic_handle_irq_desc include/linux/irqdesc.h:161 [inline] handle_irq arch/x86/kernel/irq.c:238 [inline] __common_interrupt+0x9f/0x220 arch/x86/kernel/irq.c:257 common_interrupt+0xa9/0xd0 arch/x86/kernel/irq.c:247 asm_common_interrupt+0x26/0x40 arch/x86/include/asm/idtentry.h:636 RIP: 0010:cred_label security/apparmor/include/cred.h:27 [inline] RIP: 0010:aa_cred_raw_label security/apparmor/include/cred.h:49 [inline] RIP: 0010:aa_current_raw_label security/apparmor/include/cred.h:76 [inline] RIP: 0010:__begin_current_label_crit_section security/apparmor/include/cred.h:127 [inline] RIP: 0010:common_file_perm security/apparmor/lsm.c:509 [inline] RIP: 0010:apparmor_file_permission+0xfc/0x4f0 security/apparmor/lsm.c:524 Code: 58 08 49 03 9c 24 88 00 00 00 0f 84 a8 02 00 00 e8 d9 ea a4 fd 48 89 da 48 b8 00 00 00 00 00 fc ff df 48 c1 ea 03 80 3c 02 00 <0f> 85 a2 03 00 00 48 8b 1b 48 85 db 0f 84 5b 02 00 00 e8 ad ea a4 RSP: 0018:ffffc90003fb7cd0 EFLAGS: 00000246 RAX: dffffc0000000000 RBX: ffff888042247c48 RCX: 0000000000000000 RDX: 1ffff11008448f89 RSI: ffffffff83e18407 RDI: ffff88801b7bfa88 RBP: ffff888025a42300 R08: 0000000000000005 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: ffff88801b7bfa00 R13: 0000000000000004 R14: ffff888025a42300 R15: 0000000000000000 security_file_permission+0x72/0x100 security/security.c:2546 rw_verify_area+0xb2/0x1b0 fs/read_write.c:374 vfs_read+0x13b/0x930 fs/read_write.c:461 ksys_read+0x1f0/0x250 fs/read_write.c:613 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x403ace Code: 48 89 6c 24 38 48 8d 6c 24 38 e8 0d 00 00 00 48 8b 6c 24 38 48 83 c4 40 c3 cc cc cc 49 89 f2 48 89 fa 48 89 ce 48 89 df 0f 05 <48> 3d 01 f0 ff ff 76 15 48 f7 d8 48 89 c1 48 c7 c0 ff ff ff ff 48 RSP: 002b:000000c000cad880 EFLAGS: 00000206 ORIG_RAX: 0000000000000000 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000000403ace RDX: 0000000000001000 RSI: 000000c00071c000 RDI: 0000000000000003 RBP: 000000c000cad8c0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000206 R12: 000000c000cada00 R13: 0000000000000000 R14: 000000c000528820 R15: 000000c00d27e400 Allocated by task 12539: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:374 [inline] __kasan_kmalloc+0xa2/0xb0 mm/kasan/common.c:383 kmalloc include/linux/slab.h:582 [inline] p9_client_create+0xcf/0x1210 net/9p/client.c:979 v9fs_session_init+0x1f8/0x1a30 fs/9p/v9fs.c:410 v9fs_mount+0xc6/0xcc0 fs/9p/vfs_super.c:123 legacy_get_tree+0x109/0x220 fs/fs_context.c:611 vfs_get_tree+0x88/0x350 fs/super.c:1519 do_new_mount fs/namespace.c:3335 [inline] path_mount+0x1492/0x1ed0 fs/namespace.c:3662 do_mount fs/namespace.c:3675 [inline] __do_sys_mount fs/namespace.c:3884 [inline] __se_sys_mount fs/namespace.c:3861 [inline] __ia32_sys_mount+0x291/0x310 fs/namespace.c:3861 do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline] __do_fast_syscall_32+0x61/0xe0 arch/x86/entry/common.c:178 do_fast_syscall_32+0x33/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x70/0x82 Freed by task 12539: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 kasan_save_free_info+0x2b/0x40 mm/kasan/generic.c:522 ____kasan_slab_free mm/kasan/common.c:236 [inline] ____kasan_slab_free+0x15e/0x1b0 mm/kasan/common.c:200 kasan_slab_free include/linux/kasan.h:162 [inline] slab_free_hook mm/slub.c:1792 [inline] slab_free_freelist_hook+0x10b/0x1e0 mm/slub.c:1818 slab_free mm/slub.c:3801 [inline] __kmem_cache_free+0xb8/0x2f0 mm/slub.c:3814 p9_client_create+0xa14/0x1210 net/9p/client.c:1050 v9fs_session_init+0x1f8/0x1a30 fs/9p/v9fs.c:410 v9fs_mount+0xc6/0xcc0 fs/9p/vfs_super.c:123 legacy_get_tree+0x109/0x220 fs/fs_context.c:611 vfs_get_tree+0x88/0x350 fs/super.c:1519 do_new_mount fs/namespace.c:3335 [inline] path_mount+0x1492/0x1ed0 fs/namespace.c:3662 do_mount fs/namespace.c:3675 [inline] __do_sys_mount fs/namespace.c:3884 [inline] __se_sys_mount fs/namespace.c:3861 [inline] __ia32_sys_mount+0x291/0x310 fs/namespace.c:3861 do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline] __do_fast_syscall_32+0x61/0xe0 arch/x86/entry/common.c:178 do_fast_syscall_32+0x33/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x70/0x82 Last potentially related work creation: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 __kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:492 __call_rcu_common.constprop.0+0x9a/0x790 kernel/rcu/tree.c:2649 destroy_workqueue+0x74a/0x8d0 kernel/workqueue.c:4806 xfs_destroy_mount_workqueues+0x93/0x150 fs/xfs/xfs_super.c:608 xfs_fs_put_super+0x267/0x3b0 fs/xfs/xfs_super.c:1149 generic_shutdown_super+0x158/0x480 fs/super.c:499 kill_block_super+0x64/0xb0 fs/super.c:1417 deactivate_locked_super+0x9a/0x170 fs/super.c:330 deactivate_super+0xde/0x100 fs/super.c:361 cleanup_mnt+0x222/0x3d0 fs/namespace.c:1254 task_work_run+0x14d/0x240 kernel/task_work.c:179 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop kernel/entry/common.c:171 [inline] exit_to_user_mode_prepare+0x210/0x240 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:286 [inline] syscall_exit_to_user_mode+0x1d/0x50 kernel/entry/common.c:297 __do_fast_syscall_32+0x6d/0xe0 arch/x86/entry/common.c:181 do_fast_syscall_32+0x33/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x70/0x82 Second to last potentially related work creation: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 __kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:492 insert_work+0x4a/0x330 kernel/workqueue.c:1553 __queue_work+0x5f5/0x1040 kernel/workqueue.c:1714 queue_work_on+0xed/0x110 kernel/workqueue.c:1744 queue_work include/linux/workqueue.h:506 [inline] xlog_cil_push_now.isra.0+0x1a0/0x200 fs/xfs/xfs_log_cil.c:1545 xlog_cil_force_seq+0x1e3/0x930 fs/xfs/xfs_log_cil.c:1723 xlog_cil_force fs/xfs/xfs_log_priv.h:598 [inline] xfs_log_force+0x247/0xc50 fs/xfs/xfs_log.c:3206 xfs_unmount_flush_inodes+0x16/0xd0 fs/xfs/xfs_mount.c:585 xfs_unmountfs+0xbf/0x2a0 fs/xfs/xfs_mount.c:1071 xfs_fs_put_super+0x7b/0x3b0 fs/xfs/xfs_super.c:1142 generic_shutdown_super+0x158/0x480 fs/super.c:499 kill_block_super+0x64/0xb0 fs/super.c:1417 deactivate_locked_super+0x9a/0x170 fs/super.c:330 deactivate_super+0xde/0x100 fs/super.c:361 cleanup_mnt+0x222/0x3d0 fs/namespace.c:1254 task_work_run+0x14d/0x240 kernel/task_work.c:179 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop kernel/entry/common.c:171 [inline] exit_to_user_mode_prepare+0x210/0x240 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:286 [inline] syscall_exit_to_user_mode+0x1d/0x50 kernel/entry/common.c:297 __do_fast_syscall_32+0x6d/0xe0 arch/x86/entry/common.c:181 do_fast_syscall_32+0x33/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x70/0x82 The buggy address belongs to the object at ffff88802747fc00 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 24 bytes inside of freed 512-byte region [ffff88802747fc00, ffff88802747fe00) The buggy address belongs to the physical page: page:ffffea00009d1f00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2747c head:ffffea00009d1f00 order:2 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000010200 ffff888012842c80 ffffea0000a24600 dead000000000002 raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 2, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 104, tgid 104 (kworker/1:1), ts 129894850940, free_ts 129883923146 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2d2/0x350 mm/page_alloc.c:1570 prep_new_page mm/page_alloc.c:1577 [inline] get_page_from_freelist+0x10a9/0x31e0 mm/page_alloc.c:3221 __alloc_pages+0x1d0/0x4a0 mm/page_alloc.c:4477 alloc_pages+0x1a9/0x270 mm/mempolicy.c:2279 alloc_slab_page mm/slub.c:1862 [inline] allocate_slab+0x24e/0x380 mm/slub.c:2009 new_slab mm/slub.c:2062 [inline] ___slab_alloc+0x8bc/0x1570 mm/slub.c:3215 __slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3314 __slab_alloc_node mm/slub.c:3367 [inline] slab_alloc_node mm/slub.c:3460 [inline] __kmem_cache_alloc_node+0x137/0x350 mm/slub.c:3509 kmalloc_trace+0x25/0xe0 mm/slab_common.c:1076 kmalloc include/linux/slab.h:582 [inline] kzalloc include/linux/slab.h:703 [inline] mca_alloc net/ipv6/mcast.c:880 [inline] __ipv6_dev_mc_inc+0x2b7/0xc40 net/ipv6/mcast.c:936 addrconf_join_solict net/ipv6/addrconf.c:2179 [inline] addrconf_dad_begin net/ipv6/addrconf.c:3995 [inline] addrconf_dad_work+0x232/0x1410 net/ipv6/addrconf.c:4120 process_one_work+0xaa2/0x16f0 kernel/workqueue.c:2597 worker_thread+0x687/0x1110 kernel/workqueue.c:2748 kthread+0x33a/0x430 kernel/kthread.c:389 ret_from_fork+0x2c/0x70 arch/x86/kernel/process.c:145 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:296 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1161 [inline] free_unref_page_prepare+0x508/0xb90 mm/page_alloc.c:2348 free_unref_page+0x33/0x3b0 mm/page_alloc.c:2443 __unfreeze_partials+0x21d/0x240 mm/slub.c:2647 qlink_free mm/kasan/quarantine.c:166 [inline] qlist_free_all+0x6a/0x170 mm/kasan/quarantine.c:185 kasan_quarantine_reduce+0x18b/0x1d0 mm/kasan/quarantine.c:292 __kasan_slab_alloc+0x65/0x90 mm/kasan/common.c:305 kasan_slab_alloc include/linux/kasan.h:186 [inline] slab_post_alloc_hook mm/slab.h:762 [inline] slab_alloc_node mm/slub.c:3470 [inline] kmem_cache_alloc_node+0x185/0x3f0 mm/slub.c:3515 __alloc_skb+0x287/0x330 net/core/skbuff.c:634 alloc_skb include/linux/skbuff.h:1289 [inline] alloc_skb_with_frags+0x9d/0x700 net/core/skbuff.c:6233 sock_alloc_send_pskb+0x7c8/0x950 net/core/sock.c:2782 sock_alloc_send_skb include/net/sock.h:1871 [inline] mld_newpack.isra.0+0x1ee/0x790 net/ipv6/mcast.c:1748 add_grhead+0x295/0x340 net/ipv6/mcast.c:1851 add_grec+0x10bb/0x1680 net/ipv6/mcast.c:1989 mld_send_cr net/ipv6/mcast.c:2115 [inline] mld_ifc_work+0x41f/0xcd0 net/ipv6/mcast.c:2653 process_one_work+0xaa2/0x16f0 kernel/workqueue.c:2597 worker_thread+0x687/0x1110 kernel/workqueue.c:2748 Memory state around the buggy address: ffff88802747fb00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88802747fb80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88802747fc00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88802747fc80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88802747fd00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess): 0: 58 pop %rax 1: 08 49 03 or %cl,0x3(%rcx) 4: 9c pushf 5: 24 88 and $0x88,%al 7: 00 00 add %al,(%rax) 9: 00 0f add %cl,(%rdi) b: 84 a8 02 00 00 e8 test %ch,-0x17fffffe(%rax) 11: d9 ea fldl2e 13: a4 movsb %ds:(%rsi),%es:(%rdi) 14: fd std 15: 48 89 da mov %rbx,%rdx 18: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax 1f: fc ff df 22: 48 c1 ea 03 shr $0x3,%rdx 26: 80 3c 02 00 cmpb $0x0,(%rdx,%rax,1) * 2a: 0f 85 a2 03 00 00 jne 0x3d2 <-- trapping instruction 30: 48 8b 1b mov (%rbx),%rbx 33: 48 85 db test %rbx,%rbx 36: 0f 84 5b 02 00 00 je 0x297 3c: e8 .byte 0xe8 3d: ad lods %ds:(%rsi),%eax 3e: ea (bad) 3f: a4 movsb %ds:(%rsi),%es:(%rdi)