[v5.15] KASAN: use-after-free Read in ax25_release

5 views
Skip to first unread message

syzbot

unread,
Feb 26, 2025, 1:03:19 PM2/26/25
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: c16c81c81336 Linux 5.15.178
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=15d70ff8580000
kernel config: https://syzkaller.appspot.com/x/.config?x=d302c69e93fb6774
dashboard link: https://syzkaller.appspot.com/bug?extid=38f5235bade356590c03
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40

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

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/267e46ee7273/disk-c16c81c8.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/944e289206cf/vmlinux-c16c81c8.xz
kernel image: https://storage.googleapis.com/syzbot-assets/f8cadf62458e/bzImage-c16c81c8.xz

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

==================================================================
BUG: KASAN: use-after-free in ax25_release+0x320/0x840 net/ax25/af_ax25.c:1061
Read of size 8 at addr ffff888028c11d08 by task syz.2.175/5322

CPU: 1 PID: 5322 Comm: syz.2.175 Not tainted 5.15.178-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x1e3/0x2d0 lib/dump_stack.c:106
print_address_description+0x63/0x3b0 mm/kasan/report.c:248
__kasan_report mm/kasan/report.c:434 [inline]
kasan_report+0x16b/0x1c0 mm/kasan/report.c:451
ax25_release+0x320/0x840 net/ax25/af_ax25.c:1061
__sock_release net/socket.c:649 [inline]
sock_close+0xcd/0x230 net/socket.c:1336
__fput+0x3fe/0x8e0 fs/file_table.c:280
task_work_run+0x129/0x1a0 kernel/task_work.c:188
tracehook_notify_resume include/linux/tracehook.h:189 [inline]
exit_to_user_mode_loop+0x106/0x130 kernel/entry/common.c:181
exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:214
__syscall_exit_to_user_mode_work kernel/entry/common.c:296 [inline]
syscall_exit_to_user_mode+0x5d/0x240 kernel/entry/common.c:307
do_syscall_64+0x47/0xb0 arch/x86/entry/common.c:86
entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7fde33c01169
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffd614af0e8 EFLAGS: 00000246 ORIG_RAX: 00000000000001b4
RAX: 0000000000000000 RBX: 00007fde33e1bba0 RCX: 00007fde33c01169
RDX: 0000000000000000 RSI: 000000000000001e RDI: 0000000000000003
RBP: 00007fde33e1bba0 R08: 00000000000000a0 R09: 00000009614af3df
R10: 00000000003ffd3c R11: 0000000000000246 R12: 000000000001c9e6
R13: 00007ffd614af1e0 R14: ffffffffffffffff R15: 00007ffd614af200
</TASK>

Allocated by task 5323:
kasan_save_stack mm/kasan/common.c:38 [inline]
kasan_set_track mm/kasan/common.c:46 [inline]
set_alloc_info mm/kasan/common.c:434 [inline]
____kasan_kmalloc+0xba/0xf0 mm/kasan/common.c:513
kasan_kmalloc include/linux/kasan.h:264 [inline]
kmem_cache_alloc_trace+0x143/0x290 mm/slub.c:3247
kmalloc include/linux/slab.h:591 [inline]
kzalloc include/linux/slab.h:721 [inline]
ax25_dev_device_up+0x51/0x5a0 net/ax25/ax25_dev.c:55
ax25_device_event+0x49b/0x500 net/ax25/af_ax25.c:139
notifier_call_chain kernel/notifier.c:83 [inline]
raw_notifier_call_chain+0xd0/0x170 kernel/notifier.c:391
__dev_notify_flags+0x304/0x610
dev_change_flags+0xe7/0x190 net/core/dev.c:8897
dev_ifsioc+0x147/0x10c0 net/core/dev_ioctl.c:324
dev_ioctl+0x504/0xf60 net/core/dev_ioctl.c:587
sock_do_ioctl+0x34f/0x5a0 net/socket.c:1154
sock_ioctl+0x47f/0x770 net/socket.c:1257
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:874 [inline]
__se_sys_ioctl+0xf1/0x160 fs/ioctl.c:860
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0

