[Android 5.4] KASAN: use-after-free Read in ext4_xattr_delete_inode

4 views
Skip to first unread message

syzbot

unread,
May 26, 2024, 1:00:30 AMMay 26
to syzkaller-a...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 8322246edffa UPSTREAM: selftests: timers: Fix valid-adjtim..
git tree: android12-5.4
console+strace: https://syzkaller.appspot.com/x/log.txt?x=135e4d92980000
kernel config: https://syzkaller.appspot.com/x/.config?x=60c0e8be982a03fd
dashboard link: https://syzkaller.appspot.com/bug?extid=57934e2c8e7a99992e41
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=10262784980000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=11b1e7f0980000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/e66d48f9b7c2/disk-8322246e.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/99bc737b819a/vmlinux-8322246e.xz
kernel image: https://storage.googleapis.com/syzbot-assets/25b8090a87db/bzImage-8322246e.xz
mounted in repro #1: https://storage.googleapis.com/syzbot-assets/701e6d099ddb/mount_0.gz
mounted in repro #2: https://storage.googleapis.com/syzbot-assets/4571a33cec05/mount_6.gz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+57934e...@syzkaller.appspotmail.com

EXT4-fs warning (device loop0): empty_inline_dir:1820: bad inline directory (dir #12) - no `..'
==================================================================
BUG: KASAN: use-after-free in ext4_xattr_delete_inode+0xc1f/0xc30 fs/ext4/xattr.c:2911
Read of size 4 at addr ffff8881db6b2000 by task syz-executor194/360

CPU: 1 PID: 360 Comm: syz-executor194 Not tainted 5.4.268-syzkaller-00001-g8322246edffa #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024
Call Trace:
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack+0x1d8/0x241 lib/dump_stack.c:118
print_address_description+0x8c/0x600 mm/kasan/report.c:384
__kasan_report+0xf3/0x120 mm/kasan/report.c:516
kasan_report+0x30/0x60 mm/kasan/common.c:653
ext4_xattr_delete_inode+0xc1f/0xc30 fs/ext4/xattr.c:2911
ext4_evict_inode+0x1378/0x1ac0 fs/ext4/inode.c:318
evict+0x29b/0x6a0 fs/inode.c:575
d_delete_notify include/linux/fsnotify.h:224 [inline]
vfs_rmdir+0x24b/0x3c0 fs/namei.c:3992
do_rmdir+0x2c1/0x580 fs/namei.c:4040
do_syscall_64+0xca/0x1c0 arch/x86/entry/common.c:290
entry_SYSCALL_64_after_hwframe+0x5c/0xc1

Allocated by task 179:
save_stack mm/kasan/common.c:70 [inline]
set_track mm/kasan/common.c:78 [inline]
__kasan_kmalloc+0x171/0x210 mm/kasan/common.c:529
slab_post_alloc_hook mm/slab.h:584 [inline]
slab_alloc_node mm/slub.c:2829 [inline]
slab_alloc mm/slub.c:2837 [inline]
kmem_cache_alloc+0xd9/0x250 mm/slub.c:2842
mempool_alloc+0x11f/0x530 mm/mempool.c:393
bio_alloc_bioset+0x1e0/0x650 block/bio.c:483
bio_clone_fast+0x25/0x220 block/bio.c:665
bio_split+0x75/0x190 block/bio.c:1905
__blk_queue_split+0xe52/0x14f0 block/blk-merge.c:284
blk_mq_make_request+0x1ad/0x1e10 block/blk-mq.c:2044
generic_make_request+0x40c/0xc90 block/blk-core.c:1072
submit_bio+0x1bf/0x6d0 block/blk-core.c:1199
ext4_io_submit fs/ext4/page-io.c:350 [inline]
io_submit_add_bh fs/ext4/page-io.c:393 [inline]
ext4_bio_write_page+0xf49/0x1810 fs/ext4/page-io.c:518
mpage_submit_page+0x1ae/0x230 fs/ext4/inode.c:2277
mpage_map_and_submit_buffers fs/ext4/inode.c:2477 [inline]
mpage_map_and_submit_extent fs/ext4/inode.c:2611 [inline]
ext4_writepages+0x1fc9/0x3cc0 fs/ext4/inode.c:2940
do_writepages+0x12b/0x270 mm/page-writeback.c:2344
__writeback_single_inode+0xd9/0xcc0 fs/fs-writeback.c:1467
writeback_sb_inodes+0x9e0/0x1800 fs/fs-writeback.c:1730
__writeback_inodes_wb fs/fs-writeback.c:1801 [inline]
wb_writeback+0x4b3/0xd70 fs/fs-writeback.c:1907
wb_check_background_flush fs/fs-writeback.c:1975 [inline]
wb_do_writeback fs/fs-writeback.c:2063 [inline]
wb_workfn+0xce8/0x1230 fs/fs-writeback.c:2091
process_one_work+0x765/0xd20 kernel/workqueue.c:2290
worker_thread+0xaef/0x1470 kernel/workqueue.c:2436
kthread+0x2da/0x360 kernel/kthread.c:288
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:354

Freed by task 17:
save_stack mm/kasan/common.c:70 [inline]
set_track mm/kasan/common.c:78 [inline]
kasan_set_free_info mm/kasan/common.c:345 [inline]
__kasan_slab_free+0x1b5/0x270 mm/kasan/common.c:487
slab_free_hook mm/slub.c:1455 [inline]
slab_free_freelist_hook mm/slub.c:1494 [inline]
slab_free mm/slub.c:3080 [inline]
kmem_cache_free+0x10b/0x2c0 mm/slub.c:3096
bio_put block/bio.c:604 [inline]
__bio_chain_endio block/bio.c:313 [inline]
bio_endio+0x2f/0x790 block/bio.c:1865
req_bio_endio block/blk-core.c:246 [inline]
blk_update_request+0x37f/0xe40 block/blk-core.c:1481
scsi_end_request+0x83/0x520 drivers/scsi/scsi_lib.c:588
scsi_io_completion+0x1cb/0x480 drivers/scsi/scsi_lib.c:969
blk_done_softirq+0x2f3/0x390 block/blk-softirq.c:37
__do_softirq+0x23b/0x6b7 kernel/softirq.c:292

The buggy address belongs to the object at ffff8881db6b2000
which belongs to the cache bio-0 of size 216
The buggy address is located 0 bytes inside of
216-byte region [ffff8881db6b2000, ffff8881db6b20d8)
The buggy address belongs to the page:
page:ffffea00076dac80 refcount:1 mapcount:0 mapping:ffff8881f1cf1180 index:0x0
flags: 0x8000000000000200(slab)
raw: 8000000000000200 dead000000000100 dead000000000122 ffff8881f1cf1180
raw: 0000000000000000 00000000000c000c 00000001ffffffff 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 0x92800(GFP_NOWAIT|__GFP_NOWARN|__GFP_NORETRY|__GFP_NOMEMALLOC)
set_page_owner include/linux/page_owner.h:31 [inline]
post_alloc_hook mm/page_alloc.c:2165 [inline]
prep_new_page+0x18f/0x370 mm/page_alloc.c:2171
get_page_from_freelist+0x2d13/0x2d90 mm/page_alloc.c:3794
__alloc_pages_nodemask+0x393/0x840 mm/page_alloc.c:4891
alloc_slab_page+0x39/0x3c0 mm/slub.c:343
allocate_slab mm/slub.c:1683 [inline]
new_slab+0x97/0x440 mm/slub.c:1749
new_slab_objects mm/slub.c:2505 [inline]
___slab_alloc+0x2fe/0x490 mm/slub.c:2667
__slab_alloc+0x62/0xa0 mm/slub.c:2707
slab_alloc_node mm/slub.c:2792 [inline]
slab_alloc mm/slub.c:2837 [inline]
kmem_cache_alloc+0x109/0x250 mm/slub.c:2842
mempool_alloc+0x11f/0x530 mm/mempool.c:393
bio_alloc_bioset+0x1e0/0x650 block/bio.c:483
bio_clone_fast+0x25/0x220 block/bio.c:665
bio_split+0x75/0x190 block/bio.c:1905
__blk_queue_split+0xe52/0x14f0 block/blk-merge.c:284
blk_mq_make_request+0x1ad/0x1e10 block/blk-mq.c:2044
generic_make_request+0x40c/0xc90 block/blk-core.c:1072
submit_bio+0x1bf/0x6d0 block/blk-core.c:1199
page_owner free stack trace missing

Memory state around the buggy address:
ffff8881db6b1f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff8881db6b1f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff8881db6b2000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff8881db6b2080: fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc fc
ffff8881db6b2100: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb
==================================================================


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup

syzbot

unread,
May 31, 2024, 3:37:31 AMMay 31
to syzkaller-a...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: a8e7f812fbc1 ANDROID: cpufreq: brcmstb-avs-cpufreq: fix bu..
git tree: android13-5.10-lts
console+strace: https://syzkaller.appspot.com/x/log.txt?x=16e5dfe6980000
kernel config: https://syzkaller.appspot.com/x/.config?x=74d175a2076bec3e
dashboard link: https://syzkaller.appspot.com/bug?extid=d45e91cd9eebfdf60831
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=10db4e06980000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=11164dd2980000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/8d154db8524e/disk-a8e7f812.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/0e20473f93c5/vmlinux-a8e7f812.xz
kernel image: https://storage.googleapis.com/syzbot-assets/e0b27eb5a639/bzImage-a8e7f812.xz
mounted in repro: https://storage.googleapis.com/syzbot-assets/c84967c7b97c/mount_0.gz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+d45e91...@syzkaller.appspotmail.com

==================================================================
BUG: KASAN: use-after-free in ext4_xattr_delete_inode+0xc67/0xc80 fs/ext4/xattr.c:2894
Read of size 4 at addr ffff8881085a9000 by task syz-executor167/288

CPU: 1 PID: 288 Comm: syz-executor167 Not tainted 5.10.214-syzkaller-00496-ga8e7f812fbc1 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024
Call Trace:
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack_lvl+0x1e2/0x24b lib/dump_stack.c:118
print_address_description+0x81/0x3b0 mm/kasan/report.c:248
__kasan_report mm/kasan/report.c:435 [inline]
kasan_report+0x179/0x1c0 mm/kasan/report.c:452
__asan_report_load4_noabort+0x14/0x20 mm/kasan/report_generic.c:308
ext4_xattr_delete_inode+0xc67/0xc80 fs/ext4/xattr.c:2894
ext4_evict_inode+0x1095/0x1730 fs/ext4/inode.c:300
evict+0x2a3/0x6c0 fs/inode.c:577
iput_final fs/inode.c:1697 [inline]
iput+0x632/0x7e0 fs/inode.c:1723
d_delete_notify include/linux/fsnotify.h:261 [inline]
vfs_rmdir+0x271/0x3f0 fs/namei.c:3865
do_rmdir+0x2cf/0x5c0 fs/namei.c:3912
__do_sys_rmdir fs/namei.c:3930 [inline]
__se_sys_rmdir fs/namei.c:3928 [inline]
__x64_sys_rmdir+0x49/0x50 fs/namei.c:3928
do_syscall_64+0x34/0x70
entry_SYSCALL_64_after_hwframe+0x61/0xc6
RIP: 0033:0x7fba1ce18dc7
Code: 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 b8 54 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffdec9f2128 EFLAGS: 00000207 ORIG_RAX: 0000000000000054
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fba1ce18dc7
RDX: 0000000000008890 RSI: 0000000000000000 RDI: 00007ffdec9f32d0
RBP: 0000000000000065 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000100 R11: 0000000000000207 R12: 00007ffdec9f32d0
R13: 0000555556cc1740 R14: 431bde82d7b634db R15: 00007ffdec9f5450

Allocated by task 0:
(stack is not available)

The buggy address belongs to the object at ffff8881085a9000
which belongs to the cache kmalloc-128 of size 128
The buggy address is located 0 bytes inside of
128-byte region [ffff8881085a9000, ffff8881085a9080)
The buggy address belongs to the page:
page:ffffea0004216a40 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff8881085a9100 pfn:0x1085a9
flags: 0x4000000000000200(slab)
raw: 4000000000000200 ffffea0004216b08 ffffea0004216908 ffff888100043500
raw: ffff8881085a9100 0000000000100005 00000001ffffffff 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 0x12cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY), pid 1, ts 1126045837, free_ts 0
set_page_owner include/linux/page_owner.h:35 [inline]
post_alloc_hook mm/page_alloc.c:2456 [inline]
prep_new_page+0x166/0x180 mm/page_alloc.c:2462
get_page_from_freelist+0x2d8c/0x2f30 mm/page_alloc.c:4254
__alloc_pages_nodemask+0x435/0xaf0 mm/page_alloc.c:5346
allocate_slab mm/slub.c:1808 [inline]
new_slab+0x80/0x400 mm/slub.c:1869
new_slab_objects mm/slub.c:2627 [inline]
___slab_alloc+0x302/0x4b0 mm/slub.c:2791
__slab_alloc+0x63/0xa0 mm/slub.c:2831
slab_alloc_node mm/slub.c:2913 [inline]
slab_alloc mm/slub.c:2955 [inline]
kmem_cache_alloc_trace+0x1bd/0x2e0 mm/slub.c:2972
kmalloc include/linux/slab.h:552 [inline]
kzalloc include/linux/slab.h:664 [inline]
call_usermodehelper_setup+0x72/0x1e0 kernel/umh.c:363
kobject_uevent_env+0x637/0x700 lib/kobject_uevent.c:614
kobject_uevent+0x1f/0x30 lib/kobject_uevent.c:642
kernel_add_sysfs_param+0x108/0x12d kernel/params.c:798
param_sysfs_builtin+0x16a/0x1e2 kernel/params.c:833
param_sysfs_init+0x6a/0x6f kernel/params.c:954
do_one_initcall+0x189/0x620 init/main.c:1195
do_initcall_level+0x186/0x304 init/main.c:1268
do_initcalls+0x4e/0x8e init/main.c:1284
page_owner free stack trace missing

