================================================================== BUG: KASAN: slab-out-of-bounds in instrument_atomic_read include/linux/instrumented.h:68 [inline] BUG: KASAN: slab-out-of-bounds in atomic_long_read include/linux/atomic/atomic-instrumented.h:3188 [inline] BUG: KASAN: slab-out-of-bounds in zs_get_total_pages mm/zsmalloc.c:1066 [inline] BUG: KASAN: slab-out-of-bounds in zpool_get_total_pages+0x46/0x70 mm/zsmalloc.c:436 Read of size 8 at addr ffff88810ccc7b10 by task syz.0.17/5992 CPU: 0 UID: 0 PID: 5992 Comm: syz.0.17 Not tainted syzkaller #0 PREEMPT(full) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 Call Trace: dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0xca/0x240 mm/kasan/report.c:482 kasan_report+0x118/0x150 mm/kasan/report.c:595 check_region_inline mm/kasan/generic.c:-1 [inline] kasan_check_range+0x2b0/0x2c0 mm/kasan/generic.c:200 instrument_atomic_read include/linux/instrumented.h:68 [inline] atomic_long_read include/linux/atomic/atomic-instrumented.h:3188 [inline] zs_get_total_pages mm/zsmalloc.c:1066 [inline] zpool_get_total_pages+0x46/0x70 mm/zsmalloc.c:436 zswap_total_pages+0xf6/0x1e0 mm/zswap.c:457 zswap_check_limits mm/zswap.c:465 [inline] zswap_store+0x52f/0x1f40 mm/zswap.c:1521 swap_writeout+0x710/0xd70 mm/page_io.c:275 writeout mm/vmscan.c:662 [inline] pageout mm/vmscan.c:721 [inline] shrink_folio_list+0x3011/0x4c70 mm/vmscan.c:1453 reclaim_folio_list+0xeb/0x500 mm/vmscan.c:2233 reclaim_pages+0x454/0x520 mm/vmscan.c:2270 madvise_cold_or_pageout_pte_range+0x1974/0x1d00 mm/madvise.c:565 walk_pmd_range mm/pagewalk.c:130 [inline] walk_pud_range mm/pagewalk.c:224 [inline] walk_p4d_range mm/pagewalk.c:262 [inline] walk_pgd_range+0xfe9/0x1d40 mm/pagewalk.c:303 __walk_page_range+0x14c/0x710 mm/pagewalk.c:410 walk_page_range_vma+0x393/0x440 mm/pagewalk.c:705 madvise_pageout_page_range mm/madvise.c:624 [inline] madvise_pageout mm/madvise.c:649 [inline] madvise_vma_behavior+0x311f/0x3a10 mm/madvise.c:1352 madvise_walk_vmas+0x51c/0xa30 mm/madvise.c:1669 madvise_do_behavior+0x38e/0x550 mm/madvise.c:1885 do_madvise+0x1bc/0x270 mm/madvise.c:1978 __do_sys_madvise mm/madvise.c:1987 [inline] __se_sys_madvise mm/madvise.c:1985 [inline] __x64_sys_madvise+0xa7/0xc0 mm/madvise.c:1985 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0xfa0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f526318ec29 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ffdd0a28298 EFLAGS: 00000246 ORIG_RAX: 000000000000001c RAX: ffffffffffffffda RBX: 00007f52633d5fa0 RCX: 00007f526318ec29 RDX: 0000000000000015 RSI: 0000000000003000 RDI: 0000200000000000 RBP: 00007f5263211e41 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f52633d5fa0 R14: 00007f52633d5fa0 R15: 0000000000000003 Allocated by task 1: kasan_save_stack mm/kasan/common.c:56 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:77 poison_kmalloc_redzone mm/kasan/common.c:400 [inline] __kasan_kmalloc+0x93/0xb0 mm/kasan/common.c:417 kasan_kmalloc include/linux/kasan.h:262 [inline] __do_kmalloc_node mm/slub.c:5602 [inline] __kmalloc_noprof+0x411/0x7f0 mm/slub.c:5614 kmalloc_noprof include/linux/slab.h:961 [inline] kzalloc_noprof include/linux/slab.h:1094 [inline] shrinker_alloc+0x199/0xa80 mm/shrinker.c:724 binder_alloc_shrinker_init+0x45/0xe0 drivers/android/binder_alloc.c:1265 binder_init+0x17/0x260 drivers/android/binder.c:7095 do_one_initcall+0x236/0x820 init/main.c:1283 do_initcall_level+0x104/0x190 init/main.c:1345 do_initcalls+0x59/0xa0 init/main.c:1361 kernel_init_freeable+0x334/0x4b0 init/main.c:1593 kernel_init+0x1d/0x1d0 init/main.c:1483 ret_from_fork+0x4bc/0x870 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 ffff88810ccc7b00 which belongs to the cache kmalloc-8 of size 8 The buggy address is located 8 bytes to the right of allocated 8-byte region [ffff88810ccc7b00, ffff88810ccc7b08) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10ccc7 anon flags: 0x57ff00000000000(node=1|zone=2|lastcpupid=0x7ff) page_type: f5(slab) raw: 057ff00000000000 ffff88801a841500 0000000000000000 dead000000000001 raw: 0000000000000000 0000000000800080 00000000f5000000 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x52cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP), pid 1, tgid 1 (swapper/0), ts 16130935485, free_ts 0 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x240/0x2a0 mm/page_alloc.c:1850 prep_new_page mm/page_alloc.c:1858 [inline] get_page_from_freelist+0x21e4/0x22c0 mm/page_alloc.c:3869 __alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:5159 alloc_pages_mpol+0x232/0x4a0 mm/mempolicy.c:2416 alloc_slab_page mm/slub.c:3023 [inline] allocate_slab+0x96/0x3a0 mm/slub.c:3196 new_slab mm/slub.c:3250 [inline] ___slab_alloc+0xe94/0x1920 mm/slub.c:4626 __slab_alloc+0x65/0x100 mm/slub.c:4745 __slab_alloc_node mm/slub.c:4821 [inline] slab_alloc_node mm/slub.c:5232 [inline] __do_kmalloc_node mm/slub.c:5601 [inline] __kmalloc_node_track_caller_noprof+0x5c7/0x800 mm/slub.c:5711 __kmemdup_nul mm/util.c:64 [inline] kstrdup+0x42/0x100 mm/util.c:84 __kernfs_new_node+0x9c/0x7e0 fs/kernfs/dir.c:633 kernfs_new_node+0x102/0x210 fs/kernfs/dir.c:713 kernfs_create_link+0xa7/0x200 fs/kernfs/symlink.c:39 sysfs_do_create_link_sd+0x83/0x110 fs/sysfs/symlink.c:44 device_create_sys_dev_entry+0x11a/0x180 drivers/base/core.c:3515 device_add+0x733/0xb50 drivers/base/core.c:3659 __video_register_device+0x3dc1/0x4ca0 drivers/media/v4l2-core/v4l2-dev.c:1076 page_owner free stack trace missing Memory state around the buggy address: ffff88810ccc7a00: 00 fc fc fc 05 fc fc fc 00 fc fc fc 00 fc fc fc ffff88810ccc7a80: 00 fc fc fc 05 fc fc fc 06 fc fc fc 06 fc fc fc >ffff88810ccc7b00: 00 fc fc fc 06 fc fc fc 07 fc fc fc 07 fc fc fc ^ ffff88810ccc7b80: 04 fc fc fc 06 fc fc fc 00 fc fc fc 00 fc fc fc ffff88810ccc7c00: 07 fc fc fc 00 fc fc fc 06 fc fc fc 05 fc fc fc ==================================================================