================================================================== 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 ==================================================================