[BUG] KASAN: slab-use-after-free Write in gb_operation_put_active
From: Farhad Alemi
Date: Tue Dec 01 2026 - 15:12:51 EST
Hello,
We are reporting the following crash (reproducer attached):
Linux version 7.4.0-rc5-00048-g693c2e04e3f1
Build Config: UpstreamAppArmorKASAN (KASAN + UBSAN, panic_on_warn=1)
[ 31.065785][ T991] BUG: KASAN: slab-use-after-free in
_raw_spin_lock_irqsave+0x8f/0x100
[ 31.065812][ T991] Write of size 4 at addr ffff88801cd46068 by
task kworker/0:3/991
[ 31.065818][ T991]
[ 31.065831][ T991] CPU: 0 UID: 0 PID: 991 Comm: kworker/0:3 Not
tainted 7.4.0-rc5-00048-g693c2e04e3f1 #1 PREEMPT(full)
[ 31.065839][ T991] Hardware name: QEMU Standard PC (Q35 + ICH9,
2009), BIOS 1.17.0-debian-1.17.0-1ubuntu1 04/01/2014
[ 31.065844][ T991] Workqueue: greybus_completion gb_operation_work
[ 31.065861][ T991] Call Trace:
[ 31.065865][ T991] <TASK>
[ 31.065868][ T991] dump_stack_lvl+0x94/0xd0
[ 31.065876][ T991] print_address_description+0x55/0x1e0
[ 31.065887][ T991] ? _raw_spin_lock_irqsave+0x8f/0x100
[ 31.065896][ T991] print_report+0x58/0x70
[ 31.065905][ T991] kasan_report+0x130/0x170
[ 31.065919][ T991] ? _raw_spin_lock_irqsave+0x8f/0x100
[ 31.065928][ T991] kasan_check_range+0x264/0x2c0
[ 31.065934][ T991] _raw_spin_lock_irqsave+0x8f/0x100
[ 31.065943][ T991] ? __pfx__raw_spin_lock_irqsave+0x10/0x10
[ 31.065951][ T991] ? preempt_schedule_thunk+0x16/0x40
[ 31.065960][ T991] ? preempt_schedule_common+0x7f/0xd0
[ 31.065970][ T991] gb_operation_put_active+0x44/0x360
[ 31.065981][ T991] gb_operation_work+0x7d5/0x9d0
[ 31.065988][ T991] process_scheduled_works+0x8d9/0x11d0
[ 31.065998][ T991] worker_thread+0x988/0xde0
[ 31.066006][ T991] ? _raw_spin_lock_irqsave+0x9c/0x100
[ 31.066015][ T991] ? __kthread_parkme+0x148/0x1a0
[ 31.066023][ T991] kthread+0x335/0x420
[ 31.066032][ T991] ? __pfx_worker_thread+0x10/0x10
[ 31.066040][ T991] ? __pfx_kthread+0x10/0x10
[ 31.066057][ T991] ret_from_fork+0x351/0x940
[ 31.066063][ T991] ? __pfx_ret_from_fork+0x10/0x10
[ 31.066069][ T991] ? __switch_to+0xbe8/0x11f0
[ 31.066079][ T991] ? __pfx_kthread+0x10/0x10
[ 31.066088][ T991] ret_from_fork_asm+0x1a/0x30
[ 31.066096][ T991] </TASK>
[ 31.066098][ T991]
[ 31.066104][ T991] Allocated by task 13 on cpu 0 at 29.949374s:
[ 31.066110][ T991] kasan_save_track+0x3f/0xb0
[ 31.066119][ T991] __kasan_kmalloc+0x93/0xb0
[ 31.066128][ T991] __kmalloc_cache_noprof+0x244/0x500
[ 31.066138][ T991] _gb_connection_create+0x1b0/0x9f0
[ 31.066144][ T991] gb_connection_create+0x7d/0x90
[ 31.066150][ T991] gb_usb_probe+0xfd/0x290
[ 31.066160][ T991] gbphy_dev_probe+0x20f/0x480
[ 31.066169][ T991] really_probe+0x267/0xaf0
[ 31.066179][ T991] __driver_probe_device+0x1e2/0x350
[ 31.066187][ T991] driver_probe_device+0x4f/0x240
[ 31.066196][ T991] __device_attach_driver+0x270/0x410
[ 31.066205][ T991] bus_for_each_drv+0x257/0x2f0
[ 31.066211][ T991] __device_attach+0x2bd/0x420
[ 31.066219][ T991] device_initial_probe+0x9c/0x100
[ 31.066228][ T991] __bus_probe_device+0x126/0x220
[ 31.066233][ T991] device_add+0x7ea/0xb80
[ 31.066241][ T991] gb_gbphy_probe+0x368/0x580
[ 31.066249][ T991] greybus_probe+0x5ec/0x840
[ 31.066257][ T991] really_probe+0x267/0xaf0
[ 31.066266][ T991] __driver_probe_device+0x1e2/0x350
[ 31.066274][ T991] driver_probe_device+0x4f/0x240
[ 31.066283][ T991] __device_attach_driver+0x270/0x410
[ 31.066292][ T991] bus_for_each_drv+0x257/0x2f0
[ 31.066298][ T991] __device_attach+0x2bd/0x420
[ 31.066305][ T991] device_initial_probe+0x9c/0x100
[ 31.066314][ T991] __bus_probe_device+0x126/0x220
[ 31.066320][ T991] device_add+0x7ea/0xb80
[ 31.066326][ T991] gb_bundle_add+0x1e/0x180
[ 31.066331][ T991] gb_interface_enable+0x58f/0x900
[ 31.066340][ T991] gb_module_add+0x1b3/0x3d0
[ 31.066348][ T991] gb_svc_process_deferred_request+0x8c6/0x1150
[ 31.066357][ T991] process_scheduled_works+0x8d9/0x11d0
[ 31.066364][ T991] worker_thread+0x988/0xde0
[ 31.066371][ T991] kthread+0x335/0x420
[ 31.066379][ T991] ret_from_fork+0x351/0x940
[ 31.066384][ T991] ret_from_fork_asm+0x1a/0x30
[ 31.066391][ T991]
[ 31.066392][ T991] Freed by task 13 on cpu 0 at 31.024497s:
[ 31.066398][ T991] kasan_save_track+0x3f/0xb0
[ 31.066406][ T991] kasan_save_free_info+0x46/0x50
[ 31.066413][ T991] __kasan_slab_free+0x70/0x90
[ 31.066422][ T991] kfree+0x18c/0x4e0
[ 31.066429][ T991] gb_usb_probe+0x1eb/0x290
[ 31.066438][ T991] gbphy_dev_probe+0x20f/0x480
[ 31.066446][ T991] really_probe+0x267/0xaf0
[ 31.066455][ T991] __driver_probe_device+0x1e2/0x350
[ 31.066463][ T991] driver_probe_device+0x4f/0x240
[ 31.066472][ T991] __device_attach_driver+0x270/0x410
[ 31.066481][ T991] bus_for_each_drv+0x257/0x2f0
[ 31.066487][ T991] __device_attach+0x2bd/0x420
[ 31.066495][ T991] device_initial_probe+0x9c/0x100
[ 31.066503][ T991] __bus_probe_device+0x126/0x220
[ 31.066509][ T991] device_add+0x7ea/0xb80
[ 31.066516][ T991] gb_gbphy_probe+0x368/0x580
[ 31.066524][ T991] greybus_probe+0x5ec/0x840
[ 31.066531][ T991] really_probe+0x267/0xaf0
[ 31.066540][ T991] __driver_probe_device+0x1e2/0x350
[ 31.066548][ T991] driver_probe_device+0x4f/0x240
[ 31.066557][ T991] __device_attach_driver+0x270/0x410
[ 31.066566][ T991] bus_for_each_drv+0x257/0x2f0
[ 31.066571][ T991] __device_attach+0x2bd/0x420
[ 31.066579][ T991] device_initial_probe+0x9c/0x100
[ 31.066588][ T991] __bus_probe_device+0x126/0x220
[ 31.066594][ T991] device_add+0x7ea/0xb80
[ 31.066600][ T991] gb_bundle_add+0x1e/0x180
[ 31.066605][ T991] gb_interface_enable+0x58f/0x900
[ 31.066614][ T991] gb_module_add+0x1b3/0x3d0
[ 31.066622][ T991] gb_svc_process_deferred_request+0x8c6/0x1150
[ 31.066631][ T991] process_scheduled_works+0x8d9/0x11d0
[ 31.066637][ T991] worker_thread+0x988/0xde0
[ 31.066644][ T991] kthread+0x335/0x420
[ 31.066652][ T991] ret_from_fork+0x351/0x940
[ 31.066657][ T991] ret_from_fork_asm+0x1a/0x30
[ 31.066664][ T991]
[ 31.066665][ T991] The buggy address belongs to the object at
ffff88801cd46000
[ 31.066665][ T991] which belongs to the cache kmalloc-192 of size 192
[ 31.066671][ T991] The buggy address is located 104 bytes inside of
[ 31.066671][ T991] freed 192-byte region [ffff88801cd46000,
ffff88801cd460c0)
[ 31.066678][ T991]
[ 31.066679][ T991] The buggy address belongs to the physical page:
[ 31.066687][ T991] page: refcount:0 mapcount:0
mapping:0000000000000000 index:0x0 pfn:0x1cd46
[ 31.066697][ T991] flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff)
[ 31.066706][ T991] page_type: f5(slab)
[ 31.066715][ T991] raw: 00fff00000000000 ffff8880134413c0
dead000000000100 dead000000000122
[ 31.066721][ T991] raw: 0000000000000000 0000000000100010
00000000f5000000 0000000000000000
[ 31.066724][ T991] page dumped because: kasan: bad access detected
[ 31.066729][ T991] page_owner tracks the page as allocated
[ 31.066732][ T991] page last allocated via order 0, migratetype
Unmovable, gfp_mask
0xd2c00(GFP_NOIO|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC),
pid 1, tgid 1 (swapper/0), ts 2636390459
[ 31.066743][ T991] post_alloc_hook+0x1f9/0x250
[ 31.066753][ T991] prep_new_page+0x22/0xc0
[ 31.066762][ T991] get_page_from_freelist+0x274a/0x2830
[ 31.066771][ T991] __alloc_frozen_pages_noprof+0x226/0x560
[ 31.066781][ T991] allocate_slab+0x7d/0x5e0
[ 31.066788][ T991] refill_objects+0x304/0x380
[ 31.066794][ T991] __pcs_replace_empty_main+0x208/0x530
[ 31.066800][ T991] __kmalloc_noprof+0x3b3/0x630
[ 31.066809][ T991] usb_alloc_urb+0x46/0x150
[ 31.066815][ T991] usb_control_msg+0x118/0x3e0
[ 31.066821][ T991] usb_get_string+0xa1/0x3c0
[ 31.066829][ T991] usb_string_sub+0x76/0x420
[ 31.066836][ T991] usb_string+0x38f/0x7d0
[ 31.066842][ T991] usb_cache_string+0x7d/0xf0
[ 31.066849][ T991] usb_new_device+0x2a5/0x1720
[ 31.066856][ T991] register_root_hub+0x265/0x5e0
[ 31.066861][ T991] page_owner free stack trace missing
[ 31.066863][ T991]
[ 31.066865][ T991] Memory state around the buggy address:
[ 31.066869][ T991] ffff88801cd45f00: 00 00 00 00 00 00 00 00 00
00 00 00 fc fc fc fc
[ 31.066873][ T991] ffff88801cd45f80: fc fc fc fc fc fc fc fc fc
fc fc fc fc fc fc fc
[ 31.066877][ T991] >ffff88801cd46000: fa fb fb fb fb fb fb fb fb
fb fb fb fb fb fb fb
[ 31.066881][ T991]
^
[ 31.066884][ T991] ffff88801cd46080: fb fb fb fb fb fb fb fb fc
fc fc fc fc fc fc fc
[ 31.066889][ T991] ffff88801cd46100: fa fb fb fb fb fb fb fb fb
fb fb fb fb fb fb fb
[ 31.066892][ T991]
==================================================================
[ 31.066899][ T991] Kernel panic - not syncing: KASAN: panic_on_warn set ...
[ 31.145657][ T991] CPU: 0 UID: 0 PID: 991 Comm: kworker/0:3 Not
tainted 7.4.0-rc5-00048-g693c2e04e3f1 #1 PREEMPT(full)
[ 31.146672][ T991] Hardware name: QEMU Standard PC (Q35 + ICH9,
2009), BIOS 1.17.0-debian-1.17.0-1ubuntu1 04/01/2014
[ 31.147692][ T991] Workqueue: greybus_completion gb_operation_work
[ 31.148317][ T991] Call Trace:
[ 31.148703][ T991] <TASK>
[ 31.148994][ T991] vpanic+0x241/0x6e0
[ 31.149391][ T991] panic+0xc5/0xd0
[ 31.149763][ T991] ? __pfx_panic+0x10/0x10
[ 31.150179][ T991] ? __pfx__printk+0x10/0x10
[ 31.150613][ T991] ? _raw_spin_lock_irqsave+0x8f/0x100
[ 31.151123][ T991] check_panic_on_warn+0x89/0xb0
[ 31.151587][ T991] ? _raw_spin_lock_irqsave+0x8f/0x100
[ 31.152094][ T991] end_report+0x45/0xe0
[ 31.152485][ T991] ? _raw_spin_lock_irqsave+0x8f/0x100
[ 31.152988][ T991] kasan_report+0x141/0x170
[ 31.153419][ T991] ? _raw_spin_lock_irqsave+0x8f/0x100
[ 31.153922][ T991] kasan_check_range+0x264/0x2c0
[ 31.154382][ T991] _raw_spin_lock_irqsave+0x8f/0x100
[ 31.154897][ T991] ? __pfx__raw_spin_lock_irqsave+0x10/0x10
[ 31.155473][ T991] ? preempt_schedule_thunk+0x16/0x40
[ 31.155996][ T991] ? preempt_schedule_common+0x7f/0xd0
[ 31.156531][ T991] gb_operation_put_active+0x44/0x360
[ 31.157032][ T991] gb_operation_work+0x7d5/0x9d0
[ 31.157493][ T991] process_scheduled_works+0x8d9/0x11d0
[ 31.158006][ T991] worker_thread+0x988/0xde0
[ 31.158536][ T991] ? _raw_spin_lock_irqsave+0x9c/0x100
[ 31.159068][ T991] ? __kthread_parkme+0x148/0x1a0
[ 31.159560][ T991] kthread+0x335/0x420
[ 31.159958][ T991] ? __pfx_worker_thread+0x10/0x10
[ 31.160435][ T991] ? __pfx_kthread+0x10/0x10
[ 31.160904][ T991] ret_from_fork+0x351/0x940
[ 31.161358][ T991] ? __pfx_ret_from_fork+0x10/0x10
[ 31.161857][ T991] ? __switch_to+0xbe8/0x11f0
[ 31.162298][ T991] ? __pfx_kthread+0x10/0x10
[ 31.162729][ T991] ret_from_fork_asm+0x1a/0x30
[ 31.163178][ T991] </TASK>
[ 31.163502][ T991] Kernel Offset: disabled
[ 31.163903][ T991] Rebooting in 86400 seconds..
Regards,
Attachment:
reproducer.c
Description: Binary data