==================================================================
BUG: KASAN: slab-out-of-bounds in gb_operation_message_init drivers/greybus/operation.c:342 [inline]
BUG: KASAN: slab-out-of-bounds in gb_operation_message_alloc+0x267/0x2c0 drivers/greybus/operation.c:385
Write of size 1 at addr ffff888135ccc264 by task pr/ttyS0/31
CPU: 1 UID: 0 PID: 31 Comm: pr/ttyS0 Not tainted syzkaller #0 PREEMPT(lazy)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/06/2026
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:342 [inline]
gb_operation_message_alloc+0x267/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:1658
usb_hcd_giveback_urb+0x3ca/0x4a0 drivers/usb/core/hcd.c:1742
dummy_timer+0xdb5/0x3840 drivers/usb/gadget/udc/dummy_hcd.c:2051
__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+0x209/0xa00 kernel/softirq.c:669
__do_softirq kernel/softirq.c:703 [inline]
invoke_softirq kernel/softirq.c:542 [inline]
__irq_exit_rcu+0x17a/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+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:__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:211 [inline]
RIP: 0010:_raw_spin_unlock_irqrestore+0x31/0x80 kernel/locking/spinlock.c:221
Code: f5 53 48 8b 74 24 10 48 89 fb 48 83 c7 18 e8 26 7d ee f9 48 89 df e8 ae d3 ee f9 f7 c5 00 02 00 00 75 23 9c 58 f6 c4 02 75 37 01 00 00 00 e8 55 01 e1 f9 65 48 83 3d a4 e4 aa 05 00 74 16 5b
RSP: 0018:ffffc90000217cb0 EFLAGS: 00000246
RAX: 0000000000000002 RBX: ffffffff94747c60 RCX: 0000000000000000
RDX: 0000000000000001 RSI: ffffffff8951bcf4 RDI: ffffffff87f36780
RBP: 0000000000000246 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000001 R11: 205d343934323254 R12: 1ffff92000042f99
R13: ffffffff8a0d3640 R14: 0000000000000001 R15: dffffc0000000000
nbcon_emit_one+0x15c/0x2b0 kernel/printk/nbcon.c:1165
nbcon_kthread_func+0x5ef/0x7f0 kernel/printk/nbcon.c:1271
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 31:
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+0x8f/0xa0 mm/kasan/common.c:426
kasan_kmalloc include/linux/kasan.h:263 [inline]
__do_kmalloc_node mm/slub.c:5531 [inline]
__kmalloc_noprof+0x315/0x7e0 mm/slub.c:5556
_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:1658
usb_hcd_giveback_urb+0x3ca/0x4a0 drivers/usb/core/hcd.c:1742
dummy_timer+0xdb5/0x3840 drivers/usb/gadget/udc/dummy_hcd.c:2051
__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+0x209/0xa00 kernel/softirq.c:669
__do_softirq kernel/softirq.c:703 [inline]
invoke_softirq kernel/softirq.c:542 [inline]
__irq_exit_rcu+0x17a/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+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 ffff888135ccc260
which belongs to the cache kmalloc-8 of size 8
The buggy address is located 0 bytes to the right of
allocated 4-byte region [ffff888135ccc260, ffff888135ccc264)
The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff888135ccc6c0 pfn:0x135ccc
flags: 0x200000000000200(workingset|node=0|zone=2)
page_type: f5(slab)
raw: 0200000000000200 ffff888100041500 ffffea0004d457d0 ffffea000417a310
raw: ffff888135ccc6c0 000000000080007e 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 0xd2820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5658, tgid 5657 (syz.4.82), ts 128053466901
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+0x9da/0x2970 mm/page_alloc.c:3950
__alloc_frozen_pages_noprof+0x2a7/0x2f80 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+0x617/0x7e0 mm/slub.c:5556
_kmalloc_noprof include/linux/slab.h:995 [inline]
raw_event_queue_add+0x82/0x220 drivers/usb/gadget/legacy/raw_gadget.c:73
raw_queue_event drivers/usb/gadget/legacy/raw_gadget.c:240 [inline]
gadget_bind+0x422/0x660 drivers/usb/gadget/legacy/raw_gadget.c:316
gadget_bind_driver+0x28c/0xbf0 drivers/usb/gadget/udc/core.c:1663
call_driver_probe drivers/base/dd.c:629 [inline]
really_probe+0x241/0xa60 drivers/base/dd.c:707
__driver_probe_device+0x210/0x460 drivers/base/dd.c:869
driver_probe_device+0x4a/0x140 drivers/base/dd.c:899
__driver_attach+0x231/0x5b0 drivers/base/dd.c:1300
bus_for_each_dev+0x13e/0x1d0 drivers/base/bus.c:383
bus_add_driver+0x4bf/0x620 drivers/base/bus.c:782
page last free pid 15 tgid 15 ts 127471705673 stack trace:
reset_page_owner include/linux/page_owner.h:26 [inline]
__free_pages_prepare mm/page_alloc.c:1402 [inline]
__free_frozen_pages+0x792/0x1060 mm/page_alloc.c:2958
rcu_do_batch kernel/rcu/tree.c:2650 [inline]
rcu_core+0x5f0/0x1220 kernel/rcu/tree.c:2919
handle_softirqs+0x209/0xa00 kernel/softirq.c:669
run_ksoftirqd kernel/softirq.c:1133 [inline]
run_ksoftirqd+0x38/0x60 kernel/softirq.c:1125
smpboot_thread_fn+0x41f/0xb90 kernel/smpboot.c:162
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
Memory state around the buggy address:
ffff888135ccc100: fa fc fc fc fa fc fc fc fa fc fc fc fa fc fc fc
ffff888135ccc180: fa fc fc fc fa fc fc fc fa fc fc fc fa fc fc fc
>ffff888135ccc200: fa fc fc fc fa fc fc fc fa fc fc fc 04 fc fc fc
^
ffff888135ccc280: fa fc fc fc fa fc fc fc fa fc fc fc fa fc fc fc
ffff888135ccc300: fa fc fc fc fa fc fc fc fa fc fc fc fa fc fc fc
==================================================================
----------------
Code disassembly (best guess):
0: f5 cmc
1: 53 push %rbx
2: 48 8b 74 24 10 mov 0x10(%rsp),%rsi
7: 48 89 fb mov %rdi,%rbx
a: 48 83 c7 18 add $0x18,%rdi
e: e8 26 7d ee f9 call 0xf9ee7d39
13: 48 89 df mov %rbx,%rdi
16: e8 ae d3 ee f9 call 0xf9eed3c9
1b: f7 c5 00 02 00 00 test $0x200,%ebp
21: 75 23 jne 0x46
23: 9c pushf
24: 58 pop %rax
25: f6 c4 02 test $0x2,%ah
28: 75 37 jne 0x61
* 2a: bf 01 00 00 00 mov $0x1,%edi <-- trapping instruction
2f: e8 55 01 e1 f9 call 0xf9e10189
34: 65 48 83 3d a4 e4 aa cmpq $0x0,%gs:0x5aae4a4(%rip) # 0x5aae4e1
3b: 05 00
3d: 74 16 je 0x55
3f: 5b pop %rbx