Memory state around the buggy address:
ffff8881085a8f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff8881085a8f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff8881085a9000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff8881085a9080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff8881085a9100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb

syzbot

unread,
May 31, 2024, 3:59:27 AMMay 31
to syzkaller-a...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 424f92bcbe8f Merge branch 'android13-5.15' into branch 'an..
git tree: android13-5.15-lts
console+strace: https://syzkaller.appspot.com/x/log.txt?x=17902026980000
kernel config: https://syzkaller.appspot.com/x/.config?x=4bd6534b2e0a6561
dashboard link: https://syzkaller.appspot.com/bug?extid=1a3077ff32098e7caf1e
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=14decc4a980000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1717624a980000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/6f32113ae406/disk-424f92bc.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/e5c859ca07ad/vmlinux-424f92bc.xz
kernel image: https://storage.googleapis.com/syzbot-assets/c7430ddb9727/bzImage-424f92bc.xz
mounted in repro: https://storage.googleapis.com/syzbot-assets/fbcde576769a/mount_0.gz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+1a3077...@syzkaller.appspotmail.com

==================================================================
BUG: KASAN: use-after-free in ext4_xattr_delete_inode+0xcd0/0xce0 fs/ext4/xattr.c:2904
Read of size 4 at addr ffff88810778f000 by task syz-executor841/294

