[v6.1] KASAN: use-after-free Read in load_firmware_cb (2)

0 views
Skip to first unread message

syzbot

unread,
Oct 18, 2025, 12:24:42 PM (17 hours ago) Oct 18
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: c2fda4b3f577 Linux 6.1.156
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=1425f542580000
kernel config: https://syzkaller.appspot.com/x/.config?x=68aa5a3af1cb953a
dashboard link: https://syzkaller.appspot.com/bug?extid=f7a358f1f862868c8937
compiler: Debian clang version 20.1.8 (++20250708063551+0c9f909b7976-1~exp1~20250708183702.136), Debian LLD 20.1.8
userspace arch: arm64

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/d8907607c809/disk-c2fda4b3.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/005117d6d256/vmlinux-c2fda4b3.xz
kernel image: https://storage.googleapis.com/syzbot-assets/56e478409d48/Image-c2fda4b3.gz.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+f7a358...@syzkaller.appspotmail.com

kobject_add_internal failed for firmware (error: -2 parent: 1-1:0.183)
firmware xc3028-v27.fw: fw_load_sysfs_fallback: device_register failed
==================================================================
BUG: KASAN: use-after-free in load_firmware_cb+0xbc/0x14f4 drivers/media/tuners/xc2028.c:1372
Read of size 8 at addr ffff0000cd077318 by task kworker/1:7/4855

CPU: 1 PID: 4855 Comm: kworker/1:7 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/30/2025
Workqueue: events request_firmware_work_func
Call trace:
dump_backtrace+0x1c8/0x1f4 arch/arm64/kernel/stacktrace.c:158
show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:165
__dump_stack+0x30/0x40 lib/dump_stack.c:88
dump_stack_lvl+0xf8/0x160 lib/dump_stack.c:106
print_address_description+0x88/0x218 mm/kasan/report.c:316
print_report+0x50/0x68 mm/kasan/report.c:420
kasan_report+0xa8/0x100 mm/kasan/report.c:524
__asan_report_load8_noabort+0x2c/0x38 mm/kasan/report_generic.c:351
load_firmware_cb+0xbc/0x14f4 drivers/media/tuners/xc2028.c:1372
request_firmware_work_func+0xe8/0x19c drivers/base/firmware_loader/main.c:1137
process_one_work+0x7f4/0x13a8 kernel/workqueue.c:2292
worker_thread+0x8c8/0xfbc kernel/workqueue.c:2439
kthread+0x250/0x2d8 kernel/kthread.c:376
ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:850

Allocated by task 4855:
kasan_save_stack mm/kasan/common.c:45 [inline]
kasan_set_track+0x4c/0x80 mm/kasan/common.c:52
kasan_save_alloc_info+0x28/0x34 mm/kasan/generic.c:505
____kasan_kmalloc mm/kasan/common.c:374 [inline]
__kasan_kmalloc+0xa0/0xb8 mm/kasan/common.c:383
kasan_kmalloc include/linux/kasan.h:211 [inline]
kmalloc_trace+0x7c/0x94 mm/slab_common.c:1031
kmalloc include/linux/slab.h:563 [inline]
kzalloc include/linux/slab.h:699 [inline]
tuner_probe+0xc4/0x1680 drivers/media/v4l2-core/tuner-core.c:638
i2c_device_probe+0x680/0x8f4 drivers/i2c/i2c-core-base.c:590
call_driver_probe drivers/base/dd.c:-1 [inline]
really_probe+0x39c/0xae0 drivers/base/dd.c:639
__driver_probe_device+0x180/0x314 drivers/base/dd.c:785
driver_probe_device+0x78/0x330 drivers/base/dd.c:815
__device_attach_driver+0x290/0x4e0 drivers/base/dd.c:943
bus_for_each_drv+0x150/0x1d8 drivers/base/bus.c:429
__device_attach+0x2a8/0x3d4 drivers/base/dd.c:1015
device_initial_probe+0x24/0x34 drivers/base/dd.c:1064
bus_probe_device+0xbc/0x1c4 drivers/base/bus.c:489
device_add+0xb04/0xf94 drivers/base/core.c:3697
device_register+0x28/0x38 drivers/base/core.c:3779
i2c_new_client_device+0x87c/0xe6c drivers/i2c/i2c-core-base.c:1018
v4l2_i2c_new_subdev_board+0xb0/0x20c drivers/media/v4l2-core/v4l2-i2c.c:80
v4l2_i2c_new_subdev+0x120/0x19c drivers/media/v4l2-core/v4l2-i2c.c:135
em28xx_v4l2_init+0x6f4/0x2918 drivers/media/usb/em28xx/em28xx-video.c:2617
em28xx_init_extension+0x10c/0x1b4 drivers/media/usb/em28xx/em28xx-core.c:1116
request_module_async+0x68/0x98 drivers/media/usb/em28xx/em28xx-cards.c:3405
process_one_work+0x7f4/0x13a8 kernel/workqueue.c:2292
process_scheduled_works kernel/workqueue.c:2355 [inline]
worker_thread+0xae4/0xfbc kernel/workqueue.c:2444
kthread+0x250/0x2d8 kernel/kthread.c:376
ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:850

