================================================================== BUG: KASAN: slab-use-after-free in string_nocheck lib/vsprintf.c:648 [inline] BUG: KASAN: slab-use-after-free in string+0x471/0x4d0 lib/vsprintf.c:730 Read of size 1 at addr ffff888026f44c20 by task syz.7.3573/20291 CPU: 2 UID: 0 PID: 20291 Comm: syz.7.3573 Tainted: G L syzkaller #0 PREEMPT(full) Tainted: [L]=SOFTLOCKUP Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x100/0x190 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0x13d/0x4b0 mm/kasan/report.c:482 kasan_report+0xdf/0x1c0 mm/kasan/report.c:595 string_nocheck lib/vsprintf.c:648 [inline] string+0x471/0x4d0 lib/vsprintf.c:730 vsnprintf+0x422/0x1300 lib/vsprintf.c:2945 seq_vprintf fs/seq_file.c:392 [inline] seq_printf+0x1a4/0x250 fs/seq_file.c:407 irq_seq_show+0x390/0x8b0 kernel/irq/proc.c:601 traverse.part.0.constprop.0+0x107/0x650 fs/seq_file.c:112 traverse fs/seq_file.c:99 [inline] seq_read_iter+0x93f/0x1270 fs/seq_file.c:196 proc_reg_read_iter+0x220/0x310 fs/proc/inode.c:299 copy_splice_read+0x4ba/0xbb0 fs/splice.c:362 do_splice_read fs/splice.c:980 [inline] do_splice_read+0x285/0x370 fs/splice.c:954 splice_direct_to_actor+0x2a1/0xa30 fs/splice.c:1084 do_splice_direct_actor fs/splice.c:1202 [inline] do_splice_direct+0x174/0x240 fs/splice.c:1228 do_sendfile+0xadc/0xe20 fs/read_write.c:1371 __do_compat_sys_sendfile fs/read_write.c:1447 [inline] __se_compat_sys_sendfile fs/read_write.c:1436 [inline] __ia32_compat_sys_sendfile+0x162/0x220 fs/read_write.c:1436 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:79 [inline] __do_fast_syscall_32+0x13a/0x8b0 arch/x86/entry/syscall_32.c:291 do_fast_syscall_32+0x32/0x70 arch/x86/entry/syscall_32.c:316 entry_SYSENTER_compat_after_hwframe+0x84/0x8e RIP: 0023:0xf702efec Code: Unable to access opcode bytes at 0xf702efc2. RSP: 002b:00000000f519b50c EFLAGS: 00000292 ORIG_RAX: 00000000000000bb RAX: ffffffffffffffda RBX: 000000000000000b RCX: 0000000000000006 RDX: 00000000800000c0 RSI: 00000000000036b9 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000292 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 14404: kasan_save_stack+0x30/0x50 mm/kasan/common.c:57 kasan_save_track+0x14/0x30 mm/kasan/common.c:78 poison_kmalloc_redzone mm/kasan/common.c:398 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:415 kasan_kmalloc include/linux/kasan.h:263 [inline] __do_kmalloc_node mm/slub.c:5334 [inline] __kmalloc_node_noprof+0x33b/0x830 mm/slub.c:5346 _kmalloc_node_noprof include/linux/slab.h:1197 [inline] __vmalloc_area_node mm/vmalloc.c:3893 [inline] __vmalloc_node_range_noprof+0x409/0x1630 mm/vmalloc.c:4104 __vmalloc_node_noprof+0xad/0xf0 mm/vmalloc.c:4165 xt_compat_init_offsets+0xe2/0x1f0 net/netfilter/x_tables.c:779 ebt_compat_init_offsets net/bridge/netfilter/ebtables.c:1841 [inline] compat_table_info+0x11b/0x870 net/bridge/netfilter/ebtables.c:1852 compat_do_ebt_get_ctl+0x270/0xbb0 net/bridge/netfilter/ebtables.c:2439 do_ebt_get_ctl+0x243/0x7a0 net/bridge/netfilter/ebtables.c:2504 nf_getsockopt+0x7c/0xe0 net/netfilter/nf_sockopt.c:116 ip_getsockopt+0x192/0x1e0 net/ipv4/ip_sockglue.c:1777 tcp_getsockopt+0xa1/0x110 net/ipv4/tcp.c:4864 do_sock_getsockopt+0x50a/0x6e0 net/socket.c:2503 __sys_getsockopt+0x133/0x1d0 net/socket.c:2534 __do_compat_sys_socketcall net/compat.c:493 [inline] __se_compat_sys_socketcall net/compat.c:422 [inline] __ia32_compat_sys_socketcall+0x6af/0x770 net/compat.c:422 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:79 [inline] __do_fast_syscall_32+0x13a/0x8b0 arch/x86/entry/syscall_32.c:291 do_fast_syscall_32+0x32/0x70 arch/x86/entry/syscall_32.c:316 entry_SYSENTER_compat_after_hwframe+0x84/0x8e Freed by task 14404: kasan_save_stack+0x30/0x50 mm/kasan/common.c:57 kasan_save_track+0x14/0x30 mm/kasan/common.c:78 kasan_save_free_info+0x3b/0x70 mm/kasan/generic.c:584 poison_slab_object mm/kasan/common.c:253 [inline] __kasan_slab_free+0x5f/0x80 mm/kasan/common.c:285 kasan_slab_free include/linux/kasan.h:235 [inline] slab_free_hook mm/slub.c:2677 [inline] slab_free mm/slub.c:6377 [inline] kfree+0x22b/0x6c0 mm/slub.c:6692 vfree mm/vmalloc.c:3511 [inline] vfree+0x12f/0x730 mm/vmalloc.c:3484 xt_compat_flush_offsets+0x90/0x170 net/netfilter/x_tables.c:737 compat_do_ebt_get_ctl+0x663/0xbb0 net/bridge/netfilter/ebtables.c:2480 do_ebt_get_ctl+0x243/0x7a0 net/bridge/netfilter/ebtables.c:2504 nf_getsockopt+0x7c/0xe0 net/netfilter/nf_sockopt.c:116 ip_getsockopt+0x192/0x1e0 net/ipv4/ip_sockglue.c:1777 tcp_getsockopt+0xa1/0x110 net/ipv4/tcp.c:4864 do_sock_getsockopt+0x50a/0x6e0 net/socket.c:2503 __sys_getsockopt+0x133/0x1d0 net/socket.c:2534 __do_compat_sys_socketcall net/compat.c:493 [inline] __se_compat_sys_socketcall net/compat.c:422 [inline] __ia32_compat_sys_socketcall+0x6af/0x770 net/compat.c:422 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:79 [inline] __do_fast_syscall_32+0x13a/0x8b0 arch/x86/entry/syscall_32.c:291 do_fast_syscall_32+0x32/0x70 arch/x86/entry/syscall_32.c:316 entry_SYSENTER_compat_after_hwframe+0x84/0x8e The buggy address belongs to the object at ffff888026f44c20 which belongs to the cache kmalloc-8 of size 8 The buggy address is located 0 bytes inside of freed 8-byte region [ffff888026f44c20, ffff888026f44c28) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff888026f446c0 pfn:0x26f44 flags: 0xfff00000000200(workingset|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000200 ffff88801c042500 ffff88801c040348 ffff88801c040348 raw: ffff888026f446c0 0000000800800078 00000000f5000000 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0xd2cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 1, tgid 1 (swapper/0), ts 5661935695, free_ts 0 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0xfd/0x120 mm/page_alloc.c:1859 prep_new_page mm/page_alloc.c:1867 [inline] get_page_from_freelist+0xf46/0x3500 mm/page_alloc.c:3946 __alloc_frozen_pages_noprof+0x299/0x2dc0 mm/page_alloc.c:5304 alloc_slab_page mm/slub.c:3266 [inline] allocate_slab mm/slub.c:3380 [inline] new_slab+0xa2/0x660 mm/slub.c:3426 refill_objects+0xe3/0x410 mm/slub.c:7310 refill_sheaf mm/slub.c:2804 [inline] __pcs_replace_empty_main+0x372/0x680 mm/slub.c:4675 alloc_from_pcs mm/slub.c:4773 [inline] slab_alloc_node mm/slub.c:4905 [inline] __do_kmalloc_node mm/slub.c:5333 [inline] __kmalloc_node_track_caller_noprof+0x677/0x830 mm/slub.c:5471 __kmemdup_nul mm/util.c:64 [inline] kstrdup+0x51/0xe0 mm/util.c:84 kstrdup_const+0x63/0x80 mm/util.c:104 __kernfs_new_node+0x9b/0xa10 fs/kernfs/dir.c:661 kernfs_new_node+0x117/0x150 fs/kernfs/dir.c:751 kernfs_create_link+0xcc/0x240 fs/kernfs/symlink.c:39 sysfs_do_create_link_sd+0x90/0x140 fs/sysfs/symlink.c:44 sysfs_do_create_link fs/sysfs/symlink.c:80 [inline] sysfs_create_link+0x61/0xc0 fs/sysfs/symlink.c:92 device_create_sys_dev_entry drivers/base/core.c:3587 [inline] device_add+0xb62/0x1970 drivers/base/core.c:3731 tty_register_device_attr+0x388/0x7f0 drivers/tty/tty_io.c:3261 page_owner free stack trace missing Memory state around the buggy address: ffff888026f44b00: 05 fc fc fc 05 fc fc fc 05 fc fc fc 05 fc fc fc ffff888026f44b80: 00 fc fc fc fa fc fc fc 05 fc fc fc fa fc fc fc >ffff888026f44c00: 06 fc fc fc fa fc fc fc 05 fc fc fc 06 fc fc fc ^ ffff888026f44c80: fa fc fc fc 07 fc fc fc 05 fc fc fc 00 fc fc fc ffff888026f44d00: 06 fc fc fc 06 fc fc fc 00 fc fc fc 06 fc fc fc ==================================================================