bisecting cause commit starting from 732b74d647048668f0f8dc0c848f0746c69e2e2f building syzkaller on 838e7e2cd9228583ca33c49a39aea4d863d3e36d testing commit 732b74d647048668f0f8dc0c848f0746c69e2e2f compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 6a25409e9b24766cbebbfde7ac84fe08f762764f2f73ba0d6a32434021b7a5cd all runs: crashed: KASAN: use-after-free Read in consume_skb testing release v5.14 testing commit 7d2a07b769330c34b4deabeed939325c77a7ec2f compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 8c219514f33cf5f7e995cffb6643e798eb9f0e406da2dbcbb7423680d5a3f503 all runs: OK # git bisect start 732b74d647048668f0f8dc0c848f0746c69e2e2f 7d2a07b769330c34b4deabeed939325c77a7ec2f Bisecting: 5657 revisions left to test after this (roughly 13 steps) [477f70cd2a67904e04c2c2b9bd0fa2e95222f2f6] Merge tag 'drm-next-2021-08-31-1' of git://anongit.freedesktop.org/drm/drm testing commit 477f70cd2a67904e04c2c2b9bd0fa2e95222f2f6 compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 85c38fa76edf1e310a31bd4c3300ed33b8a7fe9384ec5bc95e2b79025a135b1e all runs: crashed: KASAN: use-after-free Read in consume_skb # git bisect bad 477f70cd2a67904e04c2c2b9bd0fa2e95222f2f6 Bisecting: 3024 revisions left to test after this (roughly 12 steps) [9e9fb7655ed585da8f468e29221f0ba194a5f613] Merge tag 'net-next-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next testing commit 9e9fb7655ed585da8f468e29221f0ba194a5f613 compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 arch/x86/kernel/setup.c:916:6: error: implicit declaration of function 'acpi_mps_check' [-Werror=implicit-function-declaration] arch/x86/kernel/setup.c:1110:2: error: implicit declaration of function 'acpi_table_upgrade' [-Werror=implicit-function-declaration] arch/x86/kernel/setup.c:1112:2: error: implicit declaration of function 'acpi_boot_table_init' [-Werror=implicit-function-declaration] arch/x86/kernel/setup.c:1120:2: error: implicit declaration of function 'early_acpi_boot_init'; did you mean 'early_cpu_init'? [-Werror=implicit-function-declaration] arch/x86/kernel/setup.c:1162:2: error: implicit declaration of function 'acpi_boot_init' [-Werror=implicit-function-declaration] # git bisect skip 9e9fb7655ed585da8f468e29221f0ba194a5f613 Bisecting: 3024 revisions left to test after this (roughly 12 steps) [7a47c52142c18a9239c5afea2c9656c68d3f22e7] s390/ccwgroup: Drop if with an always false condition testing commit 7a47c52142c18a9239c5afea2c9656c68d3f22e7 compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 7ad5c5d6b2cd282b737211014f74e72fb1a5bc2b88946eef6aae521c988310ad all runs: OK # git bisect good 7a47c52142c18a9239c5afea2c9656c68d3f22e7 Bisecting: 3021 revisions left to test after this (roughly 12 steps) [05e45887382c4c0f9522515759b34991aa17e69d] rtw88: wow: build wow function only if CONFIG_PM is on testing commit 05e45887382c4c0f9522515759b34991aa17e69d compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 09b34994a0a1d3b107bb27fbe9ec715ec28cd0b26c77a750ba8bce0f56860afc all runs: crashed: KASAN: use-after-free Read in consume_skb # git bisect bad 05e45887382c4c0f9522515759b34991aa17e69d Bisecting: 153 revisions left to test after this (roughly 7 steps) [8887ca5474bd9ddb56cabc88856bb035774e0041] net: phy: at803x: simplify custom phy id matching testing commit 8887ca5474bd9ddb56cabc88856bb035774e0041 compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 42da7ab805d229cd74dd076447f929b8d71e0b6d3ad3d7a3389951dfd8c21b08 all runs: crashed: KASAN: use-after-free Read in consume_skb # git bisect bad 8887ca5474bd9ddb56cabc88856bb035774e0041 Bisecting: 76 revisions left to test after this (roughly 6 steps) [8c5663e461e6914304bbbf2c1cf67e5dce18740f] vmxnet3: increase maximum configurable mtu to 9190 testing commit 8c5663e461e6914304bbbf2c1cf67e5dce18740f compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 269b1b393d01b69e690def8bdbfdff7d387fff013cdcdf2bdd4aecadc0e10845 all runs: crashed: KASAN: use-after-free Read in consume_skb # git bisect bad 8c5663e461e6914304bbbf2c1cf67e5dce18740f Bisecting: 38 revisions left to test after this (roughly 5 steps) [1554a080e76554fa71004bba5b93c4695932a4d7] Merge branch 'Add bpf_get_func_ip helper' testing commit 1554a080e76554fa71004bba5b93c4695932a4d7 compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 2eaebf7a7e3f463d260cb5ab01f425a734ae065f0c95503cfe91b55de5632d6e all runs: OK # git bisect good 1554a080e76554fa71004bba5b93c4695932a4d7 Bisecting: 18 revisions left to test after this (roughly 4 steps) [919d527956daa3e7ad03a23ba661beb8a46cacf4] bnx2x: remove unused variable 'cur_data_offset' testing commit 919d527956daa3e7ad03a23ba661beb8a46cacf4 compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 81ede8d88315769e7f87039d32ab82a9708f84d2e60fd098bd6f98426924b409 run #0: basic kernel testing failed: possible deadlock in fs_reclaim_acquire run #1: basic kernel testing failed: possible deadlock in fs_reclaim_acquire run #2: crashed: KASAN: use-after-free Read in consume_skb run #3: crashed: KASAN: use-after-free Read in consume_skb run #4: crashed: KASAN: use-after-free Read in consume_skb run #5: crashed: KASAN: use-after-free Read in consume_skb run #6: crashed: KASAN: use-after-free Read in consume_skb run #7: crashed: KASAN: use-after-free Read in consume_skb run #8: crashed: KASAN: use-after-free Read in consume_skb run #9: crashed: KASAN: use-after-free Read in consume_skb # git bisect bad 919d527956daa3e7ad03a23ba661beb8a46cacf4 Bisecting: 9 revisions left to test after this (roughly 3 steps) [5ea905dd432205bfa314efb1b5353889e1804f11] selftests/bpf: Add a test case for unix sockmap testing commit 5ea905dd432205bfa314efb1b5353889e1804f11 compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 6069bce573096f19281133084b70e1835eede72a92061f1d6f3934a2a37f83de run #0: basic kernel testing failed: possible deadlock in fs_reclaim_acquire run #1: crashed: KASAN: use-after-free Read in consume_skb run #2: crashed: KASAN: use-after-free Read in consume_skb run #3: crashed: KASAN: use-after-free Read in consume_skb run #4: crashed: KASAN: use-after-free Read in consume_skb run #5: crashed: KASAN: use-after-free Read in consume_skb run #6: crashed: KASAN: use-after-free Read in consume_skb run #7: crashed: KASAN: use-after-free Read in consume_skb run #8: crashed: KASAN: use-after-free Read in consume_skb run #9: crashed: KASAN: use-after-free Read in consume_skb # git bisect bad 5ea905dd432205bfa314efb1b5353889e1804f11 Bisecting: 4 revisions left to test after this (roughly 2 steps) [c7272e15f0f18d6e0f423b53207eac7a27ed5a49] af_unix: Add a dummy ->close() for sockmap testing commit c7272e15f0f18d6e0f423b53207eac7a27ed5a49 compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: eead61f171ac58c8d5021d7f0fed58d0d6619eff931c14e34f3c1ed2e66fe2fb all runs: OK # git bisect good c7272e15f0f18d6e0f423b53207eac7a27ed5a49 Bisecting: 2 revisions left to test after this (roughly 1 step) [9825d866ce0d11009513e06824885340062c166b] af_unix: Implement unix_dgram_bpf_recvmsg() testing commit 9825d866ce0d11009513e06824885340062c166b compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 6069bce573096f19281133084b70e1835eede72a92061f1d6f3934a2a37f83de run #0: basic kernel testing failed: possible deadlock in fs_reclaim_acquire run #1: crashed: KASAN: use-after-free Read in consume_skb run #2: crashed: KASAN: use-after-free Read in consume_skb run #3: crashed: KASAN: use-after-free Read in consume_skb run #4: crashed: KASAN: use-after-free Read in consume_skb run #5: crashed: KASAN: use-after-free Read in consume_skb run #6: crashed: KASAN: use-after-free Read in consume_skb run #7: crashed: KASAN: use-after-free Read in consume_skb run #8: crashed: KASAN: use-after-free Read in consume_skb run #9: crashed: KASAN: use-after-free Read in consume_skb # git bisect bad 9825d866ce0d11009513e06824885340062c166b Bisecting: 0 revisions left to test after this (roughly 0 steps) [c63829182c37c2d6d0608976d15fa61ebebe9e6b] af_unix: Implement ->psock_update_sk_prot() testing commit c63829182c37c2d6d0608976d15fa61ebebe9e6b compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 28fd56fc128e528ffdd71d53de08fb2e81ff7d84093f91f860677c6dd948634f run #0: basic kernel testing failed: possible deadlock in fs_reclaim_acquire run #1: crashed: KASAN: use-after-free Read in consume_skb run #2: crashed: KASAN: use-after-free Read in consume_skb run #3: crashed: KASAN: use-after-free Read in consume_skb run #4: crashed: KASAN: use-after-free Read in consume_skb run #5: crashed: KASAN: use-after-free Read in consume_skb run #6: crashed: KASAN: use-after-free Read in consume_skb run #7: crashed: KASAN: use-after-free Read in consume_skb run #8: crashed: KASAN: use-after-free Read in consume_skb run #9: crashed: KASAN: use-after-free Read in consume_skb # git bisect bad c63829182c37c2d6d0608976d15fa61ebebe9e6b c63829182c37c2d6d0608976d15fa61ebebe9e6b is the first bad commit commit c63829182c37c2d6d0608976d15fa61ebebe9e6b Author: Cong Wang Date: Sun Jul 4 12:02:47 2021 -0700 af_unix: Implement ->psock_update_sk_prot() Now we can implement unix_bpf_update_proto() to update sk_prot, especially prot->close(). Signed-off-by: Cong Wang Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20210704190252.11866-7-xiyou.wangcong@gmail.com MAINTAINERS | 1 + include/net/af_unix.h | 10 ++++++++++ net/core/sock_map.c | 1 + net/unix/Makefile | 1 + net/unix/af_unix.c | 6 +++++- net/unix/unix_bpf.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 net/unix/unix_bpf.c culprit signature: 28fd56fc128e528ffdd71d53de08fb2e81ff7d84093f91f860677c6dd948634f parent signature: eead61f171ac58c8d5021d7f0fed58d0d6619eff931c14e34f3c1ed2e66fe2fb revisions tested: 13, total time: 2h46m5.505118599s (build: 1h29m21.257515531s, test: 1h15m9.440518883s) first bad commit: c63829182c37c2d6d0608976d15fa61ebebe9e6b af_unix: Implement ->psock_update_sk_prot() recipients (to): ["ast@kernel.org" "bpf@vger.kernel.org" "cong.wang@bytedance.com" "daniel@iogearbox.net" "davem@davemloft.net" "jakub@cloudflare.com" "john.fastabend@gmail.com" "kuba@kernel.org" "lmb@cloudflare.com" "netdev@vger.kernel.org"] recipients (cc): ["andrii@kernel.org" "ast@kernel.org" "kafai@fb.com" "kpsingh@kernel.org" "linux-kernel@vger.kernel.org" "songliubraving@fb.com" "viro@zeniv.linux.org.uk" "yhs@fb.com"] crash: KASAN: use-after-free Read in consume_skb ================================================================== BUG: KASAN: use-after-free in instrument_atomic_read include/linux/instrumented.h:71 [inline] BUG: KASAN: use-after-free in atomic_read include/asm-generic/atomic-instrumented.h:27 [inline] BUG: KASAN: use-after-free in refcount_read include/linux/refcount.h:147 [inline] BUG: KASAN: use-after-free in skb_unref include/linux/skbuff.h:1062 [inline] BUG: KASAN: use-after-free in consume_skb+0x23/0xf0 net/core/skbuff.c:896 Read of size 4 at addr ffff8880265a9354 by task syz-executor.3/10267 CPU: 0 PID: 10267 Comm: syz-executor.3 Not tainted 5.13.0-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:79 [inline] dump_stack_lvl+0x57/0x7d lib/dump_stack.c:96 print_address_description.constprop.0.cold+0x6c/0x309 mm/kasan/report.c:233 __kasan_report mm/kasan/report.c:419 [inline] kasan_report.cold+0x83/0xdf mm/kasan/report.c:436 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/asm-generic/atomic-instrumented.h:27 [inline] refcount_read include/linux/refcount.h:147 [inline] skb_unref include/linux/skbuff.h:1062 [inline] consume_skb+0x23/0xf0 net/core/skbuff.c:896 __sk_msg_free+0x1db/0x350 net/core/skmsg.c:196 sk_msg_free net/core/skmsg.c:209 [inline] __sk_psock_purge_ingress_msg net/core/skmsg.c:706 [inline] __sk_psock_zap_ingress net/core/skmsg.c:719 [inline] sk_psock_stop+0x398/0x5c0 net/core/skmsg.c:737 sock_map_close+0x27a/0x510 net/core/sock_map.c:1515 unix_release+0x6c/0xd0 net/unix/af_unix.c:882 __sock_release+0xbb/0x270 net/socket.c:647 sock_close+0xf/0x20 net/socket.c:1293 __fput+0x209/0x870 fs/file_table.c:280 task_work_run+0xc0/0x160 kernel/task_work.c:164 tracehook_notify_resume include/linux/tracehook.h:189 [inline] exit_to_user_mode_loop kernel/entry/common.c:175 [inline] exit_to_user_mode_prepare+0x27e/0x290 kernel/entry/common.c:209 __syscall_exit_to_user_mode_work kernel/entry/common.c:291 [inline] syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:302 do_syscall_64+0x42/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7f7f3106b51b Code: 0f 05 48 3d 00 f0 ff ff 77 45 c3 0f 1f 40 00 48 83 ec 18 89 7c 24 0c e8 63 fc ff ff 8b 7c 24 0c 41 89 c0 b8 03 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 35 44 89 c7 89 44 24 0c e8 a1 fc ff ff 8b 44 RSP: 002b:00007ffd82a26990 EFLAGS: 00000293 ORIG_RAX: 0000000000000003 RAX: 0000000000000000 RBX: 0000000000000006 RCX: 00007f7f3106b51b RDX: 0000001b2bf200f8 RSI: 0000000000000000 RDI: 0000000000000005 RBP: 0000000000000001 R08: 0000000000000000 R09: 0000001b2bf200fc R10: 00007ffd82b0f090 R11: 0000000000000293 R12: 00007f7f311bdb60 R13: 00007f7f311bdb60 R14: 00007f7f311bcf60 R15: 000000000000fe68 Allocated by task 10273: 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+0x84/0xa0 mm/kasan/common.c:467 kasan_slab_alloc include/linux/kasan.h:253 [inline] slab_post_alloc_hook mm/slab.h:512 [inline] slab_alloc_node mm/slub.c:2970 [inline] slab_alloc mm/slub.c:2978 [inline] kmem_cache_alloc+0x29b/0x4a0 mm/slub.c:2983 skb_clone+0x125/0x300 net/core/skbuff.c:1504 sk_psock_verdict_recv+0x6d/0x680 net/core/skmsg.c:1097 unix_read_sock+0xc4/0x1e0 net/unix/af_unix.c:2224 sk_psock_verdict_data_ready+0xf8/0x150 net/core/skmsg.c:1140 unix_dgram_sendmsg+0xca7/0x1660 net/unix/af_unix.c:1822 sock_sendmsg_nosec net/socket.c:702 [inline] sock_sendmsg+0xab/0xe0 net/socket.c:722 ____sys_sendmsg+0x392/0x7a0 net/socket.c:2385 ___sys_sendmsg+0xd3/0x150 net/socket.c:2439 __sys_sendmmsg+0x141/0x310 net/socket.c:2525 __do_sys_sendmmsg net/socket.c:2554 [inline] __se_sys_sendmmsg net/socket.c:2551 [inline] __x64_sys_sendmmsg+0x94/0x100 net/socket.c:2551 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 3188: 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+0xfb/0x130 mm/kasan/common.c:374 kasan_slab_free include/linux/kasan.h:229 [inline] slab_free_hook mm/slub.c:1639 [inline] slab_free_freelist_hook+0xdf/0x240 mm/slub.c:1664 slab_free mm/slub.c:3224 [inline] kmem_cache_free+0x8e/0x5a0 mm/slub.c:3240 sock_drop net/core/skmsg.c:584 [inline] sk_psock_backlog+0x7d4/0xa40 net/core/skmsg.c:626 process_one_work+0x84c/0x13e0 kernel/workqueue.c:2276 worker_thread+0x598/0x1040 kernel/workqueue.c:2422 kthread+0x38b/0x460 kernel/kthread.c:319 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 The buggy address belongs to the object at ffff8880265a9280 which belongs to the cache skbuff_head_cache of size 224 The buggy address is located 212 bytes inside of 224-byte region [ffff8880265a9280, ffff8880265a9360) The buggy address belongs to the page: page:ffffea0000996a40 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x265a9 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea0000cdfec0 0000000b0000000b ffff888014de0000 raw: 0000000000000000 00000000000c000c 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x12cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY), pid 8839, ts 56051401833, free_ts 15667185239 prep_new_page mm/page_alloc.c:2445 [inline] get_page_from_freelist+0xa6f/0x2f50 mm/page_alloc.c:4178 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5386 alloc_slab_page mm/slub.c:1702 [inline] allocate_slab+0x32b/0x4c0 mm/slub.c:1842 new_slab mm/slub.c:1905 [inline] new_slab_objects mm/slub.c:2651 [inline] ___slab_alloc+0x4ba/0x820 mm/slub.c:2814 __slab_alloc.constprop.0+0xa7/0xf0 mm/slub.c:2854 slab_alloc_node mm/slub.c:2936 [inline] kmem_cache_alloc_node+0x12c/0x3e0 mm/slub.c:3006 __alloc_skb+0x153/0x280 net/core/skbuff.c:414 alloc_skb include/linux/skbuff.h:1112 [inline] alloc_uevent_skb+0x76/0x200 lib/kobject_uevent.c:290 uevent_net_broadcast_tagged lib/kobject_uevent.c:351 [inline] kobject_uevent_net_broadcast lib/kobject_uevent.c:412 [inline] kobject_uevent_env+0xe9f/0x1290 lib/kobject_uevent.c:593 rx_queue_add_kobject net/core/net-sysfs.c:1020 [inline] net_rx_queue_update_kobjects+0xb1/0x3e0 net/core/net-sysfs.c:1060 register_queue_kobjects net/core/net-sysfs.c:1711 [inline] netdev_register_kobject+0x241/0x3c0 net/core/net-sysfs.c:1959 register_netdevice+0xa91/0x1240 net/core/dev.c:10318 register_netdev+0x17/0x30 net/core/dev.c:10442 ip6_tnl_init_net+0x3f2/0x690 net/ipv6/ip6_tunnel.c:2287 ops_init+0x91/0x3c0 net/core/net_namespace.c:140 setup_net+0x3c6/0x920 net/core/net_namespace.c:333 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1355 [inline] free_pcp_prepare+0x2c5/0x780 mm/page_alloc.c:1406 free_unref_page_prepare mm/page_alloc.c:3341 [inline] free_unref_page+0x19/0x690 mm/page_alloc.c:3420 mm_free_pgd kernel/fork.c:636 [inline] __mmdrop+0xb9/0x350 kernel/fork.c:687 free_bprm+0x5b/0x290 fs/exec.c:1482 kernel_execve+0x2cc/0x3e0 fs/exec.c:1979 call_usermodehelper_exec_async+0x2c1/0x500 kernel/umh.c:112 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Memory state around the buggy address: ffff8880265a9200: fb fb fb fb fc fc fc fc fc fc fc fc fc fc fc fc ffff8880265a9280: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880265a9300: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ^ ffff8880265a9380: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb ffff8880265a9400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================