bisecting cause commit starting from 5a8fb33e530512ee67a11b30f3451a4f030f4b01 building syzkaller on 8b9ca619df135211a89cc19719f2705d0016045d testing commit 5a8fb33e530512ee67a11b30f3451a4f030f4b01 compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: a44f9104e762777673cc088058be73d046fd0d841943f973b03f24d5c3f070f7 all runs: crashed: KASAN: use-after-free Read in ip6mr_sk_done testing release v5.16 testing commit df0cc57e057f18e44dac8e6c18aba47ab53202f9 compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 6392e7dc90e0a4647080a5029d93ca58348fb8a5852ea8aba24fe1cfc2cb5f6d all runs: OK # git bisect start 5a8fb33e530512ee67a11b30f3451a4f030f4b01 df0cc57e057f18e44dac8e6c18aba47ab53202f9 Bisecting: 6465 revisions left to test after this (roughly 13 steps) [f18e2d877269672597088c308ca75d7d52620028] Merge tag 'x86_build_for_v5.17_rc1-p2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip testing commit f18e2d877269672597088c308ca75d7d52620028 compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 969c2b2f0daba5b5e6eb2a2e5686c4cd2c896a3b5e50d97fae9b3a006e6eee3f all runs: OK # git bisect good f18e2d877269672597088c308ca75d7d52620028 Bisecting: 3240 revisions left to test after this (roughly 12 steps) [a33f5c380c4bd3fa5278d690421b72052456d9fe] Merge tag 'xfs-5.17-merge-3' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux testing commit a33f5c380c4bd3fa5278d690421b72052456d9fe compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: b21ce77f2904f587f27b3a5fc316f3b3204ff1afd6345afa8cfeaa603ecc833b all runs: OK # git bisect good a33f5c380c4bd3fa5278d690421b72052456d9fe Bisecting: 1657 revisions left to test after this (roughly 11 steps) [f4484d138b31e8fa1ba410363b5b9664f68974af] Merge branch 'akpm' (patches from Andrew) testing commit f4484d138b31e8fa1ba410363b5b9664f68974af compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: bf7d80e936097a92f3726c33b0a57b1c085e44275c8df7954c0556aa5016063c all runs: OK # git bisect good f4484d138b31e8fa1ba410363b5b9664f68974af Bisecting: 838 revisions left to test after this (roughly 10 steps) [87563a043cef044fed5db7967a75741cc16ad2b1] ax25: fix reference count leaks of ax25_dev testing commit 87563a043cef044fed5db7967a75741cc16ad2b1 compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 79e596c5166e98127a476d7c33522de047446cddfcf63ec26b64536748e37b02 all runs: OK # git bisect good 87563a043cef044fed5db7967a75741cc16ad2b1 Bisecting: 419 revisions left to test after this (roughly 9 steps) [79f227c4ff3e5e5a5f73a9528cc53508d778bbcd] i40e: Remove unused RX realloc stat testing commit 79f227c4ff3e5e5a5f73a9528cc53508d778bbcd compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 9c4d00e1ac283336143ad41b8f4f441b335e71384bce4d2b8c4ceb6537e17dd4 all runs: OK # git bisect good 79f227c4ff3e5e5a5f73a9528cc53508d778bbcd Bisecting: 209 revisions left to test after this (roughly 8 steps) [44aa31a2bfaab2ad36614f05162cda88ade9ce65] Merge tag 'usb-5.17-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb testing commit 44aa31a2bfaab2ad36614f05162cda88ade9ce65 compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: d4b10932f3ca3a24a12ab945ab6f6ee2ea99fbc2eb82f40648d7d227f535e06a all runs: OK # git bisect good 44aa31a2bfaab2ad36614f05162cda88ade9ce65 Bisecting: 101 revisions left to test after this (roughly 7 steps) [3e5832e923a9c3a12c76980f68853668d4675ecf] Merge tag 'pinctrl-v5.17-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl testing commit 3e5832e923a9c3a12c76980f68853668d4675ecf compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 0c97c5c998a523174800b414f435075dec017cbf269c495f155af9d01a1f1317 all runs: OK # git bisect good 3e5832e923a9c3a12c76980f68853668d4675ecf Bisecting: 50 revisions left to test after this (roughly 6 steps) [b93235e68921b9acd38ee309953a3a9808105289] tls: cap the output scatter list to something reasonable testing commit b93235e68921b9acd38ee309953a3a9808105289 compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 74a8121cadafa299dc21299dde8bcab16d33794240401889aa81906451f8f331 all runs: OK # git bisect good b93235e68921b9acd38ee309953a3a9808105289 Bisecting: 25 revisions left to test after this (roughly 5 steps) [ed8c8f605c0bb8ec3217ffda143665ab56e82bf7] Merge branch 'mptcp-improve-set-flags-command-and-update-self-tests' testing commit ed8c8f605c0bb8ec3217ffda143665ab56e82bf7 compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: fd58eac537485e68d19fc4ae7f101b50895a007aeceba52b3c1bc68696592736 all runs: OK # git bisect good ed8c8f605c0bb8ec3217ffda143665ab56e82bf7 Bisecting: 12 revisions left to test after this (roughly 4 steps) [145c7a793838add5e004e7d49a67654dc7eba147] ipv6: make mc_forwarding atomic testing commit 145c7a793838add5e004e7d49a67654dc7eba147 compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: ae6283dfee60ec7ef7af754c81adee191d64f61083eab278ed214b714357330a all runs: OK # git bisect good 145c7a793838add5e004e7d49a67654dc7eba147 Bisecting: 6 revisions left to test after this (roughly 3 steps) [8f4f9c93c7049ad56eb6158883a8ce9857b04abe] Merge branch 'net-dev-tracking-improvements' testing commit 8f4f9c93c7049ad56eb6158883a8ce9857b04abe compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: c489db95437c5072182e649ccb8f791005625f13990cd07173d1d1eed044504e all runs: crashed: KASAN: use-after-free Read in ip6mr_sk_done # git bisect bad 8f4f9c93c7049ad56eb6158883a8ce9857b04abe Bisecting: 2 revisions left to test after this (roughly 2 steps) [e3ececfe668facd87d920b608349a32607060e66] ref_tracker: implement use-after-free detection testing commit e3ececfe668facd87d920b608349a32607060e66 compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: f8f0541fcac944f292f5d627905cb065ddc16f38c900bc866ecb485bf9ce1cc5 all runs: crashed: KASAN: use-after-free Read in ip6mr_sk_done # git bisect bad e3ececfe668facd87d920b608349a32607060e66 Bisecting: 0 revisions left to test after this (roughly 1 step) [cc3063502e0893c491ff83b61f43d402c144857d] Merge branch 'ipv6-mc_forwarding-changes' testing commit cc3063502e0893c491ff83b61f43d402c144857d compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 516cc366ae686eb6dd85efbd3b5aee1160c5a270c6ebec1f409e2a0876ea23e4 all runs: crashed: KASAN: use-after-free Read in ip6mr_sk_done # git bisect bad cc3063502e0893c491ff83b61f43d402c144857d Bisecting: 0 revisions left to test after this (roughly 0 steps) [f2f2325ec79970807012dfc9e716cdbb02d9b574] ip6mr: ip6mr_sk_done() can exit early in common cases testing commit f2f2325ec79970807012dfc9e716cdbb02d9b574 compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 17f0d2cdc51d6db0bef7ba81407974ab7f93f91ddad5884d72e23836a2ee82ba all runs: crashed: KASAN: use-after-free Read in ip6mr_sk_done # git bisect bad f2f2325ec79970807012dfc9e716cdbb02d9b574 f2f2325ec79970807012dfc9e716cdbb02d9b574 is the first bad commit commit f2f2325ec79970807012dfc9e716cdbb02d9b574 Author: Eric Dumazet Date: Fri Feb 4 12:15:46 2022 -0800 ip6mr: ip6mr_sk_done() can exit early in common cases In many cases, ip6mr_sk_done() is called while no ipmr socket has been registered. This removes 4 rtnl acquisitions per netns dismantle, with following callers: igmp6_net_exit(), tcpv6_net_exit(), ndisc_net_exit() Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller net/ipv6/ip6mr.c | 3 +++ 1 file changed, 3 insertions(+) culprit signature: 17f0d2cdc51d6db0bef7ba81407974ab7f93f91ddad5884d72e23836a2ee82ba parent signature: ae6283dfee60ec7ef7af754c81adee191d64f61083eab278ed214b714357330a revisions tested: 16, total time: 2h52m57.835476343s (build: 1h40m37.093012667s, test: 1h10m51.830691085s) first bad commit: f2f2325ec79970807012dfc9e716cdbb02d9b574 ip6mr: ip6mr_sk_done() can exit early in common cases recipients (to): ["davem@davemloft.net" "davem@davemloft.net" "dsahern@kernel.org" "edumazet@google.com" "kuba@kernel.org" "netdev@vger.kernel.org" "yoshfuji@linux-ipv6.org"] recipients (cc): ["linux-kernel@vger.kernel.org"] crash: KASAN: use-after-free Read in ip6mr_sk_done bond0 (unregistering): (slave bond_slave_1): Releasing backup interface bond0 (unregistering): (slave bond_slave_0): Releasing backup interface bond0 (unregistering): Released all slaves ================================================================== BUG: KASAN: use-after-free in instrument_atomic_read include/linux/instrumented.h:71 [inline] BUG: KASAN: use-after-free in atomic_read include/linux/atomic/atomic-instrumented.h:27 [inline] BUG: KASAN: use-after-free in ip6mr_sk_done+0xea/0x360 net/ipv6/ip6mr.c:1578 Read of size 4 at addr ffff88800fe3ee88 by task kworker/u4:4/990 CPU: 0 PID: 990 Comm: kworker/u4:4 Not tainted 5.17.0-rc2-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: netns cleanup_net Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x57/0x7d lib/dump_stack.c:106 print_address_description.constprop.0.cold+0x8d/0x336 mm/kasan/report.c:255 __kasan_report mm/kasan/report.c:442 [inline] kasan_report.cold+0x83/0xdf mm/kasan/report.c:459 check_region_inline mm/kasan/generic.c:183 [inline] kasan_check_range+0x13d/0x180 mm/kasan/generic.c:189 instrument_atomic_read include/linux/instrumented.h:71 [inline] atomic_read include/linux/atomic/atomic-instrumented.h:27 [inline] ip6mr_sk_done+0xea/0x360 net/ipv6/ip6mr.c:1578 rawv6_close+0x3e/0x60 net/ipv6/raw.c:1201 inet_release+0xef/0x210 net/ipv4/af_inet.c:428 __sock_release net/socket.c:650 [inline] sock_release+0x7d/0x190 net/socket.c:678 inet_ctl_sock_destroy include/net/inet_common.h:65 [inline] igmp6_net_exit+0x61/0x160 net/ipv6/mcast.c:3173 ops_exit_list+0x94/0x160 net/core/net_namespace.c:168 cleanup_net+0x423/0x980 net/core/net_namespace.c:600 process_one_work+0x879/0x1410 kernel/workqueue.c:2307 worker_thread+0x5a0/0xf60 kernel/workqueue.c:2454 kthread+0x299/0x340 kernel/kthread.c:377 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Allocated by task 8: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:436 [inline] ____kasan_kmalloc mm/kasan/common.c:515 [inline] ____kasan_kmalloc mm/kasan/common.c:474 [inline] __kasan_kmalloc+0xa9/0xd0 mm/kasan/common.c:524 kmalloc include/linux/slab.h:581 [inline] kzalloc include/linux/slab.h:715 [inline] set_kthread_struct+0xa6/0x1f0 kernel/kthread.c:118 copy_process+0x3064/0x6890 kernel/fork.c:2091 kernel_clone+0xb8/0x7f0 kernel/fork.c:2555 kernel_thread+0xa3/0xe0 kernel/fork.c:2607 call_usermodehelper_exec_work kernel/umh.c:174 [inline] call_usermodehelper_exec_work+0xa4/0x140 kernel/umh.c:160 process_one_work+0x879/0x1410 kernel/workqueue.c:2307 worker_thread+0x5a0/0xf60 kernel/workqueue.c:2454 kthread+0x299/0x340 kernel/kthread.c:377 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Freed by task 990: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 kasan_set_track+0x21/0x30 mm/kasan/common.c:45 kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:370 ____kasan_slab_free mm/kasan/common.c:366 [inline] ____kasan_slab_free+0x130/0x160 mm/kasan/common.c:328 kasan_slab_free include/linux/kasan.h:236 [inline] slab_free_hook mm/slub.c:1728 [inline] slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1754 slab_free mm/slub.c:3509 [inline] kfree+0xcb/0x280 mm/slub.c:4562 ops_exit_list+0x94/0x160 net/core/net_namespace.c:168 cleanup_net+0x423/0x980 net/core/net_namespace.c:600 process_one_work+0x879/0x1410 kernel/workqueue.c:2307 worker_thread+0x5a0/0xf60 kernel/workqueue.c:2454 kthread+0x299/0x340 kernel/kthread.c:377 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 The buggy address belongs to the object at ffff88800fe3ee00 which belongs to the cache kmalloc-256 of size 256 The buggy address is located 136 bytes inside of 256-byte region [ffff88800fe3ee00, ffff88800fe3ef00) The buggy address belongs to the page: page:ffffea00003f8f80 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0xfe3e head:ffffea00003f8f80 order:1 compound_mapcount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 ffffea000050f500 dead000000000003 ffff88800fc41b40 raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 1, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 8, ts 3659965345, free_ts 0 prep_new_page mm/page_alloc.c:2434 [inline] get_page_from_freelist+0xa6f/0x2f10 mm/page_alloc.c:4165 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5389 alloc_slab_page mm/slub.c:1799 [inline] allocate_slab mm/slub.c:1944 [inline] new_slab+0x28a/0x3b0 mm/slub.c:2004 ___slab_alloc+0x87e/0xe80 mm/slub.c:3018 __slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3105 slab_alloc_node mm/slub.c:3196 [inline] slab_alloc mm/slub.c:3238 [inline] kmem_cache_alloc_trace+0x289/0x2c0 mm/slub.c:3255 kmalloc include/linux/slab.h:581 [inline] kzalloc include/linux/slab.h:715 [inline] set_kthread_struct+0xa6/0x1f0 kernel/kthread.c:118 copy_process+0x3064/0x6890 kernel/fork.c:2091 kernel_clone+0xb8/0x7f0 kernel/fork.c:2555 kernel_thread+0xa3/0xe0 kernel/fork.c:2607 call_usermodehelper_exec_work kernel/umh.c:174 [inline] call_usermodehelper_exec_work+0xa4/0x140 kernel/umh.c:160 process_one_work+0x879/0x1410 kernel/workqueue.c:2307 worker_thread+0x5a0/0xf60 kernel/workqueue.c:2454 kthread+0x299/0x340 kernel/kthread.c:377 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 page_owner free stack trace missing Memory state around the buggy address: ffff88800fe3ed80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88800fe3ee00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88800fe3ee80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88800fe3ef00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88800fe3ef80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================