syzbot


KASAN: use-after-free Read in ip_check_mc_rcu

Status: closed as invalid on 2022/11/15 19:19
Subsystems: net
[Documentation on labels]
First crash: 1136d, last: 909d
Cause bisection: the issue happens on the oldest tested release (bisect log)
Crash: KASAN: use-after-free Read in ip_check_mc_rcu (log)
Repro: C syz .config
  
Fix bisection: failed (error log, bisect log)
  
Similar bugs (4)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
android-414 KASAN: use-after-free Read in ip_check_mc_rcu 1 1640d 1640d 0/1 auto-closed as invalid on 2020/01/04 09:41
linux-4.19 KASAN: use-after-free Read in ip_check_mc_rcu syz done 7 922d 1073d 1/1 fixed on 2021/09/26 12:12
android-54 KASAN: use-after-free Read in ip_check_mc_rcu C 5 889d 1097d 0/2 auto-obsoleted due to no activity on 2023/04/22 05:06
linux-4.14 KASAN: use-after-free Read in ip_check_mc_rcu C error 4 542d 1105d 0/1 upstream: reported C repro on 2021/02/22 02:16
Last patch testing requests (2)
Created Duration User Patch Repo Result
2022/09/18 02:29 18m retest repro upstream OK log
2022/09/15 13:29 19m retest repro net-old report log

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in ip_check_mc_rcu+0x604/0x660 net/ipv4/igmp.c:2716
Read of size 4 at addr ffff88801caa8198 by task syz-executor504/10145

CPU: 1 PID: 10145 Comm: syz-executor504 Not tainted 5.11.0-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:79 [inline]
 dump_stack+0xfa/0x151 lib/dump_stack.c:120
 print_address_description.constprop.0.cold+0x5b/0x2f8 mm/kasan/report.c:230
 __kasan_report mm/kasan/report.c:396 [inline]
 kasan_report.cold+0x79/0xd5 mm/kasan/report.c:413
 ip_check_mc_rcu+0x604/0x660 net/ipv4/igmp.c:2716
 __mkroute_output net/ipv4/route.c:2405 [inline]
 ip_route_output_key_hash_rcu+0x1959/0x2ce0 net/ipv4/route.c:2684
 ip_route_output_key_hash+0x1a4/0x2f0 net/ipv4/route.c:2512
 __ip_route_output_key include/net/route.h:126 [inline]
 ip_route_output_flow+0x23/0x150 net/ipv4/route.c:2773
 udp_sendmsg+0x1a2f/0x2730 net/ipv4/udp.c:1206
 inet_sendmsg+0x99/0xe0 net/ipv4/af_inet.c:821
 sock_sendmsg_nosec net/socket.c:652 [inline]
 sock_sendmsg+0xcf/0x120 net/socket.c:672
 ____sys_sendmsg+0x331/0x810 net/socket.c:2348
 ___sys_sendmsg+0xf3/0x170 net/socket.c:2402
 __sys_sendmmsg+0x195/0x470 net/socket.c:2492
 __do_sys_sendmmsg net/socket.c:2521 [inline]
 __se_sys_sendmmsg net/socket.c:2518 [inline]
 __x64_sys_sendmmsg+0x99/0x100 net/socket.c:2518
 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
 entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x448f59
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 a1 15 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:00007f006b9ec318 EFLAGS: 00000246 ORIG_RAX: 0000000000000133
RAX: ffffffffffffffda RBX: 00000000004ce4f8 RCX: 0000000000448f59
RDX: 000000000800001d RSI: 0000000020007fc0 RDI: 0000000000000003
RBP: 00000000004ce4f0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 000000000049d484
R13: 00007ffefac0544f R14: 00007f006b9ec400 R15: 0000000000022000

Allocated by task 10145:
 kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38
 kasan_set_track mm/kasan/common.c:46 [inline]
 set_alloc_info mm/kasan/common.c:401 [inline]
 ____kasan_kmalloc.constprop.0+0x82/0xa0 mm/kasan/common.c:429
 kmalloc include/linux/slab.h:554 [inline]
 kzalloc include/linux/slab.h:684 [inline]
 ip_mc_add1_src net/ipv4/igmp.c:1971 [inline]
 ip_mc_add_src+0x995/0xda0 net/ipv4/igmp.c:2095
 ip_mc_source+0xa49/0x1030 net/ipv4/igmp.c:2416
 do_ip_setsockopt net/ipv4/ip_sockglue.c:1294 [inline]
 ip_setsockopt+0x220e/0x3a00 net/ipv4/ip_sockglue.c:1423
 tcp_setsockopt+0x136/0x2440 net/ipv4/tcp.c:3636
 __sys_setsockopt+0x2db/0x610 net/socket.c:2115
 __do_sys_setsockopt net/socket.c:2126 [inline]
 __se_sys_setsockopt net/socket.c:2123 [inline]
 __x64_sys_setsockopt+0xba/0x150 net/socket.c:2123
 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
 entry_SYSCALL_64_after_hwframe+0x44/0xae

