R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 ================================================================== BUG: KASAN: double-free or invalid-free in x25_asy_free+0x37/0x140 drivers/net/wan/x25_asy.c:111 CPU: 0 PID: 29462 Comm: syz-executor0 Not tainted 4.20.0 #290 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+0x1d3/0x2c6 lib/dump_stack.c:113 print_address_description.cold.8+0x9/0x1ff mm/kasan/report.c:256 kasan_report_invalid_free+0x64/0xa0 mm/kasan/report.c:336 __kasan_slab_free+0x13a/0x150 mm/kasan/kasan.c:501 kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:528 __cache_free mm/slab.c:3498 [inline] kfree+0xcf/0x230 mm/slab.c:3817 x25_asy_free+0x37/0x140 drivers/net/wan/x25_asy.c:111 x25_asy_open_tty+0x6ad/0x7e7 drivers/net/wan/x25_asy.c:572 tty_ldisc_open.isra.1+0x8b/0xe0 drivers/tty/tty_ldisc.c:453 tty_set_ldisc+0x2dc/0x6a0 drivers/tty/tty_ldisc.c:578 tiocsetd drivers/tty/tty_io.c:2321 [inline] tty_ioctl+0x39d/0x17d0 drivers/tty/tty_io.c:2581 tty_compat_ioctl+0x89/0x540 drivers/tty/tty_io.c:2800 __do_compat_sys_ioctl fs/compat_ioctl.c:1052 [inline] __se_compat_sys_ioctl fs/compat_ioctl.c:998 [inline] __ia32_compat_sys_ioctl+0x20e/0x630 fs/compat_ioctl.c:998 do_syscall_32_irqs_on arch/x86/entry/common.c:326 [inline] do_fast_syscall_32+0x34d/0xfb2 arch/x86/entry/common.c:397 entry_SYSENTER_compat+0x70/0x7f arch/x86/entry/entry_64_compat.S:139 RIP: 0023:0xf7f9fa49 Code: 85 d2 74 02 89 0a 5b 5d c3 8b 04 24 c3 8b 14 24 c3 8b 3c 24 c3 90 90 90 90 90 90 90 90 90 90 90 90 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 eb 0d 90 90 90 90 90 90 90 90 90 90 90 90 RSP: 002b:00000000f5f9b0cc EFLAGS: 00000296 ORIG_RAX: 0000000000000036 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000000005423 RDX: 0000000020000080 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 29462: save_stack+0x43/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] kasan_kmalloc+0xc7/0xe0 mm/kasan/kasan.c:553 __do_kmalloc mm/slab.c:3722 [inline] __kmalloc+0x15b/0x770 mm/slab.c:3731 kmalloc include/linux/slab.h:551 [inline] x25_asy_open drivers/net/wan/x25_asy.c:465 [inline] x25_asy_open_tty+0x32a/0x7e7 drivers/net/wan/x25_asy.c:570 tty_ldisc_open.isra.1+0x8b/0xe0 drivers/tty/tty_ldisc.c:453 tty_set_ldisc+0x2dc/0x6a0 drivers/tty/tty_ldisc.c:578 tiocsetd drivers/tty/tty_io.c:2321 [inline] tty_ioctl+0x39d/0x17d0 drivers/tty/tty_io.c:2581 tty_compat_ioctl+0x89/0x540 drivers/tty/tty_io.c:2800 __do_compat_sys_ioctl fs/compat_ioctl.c:1052 [inline] __se_compat_sys_ioctl fs/compat_ioctl.c:998 [inline] __ia32_compat_sys_ioctl+0x20e/0x630 fs/compat_ioctl.c:998 do_syscall_32_irqs_on arch/x86/entry/common.c:326 [inline] do_fast_syscall_32+0x34d/0xfb2 arch/x86/entry/common.c:397 entry_SYSENTER_compat+0x70/0x7f arch/x86/entry/entry_64_compat.S:139 Freed by task 29462: save_stack+0x43/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/kasan.c:521 kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:528 __cache_free mm/slab.c:3498 [inline] kfree+0xcf/0x230 mm/slab.c:3817 x25_asy_open drivers/net/wan/x25_asy.c:489 [inline] x25_asy_open_tty+0x6a0/0x7e7 drivers/net/wan/x25_asy.c:570 tty_ldisc_open.isra.1+0x8b/0xe0 drivers/tty/tty_ldisc.c:453 tty_set_ldisc+0x2dc/0x6a0 drivers/tty/tty_ldisc.c:578 tiocsetd drivers/tty/tty_io.c:2321 [inline] tty_ioctl+0x39d/0x17d0 drivers/tty/tty_io.c:2581 tty_compat_ioctl+0x89/0x540 drivers/tty/tty_io.c:2800 __do_compat_sys_ioctl fs/compat_ioctl.c:1052 [inline] __se_compat_sys_ioctl fs/compat_ioctl.c:998 [inline] __ia32_compat_sys_ioctl+0x20e/0x630 fs/compat_ioctl.c:998 do_syscall_32_irqs_on arch/x86/entry/common.c:326 [inline] do_fast_syscall_32+0x34d/0xfb2 arch/x86/entry/common.c:397 entry_SYSENTER_compat+0x70/0x7f arch/x86/entry/entry_64_compat.S:139 The buggy address belongs to the object at ffff8881c3df2040 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 0 bytes inside of 1024-byte region [ffff8881c3df2040, ffff8881c3df2440) The buggy address belongs to the page: page:ffffea00070f7c80 count:1 mapcount:0 mapping:ffff8881da800ac0 index:0x0 compound_mapcount: 0 flags: 0x2fffc0000010200(slab|head) raw: 02fffc0000010200 ffffea0007032508 ffffea000701b788 ffff8881da800ac0 raw: 0000000000000000 ffff8881c3df2040 0000000100000007 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8881c3df1f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8881c3df1f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff8881c3df2000: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb ^ ffff8881c3df2080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881c3df2100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================