netlink: 4 bytes leftover after parsing attributes in process `syz-executor.2'. ================================================================== BUG: KASAN: slab-out-of-bounds in ipt_init_target+0x206/0x240 net/sched/act_ipt.c:46 Read of size 1 at addr ffff88809495d0df by task syz-executor.2/27344 CPU: 1 PID: 27344 Comm: syz-executor.2 Not tainted 4.14.176-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:0x45c889 RSP: 002b:00007ff8a0846c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000113 RAX: ffffffffffffffda RBX: 00007ff8a08476d4 RCX: 000000000045c889 RDX: 0000000000000008 RSI: 0000000000000000 RDI: 0000000000000003 RBP: 000000000076bfa0 R08: 000000000004ffe0 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff R13: 0000000000000ba4 R14: 00000000004ce6f2 R15: 000000000076bfac Allocated by task 27344: 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 SYSC_readlinkat fs/stat.c:394 [inline] SyS_readlinkat+0xa6/0x260 fs/stat.c:382 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 ffff88809495d0c0 which belongs to the cache kmalloc-32 of size 32 The buggy address is located 31 bytes inside of 32-byte region [ffff88809495d0c0, ffff88809495d0e0) The buggy address belongs to the page: page:ffffea0002525740 count:1 mapcount:0 mapping:ffff88809495d000 index:0xffff88809495dfc1 flags: 0xfffe0000000100(slab) raw: 00fffe0000000100 ffff88809495d000 ffff88809495dfc1 000000010000003f raw: ffffea00024ce7a0 ffffea00025ab160 ffff88812fe561c0 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88809495cf80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88809495d000: fb fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc >ffff88809495d080: fb fb fb fb fc fc fc fc 01 fc fc fc fc fc fc fc ^ ffff88809495d100: fb fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc ffff88809495d180: fb fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc ==================================================================