syzbot


general protection fault in icmp_sk_exit

Status: closed as invalid on 2021/12/14 20:02
Reported-by: syzbot+@syzkaller.appspotmail.com
First crash: 508d, last: 422d

Cause bisection: failed (bisect log)

Fix bisection: failed (bisect log)
similar bugs (1):
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: use-after-free Read in icmp_sk_exit 3 1370d 1384d 0/24 auto-closed as invalid on 2019/09/01 20:10

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in inet_ctl_sock_destroy include/net/inet_common.h:65 [inline]
BUG: KASAN: use-after-free in icmp_sk_exit+0x231/0x280 net/ipv4/icmp.c:1443
Read of size 8 at addr ffff888044fa9180 by task syz-executor.5/21849

CPU: 1 PID: 21849 Comm: syz-executor.5 Not tainted 5.15.0-rc4-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106
 print_address_description.constprop.0.cold+0x6c/0x309 mm/kasan/report.c:256
 __kasan_report mm/kasan/report.c:442 [inline]
 kasan_report.cold+0x83/0xdf mm/kasan/report.c:459
 inet_ctl_sock_destroy include/net/inet_common.h:65 [inline]
 icmp_sk_exit+0x231/0x280 net/ipv4/icmp.c:1443
 ops_exit_list+0xb0/0x160 net/core/net_namespace.c:168
 setup_net+0x639/0xa30 net/core/net_namespace.c:349
 copy_net_ns+0x319/0x760 net/core/net_namespace.c:470
 create_new_namespaces+0x3f6/0xb20 kernel/nsproxy.c:110
 copy_namespaces+0x391/0x450 kernel/nsproxy.c:178
 copy_process+0x2da7/0x7580 kernel/fork.c:2197
 kernel_clone+0xe7/0xac0 kernel/fork.c:2584
 __do_sys_clone+0xc8/0x110 kernel/fork.c:2701
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x7fef20ea88d9
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 bc ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fef2061f188 EFLAGS: 00000246 ORIG_RAX: 0000000000000038
RAX: ffffffffffffffda RBX: 00007fef20facf60 RCX: 00007fef20ea88d9
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 000000004900a700
RBP: 00007fef20f02cb4 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ffff87c7faf R14: 00007fef2061f300 R15: 0000000000022000

Allocated by task 21849:
 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:434 [inline]
 __kasan_slab_alloc+0x83/0xb0 mm/kasan/common.c:467
 kasan_slab_alloc include/linux/kasan.h:254 [inline]
 slab_post_alloc_hook mm/slab.h:519 [inline]
 slab_alloc_node mm/slub.c:3206 [inline]
 slab_alloc mm/slub.c:3214 [inline]
 kmem_cache_alloc+0x209/0x390 mm/slub.c:3219
 sk_prot_alloc+0x5f/0x290 net/core/sock.c:1833
 sk_alloc+0x30/0xa60 net/core/sock.c:1892
 inet_create net/ipv4/af_inet.c:322 [inline]
 inet_create+0x395/0xea0 net/ipv4/af_inet.c:248
 __sock_create+0x353/0x790 net/socket.c:1464
 inet_ctl_sock_create+0x88/0x1d0 net/ipv4/af_inet.c:1654
 icmp_sk_init net/ipv4/icmp.c:1459 [inline]
 icmp_sk_init+0xfd/0x500 net/ipv4/icmp.c:1448
 ops_init+0xaf/0x470 net/core/net_namespace.c:140
 setup_net+0x40f/0xa30 net/core/net_namespace.c:326
 copy_net_ns+0x319/0x760 net/core/net_namespace.c:470
 create_new_namespaces+0x3f6/0xb20 kernel/nsproxy.c:110
 copy_namespaces+0x391/0x450 kernel/nsproxy.c:178
 copy_process+0x2da7/0x7580 kernel/fork.c:2197
 kernel_clone+0xe7/0xac0 kernel/fork.c:2584
 __do_sys_clone+0xc8/0x110 kernel/fork.c:2701
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x44/0xae

Freed by task 154:
 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:360
 ____kasan_slab_free mm/kasan/common.c:366 [inline]
 ____kasan_slab_free mm/kasan/common.c:328 [inline]
 __kasan_slab_free+0xff/0x130 mm/kasan/common.c:374
 kasan_slab_free include/linux/kasan.h:230 [inline]
 slab_free_hook mm/slub.c:1700 [inline]
 slab_free_freelist_hook+0x81/0x190 mm/slub.c:1725
 slab_free mm/slub.c:3483 [inline]
 kmem_cache_free+0x8a/0x5b0 mm/slub.c:3499
 sk_prot_free net/core/sock.c:1873 [inline]
 __sk_destruct+0x5a2/0x900 net/core/sock.c:1961
 sk_destruct+0xbd/0xe0 net/core/sock.c:1976
 __sk_free+0xef/0x3d0 net/core/sock.c:1987
 sk_free net/core/sock.c:1998 [inline]
 sock_put include/net/sock.h:1848 [inline]
 sk_common_release+0x292/0x390 net/core/sock.c:3433
 inet_release+0x12e/0x280 net/ipv4/af_inet.c:431
 __sock_release net/socket.c:649 [inline]
 sock_release+0x87/0x1b0 net/socket.c:677
 inet_ctl_sock_destroy include/net/inet_common.h:65 [inline]
 icmp_sk_exit+0x14c/0x280 net/ipv4/icmp.c:1443
 ops_exit_list+0xb0/0x160 net/core/net_namespace.c:168
 cleanup_net+0x4ea/0xb00 net/core/net_namespace.c:591
 process_one_work+0x9bf/0x16b0 kernel/workqueue.c:2297
 worker_thread+0x658/0x11f0 kernel/workqueue.c:2444
 kthread+0x3e5/0x4d0 kernel/kthread.c:319
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295

