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: 78f830017002d992b2918713066d055d71307b4023565fe7350c1791ccc2528f 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: 398b187df53c9806c314c1b440aba7de1e0de001889b6cce871220cf7d89dea4 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: 854700035a0c7f7618d9bb5fc0793d37e521305cb50295496b668f3fdf8c3811 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: 61468dd8bbdc1918461117752d257a9dacb000e5e583132a34ee849370f82dec 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: 0d3b74b269618704fad0b7d581d1ca6d8a01ff2d2b8d55e3cbafaf3583dbebd7 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: 9059940b731e74c0a68b578e1396126d9d26cb1f8e0e8ca9c8d104d01cac03b0 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: 52372cfa8339f4aece78565211cc88af18b0908ff6a62c67094ac7b889728dd1 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: 4e1f975d63b0a09b258f7f3fa290e4b9d788ac231b70b21e78b5d5e9f0519ebc 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: 29103c633692c4047184fb47a521084867218e6c074828f87f6ffcb2edfad2d4 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: 39aa0aa554798ba09fe90592a7cc395e47fd3173e93731a46ae0ff77103ac990 run #0: basic kernel testing failed: BUG: program execution failed: executor NUM: exit status NUM run #1: crashed: KASAN: use-after-free Read in ip6mr_sk_done run #2: crashed: KASAN: use-after-free Read in ip6mr_sk_done run #3: crashed: KASAN: use-after-free Read in ip6mr_sk_done run #4: crashed: KASAN: use-after-free Read in ip6mr_sk_done run #5: crashed: KASAN: use-after-free Read in ip6mr_sk_done run #6: crashed: KASAN: use-after-free Read in ip6mr_sk_done run #7: crashed: KASAN: use-after-free Read in ip6mr_sk_done run #8: crashed: KASAN: use-after-free Read in ip6mr_sk_done run #9: 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: 17f599377425aa27c270a2b53d54e11298d5c0ffa31661639b98b4236a9e793f 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: fcdb85d8fb5cc5f43b084936c1eeb25d9bc554fa765147146359dda7a470b1f3 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: f37e646936e50cbc3869ae022791feb9f469f67403cc6df02dc8625ef5760297 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: f37e646936e50cbc3869ae022791feb9f469f67403cc6df02dc8625ef5760297 parent signature: 29103c633692c4047184fb47a521084867218e6c074828f87f6ffcb2edfad2d4 revisions tested: 16, total time: 2h48m37.002959693s (build: 2h3m10.916412981s, test: 43m56.255394047s) 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 ffff888013da0a88 by task kworker/u4:0/8 CPU: 0 PID: 8 Comm: kworker/u4:0 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 0: (stack is not available) Freed by task 8: 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 ffff888013da0a00 which belongs to the cache kmalloc-256 of size 256 The buggy address is located 136 bytes inside of 256-byte region [ffff888013da0a00, ffff888013da0b00) The buggy address belongs to the page: page:ffffea00004f6800 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x13da0 head:ffffea00004f6800 order:1 compound_mapcount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 0000000000000000 dead000000000001 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 2085771656, 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_track_caller+0x2e7/0x320 mm/slub.c:4926 __do_krealloc mm/slab_common.c:1184 [inline] krealloc+0x87/0xf0 mm/slab_common.c:1217 add_sysfs_param+0xaf/0x900 kernel/params.c:651 kernel_add_sysfs_param kernel/params.c:812 [inline] param_sysfs_builtin kernel/params.c:851 [inline] param_sysfs_init+0x279/0x351 kernel/params.c:970 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: ffff888013da0980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888013da0a00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888013da0a80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888013da0b00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888013da0b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================