CPU: 0 PID: 294 Comm: syz-executor841 Not tainted 5.15.149-syzkaller-00055-g424f92bcbe8f #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x151/0x1b7 lib/dump_stack.c:106
print_address_description+0x87/0x3b0 mm/kasan/report.c:248
__kasan_report mm/kasan/report.c:427 [inline]
kasan_report+0x179/0x1c0 mm/kasan/report.c:444
__asan_report_load4_noabort+0x14/0x20 mm/kasan/report_generic.c:308
ext4_xattr_delete_inode+0xcd0/0xce0 fs/ext4/xattr.c:2904
ext4_evict_inode+0xea1/0x14e0 fs/ext4/inode.c:300
evict+0x2a3/0x630 fs/inode.c:587
iput_final fs/inode.c:1705 [inline]
iput+0x63b/0x7e0 fs/inode.c:1731
d_delete_notify include/linux/fsnotify.h:270 [inline]
vfs_rmdir+0x359/0x470 fs/namei.c:4162
do_rmdir+0x3ab/0x630 fs/namei.c:4210
__do_sys_rmdir fs/namei.c:4229 [inline]
__se_sys_rmdir fs/namei.c:4227 [inline]
__x64_sys_rmdir+0x49/0x50 fs/namei.c:4227
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x61/0xcb
RIP: 0033:0x7fe2aba47dc7
Code: 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 b8 54 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffe9d70cac8 EFLAGS: 00000207 ORIG_RAX: 0000000000000054
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fe2aba47dc7
RDX: 0000000000008890 RSI: 0000000000000000 RDI: 00007ffe9d70dc70
RBP: 0000000000000065 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000100 R11: 0000000000000207 R12: 00007ffe9d70dc70
R13: 00005555564ab740 R14: 431bde82d7b634db R15: 00007ffe9d70fdf0
</TASK>