Freed by task 10138:
 kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38
 kasan_set_track+0x1c/0x30 mm/kasan/common.c:46
 kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:356
 ____kasan_slab_free+0xe1/0x110 mm/kasan/common.c:362
 kasan_slab_free include/linux/kasan.h:192 [inline]
 slab_free_hook mm/slub.c:1547 [inline]
 slab_free_freelist_hook+0x51/0x130 mm/slub.c:1580
 slab_free mm/slub.c:3143 [inline]
 kfree+0xdb/0x3b0 mm/slub.c:4179
 ip_mc_del1_src+0x674/0x7f0 net/ipv4/igmp.c:1884
 ip_mc_del_src.isra.0+0x3e1/0x950 net/ipv4/igmp.c:1925
 ip_mc_leave_src.isra.0+0x102/0x240 net/ipv4/igmp.c:2231
 ip_mc_drop_socket+0x11a/0x260 net/ipv4/igmp.c:2677
 inet_release+0x97/0x280 net/ipv4/af_inet.c:418
 __sock_release+0xcd/0x280 net/socket.c:597
 sock_close+0x18/0x20 net/socket.c:1256
 __fput+0x288/0x920 fs/file_table.c:280
 task_work_run+0xdd/0x1a0 kernel/task_work.c:140
 tracehook_notify_resume include/linux/tracehook.h:189 [inline]
 exit_to_user_mode_loop kernel/entry/common.c:174 [inline]
 exit_to_user_mode_prepare+0x249/0x250 kernel/entry/common.c:208
 __syscall_exit_to_user_mode_work kernel/entry/common.c:290 [inline]
 syscall_exit_to_user_mode+0x19/0x50 kernel/entry/common.c:301
 entry_SYSCALL_64_after_hwframe+0x44/0xae

The buggy address belongs to the object at ffff88801caa8180
 which belongs to the cache kmalloc-32 of size 32
The buggy address is located 24 bytes inside of
 32-byte region [ffff88801caa8180, ffff88801caa81a0)
The buggy address belongs to the page:
page:000000008b24dfcd refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1caa8
flags: 0xfff00000000200(slab)
raw: 00fff00000000200 ffffea000083cfc0 0000001800000018 ffff888010c41a00
raw: 0000000000000000 0000000080400040 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff88801caa8080: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
 ffff88801caa8100: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
>ffff88801caa8180: fa fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc
                            ^
 ffff88801caa8200: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
 ffff88801caa8280: fb fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
==================================================================

