==================================================================
BUG: KASAN: slab-out-of-bounds in gb_operation_message_init drivers/greybus/operation.c:341 [inline]
BUG: KASAN: slab-out-of-bounds in gb_operation_message_alloc+0x26e/0x2c0 drivers/greybus/operation.c:385
Write of size 2 at addr ffff88811b01e542 by task kworker/0:8/6480
CPU: 0 UID: 0 PID: 6480 Comm: kworker/0:8 Not tainted syzkaller #0 PREEMPT(lazy)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026
Workqueue: usb_hub_wq hub_event
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
gb_operation_message_init drivers/greybus/operation.c:341 [inline]
gb_operation_message_alloc+0x26e/0x2c0 drivers/greybus/operation.c:385
gb_operation_create_common+0x9f/0x710 drivers/greybus/operation.c:532
gb_operation_create_incoming drivers/greybus/operation.c:644 [inline]
gb_connection_recv_request drivers/greybus/operation.c:926 [inline]
gb_connection_recv+0x1dc/0x1050 drivers/greybus/operation.c:1063
greybus_data_rcvd+0x244/0x600 drivers/greybus/connection.c:89
cport_in_callback+0x1fb/0x280 drivers/greybus/es2.c:840
__usb_hcd_giveback_urb+0x38e/0x610 drivers/usb/core/hcd.c:1657
usb_hcd_giveback_urb+0x3ca/0x4a0 drivers/usb/core/hcd.c:1741
dummy_timer+0xdb2/0x3700 drivers/usb/gadget/udc/dummy_hcd.c:2019
__run_hrtimer kernel/time/hrtimer.c:2067 [inline]
__hrtimer_run_queues+0x462/0x9c0 kernel/time/hrtimer.c:2124
hrtimer_run_softirq+0x1ca/0x360 kernel/time/hrtimer.c:2141
handle_softirqs+0x1d9/0x9b0 kernel/softirq.c:645
__do_softirq kernel/softirq.c:679 [inline]
invoke_softirq kernel/softirq.c:519 [inline]
__irq_exit_rcu+0x168/0x210 kernel/softirq.c:758
irq_exit_rcu+0x9/0x30 kernel/softirq.c:775
instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1062 [inline]
sysvec_apic_timer_interrupt+0x8f/0xb0 arch/x86/kernel/apic/apic.c:1062
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:674
RIP: 0010:lock_acquire+0x5e/0x380 kernel/locking/lockdep.c:5947
Code: 05 0f fd 92 0b 83 f8 07 0f 87 da 00 00 00 48 0f a3 05 9e e4 84 09 0f 82 c9 02 00 00 8b 35 3e f2 84 09 85 f6 0f 85 c7 00 00 00 <48> 8b 44 24 30 65 48 2b 05 ad fc 92 0b 0f 85 09 03 00 00 48 83 c4
RSP: 0018:ffffc900142d6920 EFLAGS: 00000206
RAX: 0000000000000046 RBX: 0000000000000000 RCX: 0000000000000200
RDX: 0000000000000000 RSI: ffffffff893084e6 RDI: ffffffff87d2b780
RBP: ffffffff898e4c20 R08: 0000000028820fef R09: 0000000000000007
R10: 0000000000000200 R11: 0000000000000001 R12: 0000000000000002
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
rcu_lock_acquire include/linux/rcupdate.h:309 [inline]
rcu_read_lock include/linux/rcupdate.h:849 [inline]
class_rcu_constructor include/linux/rcupdate.h:1216 [inline]
unwind_next_frame+0xd1/0x2090 arch/x86/kernel/unwind_orc.c:495
arch_stack_walk+0x94/0xf0 arch/x86/kernel/stacktrace.c:25
stack_trace_save+0x8e/0xc0 kernel/stacktrace.c:122
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:398 [inline]
__kasan_kmalloc+0x8f/0xa0 mm/kasan/common.c:415
kasan_kmalloc include/linux/kasan.h:263 [inline]
__kmalloc_cache_noprof+0x2d8/0x680 mm/slub.c:5563
_kmalloc_noprof include/linux/slab.h:991 [inline]
dummy_urb_enqueue+0xa3/0x880 drivers/usb/gadget/udc/dummy_hcd.c:1295
usb_hcd_submit_urb+0x268/0x2150 drivers/usb/core/hcd.c:1542
usb_submit_urb+0x827/0x19b0 drivers/usb/core/urb.c:586
es2_cport_in_enable drivers/greybus/es2.c:238 [inline]
ap_probe+0xdda/0x11e0 drivers/greybus/es2.c:1414
usb_probe_interface+0x386/0x9b0 drivers/usb/core/driver.c:399
call_driver_probe drivers/base/dd.c:628 [inline]
really_probe+0x241/0xa60 drivers/base/dd.c:706
__driver_probe_device+0x210/0x460 drivers/base/dd.c:868
driver_probe_device+0x4a/0x140 drivers/base/dd.c:898
__device_attach_driver+0x1df/0x320 drivers/base/dd.c:1026
bus_for_each_drv+0x159/0x1e0 drivers/base/bus.c:500
__device_attach+0x1e4/0x4d0 drivers/base/dd.c:1098
device_initial_probe+0xaf/0xd0 drivers/base/dd.c:1153
bus_probe_device+0x64/0x160 drivers/base/bus.c:620
device_add+0x121d/0x1970 drivers/base/core.c:3776
usb_set_configuration+0xd97/0x1c60 drivers/usb/core/message.c:2268
usb_generic_driver_probe+0xa1/0xe0 drivers/usb/core/generic.c:250
usb_probe_device+0xef/0x400 drivers/usb/core/driver.c:293
call_driver_probe drivers/base/dd.c:628 [inline]
really_probe+0x241/0xa60 drivers/base/dd.c:706
__driver_probe_device+0x210/0x460 drivers/base/dd.c:868
driver_probe_device+0x4a/0x140 drivers/base/dd.c:898
__device_attach_driver+0x1df/0x320 drivers/base/dd.c:1026
bus_for_each_drv+0x159/0x1e0 drivers/base/bus.c:500
__device_attach+0x1e4/0x4d0 drivers/base/dd.c:1098
device_initial_probe+0xaf/0xd0 drivers/base/dd.c:1153
bus_probe_device+0x64/0x160 drivers/base/bus.c:620
device_add+0x121d/0x1970 drivers/base/core.c:3776
usb_new_device.part.0+0xcc2/0x1686 drivers/usb/core/hub.c:2708
usb_new_device drivers/usb/core/hub.c:5833 [inline]
hub_port_connect drivers/usb/core/hub.c:5580 [inline]
hub_port_connect_change drivers/usb/core/hub.c:5720 [inline]
port_event drivers/usb/core/hub.c:5884 [inline]
hub_event.cold+0x51a/0xe9d drivers/usb/core/hub.c:5966
process_one_work+0xac7/0x1b10 kernel/workqueue.c:3396
process_scheduled_works kernel/workqueue.c:3479 [inline]
worker_thread+0x5ef/0xe50 kernel/workqueue.c:3560
kthread+0x373/0x450 kernel/kthread.c:436
ret_from_fork+0x69f/0xc90 arch/x86/kernel/process.c:158
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
Allocated by task 6480:
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:398 [inline]
__kasan_kmalloc+0x8f/0xa0 mm/kasan/common.c:415
kasan_kmalloc include/linux/kasan.h:263 [inline]
__do_kmalloc_node mm/slub.c:5414 [inline]
__kmalloc_noprof+0x315/0x7e0 mm/slub.c:5439
_kmalloc_noprof include/linux/slab.h:995 [inline]
_kzalloc_noprof include/linux/slab.h:1312 [inline]
gb_operation_message_alloc+0x9b/0x2c0 drivers/greybus/operation.c:380
gb_operation_create_common+0x9f/0x710 drivers/greybus/operation.c:532
gb_operation_create_incoming drivers/greybus/operation.c:644 [inline]
gb_connection_recv_request drivers/greybus/operation.c:926 [inline]
gb_connection_recv+0x1dc/0x1050 drivers/greybus/operation.c:1063
greybus_data_rcvd+0x244/0x600 drivers/greybus/connection.c:89
cport_in_callback+0x1fb/0x280 drivers/greybus/es2.c:840
__usb_hcd_giveback_urb+0x38e/0x610 drivers/usb/core/hcd.c:1657
usb_hcd_giveback_urb+0x3ca/0x4a0 drivers/usb/core/hcd.c:1741
dummy_timer+0xdb2/0x3700 drivers/usb/gadget/udc/dummy_hcd.c:2019
__run_hrtimer kernel/time/hrtimer.c:2067 [inline]
__hrtimer_run_queues+0x462/0x9c0 kernel/time/hrtimer.c:2124
hrtimer_run_softirq+0x1ca/0x360 kernel/time/hrtimer.c:2141
handle_softirqs+0x1d9/0x9b0 kernel/softirq.c:645
__do_softirq kernel/softirq.c:679 [inline]
invoke_softirq kernel/softirq.c:519 [inline]
__irq_exit_rcu+0x168/0x210 kernel/softirq.c:758
irq_exit_rcu+0x9/0x30 kernel/softirq.c:775
instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1062 [inline]
sysvec_apic_timer_interrupt+0x8f/0xb0 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 ffff88811b01e540
which belongs to the cache kmalloc-8 of size 8
The buggy address is located 0 bytes to the right of
allocated 2-byte region [ffff88811b01e540, ffff88811b01e542)
The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff88811b01e740 pfn:0x11b01e
flags: 0x200000000000200(workingset|node=0|zone=2)
page_type: f5(slab)
raw: 0200000000000200 ffff888100041500 ffffea00042cdcd0 ffff888100040348
raw: ffff88811b01e740 000000000080003a 00000000f5000000 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 0, migratetype Unmovable, gfp_mask 0xd2cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5430, tgid 5430 (kworker/0:6), ts 378759372205
set_page_owner include/linux/page_owner.h:33 [inline]
post_alloc_hook+0xfd/0x120 mm/page_alloc.c:1871
prep_new_page mm/page_alloc.c:1879 [inline]
get_page_from_freelist+0xf4b/0x3440 mm/page_alloc.c:3943
__alloc_frozen_pages_noprof+0x2d7/0x2f70 mm/page_alloc.c:5436
alloc_slab_page mm/slub.c:3347 [inline]
allocate_slab mm/slub.c:3462 [inline]
new_slab+0xa9/0x6e0 mm/slub.c:3513
refill_objects+0xe3/0x410 mm/slub.c:7410
refill_sheaf mm/slub.c:2885 [inline]
__pcs_replace_empty_main+0x35e/0x650 mm/slub.c:4774
alloc_from_pcs mm/slub.c:4850 [inline]
slab_alloc_node mm/slub.c:4984 [inline]
__do_kmalloc_node mm/slub.c:5413 [inline]
__kmalloc_node_track_caller_noprof+0x634/0x820 mm/slub.c:5545
kvasprintf+0xbc/0x150 lib/kasprintf.c:25
kvasprintf_const+0x66/0x1a0 lib/kasprintf.c:49
kobject_set_name_vargs+0x5a/0x140 lib/kobject.c:274
dev_set_name+0xc7/0x100 drivers/base/core.c:3564
usb_alloc_dev+0x6a7/0x1090 drivers/usb/core/usb.c:726
hub_port_connect drivers/usb/core/hub.c:5483 [inline]
hub_port_connect_change drivers/usb/core/hub.c:5720 [inline]
port_event drivers/usb/core/hub.c:5884 [inline]
hub_event+0x2c5d/0x4510 drivers/usb/core/hub.c:5966
process_one_work+0xac7/0x1b10 kernel/workqueue.c:3396
process_scheduled_works kernel/workqueue.c:3479 [inline]
worker_thread+0x5ef/0xe50 kernel/workqueue.c:3560
kthread+0x373/0x450 kernel/kthread.c:436
page last free pid 5328 tgid 5328 ts 368145496187 stack trace:
reset_page_owner include/linux/page_owner.h:26 [inline]
__free_pages_prepare mm/page_alloc.c:1418 [inline]
__free_frozen_pages+0x714/0xfc0 mm/page_alloc.c:2962
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+0x4e/0x70 mm/kasan/common.c:350
kasan_slab_alloc include/linux/kasan.h:253 [inline]
slab_post_alloc_hook mm/slub.c:4683 [inline]
slab_alloc_node mm/slub.c:4996 [inline]
kmem_cache_alloc_lru_noprof+0x260/0x650 mm/slub.c:5029
alloc_inode+0x183/0x250 fs/inode.c:340
iget_locked+0x1d9/0x6d0 fs/inode.c:1473
kernfs_get_inode+0x46/0x470 fs/kernfs/inode.c:250
kernfs_iop_lookup+0x1a7/0x2d0 fs/kernfs/dir.c:1273
__lookup_slow+0x155/0x320 fs/namei.c:1919
lookup_slow+0x50/0x70 fs/namei.c:1936
walk_component fs/namei.c:2282 [inline]
lookup_last fs/namei.c:2789 [inline]
path_lookupat+0x5e8/0xc40 fs/namei.c:2813
filename_lookup+0x202/0x590 fs/namei.c:2842
do_readlinkat+0xd3/0x370 fs/stat.c:571
__do_sys_readlink fs/stat.c:605 [inline]
__se_sys_readlink fs/stat.c:602 [inline]
__x64_sys_readlink+0x78/0xc0 fs/stat.c:602
do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
do_syscall_64+0x119/0x710 arch/x86/entry/syscall_64.c:84
Memory state around the buggy address:
ffff88811b01e400: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88811b01e480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff88811b01e500: fc fc fc fc fc fc fc fc 02 fc fc fc fa fc fc fc
^
ffff88811b01e580: fa fc fc fc fa fc fc fc fa fc fc fc fa fc fc fc
ffff88811b01e600: fa fc fc fc fa fc fc fc fa fc fc fc fa fc fc fc
==================================================================
----------------
Code disassembly (best guess):
0: 05 0f fd 92 0b add $0xb92fd0f,%eax
5: 83 f8 07 cmp $0x7,%eax
8: 0f 87 da 00 00 00 ja 0xe8
e: 48 0f a3 05 9e e4 84 bt %rax,0x984e49e(%rip) # 0x984e4b4
15: 09
16: 0f 82 c9 02 00 00 jb 0x2e5
1c: 8b 35 3e f2 84 09 mov 0x984f23e(%rip),%esi # 0x984f260
22: 85 f6 test %esi,%esi
24: 0f 85 c7 00 00 00 jne 0xf1
* 2a: 48 8b 44 24 30 mov 0x30(%rsp),%rax <-- trapping instruction
2f: 65 48 2b 05 ad fc 92 sub %gs:0xb92fcad(%rip),%rax # 0xb92fce4
36: 0b
37: 0f 85 09 03 00 00 jne 0x346
3d: 48 rex.W
3e: 83 .byte 0x83
3f: c4 .byte 0xc4