Allocated by task 1:
kasan_save_stack mm/kasan/common.c:38 [inline]
kasan_set_track mm/kasan/common.c:45 [inline]
set_alloc_info mm/kasan/common.c:433 [inline]
____kasan_kmalloc+0xdb/0x110 mm/kasan/common.c:512
__kasan_kmalloc+0x9/0x10 mm/kasan/common.c:521
kasan_kmalloc include/linux/kasan.h:227 [inline]
kmem_cache_alloc_trace+0x115/0x210 mm/slub.c:3267
kmalloc include/linux/slab.h:603 [inline]
kzalloc include/linux/slab.h:733 [inline]
call_usermodehelper_setup+0x8f/0x220 kernel/umh.c:365
kobject_uevent_env+0x637/0x700 lib/kobject_uevent.c:614
kobject_uevent+0x1f/0x30 lib/kobject_uevent.c:642
kernel_add_sysfs_param+0x108/0x12d kernel/params.c:816
param_sysfs_builtin+0x16a/0x1e2 kernel/params.c:851
param_sysfs_init+0x6a/0x6f kernel/params.c:970
do_one_initcall+0x182/0x610 init/main.c:1299
do_initcall_level+0x186/0x304 init/main.c:1372
do_initcalls+0x4e/0x8e init/main.c:1388
do_basic_setup+0x81/0x8a init/main.c:1407
kernel_init_freeable+0x2c1/0x3f7 init/main.c:1612
kernel_init+0x1d/0x290 init/main.c:1503
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298