Crashes (30):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2021/02/25 21:15 net-old 8f1c0fd2c84c 76f7fc95 .config console log report syz C ci-upstream-net-this-kasan-gce KASAN: use-after-free Read in ip_check_mc_rcu
2021/08/30 11:37 upstream 90ac80dcd313 be2c130d .config console log report syz C ci-upstream-kasan-gce KASAN: use-after-free Read in ip_check_mc_rcu
2021/08/02 12:40 upstream c500bee1c5b2 6c236867 .config console log report info ci-upstream-kasan-gce-smack-root KASAN: use-after-free Read in ip_check_mc_rcu
2021/07/14 23:53 upstream 8096acd7442e 94e0b707 .config console log report info ci-upstream-kasan-gce-smack-root KASAN: use-after-free Read in ip_check_mc_rcu
2021/06/10 04:59 upstream cd1245d75ce9 1ba81399 .config console log report info ci-upstream-kasan-gce-selinux-root KASAN: use-after-free Read in ip_check_mc_rcu
2021/05/17 23:57 upstream 8ac91e6c6033 a343ba6b .config console log report info ci-upstream-kasan-gce KASAN: use-after-free Read in ip_check_mc_rcu
2021/04/27 05:15 upstream 4a0225c3d208 805b5003 .config console log report info ci-upstream-kasan-gce-smack-root KASAN: use-after-free Read in ip_check_mc_rcu
2021/04/15 01:29 upstream 7f75285ca572 fcdb12ba .config console log report info ci-upstream-kasan-gce-root KASAN: use-after-free Read in ip_check_mc_rcu
2021/04/03 19:43 upstream 57fbdb15ec42 6a81331a .config console log report info ci-upstream-kasan-gce-root KASAN: use-after-free Read in ip_check_mc_rcu
2021/03/29 22:27 upstream 1e43c377a79f 6a81331a .config console log report info ci-upstream-kasan-gce-smack-root KASAN: use-after-free Read in ip_check_mc_rcu
2021/02/26 15:11 upstream 2c87f7a38f93 4c37c133 .config console log report info ci-upstream-kasan-gce-smack-root KASAN: use-after-free Read in ip_check_mc_rcu
2021/02/25 15:29 upstream 29c395c77a9a 76f7fc95 .config console log report info ci-qemu-upstream KASAN: use-after-free Read in ip_check_mc_rcu
2021/07/18 14:22 upstream 1d67c8d993ba f115ae98 .config console log report info ci-upstream-kasan-gce-386 KASAN: use-after-free Read in ip_check_mc_rcu
2021/04/19 12:59 upstream bf05bf16c76b 50f523d7 .config console log report info ci-upstream-kasan-gce-386 KASAN: use-after-free Read in ip_check_mc_rcu
2021/04/13 03:47 upstream 89698becf06d bfeda1b1 .config console log report info ci-upstream-kasan-gce-386 KASAN: use-after-free Read in ip_check_mc_rcu
2021/03/06 04:38 upstream 280d542f6ffa 56722561 .config console log report info ci-upstream-kasan-gce-386 KASAN: use-after-free Read in ip_check_mc_rcu
2021/09/06 03:14 net-old 57f780f1c433 d236a457 .config console log report info ci-upstream-net-this-kasan-gce KASAN: use-after-free Read in ip_check_mc_rcu
2021/03/29 22:25 net-old fb6ec87f7229 6a81331a .config console log report info ci-upstream-net-this-kasan-gce KASAN: use-after-free Read in ip_check_mc_rcu
2021/02/25 14:42 net-old 8f1c0fd2c84c 76f7fc95 .config console log report info ci-upstream-net-this-kasan-gce KASAN: use-after-free Read in ip_check_mc_rcu
2021/01/26 08:56 net-old 62d9f1a6945b 52e37319 .config console log report info ci-upstream-net-this-kasan-gce KASAN: use-after-free Read in ip_check_mc_rcu
2021/06/21 17:53 net-next-old adc2e56ebe63 aba2b2fb .config console log report info ci-upstream-net-kasan-gce KASAN: use-after-free Read in ip_check_mc_rcu
2021/06/12 21:16 net-next-old 02b0bb51a8da 1ba81399 .config console log report info ci-upstream-net-kasan-gce KASAN: use-after-free Read in ip_check_mc_rcu
2021/05/28 13:26 net-next-old af9207adb6d9 858ea628 .config console log report info ci-upstream-net-kasan-gce KASAN: use-after-free Read in ip_check_mc_rcu
2021/05/24 01:13 net-next-old 5d6c3d91ad72 3c7fef33 .config console log report info ci-upstream-net-kasan-gce KASAN: use-after-free Read in ip_check_mc_rcu
2021/04/14 10:02 net-next-old 5871d0c6b8ea 3134b37f .config console log report info ci-upstream-net-kasan-gce KASAN: use-after-free Read in ip_check_mc_rcu
2021/03/18 17:33 net-next-old 6ef4f40993e7 7216542e .config console log report info ci-upstream-net-kasan-gce KASAN: use-after-free Read in ip_check_mc_rcu
2021/01/22 04:16 net-next-old fdb6b338d2e5 d4f4eca5 .config console log report info ci-upstream-net-kasan-gce KASAN: use-after-free Read in ip_check_mc_rcu
2021/03/22 08:49 linux-next e3128d2f068e bea32f74 .config console log report info ci-upstream-linux-next-kasan-gce-root KASAN: use-after-free Read in ip_check_mc_rcu
2021/01/23 09:45 linux-next bc085f8fc88f 52e37319 .config console log report info ci-upstream-linux-next-kasan-gce-root KASAN: use-after-free Read in ip_check_mc_rcu
2021/05/21 16:06 upstream 79a106fc6585 3c7fef33 .config console log report info ci-upstream-kasan-gce-smack-root KASAN: slab-out-of-bounds Read in ip_check_mc_rcu
* Struck through repros no longer work on HEAD.