syzbot


KASAN: slab-out-of-bounds Read in contpte_clear_young_dirty_ptes

Status: auto-obsoleted due to no activity on 2024/09/08 08:03
Subsystems: arm
[Documentation on labels]
Reported-by: syzbot+7eaa0d7b9fccf21052f1@syzkaller.appspotmail.com
First crash: 180d, last: 175d
Discussions (2)
Title Replies (including bot) Last reply
[syzbot] [maple-tree?] BUG: unable to handle kernel paging request in mas_walk 4 (6) 2024/06/13 19:02
[syzbot] [arm?] KASAN: slab-out-of-bounds Read in contpte_clear_young_dirty_ptes 0 (1) 2024/05/30 23:49

Sample crash report:
==================================================================
BUG: KASAN: slab-out-of-bounds in __ptep_get arch/arm64/include/asm/pgtable.h:315 [inline]
BUG: KASAN: slab-out-of-bounds in __clear_young_dirty_ptes arch/arm64/include/asm/pgtable.h:1309 [inline]
BUG: KASAN: slab-out-of-bounds in contpte_clear_young_dirty_ptes+0x104/0x214 arch/arm64/mm/contpte.c:389
Read of size 8 at addr ffff00000fb510b0 by task syz-executor.1/17627

CPU: 1 PID: 17627 Comm: syz-executor.1 Tainted: G        W          6.10.0-rc1-syzkaller-00027-g4a4be1ad3a6e #0
Hardware name: linux,dummy-virt (DT)
Call trace:
 dump_backtrace+0x9c/0x11c arch/arm64/kernel/stacktrace.c:317
 show_stack+0x18/0x24 arch/arm64/kernel/stacktrace.c:324
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0xa4/0xf4 lib/dump_stack.c:114
 print_address_description mm/kasan/report.c:377 [inline]
 print_report+0xf4/0x5a4 mm/kasan/report.c:488
 kasan_report+0xc8/0x108 mm/kasan/report.c:601
 __asan_report_load8_noabort+0x20/0x2c mm/kasan/report_generic.c:381
 __ptep_get arch/arm64/include/asm/pgtable.h:315 [inline]
 __clear_young_dirty_ptes arch/arm64/include/asm/pgtable.h:1309 [inline]
 contpte_clear_young_dirty_ptes+0x104/0x214 arch/arm64/mm/contpte.c:389
 clear_young_dirty_ptes arch/arm64/include/asm/pgtable.h:1715 [inline]
 madvise_free_pte_range+0xce8/0x10e0 mm/madvise.c:767
 walk_pmd_range mm/pagewalk.c:143 [inline]
 walk_pud_range mm/pagewalk.c:221 [inline]
 walk_p4d_range mm/pagewalk.c:256 [inline]
 walk_pgd_range+0x8e8/0x14a4 mm/pagewalk.c:293
 __walk_page_range+0x420/0x5e4 mm/pagewalk.c:395
 walk_page_range+0x370/0x6f8 mm/pagewalk.c:521
 madvise_free_single_vma+0x300/0x5a8 mm/madvise.c:815
 madvise_dontneed_free mm/madvise.c:929 [inline]
 madvise_vma_behavior+0x30c/0x1028 mm/madvise.c:1046
 madvise_walk_vmas+0x114/0x210 mm/madvise.c:1268
 do_madvise+0x20c/0x6c4 mm/madvise.c:1464
 __do_sys_madvise mm/madvise.c:1481 [inline]
 __se_sys_madvise mm/madvise.c:1479 [inline]
 __arm64_sys_madvise+0x88/0xdc mm/madvise.c:1479
 __invoke_syscall arch/arm64/kernel/syscall.c:34 [inline]
 invoke_syscall+0x6c/0x25c arch/arm64/kernel/syscall.c:48
 el0_svc_common.constprop.0+0xac/0x230 arch/arm64/kernel/syscall.c:133
 do_el0_svc+0x40/0x58 arch/arm64/kernel/syscall.c:152
 el0_svc+0x50/0x180 arch/arm64/kernel/entry-common.c:712
 el0t_64_sync_handler+0x100/0x12c arch/arm64/kernel/entry-common.c:730
 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:598

