bisecting fixing commit since 5692097116094a4a7045abcc1dbc172dbdc5657e building syzkaller on 749688d22abef3f3cb9a0480e15c19a3f2ed8e13 testing commit 5692097116094a4a7045abcc1dbc172dbdc5657e with gcc (GCC) 8.1.0 kernel signature: 49c57398dd340f2ef8aab7f6751be5f1a0fcc33755dd63c3c5e9c30f386dd8cf all runs: crashed: KASAN: slab-out-of-bounds Read in xt_find_match testing current HEAD 258f0cf7ac3b788a14c0d01aab3c4aea02f8c86e testing commit 258f0cf7ac3b788a14c0d01aab3c4aea02f8c86e with gcc (GCC) 8.1.0 kernel signature: 4872f040822239cf0574fb7a157a89d934289f19a70b8d11141e77a600cf33c2 run #0: crashed: KASAN: slab-out-of-bounds Read in xt_find_match run #1: crashed: KASAN: slab-out-of-bounds Read in xt_find_match run #2: crashed: KASAN: slab-out-of-bounds Read in xt_find_match run #3: crashed: KASAN: slab-out-of-bounds Read in xt_find_match run #4: crashed: KASAN: slab-out-of-bounds Read in xt_find_match run #5: crashed: KASAN: slab-out-of-bounds Read in xt_find_match run #6: crashed: KASAN: use-after-free Read in xt_find_match run #7: crashed: KASAN: slab-out-of-bounds Read in xt_find_match run #8: crashed: KASAN: slab-out-of-bounds Read in xt_find_match run #9: crashed: KASAN: slab-out-of-bounds Read in xt_find_match revisions tested: 2, total time: 27m44.553930575s (build: 19m41.985607761s, test: 6m8.399240962s) the crash still happens on HEAD commit msg: Linux 4.19.123 crash: KASAN: slab-out-of-bounds Read in xt_find_match IPv6: ADDRCONF(NETDEV_CHANGE): batadv_slave_1: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): veth1_to_batadv: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): batadv_slave_1: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): veth1_to_batadv: link becomes ready ================================================================== BUG: KASAN: slab-out-of-bounds in __lock_acquire+0x3426/0x4980 kernel/locking/lockdep.c:3294 Read of size 8 at addr ffff8882161bfc30 by task syz-executor.5/7903 CPU: 1 PID: 7903 Comm: syz-executor.5 Not tainted 4.19.123-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x123/0x177 lib/dump_stack.c:118 print_address_description.cold.8+0x9/0x1ff mm/kasan/report.c:256 kasan_report_error mm/kasan/report.c:354 [inline] kasan_report.cold.9+0x242/0x309 mm/kasan/report.c:412 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:433 __lock_acquire+0x3426/0x4980 kernel/locking/lockdep.c:3294 lock_acquire+0x173/0x3d0 kernel/locking/lockdep.c:3907 __mutex_lock_common kernel/locking/mutex.c:925 [inline] __mutex_lock+0xf5/0x1210 kernel/locking/mutex.c:1072 mutex_lock_nested+0x16/0x20 kernel/locking/mutex.c:1087 xt_find_match+0x61/0x1b0 net/netfilter/x_tables.c:189 xt_request_find_match+0x4e/0xc0 net/netfilter/x_tables.c:219 get_xt_match net/sched/em_ipt.c:112 [inline] em_ipt_change+0x21c/0x590 net/sched/em_ipt.c:132 tcf_em_validate net/sched/ematch.c:248 [inline] tcf_em_tree_validate+0x96f/0x1383 net/sched/ematch.c:365 flow_change+0x370/0x2000 net/sched/cls_flow.c:439 tc_new_tfilter+0x613/0x1550 net/sched/cls_api.c:1320 rtnetlink_rcv_msg+0x34f/0x8f0 net/core/rtnetlink.c:4777 netlink_rcv_skb+0x142/0x390 net/netlink/af_netlink.c:2455 rtnetlink_rcv+0x10/0x20 net/core/rtnetlink.c:4795 netlink_unicast_kernel net/netlink/af_netlink.c:1318 [inline] netlink_unicast+0x443/0x650 net/netlink/af_netlink.c:1344 netlink_sendmsg+0x765/0xc40 net/netlink/af_netlink.c:1909 sock_sendmsg_nosec net/socket.c:622 [inline] sock_sendmsg+0xb5/0xf0 net/socket.c:632 ___sys_sendmsg+0x647/0x950 net/socket.c:2115 __sys_sendmsg+0xd9/0x180 net/socket.c:2153 __do_sys_sendmsg net/socket.c:2162 [inline] __se_sys_sendmsg net/socket.c:2160 [inline] __x64_sys_sendmsg+0x73/0xb0 net/socket.c:2160 do_syscall_64+0xd0/0x4e0 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x45c849 Code: ad b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 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 0f 83 7b b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f4e8dcffc78 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007f4e8dd006d4 RCX: 000000000045c849 RDX: 0000000000000000 RSI: 00000000200001c0 RDI: 0000000000000003 RBP: 000000000076bf00 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff R13: 00000000000009fa R14: 00000000004ccb28 R15: 000000000076bf0c Allocated by task 1: save_stack+0x43/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] kasan_kmalloc+0xc7/0xe0 mm/kasan/kasan.c:553 kmem_cache_alloc_trace+0x152/0x740 mm/slab.c:3625 kmalloc include/linux/slab.h:515 [inline] kmalloc_array include/linux/slab.h:636 [inline] kcalloc include/linux/slab.h:648 [inline] xt_init+0x124/0x27c net/netfilter/x_tables.c:1902 do_one_initcall+0xbc/0x518 init/main.c:883 do_initcall_level init/main.c:951 [inline] do_initcalls init/main.c:959 [inline] do_basic_setup init/main.c:977 [inline] kernel_init_freeable+0x461/0x505 init/main.c:1144 kernel_init+0xc/0x10c init/main.c:1061 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415 Freed by task 0: (stack is not available) The buggy address belongs to the object at ffff8882161bea00 which belongs to the cache kmalloc-4096 of size 4096 The buggy address is located 560 bytes to the right of 4096-byte region [ffff8882161bea00, ffff8882161bfa00) The buggy address belongs to the page: page:ffffea0008586f80 count:1 mapcount:0 mapping:ffff88812c29cdc0 index:0x0 compound_mapcount: 0 flags: 0x57ffe0000008100(slab|head) raw: 057ffe0000008100 ffffea0008586f08 ffffea0008588088 ffff88812c29cdc0 raw: 0000000000000000 ffff8882161bea00 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8882161bfb00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8882161bfb80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8882161bfc00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff8882161bfc80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8882161bfd00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================