================================================================== BUG: KASAN: slab-out-of-bounds in ipt_init_target+0x206/0x240 net/sched/act_ipt.c:46 Read of size 1 at addr ffff8880a992561f by task syz-executor.0/24958 CPU: 0 PID: 24958 Comm: syz-executor.0 Not tainted 4.14.173-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0x13e/0x194 lib/dump_stack.c:58 print_address_description.cold+0x7c/0x1e2 mm/kasan/report.c:252 kasan_report_error mm/kasan/report.c:351 [inline] kasan_report mm/kasan/report.c:409 [inline] kasan_report.cold+0xa9/0x2ae mm/kasan/report.c:393 ipt_init_target+0x206/0x240 net/sched/act_ipt.c:46 __tcf_ipt_init+0x455/0xaf0 net/sched/act_ipt.c:168 tcf_ipt_init+0x43/0x50 net/sched/act_ipt.c:202 tcf_action_init_1+0x51a/0x9f0 net/sched/act_api.c:682 tcf_action_init+0x26d/0x400 net/sched/act_api.c:751 tcf_action_add net/sched/act_api.c:1079 [inline] tc_ctl_action+0x2e3/0x513 net/sched/act_api.c:1131 rtnetlink_rcv_msg+0x3be/0xb10 net/core/rtnetlink.c:4315 netlink_rcv_skb+0x127/0x370 net/netlink/af_netlink.c:2433 netlink_unicast_kernel net/netlink/af_netlink.c:1287 [inline] netlink_unicast+0x437/0x620 net/netlink/af_netlink.c:1313 netlink_sendmsg+0x733/0xbe0 net/netlink/af_netlink.c:1878 sock_sendmsg_nosec net/socket.c:646 [inline] sock_sendmsg+0xc5/0x100 net/socket.c:656 ___sys_sendmsg+0x70a/0x840 net/socket.c:2062 __sys_sendmsg+0xa3/0x120 net/socket.c:2096 SYSC_sendmsg net/socket.c:2107 [inline] SyS_sendmsg+0x27/0x40 net/socket.c:2103 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x42/0xb7 RIP: 0033:0x45c849 RSP: 002b:00007f224e646c78 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007f224e6476d4 RCX: 000000000045c849 RDX: 00000000040000a0 RSI: 0000000020000080 RDI: 0000000000000003 RBP: 000000000076bf00 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff R13: 00000000000009fa R14: 00000000004ccb28 R15: 000000000076bf0c Allocated by task 24958: save_stack+0x32/0xa0 mm/kasan/kasan.c:447 set_track mm/kasan/kasan.c:459 [inline] kasan_kmalloc mm/kasan/kasan.c:551 [inline] kasan_kmalloc+0xbf/0xe0 mm/kasan/kasan.c:529 __do_kmalloc mm/slab.c:3720 [inline] __kmalloc_track_caller+0x153/0x7b0 mm/slab.c:3735 kmemdup+0x23/0x50 mm/util.c:118 kmemdup include/linux/string.h:420 [inline] __tcf_ipt_init+0x431/0xaf0 net/sched/act_ipt.c:164 tcf_ipt_init+0x43/0x50 net/sched/act_ipt.c:202 tcf_action_init_1+0x51a/0x9f0 net/sched/act_api.c:682 tcf_action_init+0x26d/0x400 net/sched/act_api.c:751 tcf_action_add net/sched/act_api.c:1079 [inline] tc_ctl_action+0x2e3/0x513 net/sched/act_api.c:1131 rtnetlink_rcv_msg+0x3be/0xb10 net/core/rtnetlink.c:4315 netlink_rcv_skb+0x127/0x370 net/netlink/af_netlink.c:2433 netlink_unicast_kernel net/netlink/af_netlink.c:1287 [inline] netlink_unicast+0x437/0x620 net/netlink/af_netlink.c:1313 netlink_sendmsg+0x733/0xbe0 net/netlink/af_netlink.c:1878 sock_sendmsg_nosec net/socket.c:646 [inline] sock_sendmsg+0xc5/0x100 net/socket.c:656 ___sys_sendmsg+0x70a/0x840 net/socket.c:2062 __sys_sendmsg+0xa3/0x120 net/socket.c:2096 SYSC_sendmsg net/socket.c:2107 [inline] SyS_sendmsg+0x27/0x40 net/socket.c:2103 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x42/0xb7 Freed by task 7450: save_stack+0x32/0xa0 mm/kasan/kasan.c:447 set_track mm/kasan/kasan.c:459 [inline] kasan_slab_free+0x75/0xc0 mm/kasan/kasan.c:524 __cache_free mm/slab.c:3496 [inline] kfree+0xcb/0x260 mm/slab.c:3815 kvfree+0x45/0x50 mm/util.c:416 xt_free_table_info+0xfe/0x170 net/netfilter/x_tables.c:1079 __do_replace+0x3f6/0x580 net/ipv6/netfilter/ip6_tables.c:1107 do_replace net/ipv6/netfilter/ip6_tables.c:1161 [inline] do_ip6t_set_ctl+0x255/0x3a3 net/ipv6/netfilter/ip6_tables.c:1685 nf_sockopt net/netfilter/nf_sockopt.c:106 [inline] nf_setsockopt+0x5f/0xb0 net/netfilter/nf_sockopt.c:115 ipv6_setsockopt net/ipv6/ipv6_sockglue.c:930 [inline] ipv6_setsockopt+0xfd/0x130 net/ipv6/ipv6_sockglue.c:914 tcp_setsockopt net/ipv4/tcp.c:2826 [inline] tcp_setsockopt+0x7b/0xc0 net/ipv4/tcp.c:2820 SYSC_setsockopt net/socket.c:1865 [inline] SyS_setsockopt+0x110/0x1e0 net/socket.c:1844 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x42/0xb7 The buggy address belongs to the object at ffff8880a9925600 which belongs to the cache kmalloc-32 of size 32 The buggy address is located 31 bytes inside of 32-byte region [ffff8880a9925600, ffff8880a9925620) The buggy address belongs to the page: page:ffffea0002a64940 count:1 mapcount:0 mapping:ffff8880a9925000 index:0xffff8880a9925fc1 flags: 0xfffe0000000100(slab) raw: 00fffe0000000100 ffff8880a9925000 ffff8880a9925fc1 000000010000003d raw: ffffea0002950c20 ffffea000272ade0 ffff88812fe561c0 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880a9925500: 00 01 fc fc fc fc fc fc 00 00 01 fc fc fc fc fc ffff8880a9925580: 00 01 fc fc fc fc fc fc 00 01 fc fc fc fc fc fc >ffff8880a9925600: 02 fc fc fc fc fc fc fc 00 01 fc fc fc fc fc fc ^ ffff8880a9925680: 00 01 fc fc fc fc fc fc 00 01 fc fc fc fc fc fc ffff8880a9925700: 00 01 fc fc fc fc fc fc 00 01 fc fc fc fc fc fc ==================================================================