The buggy address belongs to the object at ffff88810778f000
which belongs to the cache kmalloc-128 of size 128
The buggy address is located 0 bytes inside of
128-byte region [ffff88810778f000, ffff88810778f080)
The buggy address belongs to the page:
page:ffffea00041de3c0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10778f
flags: 0x4000000000000200(slab|zone=1)
raw: 4000000000000200 ffffea00041de240 0000000500000005 ffff888100042a80
raw: 0000000000000000 0000000080100010 00000001ffffffff 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 0x12cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY), pid 1, ts 1205780601, free_ts 0
set_page_owner include/linux/page_owner.h:33 [inline]
post_alloc_hook+0x1a3/0x1b0 mm/page_alloc.c:2604
prep_new_page+0x1b/0x110 mm/page_alloc.c:2610
get_page_from_freelist+0x3550/0x35d0 mm/page_alloc.c:4484
__alloc_pages+0x27e/0x8f0 mm/page_alloc.c:5776
allocate_slab mm/slub.c:1932 [inline]
new_slab+0x9a/0x4e0 mm/slub.c:1995
___slab_alloc+0x39e/0x830 mm/slub.c:3028
__slab_alloc+0x4a/0x90 mm/slub.c:3115
slab_alloc_node mm/slub.c:3206 [inline]
slab_alloc mm/slub.c:3248 [inline]
kmem_cache_alloc_trace+0x142/0x210 mm/slub.c:3265
kmalloc include/linux/slab.h:603 [inline]
kzalloc include/linux/slab.h:733 [inline]
call_usermodehelper_setup+0x8f/0x220 kernel/umh.c:365
kobject_uevent_env+0x637/0x700 lib/kobject_uevent.c:614
kobject_uevent+0x1f/0x30 lib/kobject_uevent.c:642
kernel_add_sysfs_param+0x108/0x12d kernel/params.c:816
param_sysfs_builtin+0x16a/0x1e2 kernel/params.c:851
param_sysfs_init+0x6a/0x6f kernel/params.c:970
do_one_initcall+0x182/0x610 init/main.c:1299
do_initcall_level+0x186/0x304 init/main.c:1372
page_owner free stack trace missing

Memory state around the buggy address:
ffff88810778ef00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff88810778ef80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff88810778f000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff88810778f080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88810778f100: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb

syzbot

unread,
May 31, 2024, 4:44:20 AMMay 31
to syzkaller-a...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: dd875b63669a ANDROID: GKI: Update rockchip symbols for som..
git tree: android14-6.1
console+strace: https://syzkaller.appspot.com/x/log.txt?x=12dc2f8a980000
kernel config: https://syzkaller.appspot.com/x/.config?x=4a340f281ebc7608
dashboard link: https://syzkaller.appspot.com/bug?extid=93b5dbd72bdcbd60b5ec
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=12b5744a980000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=174e4162980000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/7af88db2f98b/disk-dd875b63.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/7e301d96f827/vmlinux-dd875b63.xz
kernel image: https://storage.googleapis.com/syzbot-assets/8421aa66a5f7/bzImage-dd875b63.xz
mounted in repro: https://storage.googleapis.com/syzbot-assets/2f445bbb7f34/mount_0.gz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+93b5db...@syzkaller.appspotmail.com

