Uh, sorry, I used a wrong vmlinux for postprocessing.
Here is a proper report.
drivers/tty/tty_io.c:2881 is:
case TIOCGETD:
return put_user(tty->ldisc->ops->num, (int __user *)p);
BUG: KASAN: use-after-free in tty_ioctl+0x1d1c/0x1fd0 at addr ffff8800640bc810
Read of size 8 by task a.out/23957
=============================================================================
BUG kmalloc-16 (Tainted: G B ): kasan: bad access detected
-----------------------------------------------------------------------------
INFO: Allocated in tty_ldisc_get.part.3+0x61/0x130 age=0 cpu=3 pid=23947
[< none >] ___slab_alloc+0x489/0x4e0 mm/slub.c:2438
[< none >] __slab_alloc+0x4c/0x90 mm/slub.c:2467
[< inline >] slab_alloc_node mm/slub.c:2530
[< inline >] slab_alloc mm/slub.c:2572
[< none >] kmem_cache_alloc_trace+0x1c6/0x210 mm/slub.c:2589
[< inline >] kmalloc include/linux/slab.h:458
[< none >] tty_ldisc_get.part.3+0x61/0x130 drivers/tty/tty_ldisc.c:171
[< inline >] tty_ldisc_get drivers/tty/tty_ldisc.c:190
[< inline >] tty_ldisc_restore drivers/tty/tty_ldisc.c:490
[< none >] tty_set_ldisc+0x74c/0x940 drivers/tty/tty_ldisc.c:571
[< inline >] tiocsetd drivers/tty/tty_io.c:2650
[< none >] tty_ioctl+0xace/0x1fd0 drivers/tty/tty_io.c:2883
[< inline >] vfs_ioctl fs/ioctl.c:43
[< none >] do_vfs_ioctl+0x57c/0xe60 fs/ioctl.c:607
[< inline >] SYSC_ioctl fs/ioctl.c:622
[< none >] SyS_ioctl+0x74/0x80 fs/ioctl.c:613
[< none >] entry_SYSCALL_64_fastpath+0x16/0x7a
arch/x86/entry/entry_64.S:185
INFO: Freed in tty_set_ldisc+0x423/0x940 age=0 cpu=3 pid=23947
[< none >] __slab_free+0x206/0x360 mm/slub.c:2648 (discriminator 1)
[< inline >] slab_free mm/slub.c:2803
[< none >] kfree+0x1a2/0x1c0 mm/slub.c:3632
[< inline >] tty_ldisc_put drivers/tty/tty_ldisc.c:194
[< none >] tty_set_ldisc+0x423/0x940 drivers/tty/tty_ldisc.c:570
[< inline >] tiocsetd drivers/tty/tty_io.c:2650
[< none >] tty_ioctl+0xace/0x1fd0 drivers/tty/tty_io.c:2883
[< inline >] vfs_ioctl fs/ioctl.c:43
[< none >] do_vfs_ioctl+0x57c/0xe60 fs/ioctl.c:607
[< inline >] SYSC_ioctl fs/ioctl.c:622
[< none >] SyS_ioctl+0x74/0x80 fs/ioctl.c:613
[< none >] entry_SYSCALL_64_fastpath+0x16/0x7a
arch/x86/entry/entry_64.S:185
INFO: Slab 0xffffea0001902f00 objects=23 used=3 fp=0xffff8800640bc000
flags=0x5fffc0000004080
INFO: Object 0xffff8800640bc810 @offset=2064 fp=0xffff8800640bc000
Bytes b4 ffff8800640bc800: 15 1d 3b 00 01 00 00 00 5a 5a 5a 5a 5a 5a
5a 5a ..;.....ZZZZZZZZ
Object ffff8800640bc810: a0 9b 3d 86 ff ff ff ff 60 ef 16 6d 00 88 ff
ff ..=.....`..m....
Redzone ffff8800640bc820: cc cc cc cc cc cc cc cc
........
Padding ffff8800640bc960: 5a 5a 5a 5a 5a 5a 5a 5a
ZZZZZZZZ
CPU: 0 PID: 23957 Comm: a.out Tainted: G B 4.4.0-rc2+ #51
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
ffff8800640bc000 ffff88006127fab8 ffffffff826c8be0 ffff88003e807980
ffff88006127fae8 ffffffff815f1604 ffff88003e807980 ffffea0001902f00
ffff8800640bc810 0000000000005424 ffff88006127fb10 ffffffff815f775f
Call Trace:
[< inline >] __dump_stack lib/dump_stack.c:15
[<ffffffff826c8be0>] dump_stack+0x44/0x64 lib/dump_stack.c:50
[<ffffffff815f1604>] print_trailer+0xf4/0x150 mm/slub.c:652
[<ffffffff815f775f>] object_err+0x2f/0x40 mm/slub.c:659
[< inline >] print_address_description mm/kasan/report.c:138
[<ffffffff815f9ee0>] kasan_report_error+0x210/0x520 mm/kasan/report.c:236
[< inline >] kasan_report mm/kasan/report.c:259
[<ffffffff815fa2ee>] __asan_report_load8_noabort+0x3e/0x40
mm/kasan/report.c:280
[<ffffffff829db6ec>] tty_ioctl+0x1d1c/0x1fd0 drivers/tty/tty_io.c:2881
[< inline >] vfs_ioctl fs/ioctl.c:43
[<ffffffff816708ac>] do_vfs_ioctl+0x57c/0xe60 fs/ioctl.c:607
[< inline >] SYSC_ioctl fs/ioctl.c:622
[<ffffffff81671204>] SyS_ioctl+0x74/0x80 fs/ioctl.c:613
[<ffffffff852a7876>] entry_SYSCALL_64_fastpath+0x16/0x7a
arch/x86/entry/entry_64.S:185