================================================================== BUG: KASAN: use-after-free in n_tty_receive_char_inline drivers/tty/n_tty.c:1411 [inline] BUG: KASAN: use-after-free in n_tty_receive_buf_standard drivers/tty/n_tty.c:1583 [inline] BUG: KASAN: use-after-free in __receive_buf drivers/tty/n_tty.c:1646 [inline] BUG: KASAN: use-after-free in n_tty_receive_buf_common+0x1feb/0x2410 drivers/tty/n_tty.c:1742 Read of size 1 at addr ffff88809feda3c0 by task syz-executor453/9268 CPU: 0 PID: 9268 Comm: syz-executor453 Not tainted 4.14.157-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+0x142/0x197 lib/dump_stack.c:58 print_address_description.cold+0x7c/0x1dc 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/0x2af mm/kasan/report.c:393 __asan_report_load1_noabort+0x14/0x20 mm/kasan/report.c:427 n_tty_receive_char_inline drivers/tty/n_tty.c:1411 [inline] n_tty_receive_buf_standard drivers/tty/n_tty.c:1583 [inline] __receive_buf drivers/tty/n_tty.c:1646 [inline] n_tty_receive_buf_common+0x1feb/0x2410 drivers/tty/n_tty.c:1742 n_tty_receive_buf2+0x34/0x40 drivers/tty/n_tty.c:1777 tty_ldisc_receive_buf+0xa5/0x1a0 drivers/tty/tty_buffer.c:455 paste_selection+0x1e6/0x3f2 drivers/tty/vt/selection.c:360 tioclinux+0x10e/0x400 drivers/tty/vt/vt.c:2696 vt_ioctl+0x180c/0x2170 drivers/tty/vt/vt_ioctl.c:364 tty_ioctl+0x841/0x1320 drivers/tty/tty_io.c:2661 vfs_ioctl fs/ioctl.c:46 [inline] file_ioctl fs/ioctl.c:500 [inline] do_vfs_ioctl+0x7ae/0x1060 fs/ioctl.c:684 SYSC_ioctl fs/ioctl.c:701 [inline] SyS_ioctl+0x8f/0xc0 fs/ioctl.c:692 do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x42/0xb7 RIP: 0033:0x4417b9 RSP: 002b:00007ffeb350ec98 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 000000000007c3e5 RCX: 00000000004417b9 RDX: 0000000020000040 RSI: 000000000000541c RDI: 0000000000000003 RBP: 0000000000000000 R08: 000000000000000d R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000000016f R13: 0000000000402490 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 9266: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59 save_stack+0x45/0xd0 mm/kasan/kasan.c:447 set_track mm/kasan/kasan.c:459 [inline] kasan_kmalloc mm/kasan/kasan.c:551 [inline] kasan_kmalloc+0xce/0xf0 mm/kasan/kasan.c:529 __do_kmalloc mm/slab.c:3720 [inline] __kmalloc+0x15d/0x7a0 mm/slab.c:3729 kmalloc include/linux/slab.h:493 [inline] set_selection+0x79a/0xe30 drivers/tty/vt/selection.c:295 tioclinux+0xf7/0x400 drivers/tty/vt/vt.c:2692 vt_ioctl+0x180c/0x2170 drivers/tty/vt/vt_ioctl.c:364 tty_ioctl+0x841/0x1320 drivers/tty/tty_io.c:2661 vfs_ioctl fs/ioctl.c:46 [inline] file_ioctl fs/ioctl.c:500 [inline] do_vfs_ioctl+0x7ae/0x1060 fs/ioctl.c:684 SYSC_ioctl fs/ioctl.c:701 [inline] SyS_ioctl+0x8f/0xc0 fs/ioctl.c:692 do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x42/0xb7 Freed by task 9267: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59 save_stack+0x45/0xd0 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+0xcc/0x270 mm/slab.c:3815 set_selection+0x7b7/0xe30 drivers/tty/vt/selection.c:301 tioclinux+0xf7/0x400 drivers/tty/vt/vt.c:2692 vt_ioctl+0x180c/0x2170 drivers/tty/vt/vt_ioctl.c:364 tty_ioctl+0x841/0x1320 drivers/tty/tty_io.c:2661 vfs_ioctl fs/ioctl.c:46 [inline] file_ioctl fs/ioctl.c:500 [inline] do_vfs_ioctl+0x7ae/0x1060 fs/ioctl.c:684 SYSC_ioctl fs/ioctl.c:701 [inline] SyS_ioctl+0x8f/0xc0 fs/ioctl.c:692 do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x42/0xb7 The buggy address belongs to the object at ffff88809feda3c0 which belongs to the cache kmalloc-32 of size 32 The buggy address is located 0 bytes inside of 32-byte region [ffff88809feda3c0, ffff88809feda3e0) The buggy address belongs to the page: page:ffffea00027fb680 count:1 mapcount:0 mapping:ffff88809feda000 index:0xffff88809fedafc1 flags: 0xfffe0000000100(slab) raw: 00fffe0000000100 ffff88809feda000 ffff88809fedafc1 000000010000003f raw: ffffea00027e0160 ffffea00027fce20 ffff8880aa8001c0 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88809feda280: fb fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc ffff88809feda300: 00 00 01 fc fc fc fc fc fb fb fb fb fc fc fc fc >ffff88809feda380: fb fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc ^ ffff88809feda400: 00 00 01 fc fc fc fc fc fb fb fb fb fc fc fc fc ffff88809feda480: fb fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc ==================================================================