bisecting cause commit starting from 5a8fb33e530512ee67a11b30f3451a4f030f4b01 building syzkaller on a7dab6385c1d95547a88e22577fb56fbcd5c37eb testing commit 5a8fb33e530512ee67a11b30f3451a4f030f4b01 compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 844e3930cdb125b406a98094a5fcd46c84f733a448c466a9c1b08cec657ea198 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 run #0: basic kernel testing failed: BUG: program execution failed: executor NUM: failed to write control pipe: write |NUM: broken pipe run #1: OK run #2: OK run #3: OK run #4: OK run #5: OK run #6: OK run #7: OK run #8: OK run #9: 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: 3ae55386e2e4b3cdf01b6008c8e5733f70604dcbaae91004b162344bea7b6695 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: d9d2122edfbf4fb1a489f7d52c73084f1f241bbb066d9f63397de7488bb8eba2 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: 164edd3948ba330df069e3b03f18d3410ca92aaf728957f55fd4e7515fd803a0 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: 71a1346a76b5e067526509274a6739730c1f94a4c6e20619ba99812596dfa24b 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: 9318d63ef1917f896411ca6c1208f8e56b87c070175c116c0c91a22494ea0966 run #0: basic kernel testing failed: BUG: program execution failed: executor NUM: exit status NUM run #1: OK run #2: OK run #3: OK run #4: OK run #5: OK run #6: OK run #7: OK run #8: OK run #9: 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: c23149e9e120cbd648b72539c653956dae5514c9a05a5a4fb1d9945c05d4cd3b 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: ccad214557d000997edd83fbd831b88abdb78c7adca645d39687c15862b50d2f 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: ccbaae33eb984139f3cd5d21abefff94fd0ae10f2116a2e49c345f30b37be9ba 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: af87c1e2f8aa8dac07f3e9b03e0e50581986748974cdd96e4b24dcea34fb555e 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: ecfa542a4ba2693df603e405e2f0477d6747ba4110219681e6236d9030028544 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: d72cf8214008ec41d81fffc38e563bb9b66bd7d029acfe38a8fc5f64d412144e 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: da604429f9b4a819f350abf76c761a7cc2b8af856633040fe5412b4ec17c5825 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: da604429f9b4a819f350abf76c761a7cc2b8af856633040fe5412b4ec17c5825 parent signature: ccbaae33eb984139f3cd5d21abefff94fd0ae10f2116a2e49c345f30b37be9ba revisions tested: 16, total time: 3h2m13.377995778s (build: 1h50m0.70885416s, test: 1h10m42.802521885s) 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 ffff88801668d288 by task kworker/u4:3/90 CPU: 1 PID: 90 Comm: kworker/u4:3 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 90: 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 90: 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 ffff88801668d200 which belongs to the cache kmalloc-256 of size 256 The buggy address is located 136 bytes inside of 256-byte region [ffff88801668d200, ffff88801668d300) The buggy address belongs to the page: page:ffffea000059a300 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1668c head:ffffea000059a300 order:1 compound_mapcount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 dead000000000100 dead000000000122 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 1, ts 3695148983, 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_page_interleave+0xf/0x1c0 mm/mempolicy.c:2116 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] __kmalloc+0x2fb/0x340 mm/slub.c:4420 kmalloc_array include/linux/slab.h:621 [inline] kcalloc include/linux/slab.h:652 [inline] __list_lru_init+0xbb/0x860 mm/list_lru.c:584 workingset_init+0xa4/0xc4 mm/workingset.c:627 do_one_initcall+0xbe/0x440 init/main.c:1300 do_initcall_level init/main.c:1373 [inline] do_initcalls init/main.c:1389 [inline] do_basic_setup init/main.c:1408 [inline] kernel_init_freeable+0x5ab/0x605 init/main.c:1613 kernel_init+0x14/0x130 init/main.c:1502 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 page_owner free stack trace missing Memory state around the buggy address: ffff88801668d180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88801668d200: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88801668d280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88801668d300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88801668d380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================