================================================================== BUG: KASAN: use-after-free in cipso_v4_genopt.part.9.constprop.13+0x124f/0x17a0 net/ipv4/cipso_ipv4.c:1776 Read of size 1 at addr ffff888238fdf610 by task syz-executor.0/10694 CPU: 0 PID: 10694 Comm: syz-executor.0 Not tainted 5.4.0-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x96/0xe0 lib/dump_stack.c:118 print_address_description.constprop.4.cold.6+0x9/0x373 mm/kasan/report.c:374 __kasan_report.cold.7+0x7a/0x95 mm/kasan/report.c:506 kasan_report+0xe/0x20 mm/kasan/common.c:634 cipso_v4_genopt.part.9.constprop.13+0x124f/0x17a0 net/ipv4/cipso_ipv4.c:1776 cipso_v4_genopt net/ipv4/cipso_ipv4.c:1767 [inline] cipso_v4_sock_setattr+0x6e/0x3c0 net/ipv4/cipso_ipv4.c:1858 netlbl_sock_setattr+0x1b1/0x2c0 net/netlabel/netlabel_kapi.c:989 smack_netlabel+0x10f/0x150 security/smack/smack_lsm.c:2431 security_socket_post_create+0x58/0xa0 security/security.c:1981 __sock_create+0x41f/0x5b0 net/socket.c:1434 sock_create net/socket.c:1469 [inline] __sys_socket+0xd1/0x1a0 net/socket.c:1511 __do_sys_socket net/socket.c:1520 [inline] __se_sys_socket net/socket.c:1518 [inline] __x64_sys_socket+0x6a/0xb0 net/socket.c:1518 do_syscall_64+0x8e/0x4e0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x465ef9 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f827f94f188 EFLAGS: 00000246 ORIG_RAX: 0000000000000029 RAX: ffffffffffffffda RBX: 000000000056bf60 RCX: 0000000000465ef9 RDX: 0000000000000002 RSI: 0000000000000003 RDI: 0000040000000002 RBP: 00000000004bcd1c R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000056bf60 R13: 00007ffd58d8e3cf R14: 00007f827f94f300 R15: 0000000000022000 Allocated by task 1: save_stack+0x19/0x80 mm/kasan/common.c:69 set_track mm/kasan/common.c:77 [inline] __kasan_kmalloc mm/kasan/common.c:510 [inline] __kasan_kmalloc.constprop.11+0xc1/0xd0 mm/kasan/common.c:483 kmalloc include/linux/slab.h:556 [inline] smk_cipso_doi+0x224/0x4d0 security/smack/smackfs.c:696 init_smk_fs+0xd4/0x154 security/smack/smackfs.c:2974 do_one_initcall+0xc3/0x51f init/main.c:938 do_initcall_level init/main.c:1006 [inline] do_initcalls init/main.c:1014 [inline] do_basic_setup init/main.c:1031 [inline] kernel_init_freeable+0x51f/0x5b9 init/main.c:1191 kernel_init+0x7/0x123 init/main.c:1109 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:352 Freed by task 5340: save_stack+0x19/0x80 mm/kasan/common.c:69 set_track mm/kasan/common.c:77 [inline] kasan_set_free_info mm/kasan/common.c:332 [inline] __kasan_slab_free+0x124/0x170 mm/kasan/common.c:471 slab_free_hook mm/slub.c:1424 [inline] slab_free_freelist_hook+0x53/0x140 mm/slub.c:1457 slab_free mm/slub.c:3004 [inline] kfree+0xd6/0x3b0 mm/slub.c:3956 __rcu_reclaim kernel/rcu/rcu.h:222 [inline] rcu_do_batch kernel/rcu/tree.c:2157 [inline] rcu_core+0x9bf/0x1240 kernel/rcu/tree.c:2377 __do_softirq+0x24a/0xa97 kernel/softirq.c:292 The buggy address belongs to the object at ffff888238fdf600 which belongs to the cache kmalloc-64 of size 64 The buggy address is located 16 bytes inside of 64-byte region [ffff888238fdf600, ffff888238fdf640) The buggy address belongs to the page: page:ffffea0008e3f7c0 refcount:1 mapcount:0 mapping:ffff8880b5803180 index:0x0 raw: 057ff00000000200 ffffea0008ead980 0000000e00000002 ffff8880b5803180 raw: 0000000000000000 0000000000200020 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888238fdf500: 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc ffff888238fdf580: 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc >ffff888238fdf600: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ^ ffff888238fdf680: 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc ffff888238fdf700: 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc ==================================================================