================================================================== BUG: KASAN: double-free or invalid-free in x25_asy_free+0x37/0x140 drivers/net/wan/x25_asy.c:111 CPU: 1 PID: 15500 Comm: syz-executor1 Not tainted 4.20.0+ #5 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+0x1db/0x2d0 lib/dump_stack.c:113 print_address_description.cold+0x7c/0x20d mm/kasan/report.c:187 kasan_report_invalid_free+0x65/0xa0 mm/kasan/report.c:278 __kasan_slab_free+0x13a/0x150 mm/kasan/common.c:423 kasan_slab_free+0xe/0x10 mm/kasan/common.c:452 __cache_free mm/slab.c:3485 [inline] kfree+0xcf/0x230 mm/slab.c:3804 x25_asy_free+0x37/0x140 drivers/net/wan/x25_asy.c:111 x25_asy_open_tty+0x67b/0x80b drivers/net/wan/x25_asy.c:572 tty_ldisc_open.isra.0+0x8b/0xe0 drivers/tty/tty_ldisc.c:460 tty_set_ldisc+0x2d7/0x690 drivers/tty/tty_ldisc.c:587 tiocsetd drivers/tty/tty_io.c:2323 [inline] tty_ioctl+0xffa/0x16c0 drivers/tty/tty_io.c:2583 vfs_ioctl fs/ioctl.c:46 [inline] file_ioctl fs/ioctl.c:509 [inline] do_vfs_ioctl+0x107b/0x17d0 fs/ioctl.c:696 ksys_ioctl+0xab/0xd0 fs/ioctl.c:713 __do_sys_ioctl fs/ioctl.c:720 [inline] __se_sys_ioctl fs/ioctl.c:718 [inline] __x64_sys_ioctl+0x73/0xb0 fs/ioctl.c:718 do_syscall_64+0x1a3/0x800 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x457ec9 Code: 6d 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 3b b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f41bcabdc78 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007f41bcabdc90 RCX: 0000000000457ec9 RDX: 0000000020000080 RSI: 0000000000005423 RDI: 0000000000000005 RBP: 000000000073bf00 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f41bcabe6d4 R13: 00000000004c207b R14: 00000000004d4450 R15: 0000000000000006 Allocated by task 15500: save_stack+0x45/0xd0 mm/kasan/common.c:73 set_track mm/kasan/common.c:85 [inline] kasan_kmalloc mm/kasan/common.c:482 [inline] kasan_kmalloc+0xcf/0xe0 mm/kasan/common.c:455 __do_kmalloc mm/slab.c:3709 [inline] __kmalloc+0x15c/0x740 mm/slab.c:3718 kmalloc include/linux/slab.h:550 [inline] x25_asy_open drivers/net/wan/x25_asy.c:465 [inline] x25_asy_open_tty+0x470/0x80b drivers/net/wan/x25_asy.c:570 tty_ldisc_open.isra.0+0x8b/0xe0 drivers/tty/tty_ldisc.c:460 tty_set_ldisc+0x2d7/0x690 drivers/tty/tty_ldisc.c:587 tiocsetd drivers/tty/tty_io.c:2323 [inline] tty_ioctl+0xffa/0x16c0 drivers/tty/tty_io.c:2583 vfs_ioctl fs/ioctl.c:46 [inline] file_ioctl fs/ioctl.c:509 [inline] do_vfs_ioctl+0x107b/0x17d0 fs/ioctl.c:696 ksys_ioctl+0xab/0xd0 fs/ioctl.c:713 __do_sys_ioctl fs/ioctl.c:720 [inline] __se_sys_ioctl fs/ioctl.c:718 [inline] __x64_sys_ioctl+0x73/0xb0 fs/ioctl.c:718 do_syscall_64+0x1a3/0x800 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 15500: save_stack+0x45/0xd0 mm/kasan/common.c:73 set_track mm/kasan/common.c:85 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/common.c:444 kasan_slab_free+0xe/0x10 mm/kasan/common.c:452 __cache_free mm/slab.c:3485 [inline] kfree+0xcf/0x230 mm/slab.c:3804 x25_asy_open drivers/net/wan/x25_asy.c:489 [inline] x25_asy_open_tty+0x66e/0x80b drivers/net/wan/x25_asy.c:570 tty_ldisc_open.isra.0+0x8b/0xe0 drivers/tty/tty_ldisc.c:460 tty_set_ldisc+0x2d7/0x690 drivers/tty/tty_ldisc.c:587 tiocsetd drivers/tty/tty_io.c:2323 [inline] tty_ioctl+0xffa/0x16c0 drivers/tty/tty_io.c:2583 vfs_ioctl fs/ioctl.c:46 [inline] file_ioctl fs/ioctl.c:509 [inline] do_vfs_ioctl+0x107b/0x17d0 fs/ioctl.c:696 ksys_ioctl+0xab/0xd0 fs/ioctl.c:713 __do_sys_ioctl fs/ioctl.c:720 [inline] __se_sys_ioctl fs/ioctl.c:718 [inline] __x64_sys_ioctl+0x73/0xb0 fs/ioctl.c:718 do_syscall_64+0x1a3/0x800 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff888090363240 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 0 bytes inside of 1024-byte region [ffff888090363240, ffff888090363640) The buggy address belongs to the page: page:ffffea000240d880 count:1 mapcount:0 mapping:ffff88812c3f0ac0 index:0x0 compound_mapcount: 0 flags: 0x1fffc0000010200(slab|head) raw: 01fffc0000010200 ffffea00023bb508 ffffea00029d2b88 ffff88812c3f0ac0 raw: 0000000000000000 ffff888090362040 0000000100000007 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888090363100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888090363180: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >ffff888090363200: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb ^ kobject: 'loop4' (000000002c591ed6): fill_kobj_path: path = '/devices/virtual/block/loop4' ffff888090363280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888090363300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================