==================================================================
BUG: KASAN: slab-use-after-free in find_endpoint+0x2a3/0x2c0 drivers/usb/gadget/udc/dummy_hcd.c:1650
Read of size 1 at addr ffff8880564930e8 by task syz.1.589/8415
CPU: 0 UID: 0 PID: 8415 Comm: syz.1.589 Not tainted syzkaller #0 PREEMPT(full)
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
Call Trace:
__dump_stack lib/dump_stack.c:94 [inline]
dump_stack_lvl+0x100/0x190 lib/dump_stack.c:120
print_address_description mm/kasan/report.c:378 [inline]
print_report+0x13d/0x4b0 mm/kasan/report.c:482
kasan_report+0xdf/0x1c0 mm/kasan/report.c:595
find_endpoint+0x2a3/0x2c0 drivers/usb/gadget/udc/dummy_hcd.c:1650
dummy_timer+0x506/0x3840 drivers/usb/gadget/udc/dummy_hcd.c:1922
__run_hrtimer kernel/time/hrtimer.c:2079 [inline]
__hrtimer_run_queues+0x448/0x9a0 kernel/time/hrtimer.c:2136
hrtimer_run_softirq+0x1ca/0x360 kernel/time/hrtimer.c:2153
handle_softirqs+0x216/0xa20 kernel/softirq.c:669
__do_softirq kernel/softirq.c:703 [inline]
invoke_softirq kernel/softirq.c:542 [inline]
__irq_exit_rcu+0x178/0x220 kernel/softirq.c:786
irq_exit_rcu+0x9/0x30 kernel/softirq.c:809
instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1062 [inline]
sysvec_apic_timer_interrupt+0xa3/0xc0 arch/x86/kernel/apic/apic.c:1062
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:674
RIP: 0010:finish_task_switch.isra.0+0x2ca/0x10d0 kernel/sched/core.c:5435
Code: b6 0a 00 00 41 c7 87 20 0e 00 00 00 00 00 00 e9 47 04 00 00 49 8d 7f 48 e8 c3 f9 18 0a e8 8e 86 3d 00 fb 48 8d bb 18 17 00 00 <48> b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 0f b6 04 02 84
RSP: 0000:ffffc90002ddfd30 EFLAGS: 00000206
RAX: 00000000000022f3 RBX: ffff88805bdda580 RCX: 0000000000000000
RDX: 0000000000000001 RSI: ffffffff8e627492 RDI: ffff88805bddbc98
RBP: ffffc90002ddfd88 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000001 R11: 0000000000000000 R12: ffff88801e330000
R13: 0000000000000001 R14: ffffffff926b3244 R15: ffff88802ae3ca40
context_switch kernel/sched/core.c:5587 [inline]
__schedule+0x1315/0x7de0 kernel/sched/core.c:7386
__schedule_loop kernel/sched/core.c:7463 [inline]
schedule+0xdd/0x2c0 kernel/sched/core.c:7478
__exit_to_user_mode_loop kernel/entry/common.c:55 [inline]
exit_to_user_mode_loop kernel/entry/common.c:101 [inline]
__exit_to_user_mode_prepare include/linux/irq-entry-common.h:207 [inline]
irqentry_exit_to_user_mode_prepare include/linux/irq-entry-common.h:244 [inline]
irqentry_exit_to_user_mode include/linux/irq-entry-common.h:315 [inline]
irqentry_exit+0x4bf/0xab0 kernel/entry/common.c:152
asm_sysvec_reschedule_ipi+0x1a/0x20 arch/x86/include/asm/idtentry.h:679
RIP: 0023:0xf7000576
Code: 00 00 00 00 c3 2e 8d b4 26 00 00 00 00 8d b4 26 00 00 00 00 c3 2e 8d b4 26 00 00 00 00 8d b4 26 00 00 00 00 55 57 89 cf 89 d1 <56> 53 e8 13 fe ff ff 81 c3 77 0a 3b 00 83 ec 24 89 54 24 08 8d 52
RSP: 002b:00000000ffa55b34 EFLAGS: 00000246
RAX: 0000000000000018 RBX: 00000000f7f15610 RCX: 000000008be9cbe2
RDX: 000000008be9cbe2 RSI: 0000000000006d8b RDI: 00000000ffffffff
RBP: 00000000ffffffff R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
Allocated by task 5860:
kasan_save_stack+0x30/0x50 mm/kasan/common.c:57
kasan_save_track+0x14/0x30 mm/kasan/common.c:78
poison_kmalloc_redzone mm/kasan/common.c:409 [inline]
__kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:426
kasan_kmalloc include/linux/kasan.h:263 [inline]
__kmalloc_cache_noprof+0x2f8/0x6d0 mm/slub.c:5680
_kmalloc_noprof include/linux/slab.h:991 [inline]
batadv_forw_packet_alloc+0x3a9/0x4d0 net/batman-adv/send.c:511
batadv_iv_ogm_aggregate_new+0x11e/0x4d0 net/batman-adv/bat_iv_ogm.c:648
batadv_iv_ogm_queue_add net/batman-adv/bat_iv_ogm.c:769 [inline]
batadv_iv_ogm_schedule_buff+0x94d/0x15d0 net/batman-adv/bat_iv_ogm.c:957
batadv_iv_ogm_schedule net/batman-adv/bat_iv_ogm.c:1011 [inline]
batadv_iv_ogm_schedule net/batman-adv/bat_iv_ogm.c:1005 [inline]
batadv_iv_send_outstanding_bat_ogm_packet+0x57c/0x850 net/batman-adv/bat_iv_ogm.c:1929
process_one_work+0xac7/0x1b10 kernel/workqueue.c:3495
process_scheduled_works kernel/workqueue.c:3578 [inline]
worker_thread+0x5ef/0xe50 kernel/workqueue.c:3659
kthread+0x373/0x450 kernel/kthread.c:436
ret_from_fork+0x730/0xd60 arch/x86/kernel/process.c:158
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
Freed by task 5834:
kasan_save_stack+0x30/0x50 mm/kasan/common.c:57
kasan_save_track+0x14/0x30 mm/kasan/common.c:78
kasan_save_free_info+0x3b/0x70 mm/kasan/generic.c:584
poison_slab_object mm/kasan/common.c:264 [inline]
__kasan_slab_free+0x5f/0x80 mm/kasan/common.c:296
kasan_slab_free include/linux/kasan.h:235 [inline]
slab_free_hook mm/slub.c:2780 [inline]
slab_free mm/slub.c:6630 [inline]
kfree+0x22b/0x6d0 mm/slub.c:6923
batadv_iv_send_outstanding_bat_ogm_packet+0x294/0x850 net/batman-adv/bat_iv_ogm.c:1935
process_one_work+0xac7/0x1b10 kernel/workqueue.c:3495
process_scheduled_works kernel/workqueue.c:3578 [inline]
worker_thread+0x5ef/0xe50 kernel/workqueue.c:3659
kthread+0x373/0x450 kernel/kthread.c:436
ret_from_fork+0x730/0xd60 arch/x86/kernel/process.c:158
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
Last potentially related work creation:
kasan_save_stack+0x30/0x50 mm/kasan/common.c:57
kasan_record_aux_stack+0xa7/0xc0 mm/kasan/generic.c:556
insert_work+0x36/0x230 kernel/workqueue.c:2356
__queue_work+0x4df/0x16f0 kernel/workqueue.c:2550
call_timer_fn+0x198/0x5f0 kernel/time/timer.c:1749
expire_timers kernel/time/timer.c:1795 [inline]
__run_timers+0x570/0xb00 kernel/time/timer.c:2375
__run_timer_base kernel/time/timer.c:2387 [inline]
__run_timer_base kernel/time/timer.c:2379 [inline]
run_timer_base+0x114/0x190 kernel/time/timer.c:2396
run_timer_softirq+0x1a/0x50 kernel/time/timer.c:2406
handle_softirqs+0x216/0xa20 kernel/softirq.c:669
__do_softirq kernel/softirq.c:703 [inline]
invoke_softirq kernel/softirq.c:542 [inline]
__irq_exit_rcu+0x178/0x220 kernel/softirq.c:786
irq_exit_rcu+0x9/0x30 kernel/softirq.c:809
instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1062 [inline]
sysvec_apic_timer_interrupt+0xa3/0xc0 arch/x86/kernel/apic/apic.c:1062
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:674
The buggy address belongs to the object at ffff888056493000
which belongs to the cache kmalloc-512 of size 512
The buggy address is located 232 bytes inside of
freed 512-byte region [ffff888056493000, ffff888056493200)
The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff888056493000 pfn:0x56490
head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
flags: 0x4fff00000000240(workingset|head|node=1|zone=1|lastcpupid=0x7ff)
page_type: f5(slab)
raw: 04fff00000000240 ffff88801d442c80 ffffea0001322210 ffffea0001592510
raw: ffff888056493000 000000000010000d 00000000f5000000 0000000000000000
head: 04fff00000000240 ffff88801d442c80 ffffea0001322210 ffffea0001592510
head: ffff888056493000 000000000010000d 00000000f5000000 0000000000000000
head: 04fff00000000002 ffffffffffffff01 00000000ffffffff 00000000ffffffff
head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004
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 5792, tgid 5792 (syz-executor), ts 39964723098
set_page_owner include/linux/page_owner.h:33 [inline]
post_alloc_hook+0xfd/0x120 mm/page_alloc.c:1860
prep_new_page mm/page_alloc.c:1868 [inline]
get_page_from_freelist+0xdae/0x2c80 mm/page_alloc.c:3950
__alloc_frozen_pages_noprof+0x2ad/0x31e0 mm/page_alloc.c:5492
alloc_slab_page mm/slub.c:3384 [inline]
allocate_slab mm/slub.c:3499 [inline]
new_slab+0xb1/0x6d0 mm/slub.c:3550
refill_objects+0xe3/0x410 mm/slub.c:7539
refill_sheaf mm/slub.c:2917 [inline]
__pcs_replace_empty_main+0x35e/0x650 mm/slub.c:4811
alloc_from_pcs mm/slub.c:4887 [inline]
slab_alloc_node mm/slub.c:5021 [inline]
__do_kmalloc_node mm/slub.c:5530 [inline]
__kmalloc_noprof+0x677/0x840 mm/slub.c:5556
_kmalloc_noprof include/linux/slab.h:995 [inline]
_kzalloc_noprof include/linux/slab.h:1312 [inline]
fib6_info_alloc+0x40/0x160 net/ipv6/ip6_fib.c:189
ip6_route_info_create+0x14c/0xad0 net/ipv6/route.c:3833
addrconf_f6i_alloc+0x2d9/0x670 net/ipv6/route.c:4720
ipv6_add_addr+0x577/0x20e0 net/ipv6/addrconf.c:1135
inet6_addr_add+0x26f/0x9a0 net/ipv6/addrconf.c:3092
inet6_rtm_newaddr+0x147a/0x1bb0 net/ipv6/addrconf.c:5121
rtnetlink_rcv_msg+0x95e/0xe90 net/core/rtnetlink.c:7169
netlink_rcv_skb+0x159/0x420 net/netlink/af_netlink.c:2585
netlink_unicast_kernel net/netlink/af_netlink.c:1336 [inline]
netlink_unicast+0x668/0x950 net/netlink/af_netlink.c:1362
page last free pid 5846 tgid 5846 ts 38440219163 stack trace:
reset_page_owner include/linux/page_owner.h:26 [inline]
__free_pages_prepare mm/page_alloc.c:1402 [inline]
__free_frozen_pages+0x7b1/0x10f0 mm/page_alloc.c:2958
qlink_free mm/kasan/quarantine.c:163 [inline]
qlist_free_all+0x47/0xf0 mm/kasan/quarantine.c:179
kasan_quarantine_reduce+0x1a0/0x1f0 mm/kasan/quarantine.c:286
__kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:361
kasan_slab_alloc include/linux/kasan.h:253 [inline]
slab_post_alloc_hook mm/slub.c:4720 [inline]
slab_alloc_node mm/slub.c:5033 [inline]
kmem_cache_alloc_noprof+0x269/0x6a0 mm/slub.c:5047
mt_alloc_one lib/maple_tree.c:139 [inline]
mas_alloc_nodes lib/maple_tree.c:1049 [inline]
mas_preallocate+0xc22/0xee0 lib/maple_tree.c:5016
vma_iter_prealloc mm/vma.h:698 [inline]
__split_vma+0x447/0xce0 mm/vma.c:562
vms_gather_munmap_vmas+0x1d2/0x1720 mm/vma.c:1524
__mmap_setup mm/vma.c:2591 [inline]
__mmap_region+0x4d4/0x3910 mm/vma.c:3071
mmap_region+0x3db/0x6d0 mm/vma.c:3173
do_mmap+0x12c7/0x1c30 mm/mmap.c:573
vm_mmap_pgoff+0x283/0x490 mm/util.c:581
ksys_mmap_pgoff+0x3cb/0x610 mm/mmap.c:619
__do_sys_mmap arch/x86/kernel/sys_x86_64.c:96 [inline]
__se_sys_mmap arch/x86/kernel/sys_x86_64.c:89 [inline]
__x64_sys_mmap+0x125/0x190 arch/x86/kernel/sys_x86_64.c:89
do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
do_syscall_64+0x123/0x780 arch/x86/entry/syscall_64.c:89
entry_SYSCALL_64_after_hwframe+0x77/0x7f
Memory state around the buggy address:
ffff888056492f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff888056493000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff888056493080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888056493100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888056493180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
----------------
Code disassembly (best guess):
0: b6 0a mov $0xa,%dh
2: 00 00 add %al,(%rax)
4: 41 c7 87 20 0e 00 00 movl $0x0,0xe20(%r15)
b: 00 00 00 00
f: e9 47 04 00 00 jmp 0x45b
14: 49 8d 7f 48 lea 0x48(%r15),%rdi
18: e8 c3 f9 18 0a call 0xa18f9e0
1d: e8 8e 86 3d 00 call 0x3d86b0
22: fb sti
23: 48 8d bb 18 17 00 00 lea 0x1718(%rbx),%rdi
* 2a: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax <-- trapping instruction
31: fc ff df
34: 48 89 fa mov %rdi,%rdx
37: 48 c1 ea 03 shr $0x3,%rdx
3b: 0f b6 04 02 movzbl (%rdx,%rax,1),%eax
3f: 84 .byte 0x84