================================================================== BUG: KASAN: use-after-free in cipso_v4_genopt+0x1078/0x1700 net/ipv4/cipso_ipv4.c:1784 Read of size 1 at addr ffff888017a44610 by task kworker/u5:0/2031 CPU: 1 PID: 2031 Comm: kworker/u5:0 Not tainted 5.12.0-rc1-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: xprtiod xs_udp_setup_socket Call Trace: __dump_stack lib/dump_stack.c:79 [inline] dump_stack+0x125/0x19e lib/dump_stack.c:120 print_address_description+0x5f/0x3a0 mm/kasan/report.c:232 __kasan_report mm/kasan/report.c:399 [inline] kasan_report+0x15e/0x210 mm/kasan/report.c:416 cipso_v4_genopt+0x1078/0x1700 net/ipv4/cipso_ipv4.c:1784 cipso_v4_sock_setattr+0x7c/0x460 net/ipv4/cipso_ipv4.c:1866 netlbl_sock_setattr+0x28e/0x2f0 net/netlabel/netlabel_kapi.c:995 smack_netlbl_add security/smack/smack_lsm.c:2404 [inline] smack_socket_post_create+0x13b/0x280 security/smack/smack_lsm.c:2774 security_socket_post_create+0x6f/0xd0 security/security.c:2122 __sock_create+0x62f/0x8c0 net/socket.c:1424 xs_create_sock+0x80/0x6c0 net/sunrpc/xprtsock.c:1778 xs_udp_setup_socket+0x5e/0x600 net/sunrpc/xprtsock.c:2044 process_one_work+0x789/0xfd0 kernel/workqueue.c:2275 worker_thread+0xac1/0x1300 kernel/workqueue.c:2421 kthread+0x39a/0x3c0 kernel/kthread.c:292 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:294 Allocated by task 19220: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:427 [inline] ____kasan_kmalloc+0xc2/0xf0 mm/kasan/common.c:506 kasan_kmalloc include/linux/kasan.h:233 [inline] __kmalloc_node+0x26a/0x410 mm/slub.c:4103 kmalloc_node include/linux/slab.h:577 [inline] kvmalloc_node+0x81/0xf0 mm/util.c:587 kvmalloc include/linux/mm.h:785 [inline] simple_xattr_alloc+0x3f/0xa0 fs/xattr.c:949 shmem_initxattrs+0x91/0x1e0 mm/shmem.c:3187 security_inode_init_security+0x236/0x300 security/security.c:1054 shmem_mknod+0xb0/0x1b0 mm/shmem.c:2867 lookup_open fs/namei.c:3219 [inline] open_last_lookups fs/namei.c:3289 [inline] path_openat+0x12e7/0x3860 fs/namei.c:3495 do_filp_open+0x191/0x3a0 fs/namei.c:3525 do_sys_openat2+0xba/0x380 fs/open.c:1187 do_sys_open fs/open.c:1203 [inline] __do_sys_open fs/open.c:1211 [inline] __se_sys_open fs/open.c:1207 [inline] __x64_sys_open+0x1af/0x1e0 fs/open.c:1207 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xae Freed by task 19220: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x3d/0x70 mm/kasan/common.c:46 kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:357 ____kasan_slab_free+0x100/0x140 mm/kasan/common.c:360 kasan_slab_free include/linux/kasan.h:199 [inline] slab_free_hook mm/slub.c:1562 [inline] slab_free_freelist_hook+0x13a/0x200 mm/slub.c:1600 slab_free mm/slub.c:3161 [inline] kfree+0xcf/0x2b0 mm/slub.c:4213 simple_xattrs_free include/linux/xattr.h:112 [inline] shmem_evict_inode+0x702/0x860 mm/shmem.c:1153 evict+0x2a4/0x620 fs/inode.c:578 __dentry_kill+0x43e/0x660 fs/dcache.c:580 dentry_kill fs/dcache.c:693 [inline] dput+0x45e/0x6f0 fs/dcache.c:886 do_renameat2+0x840/0x13b0 fs/namei.c:4709 __do_sys_rename fs/namei.c:4756 [inline] __se_sys_rename fs/namei.c:4754 [inline] __x64_sys_rename+0x82/0x90 fs/namei.c:4754 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xae Last potentially related work creation: kasan_save_stack+0x27/0x50 mm/kasan/common.c:38 kasan_record_aux_stack+0xee/0x120 mm/kasan/generic.c:345 kvfree_call_rcu+0x14c/0x680 kernel/rcu/tree.c:3577 sctp_bind_addr_clean net/sctp/bind_addr.c:125 [inline] sctp_bind_addr_free+0x14b/0x1a0 net/sctp/bind_addr.c:134 sctp_association_free+0x284/0x780 net/sctp/associola.c:358 sctp_cmd_delete_tcb net/sctp/sm_sideeffect.c:930 [inline] sctp_cmd_interpreter+0x4258/0x5a10 net/sctp/sm_sideeffect.c:1318 sctp_side_effects+0x6c/0x1f0 net/sctp/sm_sideeffect.c:1185 sctp_do_sm+0x197/0x490 net/sctp/sm_sideeffect.c:1156 sctp_primitive_SHUTDOWN+0x93/0xc0 net/sctp/primitive.c:89 sctp_close+0x37d/0x850 net/sctp/socket.c:1511 inet_release+0x16e/0x1f0 net/ipv4/af_inet.c:431 __sock_release net/socket.c:599 [inline] sock_close+0xd8/0x260 net/socket.c:1258 __fput+0x352/0x7b0 fs/file_table.c:280 task_work_run+0x146/0x1c0 kernel/task_work.c:140 tracehook_notify_resume include/linux/tracehook.h:189 [inline] exit_to_user_mode_loop kernel/entry/common.c:174 [inline] exit_to_user_mode_prepare+0x10b/0x1e0 kernel/entry/common.c:208 __syscall_exit_to_user_mode_work kernel/entry/common.c:290 [inline] syscall_exit_to_user_mode+0x48/0x180 kernel/entry/common.c:301 entry_SYSCALL_64_after_hwframe+0x44/0xae Second to last potentially related work creation: kasan_save_stack+0x27/0x50 mm/kasan/common.c:38 kasan_record_aux_stack+0xee/0x120 mm/kasan/generic.c:345 __call_rcu kernel/rcu/tree.c:3039 [inline] call_rcu+0x12f/0x8a0 kernel/rcu/tree.c:3114 cipso_v4_doi_remove+0x2e2/0x310 net/ipv4/cipso_ipv4.c:531 netlbl_cipsov4_remove+0x219/0x390 net/netlabel/netlabel_cipso_v4.c:715 genl_family_rcv_msg_doit net/netlink/genetlink.c:739 [inline] genl_family_rcv_msg net/netlink/genetlink.c:783 [inline] genl_rcv_msg+0xe4e/0x1280 net/netlink/genetlink.c:800 netlink_rcv_skb+0x190/0x3a0 net/netlink/af_netlink.c:2502 genl_rcv+0x24/0x40 net/netlink/genetlink.c:811 netlink_unicast_kernel net/netlink/af_netlink.c:1312 [inline] netlink_unicast+0x786/0x940 net/netlink/af_netlink.c:1338 netlink_sendmsg+0x9ae/0xd50 net/netlink/af_netlink.c:1927 sock_sendmsg_nosec net/socket.c:654 [inline] sock_sendmsg net/socket.c:674 [inline] ____sys_sendmsg+0x519/0x800 net/socket.c:2350 ___sys_sendmsg net/socket.c:2404 [inline] __sys_sendmsg+0x2bf/0x370 net/socket.c:2433 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xae The buggy address belongs to the object at ffff888017a44600 which belongs to the cache kmalloc-64 of size 64 The buggy address is located 16 bytes inside of 64-byte region [ffff888017a44600, ffff888017a44640) The buggy address belongs to the page: page:000000005cbdcbb8 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x17a44 flags: 0xfff00000000200(slab) raw: 00fff00000000200 ffffea0000a35140 0000001d0000001d ffff888010841640 raw: 0000000000000000 0000000000200020 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888017a44500: 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc ffff888017a44580: 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc >ffff888017a44600: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ^ ffff888017a44680: 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc ffff888017a44700: 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc ==================================================================