==================================================================
BUG: KASAN: use-after-free in ext4_xattr_delete_inode+0xcd0/0xce0 fs/ext4/xattr.c:2905
Read of size 4 at addr ffff8881228df000 by task syz-executor117/295

CPU: 1 PID: 295 Comm: syz-executor117 Not tainted 6.1.75-syzkaller-00033-gdd875b63669a #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x151/0x1b7 lib/dump_stack.c:106
print_address_description mm/kasan/report.c:316 [inline]
print_report+0x158/0x4e0 mm/kasan/report.c:427
kasan_report+0x13c/0x170 mm/kasan/report.c:531
__asan_report_load4_noabort+0x14/0x20 mm/kasan/report_generic.c:350
ext4_xattr_delete_inode+0xcd0/0xce0 fs/ext4/xattr.c:2905
ext4_evict_inode+0xef9/0x1550 fs/ext4/inode.c:296
evict+0x2a3/0x630 fs/inode.c:666
iput_final fs/inode.c:1791 [inline]
iput+0x642/0x870 fs/inode.c:1817
d_delete_notify include/linux/fsnotify.h:284 [inline]
vfs_rmdir+0x3c2/0x500 fs/namei.c:4211
do_rmdir+0x3ab/0x630 fs/namei.c:4259
__do_sys_rmdir fs/namei.c:4278 [inline]
__se_sys_rmdir fs/namei.c:4276 [inline]
__x64_sys_rmdir+0x49/0x50 fs/namei.c:4276
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:81
entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7fcd595e3dc7
Code: 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 b8 54 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffff8146ce8 EFLAGS: 00000207 ORIG_RAX: 0000000000000054
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fcd595e3dc7
RDX: 0000000000008890 RSI: 0000000000000000 RDI: 00007ffff8147e90
RBP: 0000000000000065 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000100 R11: 0000000000000207 R12: 00007ffff8147e90
R13: 00005555573bd740 R14: 431bde82d7b634db R15: 00007ffff814a010
</TASK>

The buggy address belongs to the physical page:
page:ffffea00048a37c0 refcount:0 mapcount:0 mapping:0000000000000000 index:0x1 pfn:0x1228df
flags: 0x4000000000000000(zone=1)
raw: 4000000000000000 ffffea00048a3808 ffff8881f713bb68 0000000000000000
raw: 0000000000000001 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as freed
page last allocated via order 0, migratetype Movable, gfp_mask 0x140cca(GFP_HIGHUSER_MOVABLE|__GFP_COMP), pid 297, tgid 297 (udevd), ts 22637829813, free_ts 22638261179
set_page_owner include/linux/page_owner.h:33 [inline]
post_alloc_hook+0x213/0x220 mm/page_alloc.c:2590
prep_new_page+0x1b/0x110 mm/page_alloc.c:2597
get_page_from_freelist+0x27ea/0x2870 mm/page_alloc.c:4425
__alloc_pages+0x3a1/0x780 mm/page_alloc.c:5712
__folio_alloc+0x15/0x40 mm/page_alloc.c:5744
__folio_alloc_node include/linux/gfp.h:245 [inline]
folio_alloc include/linux/gfp.h:274 [inline]
shmem_alloc_folio mm/shmem.c:1597 [inline]
shmem_alloc_and_acct_folio+0x78c/0xa50 mm/shmem.c:1622
shmem_get_folio_gfp+0x12d4/0x24b0 mm/shmem.c:1950
shmem_get_folio mm/shmem.c:2081 [inline]
shmem_write_begin+0x164/0x3a0 mm/shmem.c:2569
generic_perform_write+0x2f9/0x5c0 mm/filemap.c:3838
__generic_file_write_iter+0x174/0x3a0 mm/filemap.c:3966
generic_file_write_iter+0xb1/0x310 mm/filemap.c:3998
call_write_iter include/linux/fs.h:2258 [inline]
new_sync_write fs/read_write.c:491 [inline]
vfs_write+0x902/0xeb0 fs/read_write.c:584
ksys_write+0x199/0x2c0 fs/read_write.c:637
__do_sys_write fs/read_write.c:649 [inline]
__se_sys_write fs/read_write.c:646 [inline]
__x64_sys_write+0x7b/0x90 fs/read_write.c:646
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:81
entry_SYSCALL_64_after_hwframe+0x63/0xcd
page last free stack trace:
reset_page_owner include/linux/page_owner.h:26 [inline]
free_pages_prepare mm/page_alloc.c:1498 [inline]
free_pcp_prepare mm/page_alloc.c:1572 [inline]
free_unref_page_prepare+0x83d/0x850 mm/page_alloc.c:3498
free_unref_page_list+0xf1/0x7b0 mm/page_alloc.c:3646
release_pages+0xf7f/0xfe0 mm/swap.c:1063
__pagevec_release+0x84/0x100 mm/swap.c:1083
pagevec_release include/linux/pagevec.h:71 [inline]
folio_batch_release include/linux/pagevec.h:135 [inline]
shmem_undo_range+0x5fc/0x1660 mm/shmem.c:951
shmem_truncate_range mm/shmem.c:1067 [inline]
shmem_evict_inode+0x25f/0xa30 mm/shmem.c:1176
evict+0x2a3/0x630 fs/inode.c:666
iput_final fs/inode.c:1791 [inline]
iput+0x642/0x870 fs/inode.c:1817
dentry_unlink_inode+0x34f/0x440 fs/dcache.c:401
__dentry_kill+0x447/0x650 fs/dcache.c:607
dentry_kill+0xc0/0x2a0
dput+0x160/0x310 fs/dcache.c:913
do_renameat2+0xbc9/0x1400 fs/namei.c:5016
__do_sys_rename fs/namei.c:5060 [inline]
__se_sys_rename fs/namei.c:5058 [inline]
__x64_sys_rename+0x86/0x90 fs/namei.c:5058
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:81
entry_SYSCALL_64_after_hwframe+0x63/0xcd