Freed by task 4855:
kasan_save_stack mm/kasan/common.c:45 [inline]
kasan_set_track+0x4c/0x80 mm/kasan/common.c:52
kasan_save_free_info+0x3c/0x60 mm/kasan/generic.c:516
____kasan_slab_free+0x148/0x1b0 mm/kasan/common.c:236
__kasan_slab_free+0x18/0x28 mm/kasan/common.c:244
kasan_slab_free include/linux/kasan.h:177 [inline]
slab_free_hook mm/slub.c:1729 [inline]
slab_free_freelist_hook+0x16c/0x1ec mm/slub.c:1755
slab_free mm/slub.c:3687 [inline]
__kmem_cache_free+0xc0/0x224 mm/slub.c:3700
kfree+0xd0/0x1ac mm/slab_common.c:988
tuner_remove+0x1d8/0x1f4 drivers/media/v4l2-core/tuner-core.c:791
i2c_device_remove+0x8c/0x1c0 drivers/i2c/i2c-core-base.c:631
device_remove drivers/base/dd.c:548 [inline]
__device_release_driver drivers/base/dd.c:1260 [inline]
device_release_driver_internal+0x3d4/0x6d0 drivers/base/dd.c:1286
device_release_driver+0x28/0x38 drivers/base/dd.c:1309
bus_remove_device+0x294/0x388 drivers/base/bus.c:531
device_del+0x568/0x96c drivers/base/core.c:3885
device_unregister+0x2c/0xcc drivers/base/core.c:3928
i2c_unregister_device+0x114/0x16c drivers/i2c/i2c-core-base.c:1066
v4l2_i2c_subdev_unregister+0xa8/0xbc drivers/media/v4l2-core/v4l2-i2c.c:28
v4l2_device_unregister+0x170/0x248 drivers/media/v4l2-core/v4l2-device.c:102
em28xx_v4l2_init+0x1328/0x2918 drivers/media/usb/em28xx/em28xx-video.c:2898
em28xx_init_extension+0x10c/0x1b4 drivers/media/usb/em28xx/em28xx-core.c:1116
request_module_async+0x68/0x98 drivers/media/usb/em28xx/em28xx-cards.c:3405
process_one_work+0x7f4/0x13a8 kernel/workqueue.c:2292
process_scheduled_works kernel/workqueue.c:2355 [inline]
worker_thread+0xae4/0xfbc kernel/workqueue.c:2444
kthread+0x250/0x2d8 kernel/kthread.c:376
ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:850

The buggy address belongs to the object at ffff0000cd077000
which belongs to the cache kmalloc-2k of size 2048
The buggy address is located 792 bytes inside of
2048-byte region [ffff0000cd077000, ffff0000cd077800)

