KASAN: use-after-free Read in ip_check_mc_rcu

12 views
Skip to first unread message

syzbot

unread,
Mar 1, 2021, 10:19:28 PM3/1/21
to syzkaller-a...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 000f1f48 ANDROID: Incremental fs: set the correct access t..
git tree: android12-5.4
console output: https://syzkaller.appspot.com/x/log.txt?x=1652b6bcd00000
kernel config: https://syzkaller.appspot.com/x/.config?x=3ab48ea7db7e9a3e
dashboard link: https://syzkaller.appspot.com/bug?extid=ed61c2cf5c6265522941
compiler: Debian clang version 11.0.1-2
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=10ff4e46d00000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1663c856d00000

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

==================================================================
BUG: KASAN: use-after-free in ip_check_mc_rcu+0x29d/0x3c0 net/ipv4/igmp.c:2726
Read of size 8 at addr ffff8881ee628c40 by task syz-executor640/536

CPU: 0 PID: 536 Comm: syz-executor640 Not tainted 5.4.101-syzkaller-00451-g000f1f482d2c #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack+0x1d8/0x24e lib/dump_stack.c:118
print_address_description+0x9b/0x650 mm/kasan/report.c:376
__kasan_report+0x182/0x250 mm/kasan/report.c:508
kasan_report+0x30/0x60 mm/kasan/common.c:641
ip_check_mc_rcu+0x29d/0x3c0 net/ipv4/igmp.c:2726
__mkroute_output+0x372/0x1430 net/ipv4/route.c:2357
ip_route_output_key_hash net/ipv4/route.c:2465 [inline]
__ip_route_output_key include/net/route.h:126 [inline]
ip_route_output_flow+0x13d/0x320 net/ipv4/route.c:2726
udp_sendmsg+0x17f6/0x2f80 net/ipv4/udp.c:1147
sock_sendmsg_nosec net/socket.c:638 [inline]
sock_sendmsg net/socket.c:658 [inline]
____sys_sendmsg+0x583/0x8c0 net/socket.c:2298
___sys_sendmsg net/socket.c:2352 [inline]
__sys_sendmmsg+0x3b3/0x730 net/socket.c:2455
__do_sys_sendmmsg net/socket.c:2484 [inline]
__se_sys_sendmmsg net/socket.c:2481 [inline]
__x64_sys_sendmmsg+0x9c/0xb0 net/socket.c:2481
do_syscall_64+0xcb/0x150 arch/x86/entry/common.c:290
entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x4504b9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 91 18 00 00 90 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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fd1a9ed6318 EFLAGS: 00000246 ORIG_RAX: 0000000000000133
RAX: ffffffffffffffda RBX: 00000000004ce4c8 RCX: 00000000004504b9
RDX: 000000000800001d RSI: 0000000020007fc0 RDI: 0000000000000003
RBP: 00000000004ce4c0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 000000000049d6e8
R13: 00007fff883f688f R14: 00007fd1a9ed6400 R15: 0000000000022000

Allocated by task 536:
save_stack mm/kasan/common.c:70 [inline]
set_track mm/kasan/common.c:78 [inline]
__kasan_kmalloc+0x137/0x1e0 mm/kasan/common.c:517
kmem_cache_alloc_trace+0x139/0x2b0 mm/slub.c:2848
kmalloc include/linux/slab.h:556 [inline]
kzalloc include/linux/slab.h:690 [inline]
ip_mc_add1_src net/ipv4/igmp.c:1973 [inline]
ip_mc_add_src+0x4dd/0xa90 net/ipv4/igmp.c:2097
ip_mc_source+0xc44/0x1170 net/ipv4/igmp.c:2418
do_ip_setsockopt+0x2313/0x3ac0 net/ipv4/ip_sockglue.c:998
ip_setsockopt+0x4c/0xc0 net/ipv4/ip_sockglue.c:1248
__sys_setsockopt+0x56a/0x870 net/socket.c:2085
__do_sys_setsockopt net/socket.c:2101 [inline]
__se_sys_setsockopt net/socket.c:2098 [inline]
__x64_sys_setsockopt+0xb1/0xc0 net/socket.c:2098
do_syscall_64+0xcb/0x150 arch/x86/entry/common.c:290
entry_SYSCALL_64_after_hwframe+0x44/0xa9

Freed by task 533:
save_stack mm/kasan/common.c:70 [inline]
set_track mm/kasan/common.c:78 [inline]
kasan_set_free_info mm/kasan/common.c:333 [inline]
__kasan_slab_free+0x18a/0x240 mm/kasan/common.c:475
slab_free_hook mm/slub.c:1454 [inline]
slab_free_freelist_hook+0x7b/0x150 mm/slub.c:1492
slab_free mm/slub.c:3072 [inline]
kfree+0xe0/0x660 mm/slub.c:4061
ip_mc_del1_src+0x6dd/0x7f0 net/ipv4/igmp.c:1886
ip_mc_del_src+0x398/0x7b0 net/ipv4/igmp.c:1927
ip_mc_leave_src net/ipv4/igmp.c:2233 [inline]
ip_mc_drop_socket+0x199/0x3a0 net/ipv4/igmp.c:2687
inet_release+0x48/0x180 net/ipv4/af_inet.c:414
__sock_release net/socket.c:591 [inline]
sock_close+0xd2/0x250 net/socket.c:1269
__fput+0x27d/0x6c0 fs/file_table.c:281
task_work_run+0x186/0x1b0 kernel/task_work.c:113
tracehook_notify_resume include/linux/tracehook.h:188 [inline]
exit_to_usermode_loop arch/x86/entry/common.c:163 [inline]
prepare_exit_to_usermode+0x2b0/0x310 arch/x86/entry/common.c:194
entry_SYSCALL_64_after_hwframe+0x44/0xa9

The buggy address belongs to the object at ffff8881ee628c40
which belongs to the cache kmalloc-32 of size 32
The buggy address is located 0 bytes inside of
32-byte region [ffff8881ee628c40, ffff8881ee628c60)
The buggy address belongs to the page:
page:ffffea0007b98a00 refcount:1 mapcount:0 mapping:ffff8881f5c03400 index:0x0
flags: 0x8000000000000200(slab)
raw: 8000000000000200 ffffea0007bcf5c0 0000000300000003 ffff8881f5c03400
raw: 0000000000000000 0000000080400040 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff8881ee628b00: fb fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc
ffff8881ee628b80: fb fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc
>ffff8881ee628c00: fb fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc
^
ffff8881ee628c80: fb fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc
ffff8881ee628d00: fb fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc
==================================================================


---
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.
syzbot can test patches for this issue, for details see:
https://goo.gl/tpsmEJ#testing-patches

syzbot

unread,
Apr 22, 2023, 1:06:41 AM4/22/23
to syzkaller-a...@googlegroups.com
Auto-closing this bug as obsolete.
No recent activity, existing reproducers are no longer triggering the issue.
Reply all
Reply to author
Forward
0 new messages