================================================================== BUG: KASAN: use-after-free in atomic_read include/asm-generic/atomic-instrumented.h:21 [inline] BUG: KASAN: use-after-free in refcount_read include/linux/refcount.h:43 [inline] BUG: KASAN: use-after-free in check_net include/net/net_namespace.h:254 [inline] BUG: KASAN: use-after-free in rds_destroy_pending net/rds/rds.h:951 [inline] BUG: KASAN: use-after-free in rds_cong_queue_updates+0x209/0x4d0 net/rds/cong.c:229 Read of size 4 at addr ffff88808a5a80c4 by task kworker/u4:5/3049 CPU: 1 PID: 3049 Comm: kworker/u4:5 Not tainted 5.0.0-rc7+ #91 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: krdsd rds_send_worker 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:187 kasan_report.cold+0x1b/0x40 mm/kasan/report.c:317 check_memory_region_inline mm/kasan/generic.c:185 [inline] check_memory_region+0x123/0x190 mm/kasan/generic.c:191 kasan_check_read+0x11/0x20 mm/kasan/common.c:100 atomic_read include/asm-generic/atomic-instrumented.h:21 [inline] refcount_read include/linux/refcount.h:43 [inline] check_net include/net/net_namespace.h:254 [inline] rds_destroy_pending net/rds/rds.h:951 [inline] rds_cong_queue_updates+0x209/0x4d0 net/rds/cong.c:229 rds_recv_rcvbuf_delta.part.0+0x34f/0x3f0 net/rds/recv.c:118 rds_recv_rcvbuf_delta net/rds/recv.c:379 [inline] rds_recv_incoming+0x789/0x11f0 net/rds/recv.c:379 rds_loop_xmit+0xf3/0x2a0 net/rds/loop.c:96 rds_send_xmit+0x1113/0x2560 net/rds/send.c:355 rds_send_worker+0x90/0x290 net/rds/threads.c:200 process_one_work+0x98e/0x1790 kernel/workqueue.c:2173 worker_thread+0x98/0xe40 kernel/workqueue.c:2319 kthread+0x357/0x430 kernel/kthread.c:246 ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:352 Allocated by task 7654: save_stack+0x45/0xd0 mm/kasan/common.c:73 set_track mm/kasan/common.c:85 [inline] __kasan_kmalloc mm/kasan/common.c:495 [inline] __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:468 kasan_slab_alloc+0xf/0x20 mm/kasan/common.c:503 slab_post_alloc_hook mm/slab.h:440 [inline] slab_alloc mm/slab.c:3388 [inline] kmem_cache_alloc+0x11a/0x6f0 mm/slab.c:3548 kmem_cache_zalloc include/linux/slab.h:730 [inline] net_alloc net/core/net_namespace.c:384 [inline] copy_net_ns+0xed/0x340 net/core/net_namespace.c:424 create_new_namespaces+0x400/0x7b0 kernel/nsproxy.c:107 unshare_nsproxy_namespaces+0xc2/0x200 kernel/nsproxy.c:206 ksys_unshare+0x440/0x980 kernel/fork.c:2550 __do_sys_unshare kernel/fork.c:2618 [inline] __se_sys_unshare kernel/fork.c:2616 [inline] __x64_sys_unshare+0x31/0x40 kernel/fork.c:2616 do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 149: 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:457 kasan_slab_free+0xe/0x10 mm/kasan/common.c:465 __cache_free mm/slab.c:3494 [inline] kmem_cache_free+0x86/0x260 mm/slab.c:3754 net_free net/core/net_namespace.c:400 [inline] net_drop_ns.part.0+0x70/0x90 net/core/net_namespace.c:407 net_drop_ns net/core/net_namespace.c:406 [inline] cleanup_net+0x538/0x960 net/core/net_namespace.c:569 process_one_work+0x98e/0x1790 kernel/workqueue.c:2173 worker_thread+0x98/0xe40 kernel/workqueue.c:2319 kthread+0x357/0x430 kernel/kthread.c:246 ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:352 The buggy address belongs to the object at ffff88808a5a80c0 which belongs to the cache net_namespace of size 8512 The buggy address is located 4 bytes inside of 8512-byte region [ffff88808a5a80c0, ffff88808a5aa200) The buggy address belongs to the page: page:ffffea0002296a00 count:1 mapcount:0 mapping:ffff88821bc45e00 index:0xffff88808a5a80c0 compound_mapcount: 0 flags: 0x1fffc0000010200(slab|head) raw: 01fffc0000010200 ffff8880aa34ce58 ffff8880aa34ce58 ffff88821bc45e00 raw: ffff88808a5a80c0 ffff88808a5a80c0 0000000100000000 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88808a5a7f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88808a5a8000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88808a5a8080: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb ^ ffff88808a5a8100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88808a5a8180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================