================================================================== BUG: KASAN: use-after-free in si470x_int_in_callback.cold+0x96/0xbf drivers/media/radio/si470x/radio-si470x-usb.c:378 Read of size 8 at addr ffff88807a06aab8 by task udevd/3619 CPU: 1 PID: 3619 Comm: udevd Not tainted 5.18.0-syzkaller-12234-g50fd82b3a9a9 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 print_address_description.constprop.0.cold+0xeb/0x495 mm/kasan/report.c:313 print_report mm/kasan/report.c:429 [inline] kasan_report.cold+0xf4/0x1c6 mm/kasan/report.c:491 si470x_int_in_callback.cold+0x96/0xbf drivers/media/radio/si470x/radio-si470x-usb.c:378 __usb_hcd_giveback_urb+0x2b0/0x5c0 drivers/usb/core/hcd.c:1670 usb_hcd_giveback_urb+0x367/0x410 drivers/usb/core/hcd.c:1747 dummy_timer+0x11f9/0x32b0 drivers/usb/gadget/udc/dummy_hcd.c:1988 call_timer_fn+0x1a5/0x6b0 kernel/time/timer.c:1474 expire_timers kernel/time/timer.c:1519 [inline] __run_timers.part.0+0x679/0xa80 kernel/time/timer.c:1790 __run_timers kernel/time/timer.c:1768 [inline] run_timer_softirq+0xb3/0x1d0 kernel/time/timer.c:1803 __do_softirq+0x29b/0x9c2 kernel/softirq.c:571 invoke_softirq kernel/softirq.c:445 [inline] __irq_exit_rcu+0x123/0x180 kernel/softirq.c:650 irq_exit_rcu+0x5/0x20 kernel/softirq.c:662 sysvec_apic_timer_interrupt+0x93/0xc0 arch/x86/kernel/apic/apic.c:1106 asm_sysvec_apic_timer_interrupt+0x1b/0x20 arch/x86/include/asm/idtentry.h:649 RIP: 0010:__syscall_enter_from_user_work kernel/entry/common.c:89 [inline] RIP: 0010:syscall_enter_from_user_mode+0x2b/0x70 kernel/entry/common.c:110 Code: 54 49 89 f4 55 48 89 fd 48 8b 7c 24 10 e8 ed f5 ff ff eb 27 eb 2b e8 54 57 0a f8 e8 0f 55 0a f8 fb 65 48 8b 04 25 80 6f 02 00 <48> 8b 70 08 40 f6 c6 3f 75 19 4c 89 e0 5d 41 5c c3 eb 1b 0f 0b eb RSP: 0018:ffffc900030cff28 EFLAGS: 00000206 RAX: ffff888018228000 RBX: 0000000000000000 RCX: 1ffffffff1b774b1 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: ffffc900030cff58 R08: 0000000000000001 R09: 0000000000000001 R10: fffffbfff1b77a8a R11: 0000000000000001 R12: 0000000000000106 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 do_syscall_64+0x16/0xb0 arch/x86/entry/common.c:76 entry_SYSCALL_64_after_hwframe+0x46/0xb0 RIP: 0033:0x7f1124d251da Code: 48 89 f2 b9 00 01 00 00 48 89 fe bf 9c ff ff ff e9 0b 00 00 00 66 2e 0f 1f 84 00 00 00 00 00 90 41 89 ca b8 06 01 00 00 0f 05 <3d> 00 f0 ff ff 77 07 31 c0 c3 0f 1f 40 00 48 8b 15 69 fc 0c 00 f7 RSP: 002b:00007ffd0a7c41e8 EFLAGS: 00000206 ORIG_RAX: 0000000000000106 RAX: ffffffffffffffda RBX: 00007ffd0a7c4298 RCX: 00007f1124d251da RDX: 00007ffd0a7c4208 RSI: 00007ffd0a7c4bb8 RDI: 00000000ffffff9c RBP: 00007ffd0a7c4bb8 R08: 0000000000000000 R09: 00007ffd0a7c49a0 R10: 0000000000000100 R11: 0000000000000206 R12: 0000000000000005 R13: 0000561f2d7512e0 R14: 0000561f2d732190 R15: 00007ffd0a7c4bc9 Allocated by task 3618: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:436 [inline] ____kasan_kmalloc mm/kasan/common.c:515 [inline] ____kasan_kmalloc mm/kasan/common.c:474 [inline] __kasan_kmalloc+0xa9/0xd0 mm/kasan/common.c:524 kmalloc include/linux/slab.h:600 [inline] kzalloc include/linux/slab.h:733 [inline] si470x_usb_driver_probe+0x51/0xf90 drivers/media/radio/si470x/radio-si470x-usb.c:573 usb_probe_interface+0x315/0x7f0 drivers/usb/core/driver.c:396 call_driver_probe drivers/base/dd.c:542 [inline] really_probe+0x23e/0xb90 drivers/base/dd.c:621 __driver_probe_device+0x338/0x4d0 drivers/base/dd.c:754 driver_probe_device+0x4c/0x1a0 drivers/base/dd.c:784 __device_attach_driver+0x20b/0x2f0 drivers/base/dd.c:901 bus_for_each_drv+0x15f/0x1e0 drivers/base/bus.c:427 __device_attach+0x228/0x4a0 drivers/base/dd.c:972 bus_probe_device+0x1e4/0x290 drivers/base/bus.c:487 device_add+0xb83/0x1e20 drivers/base/core.c:3402 usb_set_configuration+0x101e/0x1900 drivers/usb/core/message.c:2170 usb_generic_driver_probe+0xba/0x100 drivers/usb/core/generic.c:238 usb_probe_device+0xd9/0x2c0 drivers/usb/core/driver.c:293 call_driver_probe drivers/base/dd.c:542 [inline] really_probe+0x23e/0xb90 drivers/base/dd.c:621 __driver_probe_device+0x338/0x4d0 drivers/base/dd.c:754 driver_probe_device+0x4c/0x1a0 drivers/base/dd.c:784 __device_attach_driver+0x20b/0x2f0 drivers/base/dd.c:901 bus_for_each_drv+0x15f/0x1e0 drivers/base/bus.c:427 __device_attach+0x228/0x4a0 drivers/base/dd.c:972 bus_probe_device+0x1e4/0x290 drivers/base/bus.c:487 device_add+0xb83/0x1e20 drivers/base/core.c:3402 usb_new_device.cold+0x641/0x1091 drivers/usb/core/hub.c:2566 hub_port_connect drivers/usb/core/hub.c:5363 [inline] hub_port_connect_change drivers/usb/core/hub.c:5507 [inline] port_event drivers/usb/core/hub.c:5665 [inline] hub_event+0x25c6/0x4680 drivers/usb/core/hub.c:5747 process_one_work+0x996/0x1610 kernel/workqueue.c:2289 worker_thread+0x665/0x1080 kernel/workqueue.c:2436 kthread+0x2e9/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:302 Freed by task 3618: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 kasan_set_track+0x21/0x30 mm/kasan/common.c:45 kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:370 ____kasan_slab_free mm/kasan/common.c:366 [inline] ____kasan_slab_free+0x166/0x1a0 mm/kasan/common.c:328 kasan_slab_free include/linux/kasan.h:200 [inline] slab_free_hook mm/slub.c:1727 [inline] slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1753 slab_free mm/slub.c:3507 [inline] kfree+0xd6/0x4d0 mm/slub.c:4555 si470x_usb_driver_probe+0xb3d/0xf90 drivers/media/radio/si470x/radio-si470x-usb.c:760 usb_probe_interface+0x315/0x7f0 drivers/usb/core/driver.c:396 call_driver_probe drivers/base/dd.c:542 [inline] really_probe+0x23e/0xb90 drivers/base/dd.c:621 __driver_probe_device+0x338/0x4d0 drivers/base/dd.c:754 driver_probe_device+0x4c/0x1a0 drivers/base/dd.c:784 __device_attach_driver+0x20b/0x2f0 drivers/base/dd.c:901 bus_for_each_drv+0x15f/0x1e0 drivers/base/bus.c:427 __device_attach+0x228/0x4a0 drivers/base/dd.c:972 bus_probe_device+0x1e4/0x290 drivers/base/bus.c:487 device_add+0xb83/0x1e20 drivers/base/core.c:3402 usb_set_configuration+0x101e/0x1900 drivers/usb/core/message.c:2170 usb_generic_driver_probe+0xba/0x100 drivers/usb/core/generic.c:238 usb_probe_device+0xd9/0x2c0 drivers/usb/core/driver.c:293 call_driver_probe drivers/base/dd.c:542 [inline] really_probe+0x23e/0xb90 drivers/base/dd.c:621 __driver_probe_device+0x338/0x4d0 drivers/base/dd.c:754 driver_probe_device+0x4c/0x1a0 drivers/base/dd.c:784 __device_attach_driver+0x20b/0x2f0 drivers/base/dd.c:901 bus_for_each_drv+0x15f/0x1e0 drivers/base/bus.c:427 __device_attach+0x228/0x4a0 drivers/base/dd.c:972 bus_probe_device+0x1e4/0x290 drivers/base/bus.c:487 device_add+0xb83/0x1e20 drivers/base/core.c:3402 usb_new_device.cold+0x641/0x1091 drivers/usb/core/hub.c:2566 hub_port_connect drivers/usb/core/hub.c:5363 [inline] hub_port_connect_change drivers/usb/core/hub.c:5507 [inline] port_event drivers/usb/core/hub.c:5665 [inline] hub_event+0x25c6/0x4680 drivers/usb/core/hub.c:5747 process_one_work+0x996/0x1610 kernel/workqueue.c:2289 worker_thread+0x665/0x1080 kernel/workqueue.c:2436 kthread+0x2e9/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:302 The buggy address belongs to the object at ffff88807a06a000 which belongs to the cache kmalloc-4k of size 4096 The buggy address is located 2744 bytes inside of 4096-byte region [ffff88807a06a000, ffff88807a06b000) The buggy address belongs to the physical page: page:ffffea0001e81a00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7a068 head:ffffea0001e81a00 order:3 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 0000000000000000 dead000000000001 ffff888011842140 raw: 0000000000000000 0000000000040004 00000001ffffffff 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 0xd2040(__GFP_IO|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 2981, tgid 2981 (udevd), ts 20846548382, free_ts 16235536753 prep_new_page mm/page_alloc.c:2456 [inline] get_page_from_freelist+0x1290/0x3b70 mm/page_alloc.c:4198 __alloc_pages+0x1c7/0x510 mm/page_alloc.c:5426 alloc_pages+0x1aa/0x310 mm/mempolicy.c:2272 alloc_slab_page mm/slub.c:1797 [inline] allocate_slab+0x26c/0x3c0 mm/slub.c:1942 new_slab mm/slub.c:2002 [inline] ___slab_alloc+0x985/0xd90 mm/slub.c:3002 __slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3089 slab_alloc_node mm/slub.c:3180 [inline] slab_alloc mm/slub.c:3222 [inline] __kmalloc+0x318/0x350 mm/slub.c:4413 kmalloc include/linux/slab.h:605 [inline] tomoyo_realpath_from_path+0xc3/0x620 security/tomoyo/realpath.c:254 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_path_perm+0x21b/0x400 security/tomoyo/file.c:822 security_inode_getattr+0xcf/0x140 security/security.c:1344 vfs_getattr fs/stat.c:157 [inline] vfs_statx+0x16a/0x390 fs/stat.c:232 vfs_fstatat+0x8c/0xb0 fs/stat.c:255 __do_sys_newfstatat+0x91/0x110 fs/stat.c:425 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1371 [inline] free_pcp_prepare+0x549/0xd20 mm/page_alloc.c:1421 free_unref_page_prepare mm/page_alloc.c:3343 [inline] free_unref_page+0x19/0x6a0 mm/page_alloc.c:3438 __unfreeze_partials+0x17c/0x1a0 mm/slub.c:2521 qlink_free mm/kasan/quarantine.c:168 [inline] qlist_free_all+0x6a/0x170 mm/kasan/quarantine.c:187 kasan_quarantine_reduce+0x180/0x200 mm/kasan/quarantine.c:294 __kasan_slab_alloc+0xa2/0xc0 mm/kasan/common.c:446 kasan_slab_alloc include/linux/kasan.h:224 [inline] slab_post_alloc_hook mm/slab.h:750 [inline] slab_alloc_node mm/slub.c:3214 [inline] slab_alloc mm/slub.c:3222 [inline] __kmem_cache_alloc_lru mm/slub.c:3229 [inline] kmem_cache_alloc+0x204/0x3b0 mm/slub.c:3239 kmem_cache_zalloc include/linux/slab.h:723 [inline] lsm_file_alloc security/security.c:573 [inline] security_file_alloc+0x34/0x170 security/security.c:1526 __alloc_file+0xd9/0x270 fs/file_table.c:143 alloc_empty_file+0x6d/0x170 fs/file_table.c:187 path_openat+0xe4/0x2910 fs/namei.c:3646 do_filp_open+0x1aa/0x400 fs/namei.c:3687 do_sys_openat2+0x16d/0x4c0 fs/open.c:1278 do_sys_open fs/open.c:1294 [inline] __do_sys_openat fs/open.c:1310 [inline] __se_sys_openat fs/open.c:1305 [inline] __x64_sys_openat+0x13f/0x1f0 fs/open.c:1305 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 Memory state around the buggy address: ffff88807a06a980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88807a06aa00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88807a06aa80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88807a06ab00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88807a06ab80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess): 0: 54 push %rsp 1: 49 89 f4 mov %rsi,%r12 4: 55 push %rbp 5: 48 89 fd mov %rdi,%rbp 8: 48 8b 7c 24 10 mov 0x10(%rsp),%rdi d: e8 ed f5 ff ff callq 0xfffff5ff 12: eb 27 jmp 0x3b 14: eb 2b jmp 0x41 16: e8 54 57 0a f8 callq 0xf80a576f 1b: e8 0f 55 0a f8 callq 0xf80a552f 20: fb sti 21: 65 48 8b 04 25 80 6f mov %gs:0x26f80,%rax 28: 02 00 * 2a: 48 8b 70 08 mov 0x8(%rax),%rsi <-- trapping instruction 2e: 40 f6 c6 3f test $0x3f,%sil 32: 75 19 jne 0x4d 34: 4c 89 e0 mov %r12,%rax 37: 5d pop %rbp 38: 41 5c pop %r12 3a: c3 retq 3b: eb 1b jmp 0x58 3d: 0f 0b ud2 3f: eb .byte 0xeb