netlink: 4 bytes leftover after parsing attributes in process `syz-executor.4'. ================================================================== BUG: KASAN: slab-out-of-bounds in ipt_init_target+0x206/0x240 net/sched/act_ipt.c:46 Read of size 1 at addr ffff888093d6345f by task syz-executor.4/26030 CPU: 1 PID: 26030 Comm: syz-executor.4 Not tainted 4.14.177-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_xt_init+0x43/0x50 net/sched/act_ipt.c:210 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 sock_no_sendpage+0xe5/0x110 net/core/sock.c:2572 kernel_sendpage+0x82/0xd0 net/socket.c:3407 sock_sendpage+0x84/0xa0 net/socket.c:871 pipe_to_sendpage+0x226/0x2d0 fs/splice.c:451 splice_from_pipe_feed fs/splice.c:502 [inline] __splice_from_pipe+0x332/0x740 fs/splice.c:626 splice_from_pipe+0xc6/0x120 fs/splice.c:661 do_splice_from fs/splice.c:851 [inline] do_splice fs/splice.c:1147 [inline] SYSC_splice fs/splice.c:1402 [inline] SyS_splice+0xca0/0x1230 fs/splice.c:1382 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x42/0xb7 RIP: 0033:0x45c829 RSP: 002b:00007fd1e42ddc78 EFLAGS: 00000246 ORIG_RAX: 0000000000000113 RAX: ffffffffffffffda RBX: 00000000005073c0 RCX: 000000000045c829 RDX: 0000000000000005 RSI: 0000000000000000 RDI: 0000000000000003 RBP: 000000000078bfa0 R08: 000000000004ffe0 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff R13: 0000000000000ba4 R14: 00000000004ce710 R15: 00007fd1e42de6d4 Allocated by task 26030: 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_xt_init+0x43/0x50 net/sched/act_ipt.c:210 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 sock_no_sendpage+0xe5/0x110 net/core/sock.c:2572 kernel_sendpage+0x82/0xd0 net/socket.c:3407 sock_sendpage+0x84/0xa0 net/socket.c:871 pipe_to_sendpage+0x226/0x2d0 fs/splice.c:451 splice_from_pipe_feed fs/splice.c:502 [inline] __splice_from_pipe+0x332/0x740 fs/splice.c:626 splice_from_pipe+0xc6/0x120 fs/splice.c:661 do_splice_from fs/splice.c:851 [inline] do_splice fs/splice.c:1147 [inline] SYSC_splice fs/splice.c:1402 [inline] SyS_splice+0xca0/0x1230 fs/splice.c:1382 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x42/0xb7 Freed by task 3640: 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 security_context_to_sid_core+0x284/0x3d0 security/selinux/ss/services.c:1460 selinux_inode_setsecurity+0x155/0x350 security/selinux/hooks.c:3377 selinux_inode_notifysecctx+0x2b/0x50 security/selinux/hooks.c:6132 security_inode_notifysecctx+0x76/0xb0 security/security.c:1314 kernfs_refresh_inode+0x328/0x4b0 fs/kernfs/inode.c:195 kernfs_iop_permission+0x59/0x90 fs/kernfs/inode.c:302 do_inode_permission fs/namei.c:384 [inline] __inode_permission+0x1f3/0x300 fs/namei.c:426 inode_permission+0x23/0x100 fs/namei.c:476 may_lookup fs/namei.c:1717 [inline] link_path_walk+0x75d/0xed0 fs/namei.c:2097 path_lookupat.isra.0+0xcb/0x7b0 fs/namei.c:2342 filename_lookup+0x18e/0x380 fs/namei.c:2377 user_path_at include/linux/namei.h:57 [inline] vfs_statx+0xd1/0x160 fs/stat.c:185 vfs_lstat include/linux/fs.h:3066 [inline] SYSC_newlstat+0x83/0xe0 fs/stat.c:350 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 ffff888093d63440 which belongs to the cache kmalloc-32 of size 32 The buggy address is located 31 bytes inside of 32-byte region [ffff888093d63440, ffff888093d63460) The buggy address belongs to the page: page:ffffea00024f58c0 count:1 mapcount:0 mapping:ffff888093d63000 index:0xffff888093d63fc1 flags: 0xfffe0000000100(slab) raw: 00fffe0000000100 ffff888093d63000 ffff888093d63fc1 0000000100000032 raw: ffffea000231d060 ffffea00028d2b20 ffff88812fe541c0 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888093d63300: fb fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc ffff888093d63380: fb fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc >ffff888093d63400: 00 00 01 fc fc fc fc fc 00 00 01 fc fc fc fc fc ^ ffff888093d63480: fb fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc ffff888093d63500: 00 00 01 fc fc fc fc fc fb fb fb fb fc fc fc fc ==================================================================