syzbot


KASAN: use-after-free Read in ip_check_mc_rcu

Status: upstream: reported C repro on 2021/02/22 02:16
Reported-by: syzbot+f6af1afebd70801fd9e1@syzkaller.appspotmail.com
First crash: 1368d, last: 805d
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 1903d 1903d 0/1 auto-closed as invalid on 2020/01/04 09:41
upstream KASAN: use-after-free Read in ip_check_mc_rcu net C inconclusive error 30 1172d 1399d 0/28 closed as invalid on 2022/11/15 19:19
linux-4.19 KASAN: use-after-free Read in ip_check_mc_rcu syz done 7 1186d 1337d 1/1 fixed on 2021/09/26 12:12
android-54 KASAN: use-after-free Read in ip_check_mc_rcu C 5 1152d 1360d 0/2 auto-obsoleted due to no activity on 2023/04/22 05:06
Fix bisection attempts (18)
Created Duration User Patch Repo Result
2022/10/13 02:21 0m bisect fix linux-4.14.y error job log
2022/09/08 10:09 30m bisect fix linux-4.14.y OK (0) job log log
2022/08/09 09:34 30m bisect fix linux-4.14.y OK (0) job log log
2022/07/10 09:06 27m bisect fix linux-4.14.y OK (0) job log log
2022/06/10 08:38 28m bisect fix linux-4.14.y OK (0) job log log
2022/05/01 17:30 29m (4) bisect fix linux-4.14.y OK (0) job log log
2022/04/01 16:42 38m bisect fix linux-4.14.y OK (0) job log log
2022/03/01 19:35 32m bisect fix linux-4.14.y OK (0) job log log
2022/01/30 15:33 35m bisect fix linux-4.14.y OK (0) job log log
2021/12/31 14:22 31m bisect fix linux-4.14.y OK (0) job log log
2021/12/01 13:50 31m bisect fix linux-4.14.y OK (0) job log log
2021/11/01 13:17 32m bisect fix linux-4.14.y OK (0) job log log
2021/10/02 12:42 31m bisect fix linux-4.14.y OK (0) job log log
2021/09/02 12:08 30m bisect fix linux-4.14.y OK (0) job log log
2021/08/03 11:25 30m bisect fix linux-4.14.y OK (0) job log log
2021/07/04 10:46 29m bisect fix linux-4.14.y OK (0) job log log
2021/06/04 10:12 30m bisect fix linux-4.14.y OK (0) job log log
2021/04/05 19:22 38m bisect fix linux-4.14.y OK (0) job log log

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in ip_check_mc_rcu+0x4e5/0x540 net/ipv4/igmp.c:2698
Read of size 4 at addr ffff8880a168e308 by task syz-executor227/19694

CPU: 1 PID: 19694 Comm: syz-executor227 Not tainted 4.14.232-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0x1b2/0x281 lib/dump_stack.c:58
 print_address_description.cold+0x54/0x1d3 mm/kasan/report.c:252
 kasan_report_error.cold+0x8a/0x191 mm/kasan/report.c:351
 kasan_report mm/kasan/report.c:409 [inline]
 __asan_report_load4_noabort+0x68/0x70 mm/kasan/report.c:429
 ip_check_mc_rcu+0x4e5/0x540 net/ipv4/igmp.c:2698
 __mkroute_output net/ipv4/route.c:2234 [inline]
 ip_route_output_key_hash_rcu+0x1f25/0x29f0 net/ipv4/route.c:2516
 ip_route_output_key_hash+0x195/0x2a0 net/ipv4/route.c:2344
 __ip_route_output_key include/net/route.h:126 [inline]
 ip_route_output_flow+0x23/0x130 net/ipv4/route.c:2601
 udp_sendmsg+0x13b5/0x1c80 net/ipv4/udp.c:1025
 inet_sendmsg+0x11a/0x4e0 net/ipv4/af_inet.c:762
 sock_sendmsg_nosec net/socket.c:646 [inline]
 sock_sendmsg+0xb5/0x100 net/socket.c:656
 ___sys_sendmsg+0x326/0x800 net/socket.c:2062
 __sys_sendmmsg+0x129/0x330 net/socket.c:2152
 SYSC_sendmmsg net/socket.c:2183 [inline]
 SyS_sendmmsg+0x2f/0x50 net/socket.c:2178
 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x46/0xbb