Allocated by task 15369:
 kasan_save_stack+0x3c/0x64 mm/kasan/common.c:47
 kasan_save_track+0x20/0x3c mm/kasan/common.c:68
 kasan_save_alloc_info+0x40/0x54 mm/kasan/generic.c:565
 unpoison_slab_object mm/kasan/common.c:312 [inline]
 __kasan_slab_alloc+0x8c/0x90 mm/kasan/common.c:338
 kasan_slab_alloc include/linux/kasan.h:201 [inline]
 slab_post_alloc_hook mm/slub.c:3940 [inline]
 slab_alloc_node mm/slub.c:4000 [inline]
 kmem_cache_alloc_noprof+0x128/0x2e0 mm/slub.c:4007
 __kernfs_new_node+0xd0/0x704 fs/kernfs/dir.c:624
 kernfs_new_node+0x100/0x1f0 fs/kernfs/dir.c:700
 __kernfs_create_file+0x38/0x2dc fs/kernfs/file.c:1034
 sysfs_add_file_mode_ns+0x164/0x384 fs/sysfs/file.c:307
 create_files fs/sysfs/group.c:76 [inline]
 internal_create_group+0x3dc/0xb80 fs/sysfs/group.c:180
 internal_create_groups+0x80/0x128 fs/sysfs/group.c:220
 sysfs_create_groups+0x18/0x24 fs/sysfs/group.c:246
 device_add_groups drivers/base/core.c:2823 [inline]
 device_add_attrs drivers/base/core.c:2943 [inline]
 device_add+0xa68/0x12b8 drivers/base/core.c:3675
 netdev_register_kobject+0xe0/0x2b8 net/core/net-sysfs.c:2136
 register_netdevice+0xbe0/0x13e4 net/core/dev.c:10374
 tun_set_iff drivers/net/tun.c:2851 [inline]
 __tun_chr_ioctl+0x1ca0/0x4048 drivers/net/tun.c:3120
 tun_chr_ioctl+0x14/0x2c drivers/net/tun.c:3407
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:907 [inline]
 __se_sys_ioctl fs/ioctl.c:893 [inline]
 __arm64_sys_ioctl+0x124/0x190 fs/ioctl.c:893
 __invoke_syscall arch/arm64/kernel/syscall.c:34 [inline]
 invoke_syscall+0x6c/0x25c arch/arm64/kernel/syscall.c:48
 el0_svc_common.constprop.0+0xac/0x230 arch/arm64/kernel/syscall.c:133
 do_el0_svc+0x40/0x58 arch/arm64/kernel/syscall.c:152
 el0_svc+0x50/0x180 arch/arm64/kernel/entry-common.c:712
 el0t_64_sync_handler+0x100/0x12c arch/arm64/kernel/entry-common.c:730
 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:598

The buggy address belongs to the object at ffff00000fb51000
 which belongs to the cache kernfs_node_cache of size 176
The buggy address is located 0 bytes to the right of
 allocated 176-byte region [ffff00000fb51000, ffff00000fb510b0)

The buggy address belongs to the physical page:
page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x4fb51
flags: 0x1ffc00000000000(node=0|zone=0|lastcpupid=0x7ff)
page_type: 0xffffefff(slab)
raw: 01ffc00000000000 ffff00000a14d280 fffffdffc0787a40 dead000000000004
raw: 0000000000000000 0000000000110011 00000001ffffefff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff00000fb50f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff00000fb51000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff00000fb51080: 00 00 00 00 00 00 fc fc fc fc fc fc fc fc 00 00
                                     ^
 ffff00000fb51100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff00000fb51180: 00 00 00 00 fc fc fc fc fc fc fc fc 00 00 00 00
==================================================================

Crashes (9):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/05/31 08:03 upstream 4a4be1ad3a6e 34889ee3 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-arm64 KASAN: slab-out-of-bounds Read in contpte_clear_young_dirty_ptes
2024/05/31 08:02 upstream 4a4be1ad3a6e 34889ee3 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-arm64 KASAN: slab-out-of-bounds Read in contpte_clear_young_dirty_ptes
2024/05/31 06:29 upstream 4a4be1ad3a6e 34889ee3 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-arm64 KASAN: slab-out-of-bounds Read in contpte_clear_young_dirty_ptes
2024/05/31 06:29 upstream 4a4be1ad3a6e 34889ee3 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-arm64 KASAN: slab-out-of-bounds Read in contpte_clear_young_dirty_ptes
2024/05/30 23:40 upstream 4a4be1ad3a6e 34889ee3 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-arm64 KASAN: slab-out-of-bounds Read in contpte_clear_young_dirty_ptes
2024/05/25 20:07 upstream 56fb6f92854f a10a183e .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-arm64-compat KASAN: slab-out-of-bounds Read in contpte_clear_young_dirty_ptes
2024/05/30 23:49 upstream 4a4be1ad3a6e 34889ee3 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-arm64 KASAN: slab-use-after-free Read in contpte_clear_young_dirty_ptes
2024/05/30 23:40 upstream 4a4be1ad3a6e 34889ee3 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-arm64 KASAN: slab-use-after-free Read in contpte_clear_young_dirty_ptes
2024/05/25 20:08 upstream 56fb6f92854f a10a183e .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-arm64-compat KASAN: use-after-free Read in contpte_clear_young_dirty_ptes
* Struck through repros no longer work on HEAD.