Memory state around the buggy address:
ffff8881228def00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff8881228def80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff8881228df000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
^
ffff8881228df080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff8881228df100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================
EXT4-fs (loop0): unmounting filesystem.
EXT4-fs (loop0): unmounting filesystem.
EXT4-fs (loop0): unmounting filesystem.
EXT4-fs (loop0): unmounting filesystem.
EXT4-fs (loop0): unmounting filesystem.
EXT4-fs (loop0): unmounting filesystem.
EXT4-fs (loop0): unmounting filesystem.
EXT4-fs (loop0): unmounting filesystem.
EXT4-fs (loop0): unmounting filesystem.
EXT4-fs (loop0): unmounting filesystem.
EXT4-fs (loop0): unmounting filesystem.
EXT4-fs (loop0): unmounting filesystem.
EXT4-fs (loop0): unmounting filesystem.
EXT4-fs (loop0): unmounting filesystem.
EXT4-fs (loop0): unmounting filesystem.
EXT4-fs (loop0): unmounting filesystem.
EXT4-fs (loop0): unmounting filesystem.
EXT4-fs (loop0): unmounting filesystem.
EXT4-fs (loop0): unmounting filesystem.
EXT4-fs (loop0): unmounting filesystem.
EXT4-fs (loop0): unmounting filesystem.
EXT4-fs (loop0): unmounting filesystem.
EXT4-fs (loop0): unmounting filesystem.
EXT4-fs error (device loop0): ext4_xattr_inode_iget:404: comm syz-executor117: inode #1: comm syz-executor117: iget: illegal inode #
EXT4-fs error (device loop0): ext4_xattr_inode_iget:409: comm syz-executor117: error while reading EA inode 1 err=-117
EXT4-fs error (device loop0): ext4_xattr_inode_iget:404: comm syz-executor117: inode #1: comm syz-executor117: iget: illegal inode #
EXT4-fs error (device loop0): ext4_xattr_inode_iget:409: comm syz-executor117: error while reading EA inode 1 err=-117
EXT4-fs error (device loop0): ext4_xattr_inode_iget:404: comm syz-executor117: inode #1: comm syz-executor117: iget: illegal inode #
EXT4-fs error (device loop0): ext4_xattr_inode_iget:409: comm syz-executor117: error while reading EA inode 1 err=-117
EXT4-fs unmount: 248 callbacks suppressed
EXT4-fs (loop0): unmounting filesystem.
EXT4-fs (loop0): unmounting filesystem.
Reply all
Reply to author
Forward
0 new messages