================================================================== BUG: KASAN: slab-out-of-bounds in vsscanf+0x2666/0x2ef0 lib/vsprintf.c:3321 Read of size 1 at addr ffff8880a746ef30 by task syz-executor.5/27611 CPU: 0 PID: 27611 Comm: syz-executor.5 Not tainted 5.7.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+0x1e9/0x30e lib/dump_stack.c:118 print_address_description+0x66/0x5a0 mm/kasan/report.c:383 __kasan_report mm/kasan/report.c:513 [inline] kasan_report+0x132/0x1d0 mm/kasan/report.c:530 vsscanf+0x2666/0x2ef0 lib/vsprintf.c:3321 sscanf+0x6c/0x90 lib/vsprintf.c:3527 smk_set_cipso+0x374/0x6c0 security/smack/smackfs.c:908 __vfs_write+0x9c/0x6e0 fs/read_write.c:495 vfs_write+0x274/0x580 fs/read_write.c:559 ksys_write+0x11b/0x220 fs/read_write.c:612 do_syscall_64+0xf3/0x1b0 arch/x86/entry/common.c:295 entry_SYSCALL_64_after_hwframe+0x49/0xb3 RIP: 0033:0x45ca69 Code: 0d b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 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 0f 83 db b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007fb9545a2c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 000000000050d080 RCX: 000000000045ca69 RDX: 000000000000002f RSI: 00000000200001c0 RDI: 0000000000000003 RBP: 000000000078bf00 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff R13: 0000000000000d08 R14: 00000000004cf5af R15: 00007fb9545a36d4 Allocated by task 27611: save_stack mm/kasan/common.c:48 [inline] set_track mm/kasan/common.c:56 [inline] __kasan_kmalloc+0x103/0x140 mm/kasan/common.c:494 __do_kmalloc mm/slab.c:3656 [inline] __kmalloc_track_caller+0x249/0x320 mm/slab.c:3671 memdup_user_nul+0x26/0xf0 mm/util.c:259 smk_set_cipso+0xff/0x6c0 security/smack/smackfs.c:859 __vfs_write+0x9c/0x6e0 fs/read_write.c:495 vfs_write+0x274/0x580 fs/read_write.c:559 ksys_write+0x11b/0x220 fs/read_write.c:612 do_syscall_64+0xf3/0x1b0 arch/x86/entry/common.c:295 entry_SYSCALL_64_after_hwframe+0x49/0xb3 Freed by task 6915: save_stack mm/kasan/common.c:48 [inline] set_track mm/kasan/common.c:56 [inline] kasan_set_free_info mm/kasan/common.c:316 [inline] __kasan_slab_free+0x114/0x170 mm/kasan/common.c:455 __cache_free mm/slab.c:3426 [inline] kfree+0x10a/0x220 mm/slab.c:3757 copy_entries_to_user net/ipv4/netfilter/ip_tables.c:867 [inline] get_entries net/ipv4/netfilter/ip_tables.c:1024 [inline] do_ipt_get_ctl+0x77f/0x9b0 net/ipv4/netfilter/ip_tables.c:1700 nf_sockopt net/netfilter/nf_sockopt.c:104 [inline] nf_getsockopt+0x2c1/0x2f0 net/netfilter/nf_sockopt.c:122 ip_getsockopt+0x102/0x1e0 net/ipv4/ip_sockglue.c:1749 __sys_getsockopt+0x255/0x2c0 net/socket.c:2172 __do_sys_getsockopt net/socket.c:2187 [inline] __se_sys_getsockopt net/socket.c:2184 [inline] __x64_sys_getsockopt+0xb1/0xc0 net/socket.c:2184 do_syscall_64+0xf3/0x1b0 arch/x86/entry/common.c:295 entry_SYSCALL_64_after_hwframe+0x49/0xb3 The buggy address belongs to the object at ffff8880a746ef00 which belongs to the cache kmalloc-64 of size 64 The buggy address is located 48 bytes inside of 64-byte region [ffff8880a746ef00, ffff8880a746ef40) The buggy address belongs to the page: page:ffffea00029d1b80 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff8880a746e780 flags: 0xfffe0000000200(slab) raw: 00fffe0000000200 ffffea00025a7808 ffffea0002a26408 ffff8880aa400380 raw: ffff8880a746e780 ffff8880a746e000 000000010000001d 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880a746ee00: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff8880a746ee80: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >ffff8880a746ef00: 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc ^ ffff8880a746ef80: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff8880a746f000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================