The buggy address belongs to the physical page:
page:00000000e393e7b0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10d070
head:00000000e393e7b0 order:3 compound_mapcount:0 compound_pincount:0
flags: 0x5ffc00000010200(slab|head|node=0|zone=2|lastcpupid=0x7ff)
raw: 05ffc00000010200 dead000000000100 dead000000000122 ffff0000c0002900
raw: 0000000000000000 0000000000080008 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff0000cd077200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff0000cd077280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff0000cd077300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff0000cd077380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff0000cd077400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
Unable to handle kernel paging request at virtual address dfff800000000005
KASAN: null-ptr-deref in range [0x0000000000000028-0x000000000000002f]
Mem abort info:
ESR = 0x0000000096000006
EC = 0x25: DABT (current EL), IL = 32 bits
SET = 0, FnV = 0
EA = 0, S1PTW = 0
FSC = 0x06: level 2 translation fault
Data abort info:
ISV = 0, ISS = 0x00000006
CM = 0, WnR = 0
[dfff800000000005] address between user and kernel address ranges
Internal error: Oops: 0000000096000006 [#1] PREEMPT SMP
Modules linked in:
CPU: 1 PID: 4855 Comm: kworker/1:7 Tainted: G B syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/30/2025
Workqueue: events request_firmware_work_func
pstate: 82400005 (Nzcv daif +PAN -UAO +TCO -DIT -SSBS BTYPE=--)
pc : load_firmware_cb+0x22c/0x14f4 drivers/media/tuners/xc2028.c:1376
lr : load_firmware_cb+0xe0/0x14f4 drivers/media/tuners/xc2028.c:1374
sp : ffff800021407940
x29: ffff800021407a90 x28: ffff00019f6f5800 x27: 0000000000000000
x26: dfff800000000000 x25: ffff700004280f3c x24: 1fffe00019a0ee63
x23: ffff8000214079e0 x22: 0000000000000000 x21: 0000000000000000
x20: 0000000000000000 x19: ffff0000cd077318 x18: ffff800011abbcc0
x17: 1fffe00033edbb7e x16: ffff800008042d60 x15: 0000000040000000
x14: 0000000000000002 x13: 0000000000ff0100 x12: 0000000000ff0100
x11: ff0080000dfc1a40 x10: 0000000000000000 x9 : ffff80000dfc1a40
x8 : 0000000000000005 x7 : 0000000000000004 x6 : ffff800008251e10
x5 : 0000000000000000 x4 : 0000000000000001 x3 : ffff800008191794
x2 : 0000000000000001 x1 : 0000000000000000 x0 : 0000000000000028
Call trace:
load_firmware_cb+0x22c/0x14f4 drivers/media/tuners/xc2028.c:1376
request_firmware_work_func+0xe8/0x19c drivers/base/firmware_loader/main.c:1137
process_one_work+0x7f4/0x13a8 kernel/workqueue.c:2292
worker_thread+0x8c8/0xfbc kernel/workqueue.c:2439
kthread+0x250/0x2d8 kernel/kthread.c:376
ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:850
Code: b5fff65b f9403bf6 9100a2c0 d343fc08 (387a6908)
---[ end trace 0000000000000000 ]---
----------------
Code disassembly (best guess):
0: b5fff65b cbnz x27, 0xfffffffffffffec8
4: f9403bf6 ldr x22, [sp, #112]
8: 9100a2c0 add x0, x22, #0x28
c: d343fc08 lsr x8, x0, #3
* 10: 387a6908 ldrb w8, [x8, x26] <-- trapping instruction


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup

syzbot

unread,
Oct 18, 2025, 12:55:29 PM (17 hours ago) Oct 18
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: c2fda4b3f577 Linux 6.1.156
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=15931de2580000
kernel config: https://syzkaller.appspot.com/x/.config?x=68aa5a3af1cb953a
dashboard link: https://syzkaller.appspot.com/bug?extid=f7a358f1f862868c8937
compiler: Debian clang version 20.1.8 (++20250708063551+0c9f909b7976-1~exp1~20250708183702.136), Debian LLD 20.1.8
userspace arch: arm64
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1365da14580000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=16376492580000
firmware xc3028-v27.fw: fw_load_sysfs_fallback: device_register failed
==================================================================
BUG: KASAN: use-after-free in load_firmware_cb+0xbc/0x14f4 drivers/media/tuners/xc2028.c:1372
Read of size 8 at addr ffff0000d35ed318 by task kworker/0:9/4382

CPU: 0 PID: 4382 Comm: kworker/0:9 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/30/2025
Workqueue: events request_firmware_work_func
Call trace:
dump_backtrace+0x1c8/0x1f4 arch/arm64/kernel/stacktrace.c:158
show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:165
__dump_stack+0x30/0x40 lib/dump_stack.c:88
dump_stack_lvl+0xf8/0x160 lib/dump_stack.c:106
print_address_description+0x88/0x218 mm/kasan/report.c:316
print_report+0x50/0x68 mm/kasan/report.c:420
kasan_report+0xa8/0x100 mm/kasan/report.c:524
__asan_report_load8_noabort+0x2c/0x38 mm/kasan/report_generic.c:351
load_firmware_cb+0xbc/0x14f4 drivers/media/tuners/xc2028.c:1372
request_firmware_work_func+0xe8/0x19c drivers/base/firmware_loader/main.c:1137
process_one_work+0x7f4/0x13a8 kernel/workqueue.c:2292
worker_thread+0x8c8/0xfbc kernel/workqueue.c:2439
kthread+0x250/0x2d8 kernel/kthread.c:376
ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:850

Allocated by task 4382:
Freed by task 4382:
The buggy address belongs to the object at ffff0000d35ed000
which belongs to the cache kmalloc-2k of size 2048
The buggy address is located 792 bytes inside of
2048-byte region [ffff0000d35ed000, ffff0000d35ed800)

The buggy address belongs to the physical page:
page:000000005b468e1d refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1135e8
head:000000005b468e1d order:3 compound_mapcount:0 compound_pincount:0
flags: 0x5ffc00000010200(slab|head|node=0|zone=2|lastcpupid=0x7ff)
raw: 05ffc00000010200 0000000000000000 dead000000000122 ffff0000c0002900
raw: 0000000000000000 0000000000080008 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff0000d35ed200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff0000d35ed280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff0000d35ed300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff0000d35ed380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff0000d35ed400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
Unable to handle kernel paging request at virtual address dfff800000000005
KASAN: null-ptr-deref in range [0x0000000000000028-0x000000000000002f]
Mem abort info:
ESR = 0x0000000096000006
EC = 0x25: DABT (current EL), IL = 32 bits
SET = 0, FnV = 0
EA = 0, S1PTW = 0
FSC = 0x06: level 2 translation fault
Data abort info:
ISV = 0, ISS = 0x00000006
CM = 0, WnR = 0
[dfff800000000005] address between user and kernel address ranges
Internal error: Oops: 0000000096000006 [#1] PREEMPT SMP
Modules linked in:
CPU: 0 PID: 4382 Comm: kworker/0:9 Tainted: G B syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/30/2025
Workqueue: events request_firmware_work_func
pstate: 82400005 (Nzcv daif +PAN -UAO +TCO -DIT -SSBS BTYPE=--)
pc : load_firmware_cb+0x22c/0x14f4 drivers/media/tuners/xc2028.c:1376
lr : load_firmware_cb+0xe0/0x14f4 drivers/media/tuners/xc2028.c:1374
sp : ffff8000211a7940
x29: ffff8000211a7a90 x28: ffff00019f6d4800 x27: 0000000000000000
x26: dfff800000000000 x25: ffff700004234f3c x24: 1fffe0001a6bda63
x23: ffff8000211a79e0 x22: 0000000000000000 x21: 0000000000000000
x20: 0000000000000000 x19: ffff0000d35ed318 x18: ffff800011abbcc0
x17: 1fffe00033ed797e x16: ffff800008042d60 x15: ffff8000150bd000
x14: 0000000000000100 x13: 0000000000000120 x12: 0000000000ff0100
x11: ff0080000dfc1a40 x10: 0000000000000000 x9 : ffff80000dfc1a40
x8 : 0000000000000005 x7 : 0000000000000004 x6 : ffff800008251e10
x5 : 0000000000000000 x4 : 0000000000000001 x3 : ffff800008191794
x2 : 0000000000000001 x1 : 0000000000000000 x0 : 0000000000000028
Call trace:
load_firmware_cb+0x22c/0x14f4 drivers/media/tuners/xc2028.c:1376
request_firmware_work_func+0xe8/0x19c drivers/base/firmware_loader/main.c:1137
process_one_work+0x7f4/0x13a8 kernel/workqueue.c:2292
worker_thread+0x8c8/0xfbc kernel/workqueue.c:2439
kthread+0x250/0x2d8 kernel/kthread.c:376
ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:850
Code: b5fff65b f9403bf6 9100a2c0 d343fc08 (387a6908)
---[ end trace 0000000000000000 ]---
----------------
Code disassembly (best guess):
0: b5fff65b cbnz x27, 0xfffffffffffffec8
4: f9403bf6 ldr x22, [sp, #112]
8: 9100a2c0 add x0, x22, #0x28
c: d343fc08 lsr x8, x0, #3
* 10: 387a6908 ldrb w8, [x8, x26] <-- trapping instruction


---
If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.
Reply all
Reply to author
Forward
0 new messages