================================================================== BUG: KASAN: slab-use-after-free in instrument_atomic_read_write include/linux/instrumented.h:112 [inline] BUG: KASAN: slab-use-after-free in atomic_inc_not_zero include/linux/atomic/atomic-instrumented.h:1536 [inline] BUG: KASAN: slab-use-after-free in try_module_get+0x4c/0xd0 kernel/module/main.c:913 Write of size 4 at addr ffff88802f70e308 by task syz.5.2086/13253 CPU: 0 UID: 0 PID: 13253 Comm: syz.5.2086 Tainted: G L syzkaller #0 PREEMPT(full) Tainted: [L]=SOFTLOCKUP Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x100/0x190 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0x156/0x4c9 mm/kasan/report.c:482 kasan_report+0xdf/0x1e0 mm/kasan/report.c:595 check_region_inline mm/kasan/generic.c:186 [inline] kasan_check_range+0x10f/0x1e0 mm/kasan/generic.c:200 instrument_atomic_read_write include/linux/instrumented.h:112 [inline] atomic_inc_not_zero include/linux/atomic/atomic-instrumented.h:1536 [inline] try_module_get+0x4c/0xd0 kernel/module/main.c:913 dvb_device_open+0x124/0x3b0 drivers/media/dvb-core/dvbdev.c:103 chrdev_open+0x234/0x6a0 fs/char_dev.c:411 do_dentry_open+0x6d8/0x1660 fs/open.c:949 vfs_open+0x82/0x3f0 fs/open.c:1081 do_open fs/namei.c:4671 [inline] path_openat+0x208c/0x31a0 fs/namei.c:4830 do_file_open+0x20e/0x430 fs/namei.c:4859 do_sys_openat2+0x10d/0x1e0 fs/open.c:1366 do_sys_open fs/open.c:1372 [inline] __do_sys_openat fs/open.c:1388 [inline] __se_sys_openat fs/open.c:1383 [inline] __x64_sys_openat+0x12d/0x210 fs/open.c:1383 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x106/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f5cfcf5cece Code: 08 0f 85 a5 a8 ff ff 49 89 fb 48 89 f0 48 89 d7 48 89 ce 4c 89 c2 4d 89 ca 4c 8b 44 24 08 4c 8b 4c 24 10 4c 89 5c 24 08 0f 05 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 80 00 00 00 00 48 83 ec 08 RSP: 002b:00007f5cfde3bb28 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 00007f5cfde3c6c0 RCX: 00007f5cfcf5cece RDX: 0000000000000002 RSI: 00007f5cfde3bc00 RDI: ffffffffffffff9c RBP: 00007f5cfde3bc00 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: cccccccccccccccd R13: 00007f5cfd216038 R14: 00007f5cfd215fa0 R15: 00007ffe14582378 Allocated by task 78: kasan_save_stack+0x30/0x50 mm/kasan/common.c:57 kasan_save_track+0x14/0x30 mm/kasan/common.c:78 unpoison_slab_object mm/kasan/common.c:340 [inline] __kasan_slab_alloc+0x89/0x90 mm/kasan/common.c:366 kasan_slab_alloc include/linux/kasan.h:253 [inline] slab_post_alloc_hook mm/slub.c:4501 [inline] slab_alloc_node mm/slub.c:4830 [inline] kmem_cache_alloc_noprof+0x241/0x6e0 mm/slub.c:4837 alloc_pid+0x1bd/0x1890 kernel/pid.c:189 copy_process+0x48f6/0x7a10 kernel/fork.c:2239 kernel_clone+0xfc/0x9a0 kernel/fork.c:2654 user_mode_thread+0xcc/0x110 kernel/fork.c:2730 call_usermodehelper_exec_work kernel/umh.c:171 [inline] call_usermodehelper_exec_work+0xcb/0x180 kernel/umh.c:157 process_one_work+0x9d7/0x1920 kernel/workqueue.c:3275 process_scheduled_works kernel/workqueue.c:3358 [inline] worker_thread+0x5da/0xe40 kernel/workqueue.c:3439 kthread+0x370/0x450 kernel/kthread.c:467 ret_from_fork+0x754/0xd80 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Freed by task 15: kasan_save_stack+0x30/0x50 mm/kasan/common.c:57 kasan_save_track+0x14/0x30 mm/kasan/common.c:78 kasan_save_free_info+0x3b/0x70 mm/kasan/generic.c:584 poison_slab_object mm/kasan/common.c:253 [inline] __kasan_slab_free+0x5f/0x80 mm/kasan/common.c:285 kasan_slab_free include/linux/kasan.h:235 [inline] slab_free_hook mm/slub.c:2687 [inline] slab_free mm/slub.c:6124 [inline] kmem_cache_free+0x124/0x6a0 mm/slub.c:6254 put_pid.part.0+0xf4/0x150 kernel/pid.c:98 put_pid kernel/pid.c:92 [inline] delayed_put_pid+0x23/0x30 kernel/pid.c:107 rcu_do_batch kernel/rcu/tree.c:2617 [inline] rcu_core+0x5a2/0x10d0 kernel/rcu/tree.c:2869 handle_softirqs+0x1eb/0x9e0 kernel/softirq.c:622 run_ksoftirqd kernel/softirq.c:1063 [inline] run_ksoftirqd+0x38/0x60 kernel/softirq.c:1055 smpboot_thread_fn+0x3d3/0xaa0 kernel/smpboot.c:160 kthread+0x370/0x450 kernel/kthread.c:467 ret_from_fork+0x754/0xd80 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Last potentially related work creation: kasan_save_stack+0x30/0x50 mm/kasan/common.c:57 kasan_record_aux_stack+0xa7/0xc0 mm/kasan/generic.c:556 __call_rcu_common.constprop.0+0xa5/0x9b0 kernel/rcu/tree.c:3131 free_pids+0x45/0x80 kernel/pid.c:157 release_task+0xd63/0x1ab0 kernel/exit.c:295 exit_notify kernel/exit.c:777 [inline] do_exit+0x12a7/0x2aa0 kernel/exit.c:983 call_usermodehelper_exec_async+0x35d/0x4b0 kernel/umh.c:122 ret_from_fork+0x754/0xd80 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 The buggy address belongs to the object at ffff88802f70e280 which belongs to the cache pid of size 256 The buggy address is located 136 bytes inside of freed 256-byte region [ffff88802f70e280, ffff88802f70e380) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff88802f70f2c0 pfn:0x2f70e head: order:1 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000240(workingset|head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000240 ffff88801b881b80 ffffea0000c1b910 ffffea0000a58f90 raw: ffff88802f70f2c0 0000000000190001 00000000f5000000 0000000000000000 head: 00fff00000000240 ffff88801b881b80 ffffea0000c1b910 ffffea0000a58f90 head: ffff88802f70f2c0 0000000000190001 00000000f5000000 0000000000000000 head: 00fff00000000001 ffffea0000bdc381 00000000ffffffff 00000000ffffffff head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000002 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 1, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 13, tgid 13 (kworker/u32:1), ts 17683160438, free_ts 0 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x153/0x170 mm/page_alloc.c:1889 prep_new_page mm/page_alloc.c:1897 [inline] get_page_from_freelist+0x111d/0x3140 mm/page_alloc.c:3962 __alloc_frozen_pages_noprof+0x27c/0x2ba0 mm/page_alloc.c:5250 alloc_slab_page mm/slub.c:3255 [inline] allocate_slab mm/slub.c:3444 [inline] new_slab+0xa6/0x6d0 mm/slub.c:3502 refill_objects+0x26b/0x400 mm/slub.c:7134 refill_sheaf mm/slub.c:2804 [inline] alloc_full_sheaf mm/slub.c:2825 [inline] __pcs_replace_empty_main+0x19f/0x600 mm/slub.c:4588 alloc_from_pcs mm/slub.c:4681 [inline] slab_alloc_node mm/slub.c:4815 [inline] kmem_cache_alloc_noprof+0x480/0x6e0 mm/slub.c:4837 alloc_pid+0x1bd/0x1890 kernel/pid.c:189 copy_process+0x48f6/0x7a10 kernel/fork.c:2239 kernel_clone+0xfc/0x9a0 kernel/fork.c:2654 user_mode_thread+0xcc/0x110 kernel/fork.c:2730 call_usermodehelper_exec_work kernel/umh.c:171 [inline] call_usermodehelper_exec_work+0xcb/0x180 kernel/umh.c:157 process_one_work+0x9d7/0x1920 kernel/workqueue.c:3275 process_scheduled_works kernel/workqueue.c:3358 [inline] worker_thread+0x5da/0xe40 kernel/workqueue.c:3439 kthread+0x370/0x450 kernel/kthread.c:467 ret_from_fork+0x754/0xd80 arch/x86/kernel/process.c:158 page_owner free stack trace missing Memory state around the buggy address: ffff88802f70e200: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff88802f70e280: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88802f70e300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88802f70e380: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb ffff88802f70e400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================