Hello,
syzbot found the following issue on:
HEAD commit: 447db0046f21 Merge 39ca700c8ac0 ("crypto: af_alg - Remove ..
git tree: android13-5.10-lts
console+strace:
https://syzkaller.appspot.com/x/log.txt?x=14902079580000
kernel config:
https://syzkaller.appspot.com/x/.config?x=57bdfa4a173e5087
dashboard link:
https://syzkaller.appspot.com/bug?extid=90ffe1583ffe9c58c485
compiler: Debian clang version 22.1.8 (++20260613092233+e80beda6e255-1~exp1~20260613092250.77), Debian LLD 22.1.8
syz repro:
https://syzkaller.appspot.com/x/repro.syz?x=13660079580000
C reproducer:
https://syzkaller.appspot.com/x/repro.c?x=177dc149580000
Downloadable assets:
disk image:
https://storage.googleapis.com/syzbot-assets/1807d94a204f/disk-447db004.raw.xz
vmlinux:
https://storage.googleapis.com/syzbot-assets/8f97e2566837/vmlinux-447db004.xz
kernel image:
https://storage.googleapis.com/syzbot-assets/4051703ff7a0/bzImage-447db004.xz
IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by:
syzbot+90ffe1...@syzkaller.appspotmail.com
==================================================================
BUG: KASAN: use-after-free in instrument_atomic_read include/linux/instrumented.h:71 [inline]
BUG: KASAN: use-after-free in test_bit include/asm-generic/bitops/instrumented-non-atomic.h:134 [inline]
BUG: KASAN: use-after-free in tty_port_kopened include/linux/tty.h:616 [inline]
BUG: KASAN: use-after-free in check_tty_count+0x1a8/0x330 drivers/tty/tty_io.c:295
Read of size 8 at addr ffff888107593110 by task syz-executor780/305
CPU: 1 PID: 305 Comm: syz-executor780 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026
Call Trace:
__dump_stack+0x21/0x24 lib/dump_stack.c:77
dump_stack_lvl+0x1a7/0x208 lib/dump_stack.c:118
print_address_description+0x7f/0x2c0 mm/kasan/report.c:248
__kasan_report mm/kasan/report.c:435 [inline]
kasan_report+0x100/0x140 mm/kasan/report.c:452
check_region_inline mm/kasan/generic.c:-1 [inline]
kasan_check_range+0x249/0x2a0 mm/kasan/generic.c:189
__kasan_check_read+0x11/0x20 mm/kasan/shadow.c:31
instrument_atomic_read include/linux/instrumented.h:71 [inline]
test_bit include/asm-generic/bitops/instrumented-non-atomic.h:134 [inline]
tty_port_kopened include/linux/tty.h:616 [inline]
check_tty_count+0x1a8/0x330 drivers/tty/tty_io.c:295
tty_release+0xc9/0x1330 drivers/tty/tty_io.c:1747
__fput+0x2dc/0x730 fs/file_table.c:281
____fput+0x15/0x20 fs/file_table.c:314
task_work_run+0x127/0x190 kernel/task_work.c:189
exit_task_work include/linux/task_work.h:33 [inline]
do_exit+0xa7c/0x24e0 kernel/exit.c:873
do_group_exit+0x149/0x310 kernel/exit.c:987
__do_sys_exit_group kernel/exit.c:998 [inline]
__se_sys_exit_group kernel/exit.c:996 [inline]
__x64_sys_exit_group+0x3f/0x40 kernel/exit.c:996
do_syscall_64+0x31/0x40 arch/x86/entry/common.c:46
entry_SYSCALL_64_after_hwframe+0x61/0xcb
RIP: 0033:0x7fce6da24745
Code: Unable to access opcode bytes at RIP 0x7fce6da2471b.
RSP: 002b:00007ffd603230a8 EFLAGS: 00000202 ORIG_RAX: 00000000000000e7
RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 00007fce6da24745
RDX: 00000000000000e7 RSI: ffffffffffffffd0 RDI: 0000000000000000
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000000000
R13: 00007fce6dad5120 R14: 00007fce6dad74e8 R15: 00007fce6dad7500
Allocated by task 307:
kasan_save_stack mm/kasan/common.c:38 [inline]
kasan_set_track mm/kasan/common.c:45 [inline]
set_alloc_info mm/kasan/common.c:430 [inline]
____kasan_kmalloc mm/kasan/common.c:509 [inline]
__kasan_kmalloc+0xd4/0x100 mm/kasan/common.c:518
kasan_kmalloc include/linux/kasan.h:254 [inline]
kmem_cache_alloc_trace+0x179/0x2e0 mm/slub.c:2979
kmalloc include/linux/slab.h:555 [inline]
kzalloc include/linux/slab.h:667 [inline]
gs_port_alloc drivers/usb/gadget/function/u_serial.c:1162 [inline]
gserial_alloc_line_no_console+0x238/0x700 drivers/usb/gadget/function/u_serial.c:1242
gserial_alloc_line+0x15/0x20 drivers/usb/gadget/function/u_serial.c:1276
acm_alloc_instance+0x86/0xe0 drivers/usb/gadget/function/f_acm.c:849
try_get_usb_function_instance drivers/usb/gadget/functions.c:28 [inline]
usb_get_function_instance+0xe2/0x2f0 drivers/usb/gadget/functions.c:44
function_make+0x118/0x350 drivers/usb/gadget/configfs.c:636
configfs_mkdir+0x5d2/0xd90 fs/configfs/dir.c:1354
vfs_mkdir+0x42c/0x600 fs/namei.c:3798
do_mkdirat+0x14c/0x340 fs/namei.c:3820
__do_sys_mkdirat fs/namei.c:3831 [inline]
__se_sys_mkdirat fs/namei.c:3829 [inline]
__x64_sys_mkdirat+0x7b/0x90 fs/namei.c:3829
do_syscall_64+0x31/0x40 arch/x86/entry/common.c:46
entry_SYSCALL_64_after_hwframe+0x61/0xcb
Freed by task 307:
kasan_save_stack mm/kasan/common.c:38 [inline]
kasan_set_track+0x4a/0x70 mm/kasan/common.c:45
kasan_set_free_info+0x23/0x40 mm/kasan/generic.c:370
____kasan_slab_free+0x125/0x160 mm/kasan/common.c:362
__kasan_slab_free+0x11/0x20 mm/kasan/common.c:370
kasan_slab_free include/linux/kasan.h:220 [inline]
slab_free_hook mm/slub.c:1600 [inline]
slab_free_freelist_hook+0xc5/0x190 mm/slub.c:1626
slab_free mm/slub.c:3208 [inline]
kfree+0xc0/0x270 mm/slub.c:4196
gserial_free_port+0x240/0x2d0 drivers/usb/gadget/function/u_serial.c:1206
gserial_free_line+0x9f/0x1b0 drivers/usb/gadget/function/u_serial.c:1223
acm_free_instance+0x39/0x60 drivers/usb/gadget/function/f_acm.c:836
usb_put_function_instance+0x85/0xa0 drivers/usb/gadget/functions.c:77
acm_attr_release+0x15/0x20 drivers/usb/gadget/function/f_acm.c:785
config_item_cleanup fs/configfs/item.c:130 [inline]
config_item_release fs/configfs/item.c:139 [inline]
kref_put include/linux/kref.h:65 [inline]
config_item_put+0x158/0x210 fs/configfs/item.c:151
configfs_rmdir+0x89f/0x960 fs/configfs/dir.c:1580
vfs_rmdir+0x1ab/0x3c0 fs/namei.c:3860
do_rmdir+0x232/0x630 fs/namei.c:3920
__do_sys_rmdir fs/namei.c:3938 [inline]
__se_sys_rmdir fs/namei.c:3936 [inline]
__x64_sys_rmdir+0x49/0x50 fs/namei.c:3936
do_syscall_64+0x31/0x40 arch/x86/entry/common.c:46
entry_SYSCALL_64_after_hwframe+0x61/0xcb
The buggy address belongs to the object at ffff888107593000
which belongs to the cache kmalloc-1k of size 1024
The buggy address is located 272 bytes inside of
1024-byte region [ffff888107593000, ffff888107593400)
The buggy address belongs to the page:
page:ffffea00041d6400 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x107590
head:ffffea00041d6400 order:3 compound_mapcount:0 compound_pincount:0
flags: 0x4000000000010200(slab|head)
raw: 4000000000010200 dead000000000100 dead000000000122 ffff888100042f00
raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd2a20(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 295, ts 25177018857, free_ts 25175064365
set_page_owner include/linux/page_owner.h:35 [inline]
post_alloc_hook mm/page_alloc.c:2456 [inline]
prep_new_page+0x176/0x190 mm/page_alloc.c:2462
get_page_from_freelist+0x225f/0x23f0 mm/page_alloc.c:4254
__alloc_pages_nodemask+0x29a/0x640 mm/page_alloc.c:5384
alloc_slab_page mm/slub.c:-1 [inline]
allocate_slab mm/slub.c:1813 [inline]
new_slab+0x84/0x3f0 mm/slub.c:1874
new_slab_objects mm/slub.c:2632 [inline]
___slab_alloc+0x2f8/0x4c0 mm/slub.c:2796
__slab_alloc+0x63/0xa0 mm/slub.c:2836
slab_alloc_node mm/slub.c:2918 [inline]
slab_alloc mm/slub.c:2960 [inline]
__kmalloc_track_caller+0x1e4/0x310 mm/slub.c:4541
__kmalloc_reserve net/core/skbuff.c:144 [inline]
__alloc_skb+0xdc/0x520 net/core/skbuff.c:212
__napi_alloc_skb+0x158/0x2e0 net/core/skbuff.c:522
napi_alloc_skb include/linux/skbuff.h:2975 [inline]
page_to_skb+0x40/0x930 drivers/net/virtio_net.c:432
receive_mergeable drivers/net/virtio_net.c:1049 [inline]
receive_buf+0xc03/0x46a0 drivers/net/virtio_net.c:1159
virtnet_receive drivers/net/virtio_net.c:1451 [inline]
virtnet_poll+0x3c9/0xef0 drivers/net/virtio_net.c:1560
napi_poll net/core/dev.c:6885 [inline]
net_rx_action+0x48d/0xed0 net/core/dev.c:6955
__do_softirq+0x255/0x563 kernel/softirq.c:309
page last free stack trace:
reset_page_owner include/linux/page_owner.h:28 [inline]
free_pages_prepare mm/page_alloc.c:1349 [inline]
__free_pages_ok+0x80b/0x830 mm/page_alloc.c:1629
free_compound_page+0x73/0x90 mm/page_alloc.c:710
destroy_compound_page include/linux/mm.h:970 [inline]
__put_compound_page+0x77/0xb0 mm/swap.c:117
__put_page+0xbd/0xe0 mm/swap.c:133
put_page include/linux/mm.h:1268 [inline]
page_to_skb+0x3d9/0x930 drivers/net/virtio_net.c:473
receive_mergeable drivers/net/virtio_net.c:1049 [inline]
receive_buf+0xc03/0x46a0 drivers/net/virtio_net.c:1159
virtnet_receive drivers/net/virtio_net.c:1451 [inline]
virtnet_poll+0x3c9/0xef0 drivers/net/virtio_net.c:1560
napi_poll net/core/dev.c:6885 [inline]
net_rx_action+0x48d/0xed0 net/core/dev.c:6955
__do_softirq+0x255/0x563 kernel/softirq.c:309
Memory state around the buggy address:
ffff888107593000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888107593080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff888107593100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888107593180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888107593200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
------------[ cut here ]------------
WARNING: CPU: 0 PID: 305 at drivers/usb/gadget/function/u_serial.c:690 gs_close+0x17d/0x9a0 drivers/usb/gadget/function/u_serial.c:690
Modules linked in:
CPU: 0 PID: 305 Comm: syz-executor780 Tainted: G B syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026
RIP: 0010:gs_close+0x17d/0x9a0 drivers/usb/gadget/function/u_serial.c:690
Code: 7c 56 fe 41 ff cc 42 0f b6 04 2b 84 c0 0f 85 c1 06 00 00 48 8b 44 24 20 44 89 20 48 8b 5c 24 38 e9 bd 02 00 00 e8 83 7c 56 fe <0f> 0b 48 8b 5c 24 38 e9 ac 02 00 00 e8 72 7c 56 fe 49 8d bf 90 02
RSP: 0018:ffffc9000095fac0 EFLAGS: 00010093
RAX: ffffffff830e295d RBX: 1ffff11020eb261a RCX: ffff888122113b40
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: ffffc9000095fbd8 R08: 0000000000000003 R09: 0000000000000004
R10: dffffc0000000000 R11: fffff5200012bf48 R12: 0000000000000000
R13: dffffc0000000000 R14: 1ffff9200012bf60 R15: ffff888107593000
FS: 0000000000000000(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fce6da77da0 CR3: 0000000105be7000 CR4: 00000000003506b0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
tty_release+0x3c8/0x1330 drivers/tty/tty_io.c:1764
__fput+0x2dc/0x730 fs/file_table.c:281
____fput+0x15/0x20 fs/file_table.c:314
task_work_run+0x127/0x190 kernel/task_work.c:189
exit_task_work include/linux/task_work.h:33 [inline]
do_exit+0xa7c/0x24e0 kernel/exit.c:873
do_group_exit+0x149/0x310 kernel/exit.c:987
__do_sys_exit_group kernel/exit.c:998 [inline]
__se_sys_exit_group kernel/exit.c:996 [inline]
__x64_sys_exit_group+0x3f/0x40 kernel/exit.c:996
do_syscall_64+0x31/0x40 arch/x86/entry/common.c:46
entry_SYSCALL_64_after_hwframe+0x61/0xcb
RIP: 0033:0x7fce6da24745
Code: Unable to access opcode bytes at RIP 0x7fce6da2471b.
RSP: 002b:00007ffd603230a8 EFLAGS: 00000202 ORIG_RAX: 00000000000000e7
RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 00007fce6da24745
RDX: 00000000000000e7 RSI: ffffffffffffffd0 RDI: 0000000000000000
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000000000
R13: 00007fce6dad5120 R14: 00007fce6dad74e8 R15: 00007fce6dad7500
---[ end trace 857023a59222e9c6 ]---
---
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 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.
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