Freed by task 5323:
kasan_save_stack mm/kasan/common.c:38 [inline]
kasan_set_track+0x4b/0x80 mm/kasan/common.c:46
kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:360
____kasan_slab_free+0xd8/0x120 mm/kasan/common.c:366
kasan_slab_free include/linux/kasan.h:230 [inline]
slab_free_hook mm/slub.c:1705 [inline]
slab_free_freelist_hook+0xdd/0x160 mm/slub.c:1731
slab_free mm/slub.c:3499 [inline]
kfree+0xf1/0x270 mm/slub.c:4559
ax25_device_event+0x4d1/0x500 net/ax25/af_ax25.c:144
notifier_call_chain kernel/notifier.c:83 [inline]
raw_notifier_call_chain+0xd0/0x170 kernel/notifier.c:391
call_netdevice_notifiers_info net/core/dev.c:2018 [inline]
call_netdevice_notifiers_extack net/core/dev.c:2030 [inline]
call_netdevice_notifiers net/core/dev.c:2044 [inline]
dev_close_many+0x37c/0x530 net/core/dev.c:1619
dev_close+0x1b3/0x2b0 net/core/dev.c:1641
bpq_device_event+0x3c3/0x9d0 drivers/net/hamradio/bpqether.c:548
notifier_call_chain kernel/notifier.c:83 [inline]
raw_notifier_call_chain+0xd0/0x170 kernel/notifier.c:391
call_netdevice_notifiers_info net/core/dev.c:2018 [inline]
call_netdevice_notifiers_extack net/core/dev.c:2030 [inline]
call_netdevice_notifiers net/core/dev.c:2044 [inline]
dev_close_many+0x37c/0x530 net/core/dev.c:1619
dev_close+0x1b3/0x2b0 net/core/dev.c:1641
bond_setup_by_slave+0x66/0x390 drivers/net/bonding/bond_main.c:1471
bond_enslave+0x7b1/0x3c20 drivers/net/bonding/bond_main.c:1855
bond_do_ioctl+0x2a1/0xb40 drivers/net/bonding/bond_main.c:4238
dev_ifsioc+0xd7a/0x10c0 net/core/dev_ioctl.c:417
dev_ioctl+0x504/0xf60 net/core/dev_ioctl.c:587
sock_do_ioctl+0x34f/0x5a0 net/socket.c:1154
sock_ioctl+0x47f/0x770 net/socket.c:1257
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:874 [inline]
__se_sys_ioctl+0xf1/0x160 fs/ioctl.c:860
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0

Last potentially related work creation:
kasan_save_stack+0x36/0x60 mm/kasan/common.c:38
kasan_record_aux_stack+0xba/0x100 mm/kasan/generic.c:348
insert_work+0x54/0x3e0 kernel/workqueue.c:1366
__queue_work+0x963/0xd00 kernel/workqueue.c:1532
queue_work_on+0x14b/0x250 kernel/workqueue.c:1559
inet6addr_event+0xf8/0x160 drivers/infiniband/core/roce_gid_mgmt.c:883
notifier_call_chain kernel/notifier.c:83 [inline]
atomic_notifier_call_chain+0x15f/0x290 kernel/notifier.c:198
ipv6_add_addr+0xb00/0xd80 net/ipv6/addrconf.c:1182
inet6_addr_add+0x45c/0x9a0 net/ipv6/addrconf.c:2999
inet6_rtm_newaddr+0x892/0x2540 net/ipv6/addrconf.c:4954
rtnetlink_rcv_msg+0x993/0xee0 net/core/rtnetlink.c:5647
netlink_rcv_skb+0x1cf/0x410 net/netlink/af_netlink.c:2489
netlink_unicast_kernel net/netlink/af_netlink.c:1311 [inline]
netlink_unicast+0x7b6/0x980 net/netlink/af_netlink.c:1337
netlink_sendmsg+0xa30/0xd60 net/netlink/af_netlink.c:1905
sock_sendmsg_nosec net/socket.c:704 [inline]
__sock_sendmsg net/socket.c:716 [inline]
__sys_sendto+0x564/0x720 net/socket.c:2063
__do_sys_sendto net/socket.c:2075 [inline]
__se_sys_sendto net/socket.c:2071 [inline]
__x64_sys_sendto+0xda/0xf0 net/socket.c:2071
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0

