================================================================== BUG: KASAN: slab-out-of-bounds in inet_ctl_sock_destroy include/net/inet_common.h:56 [inline] BUG: KASAN: slab-out-of-bounds in tcp_sk_exit+0x20d/0x240 net/ipv4/tcp_ipv4.c:2603 Read of size 8 at addr ffff888061cae0ac by task kworker/u4:5/8540 CPU: 1 PID: 8540 Comm: kworker/u4:5 Not tainted 5.2.0-rc1+ #8 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: netns cleanup_net Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x172/0x1f0 lib/dump_stack.c:113 print_address_description.cold+0x7c/0x20d mm/kasan/report.c:188 __kasan_report.cold+0x1b/0x40 mm/kasan/report.c:317 kasan_report+0x12/0x20 mm/kasan/common.c:614 __asan_report_load8_noabort+0x14/0x20 mm/kasan/generic_report.c:132 inet_ctl_sock_destroy include/net/inet_common.h:56 [inline] tcp_sk_exit+0x20d/0x240 net/ipv4/tcp_ipv4.c:2603 ops_exit_list.isra.0+0xaa/0x150 net/core/net_namespace.c:154 cleanup_net+0x3fb/0x960 net/core/net_namespace.c:553 process_one_work+0x989/0x1790 kernel/workqueue.c:2269 worker_thread+0x98/0xe40 kernel/workqueue.c:2415 kthread+0x354/0x420 kernel/kthread.c:255 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:352 Allocated by task 24232: save_stack+0x23/0x90 mm/kasan/common.c:71 set_track mm/kasan/common.c:79 [inline] __kasan_kmalloc mm/kasan/common.c:489 [inline] __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:462 kasan_kmalloc+0x9/0x10 mm/kasan/common.c:503 __do_kmalloc mm/slab.c:3660 [inline] __kmalloc+0x15c/0x740 mm/slab.c:3669 kmalloc include/linux/slab.h:552 [inline] tomoyo_realpath_from_path+0xcd/0x7a0 security/tomoyo/realpath.c:277 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_path_perm+0x230/0x430 security/tomoyo/file.c:822 tomoyo_inode_getattr+0x1d/0x30 security/tomoyo/tomoyo.c:129 security_inode_getattr+0xf2/0x150 security/security.c:1183 vfs_getattr+0x25/0x70 fs/stat.c:115 vfs_statx+0x157/0x200 fs/stat.c:191 vfs_stat include/linux/fs.h:3193 [inline] __do_sys_newstat+0xa4/0x130 fs/stat.c:341 __se_sys_newstat fs/stat.c:337 [inline] __x64_sys_newstat+0x54/0x80 fs/stat.c:337 do_syscall_64+0xfd/0x680 arch/x86/entry/common.c:301 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 24232: save_stack+0x23/0x90 mm/kasan/common.c:71 set_track mm/kasan/common.c:79 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/common.c:451 kasan_slab_free+0xe/0x10 mm/kasan/common.c:459 __cache_free mm/slab.c:3432 [inline] kfree+0xcf/0x220 mm/slab.c:3755 tomoyo_realpath_from_path+0x1de/0x7a0 security/tomoyo/realpath.c:319 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_path_perm+0x230/0x430 security/tomoyo/file.c:822 tomoyo_inode_getattr+0x1d/0x30 security/tomoyo/tomoyo.c:129 security_inode_getattr+0xf2/0x150 security/security.c:1183 vfs_getattr+0x25/0x70 fs/stat.c:115 vfs_statx+0x157/0x200 fs/stat.c:191 vfs_stat include/linux/fs.h:3193 [inline] __do_sys_newstat+0xa4/0x130 fs/stat.c:341 __se_sys_newstat fs/stat.c:337 [inline] __x64_sys_newstat+0x54/0x80 fs/stat.c:337 do_syscall_64+0xfd/0x680 arch/x86/entry/common.c:301 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff888061caee00 which belongs to the cache kmalloc-4k of size 4096 The buggy address is located 3412 bytes to the left of 4096-byte region [ffff888061caee00, ffff888061cafe00) The buggy address belongs to the page: page:ffffea0001872b80 refcount:1 mapcount:0 mapping:ffff8880aa400dc0 index:0x0 compound_mapcount: 0 flags: 0x1fffc0000010200(slab|head) raw: 01fffc0000010200 ffffea0001852908 ffffea0001a4d808 ffff8880aa400dc0 raw: 0000000000000000 ffff888061caee00 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888061cadf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888061cae000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888061cae080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff888061cae100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888061cae180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================