The buggy address belongs to the object at ffff888044fa8d00
 which belongs to the cache RAW of size 1504
The buggy address is located 1152 bytes inside of
 1504-byte region [ffff888044fa8d00, ffff888044fa92e0)
The buggy address belongs to the page:
page:ffffea000113ea00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x44fa8
head:ffffea000113ea00 order:3 compound_mapcount:0 compound_pincount:0
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 0000000000000000 dead000000000122 ffff8880160f9dc0
raw: 0000000000000000 0000000080130013 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 21849, ts 340431013566, free_ts 339715193144
 prep_new_page mm/page_alloc.c:2424 [inline]
 get_page_from_freelist+0xa72/0x2f80 mm/page_alloc.c:4153
 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5375
 alloc_pages+0x1a7/0x300 mm/mempolicy.c:2197
 alloc_slab_page mm/slub.c:1763 [inline]
 allocate_slab mm/slub.c:1900 [inline]
 new_slab+0x319/0x490 mm/slub.c:1963
 ___slab_alloc+0x921/0xfe0 mm/slub.c:2994
 __slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3081
 slab_alloc_node mm/slub.c:3172 [inline]
 slab_alloc mm/slub.c:3214 [inline]
 kmem_cache_alloc+0x365/0x390 mm/slub.c:3219
 sk_prot_alloc+0x5f/0x290 net/core/sock.c:1833
 sk_alloc+0x30/0xa60 net/core/sock.c:1892
 inet_create net/ipv4/af_inet.c:322 [inline]
 inet_create+0x395/0xea0 net/ipv4/af_inet.c:248
 __sock_create+0x353/0x790 net/socket.c:1464
 inet_ctl_sock_create+0x88/0x1d0 net/ipv4/af_inet.c:1654
 tcp_sk_init net/ipv4/tcp_ipv4.c:3104 [inline]
 tcp_sk_init+0x102/0x1330 net/ipv4/tcp_ipv4.c:3093
 ops_init+0xaf/0x470 net/core/net_namespace.c:140
 setup_net+0x40f/0xa30 net/core/net_namespace.c:326
 copy_net_ns+0x319/0x760 net/core/net_namespace.c:470
page last free stack trace:
 reset_page_owner include/linux/page_owner.h:24 [inline]
 free_pages_prepare mm/page_alloc.c:1338 [inline]
 free_pcp_prepare+0x2c5/0x780 mm/page_alloc.c:1389
 free_unref_page_prepare mm/page_alloc.c:3315 [inline]
 free_unref_page+0x19/0x690 mm/page_alloc.c:3394
 __unfreeze_partials+0x340/0x360 mm/slub.c:2495
 qlink_free mm/kasan/quarantine.c:146 [inline]
 qlist_free_all+0x5a/0xc0 mm/kasan/quarantine.c:165
 kasan_quarantine_reduce+0x180/0x200 mm/kasan/quarantine.c:272
 __kasan_slab_alloc+0x95/0xb0 mm/kasan/common.c:444
 kasan_slab_alloc include/linux/kasan.h:254 [inline]
 slab_post_alloc_hook mm/slab.h:519 [inline]
 slab_alloc_node mm/slub.c:3206 [inline]
 kmem_cache_alloc_node+0x259/0x3d0 mm/slub.c:3242
 __alloc_skb+0x20b/0x340 net/core/skbuff.c:414
 alloc_skb include/linux/skbuff.h:1116 [inline]
 nlmsg_new include/net/netlink.h:953 [inline]
 inet6_netconf_notify_devconf+0xa0/0x1e0 net/ipv6/addrconf.c:582
 __addrconf_sysctl_unregister net/ipv6/addrconf.c:7049 [inline]
 addrconf_exit_net+0xe5/0x2a0 net/ipv6/addrconf.c:7153
 ops_exit_list+0xb0/0x160 net/core/net_namespace.c:168
 setup_net+0x639/0xa30 net/core/net_namespace.c:349
 copy_net_ns+0x319/0x760 net/core/net_namespace.c:470
 create_new_namespaces+0x3f6/0xb20 kernel/nsproxy.c:110
 copy_namespaces+0x391/0x450 kernel/nsproxy.c:178
 copy_process+0x2da7/0x7580 kernel/fork.c:2197

Memory state around the buggy address:
 ffff888044fa9080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff888044fa9100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff888044fa9180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                   ^
 ffff888044fa9200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff888044fa9280: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
==================================================================

Crashes (2):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci-upstream-kasan-gce-root 2021/10/09 08:52 upstream 5d6ab0bb408f efe0f24d .config log report syz KASAN: use-after-free Read in icmp_sk_exit
ci-upstream-net-kasan-gce 2021/07/15 17:48 net-next 5e437416ff66 b9a2f64e .config log report info general protection fault in icmp_sk_exit
* Struck through repros no longer work on HEAD.