8021q: adding VLAN 0 to HW filter on device batadv0 ================================================================== BUG: KASAN: use-after-free in n_tty_check_throttle drivers/tty/n_tty.c:266 [inline] BUG: KASAN: use-after-free in n_tty_receive_buf_common+0x214f/0x2570 drivers/tty/n_tty.c:1761 Read of size 1 at addr ffff8880a5e51745 by task syz-executor.4/12437 CPU: 1 PID: 12437 Comm: syz-executor.4 Not tainted 4.14.161-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_check_throttle drivers/tty/n_tty.c:266 [inline] n_tty_receive_buf_common+0x214f/0x2570 drivers/tty/n_tty.c:1761 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:0x45a9e9 RSP: 002b:00007fcc963f2c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 000000000045a9e9 RDX: 0000000020000100 RSI: 000000000000541c RDI: 0000000000000004 RBP: 000000000075bf20 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007fcc963f36d4 R13: 00000000004c5dff R14: 00000000004dc520 R15: 00000000ffffffff Allocated by task 12415: 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 12442: 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 ffff8880a5e51740 which belongs to the cache kmalloc-8192 of size 8192 The buggy address is located 5 bytes inside of 8192-byte region [ffff8880a5e51740, ffff8880a5e53740) The buggy address belongs to the page: page:ffffea0002979400 count:1 mapcount:0 mapping:ffff8880a5e51740 index:0x0 compound_mapcount: 0 flags: 0xfffe0000008100(slab|head) raw: 00fffe0000008100 ffff8880a5e51740 0000000000000000 0000000100000001 raw: ffffea0002418120 ffffea000257a420 ffff8880aa802080 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880a5e51600: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880a5e51680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8880a5e51700: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb ^ ffff8880a5e51780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880a5e51800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================