Second to last potentially related work creation:
kasan_save_stack+0x36/0x60 mm/kasan/common.c:38
kasan_record_aux_stack+0xba/0x100 mm/kasan/generic.c:348
insert_work+0x54/0x3e0 kernel/workqueue.c:1366
__queue_work+0x963/0xd00 kernel/workqueue.c:1532
queue_work_on+0x14b/0x250 kernel/workqueue.c:1559
queue_work include/linux/workqueue.h:512 [inline]
netdevice_queue_work drivers/infiniband/core/roce_gid_mgmt.c:659 [inline]
netdevice_event+0x82f/0x960 drivers/infiniband/core/roce_gid_mgmt.c:802
notifier_call_chain kernel/notifier.c:83 [inline]
raw_notifier_call_chain+0xd0/0x170 kernel/notifier.c:391
__dev_notify_flags+0x304/0x610
dev_change_flags+0xe7/0x190 net/core/dev.c:8897
do_setlink+0xc21/0x3d80 net/core/rtnetlink.c:2776
__rtnl_newlink net/core/rtnetlink.c:3447 [inline]
rtnl_newlink+0x17d6/0x2070 net/core/rtnetlink.c:3569
rtnetlink_rcv_msg+0x993/0xee0 net/core/rtnetlink.c:5647
netlink_rcv_skb+0x1cf/0x410 net/netlink/af_netlink.c:2489
netlink_unicast_kernel net/netlink/af_netlink.c:1311 [inline]
netlink_unicast+0x7b6/0x980 net/netlink/af_netlink.c:1337
netlink_sendmsg+0xa30/0xd60 net/netlink/af_netlink.c:1905
sock_sendmsg_nosec net/socket.c:704 [inline]
__sock_sendmsg net/socket.c:716 [inline]
__sys_sendto+0x564/0x720 net/socket.c:2063
__do_sys_sendto net/socket.c:2075 [inline]
__se_sys_sendto net/socket.c:2071 [inline]
__x64_sys_sendto+0xda/0xf0 net/socket.c:2071
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0

The buggy address belongs to the object at ffff888028c11d00
which belongs to the cache kmalloc-192 of size 192
The buggy address is located 8 bytes inside of
192-byte region [ffff888028c11d00, ffff888028c11dc0)
The buggy address belongs to the page:
page:ffffea0000a30440 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x28c11
flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000000200 0000000000000000 0000000a00000001 ffff888017441a00
raw: 0000000000000000 0000000080100010 00000001ffffffff 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 0x12cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY), pid 1, ts 14159765698, free_ts 0
prep_new_page mm/page_alloc.c:2426 [inline]
get_page_from_freelist+0x3b78/0x3d40 mm/page_alloc.c:4192
__alloc_pages+0x272/0x700 mm/page_alloc.c:5465
alloc_page_interleave+0x22/0x1c0 mm/mempolicy.c:2031
alloc_slab_page mm/slub.c:1775 [inline]
allocate_slab mm/slub.c:1912 [inline]
new_slab+0xbb/0x4b0 mm/slub.c:1975
___slab_alloc+0x6f6/0xe10 mm/slub.c:3008
__slab_alloc mm/slub.c:3095 [inline]
slab_alloc_node mm/slub.c:3186 [inline]
slab_alloc mm/slub.c:3228 [inline]
kmem_cache_alloc_trace+0x1a0/0x290 mm/slub.c:3245
kmalloc include/linux/slab.h:591 [inline]
kzalloc include/linux/slab.h:721 [inline]
call_usermodehelper_setup+0x8a/0x260 kernel/umh.c:365
kobject_uevent_env+0x681/0x8d0 lib/kobject_uevent.c:629
device_add+0xa4f/0xfd0 drivers/base/core.c:3393
__video_register_device+0x3826/0x45e0 drivers/media/v4l2-core/v4l2-dev.c:1037
video_register_device include/media/v4l2-dev.h:384 [inline]
vivid_create_devnodes+0x26d7/0x2f40 drivers/media/test-drivers/vivid/vivid-core.c:1721
vivid_create_instance drivers/media/test-drivers/vivid/vivid-core.c:1976 [inline]
vivid_probe+0x56bc/0x72f0 drivers/media/test-drivers/vivid/vivid-core.c:2031
platform_probe+0x131/0x1b0 drivers/base/platform.c:1391
really_probe+0x24e/0xb60 drivers/base/dd.c:595
__driver_probe_device+0x1a2/0x3d0 drivers/base/dd.c:755
driver_probe_device+0x50/0x420 drivers/base/dd.c:785
page_owner free stack trace missing

Memory state around the buggy address:
ffff888028c11c00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888028c11c80: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
>ffff888028c11d00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888028c11d80: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
ffff888028c11e00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================


---
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
Reply all
Reply to author
Forward
0 new messages