RIP: 0033:0x4490e9
RSP: 002b:00007f9dae935278 EFLAGS: 00000246 ORIG_RAX: 0000000000000133
RAX: ffffffffffffffda RBX: 00000000004ce4e0 RCX: 00000000004490e9
RDX: 000000000800001d RSI: 0000000020007fc0 RDI: 0000000000000004
RBP: 00000000004ce4ec R08: 68742f636f72702f R09: 68742f636f72702f
R10: 0000000000000000 R11: 0000000000000246 R12: 000000000049d4bc
R13: 00007f9dae935280 R14: 007761722f74656e R15: 00000000004ce4e8

Allocated by task 19701:
 save_stack mm/kasan/kasan.c:447 [inline]
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_kmalloc+0xeb/0x160 mm/kasan/kasan.c:551
 kmem_cache_alloc_trace+0x131/0x3d0 mm/slab.c:3618
 kmalloc include/linux/slab.h:488 [inline]
 kzalloc include/linux/slab.h:661 [inline]
 aa_alloc_file_ctx security/apparmor/include/file.h:60 [inline]
 apparmor_file_alloc_security+0x129/0x800 security/apparmor/lsm.c:431
 security_file_alloc+0x66/0xa0 security/security.c:874
 get_empty_filp+0x15c/0x3e0 fs/file_table.c:129
 alloc_file+0x23/0x440 fs/file_table.c:164
 sock_alloc_file+0x113/0x2e0 net/socket.c:416
 sock_map_fd net/socket.c:439 [inline]
 SYSC_socket net/socket.c:1349 [inline]
 SyS_socket+0x108/0x1b0 net/socket.c:1325
 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x46/0xbb

Freed by task 19693:
 save_stack mm/kasan/kasan.c:447 [inline]
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_slab_free+0xc3/0x1a0 mm/kasan/kasan.c:524
 __cache_free mm/slab.c:3496 [inline]
 kfree+0xc9/0x250 mm/slab.c:3815
 aa_free_file_ctx security/apparmor/include/file.h:76 [inline]
 apparmor_file_free_security+0x7e/0xb0 security/apparmor/lsm.c:441
 security_file_free+0x42/0x80 security/security.c:879
 __fput+0x26c/0x7a0 fs/file_table.c:211
 task_work_run+0x11f/0x190 kernel/task_work.c:113
 tracehook_notify_resume include/linux/tracehook.h:191 [inline]
 exit_to_usermode_loop+0x1ad/0x200 arch/x86/entry/common.c:164
 prepare_exit_to_usermode arch/x86/entry/common.c:199 [inline]
 syscall_return_slowpath arch/x86/entry/common.c:270 [inline]
 do_syscall_64+0x4a3/0x640 arch/x86/entry/common.c:297
 entry_SYSCALL_64_after_hwframe+0x46/0xbb

The buggy address belongs to the object at ffff8880a168e300
 which belongs to the cache kmalloc-96 of size 96
The buggy address is located 8 bytes inside of
 96-byte region [ffff8880a168e300, ffff8880a168e360)
The buggy address belongs to the page:
page:ffffea000285a380 count:1 mapcount:0 mapping:ffff8880a168e000 index:0xffff8880a168ef80
flags: 0xfff00000000100(slab)
raw: 00fff00000000100 ffff8880a168e000 ffff8880a168ef80 000000010000001c
raw: ffffea00026dde20 ffffea0002a487e0 ffff88813fe804c0 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8880a168e200: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
 ffff8880a168e280: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
>ffff8880a168e300: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
                      ^
 ffff8880a168e380: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
 ffff8880a168e400: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
==================================================================

Crashes (4):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2021/05/05 10:07 linux-4.14.y 7d7d1c0ab3eb 06c27ff5 .config console log report syz C ci2-linux-4-14 KASAN: use-after-free Read in ip_check_mc_rcu
2021/02/22 06:22 linux-4.14.y 29c52025152b a659b3f1 .config console log report syz C ci2-linux-4-14 KASAN: use-after-free Read in ip_check_mc_rcu
2021/03/06 19:22 linux-4.14.y 397a88b2cc86 e4b4d570 .config console log report syz ci2-linux-4-14 KASAN: use-after-free Read in ip_check_mc_rcu
2021/02/22 02:15 linux-4.14.y 29c52025152b a659b3f1 .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in ip_check_mc_rcu
* Struck through repros no longer work on HEAD.