================================================================== BUG: KASAN: slab-out-of-bounds in fib6_info_nh_dev include/net/nexthop.h:536 [inline] BUG: KASAN: slab-out-of-bounds in nft_fib6_info_nh_uses_dev net/ipv6/netfilter/nft_fib_ipv6.c:174 [inline] BUG: KASAN: slab-out-of-bounds in nft_fib6_eval+0x1673/0x17e0 net/ipv6/netfilter/nft_fib_ipv6.c:231 Read of size 8 at addr ffff88803f4b12d0 by task syz.2.1268/10672 CPU: 0 UID: 0 PID: 10672 Comm: syz.2.1268 Tainted: G L syzkaller #0 PREEMPT(full) Tainted: [L]=SOFTLOCKUP Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x100/0x190 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0x13d/0x4b0 mm/kasan/report.c:482 kasan_report+0xdf/0x1d0 mm/kasan/report.c:595 fib6_info_nh_dev include/net/nexthop.h:536 [inline] nft_fib6_info_nh_uses_dev net/ipv6/netfilter/nft_fib_ipv6.c:174 [inline] nft_fib6_eval+0x1673/0x17e0 net/ipv6/netfilter/nft_fib_ipv6.c:231 nft_fib_inet_eval+0x200/0x250 net/netfilter/nft_fib_inet.c:34 expr_call_ops_eval net/netfilter/nf_tables_core.c:237 [inline] nft_do_chain+0x2e5/0x1990 net/netfilter/nf_tables_core.c:285 nft_do_chain_inet+0xf3/0x400 net/netfilter/nft_chain_filter.c:162 nf_hook_entry_hookfn include/linux/netfilter.h:158 [inline] nf_hook_slow+0xbf/0x220 net/netfilter/core.c:619 nf_hook.constprop.0+0x2a6/0x750 include/linux/netfilter.h:273 NF_HOOK include/linux/netfilter.h:316 [inline] ipv6_rcv+0xa4/0x3d0 net/ipv6/ip6_input.c:351 __netif_receive_skb_one_core+0x12d/0x1e0 net/core/dev.c:6202 __netif_receive_skb+0x1f/0x120 net/core/dev.c:6315 netif_receive_skb_internal net/core/dev.c:6401 [inline] netif_receive_skb+0x13b/0x7f0 net/core/dev.c:6460 tun_rx_batched.isra.0+0x3f6/0x750 drivers/net/tun.c:1511 tun_get_user+0x1e31/0x3c20 drivers/net/tun.c:1955 tun_chr_write_iter+0xdc/0x200 drivers/net/tun.c:2001 new_sync_write fs/read_write.c:595 [inline] vfs_write+0x6ac/0x1070 fs/read_write.c:688 ksys_write+0x12a/0x250 fs/read_write.c:740 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x10b/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f86bb95d68e Code: 08 0f 85 a5 a8 ff ff 49 89 fb 48 89 f0 48 89 d7 48 89 ce 4c 89 c2 4d 89 ca 4c 8b 44 24 08 4c 8b 4c 24 10 4c 89 5c 24 08 0f 05 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 80 00 00 00 00 48 83 ec 08 RSP: 002b:00007f86b9bf5fb8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007f86b9bf66c0 RCX: 00007f86bb95d68e RDX: 0000000000000086 RSI: 0000200000000600 RDI: 00000000000000c8 RBP: 00007f86bba32d6f R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f86bbc16038 R14: 00007f86bbc15fa0 R15: 00007ffda61ded38 Allocated by task 7920: kasan_save_stack+0x30/0x50 mm/kasan/common.c:57 kasan_save_track+0x14/0x30 mm/kasan/common.c:78 poison_kmalloc_redzone mm/kasan/common.c:398 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:415 kmalloc_noprof include/linux/slab.h:950 [inline] kzalloc_noprof include/linux/slab.h:1188 [inline] nexthop_alloc+0x3c/0x1f0 net/ipv4/nexthop.c:536 nexthop_create net/ipv4/nexthop.c:2918 [inline] nexthop_add net/ipv4/nexthop.c:2985 [inline] rtm_new_nexthop+0x1e8b/0x8760 net/ipv4/nexthop.c:3299 rtnetlink_rcv_msg+0x95e/0xe90 net/core/rtnetlink.c:6996 netlink_rcv_skb+0x159/0x420 net/netlink/af_netlink.c:2550 netlink_unicast_kernel net/netlink/af_netlink.c:1318 [inline] netlink_unicast+0x585/0x850 net/netlink/af_netlink.c:1344 netlink_sendmsg+0x8b0/0xda0 net/netlink/af_netlink.c:1894 sock_sendmsg_nosec net/socket.c:787 [inline] __sock_sendmsg net/socket.c:802 [inline] ____sys_sendmsg+0x9e1/0xb70 net/socket.c:2698 ___sys_sendmsg+0x190/0x1e0 net/socket.c:2752 __sys_sendmsg+0x170/0x220 net/socket.c:2784 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x10b/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff88803f4b1200 which belongs to the cache kmalloc-256 of size 256 The buggy address is located 8 bytes to the right of allocated 200-byte region [ffff88803f4b1200, ffff88803f4b12c8) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x3f4b0 head: order:1 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000040 ffff88801b842b40 dead000000000100 dead000000000122 raw: 0000000000000000 0000000800100010 00000000f5000000 0000000000000000 head: 00fff00000000040 ffff88801b842b40 dead000000000100 dead000000000122 head: 0000000000000000 0000000800100010 00000000f5000000 0000000000000000 head: 00fff00000000001 ffffffffffffff81 00000000ffffffff 00000000ffffffff head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000002 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 5738, tgid 5738 (syz-executor), ts 63856485410, free_ts 63593545241 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x153/0x170 mm/page_alloc.c:1858 prep_new_page mm/page_alloc.c:1866 [inline] get_page_from_freelist+0x11a6/0x33b0 mm/page_alloc.c:3946 __alloc_frozen_pages_noprof+0x27c/0x2bc0 mm/page_alloc.c:5226 alloc_slab_page mm/slub.c:3278 [inline] allocate_slab mm/slub.c:3467 [inline] new_slab+0xa6/0x6c0 mm/slub.c:3525 refill_objects+0x277/0x420 mm/slub.c:7271 refill_sheaf mm/slub.c:2816 [inline] __pcs_replace_empty_main+0x375/0x650 mm/slub.c:4651 alloc_from_pcs mm/slub.c:4749 [inline] slab_alloc_node mm/slub.c:4883 [inline] __do_kmalloc_node mm/slub.c:5294 [inline] __kmalloc_noprof+0x688/0x850 mm/slub.c:5307 kmalloc_noprof include/linux/slab.h:954 [inline] kzalloc_noprof include/linux/slab.h:1188 [inline] fib_create_info+0x5bf/0x4640 net/ipv4/fib_semantics.c:1400 fib_table_insert+0x169/0x1c70 net/ipv4/fib_trie.c:1212 fib_magic+0x4d4/0x5c0 net/ipv4/fib_frontend.c:1134 fib_add_ifaddr+0x16d/0x560 net/ipv4/fib_frontend.c:1156 fib_inetaddr_event+0x147/0x270 net/ipv4/fib_frontend.c:1470 notifier_call_chain+0x99/0x400 kernel/notifier.c:85 blocking_notifier_call_chain kernel/notifier.c:380 [inline] blocking_notifier_call_chain+0x69/0xa0 kernel/notifier.c:368 __inet_insert_ifa+0x91d/0xc70 net/ipv4/devinet.c:566 inet_rtm_newaddr+0xea1/0x18b0 net/ipv4/devinet.c:1001 page last free pid 5733 tgid 5733 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] __free_pages_prepare mm/page_alloc.c:1402 [inline] __free_frozen_pages+0x747/0x1040 mm/page_alloc.c:2943 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x47/0xf0 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x1a0/0x1f0 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:350 kasan_slab_alloc include/linux/kasan.h:253 [inline] slab_post_alloc_hook mm/slub.c:4569 [inline] slab_alloc_node mm/slub.c:4898 [inline] __do_kmalloc_node mm/slub.c:5294 [inline] __kmalloc_node_track_caller_noprof+0x2ba/0x850 mm/slub.c:5407 __kmemdup_nul mm/util.c:64 [inline] kstrdup+0x51/0xe0 mm/util.c:84 kstrdup_const+0x63/0x80 mm/util.c:104 __kernfs_new_node+0x9b/0x9f0 fs/kernfs/dir.c:660 kernfs_new_node+0x11b/0x1a0 fs/kernfs/dir.c:748 kernfs_create_link+0xcc/0x240 fs/kernfs/symlink.c:39 sysfs_do_create_link_sd+0x90/0x140 fs/sysfs/symlink.c:44 sysfs_do_create_link fs/sysfs/symlink.c:80 [inline] sysfs_create_link+0x61/0xc0 fs/sysfs/symlink.c:92 driver_sysfs_add+0x91/0x2d0 drivers/base/dd.c:490 really_probe+0x146/0xa60 drivers/base/dd.c:697 __driver_probe_device+0x22e/0x480 drivers/base/dd.c:871 driver_probe_device+0x4c/0x1b0 drivers/base/dd.c:901 Memory state around the buggy address: ffff88803f4b1180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88803f4b1200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88803f4b1280: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc ^ ffff88803f4b1300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88803f4b1380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================