syzbot


KASAN: out-of-bounds Read in ext4_xattr_set_entry

Status: upstream: reported C repro on 2023/09/20 02:40
Reported-by: syzbot+9b8029e222e845c4480b@syzkaller.appspotmail.com
First crash: 451d, last: 4d01h
Fix bisection: the issue occurs on the latest tested release (bisect log)
  
Similar bugs (15)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.19 KASAN: use-after-free Read in ext4_xattr_set_entry (2) C done 7 1189d 1647d 1/1 fixed on 2021/10/13 07:23
android-5-15 KASAN: out-of-bounds Read in ext4_xattr_set_entry 1 544d 544d 0/2 auto-obsoleted due to no activity on 2023/09/17 07:02
upstream KASAN: out-of-bounds Read in ext4_xattr_set_entry ext4 C error 537 17m 83d 0/28 upstream: reported C repro on 2024/09/22 00:16
android-54 KASAN: out-of-bounds Read in ext4_xattr_set_entry ext4 C 14 598d 1364d 0/2 auto-obsoleted due to no activity on 2023/08/23 09:06
linux-6.1 KASAN: out-of-bounds Read in ext4_xattr_set_entry missing-backport origin:lts-only C unreliable 230 7h45m 575d 0/3 upstream: reported C repro on 2023/05/19 08:42
linux-4.14 KASAN: out-of-bounds Read in ext4_xattr_set_entry C error 2 828d 1342d 0/1 upstream: reported C repro on 2021/04/12 14:20
android-6-1 KASAN: out-of-bounds Read in ext4_xattr_set_entry origin:lts C 118 12h52m 215d 0/2 upstream: reported C repro on 2024/05/13 18:18
android-5-15 general protection fault in ext4_xattr_set_entry C error 1 653d 733d 2/2 fixed on 2023/03/28 12:29
android-5-10 general protection fault in ext4_xattr_set_entry (4) C error 62 556d 585d 2/2 fixed on 2023/06/07 17:22
android-5-10 general protection fault in ext4_xattr_set_entry (2) ext4 C error 423 591d 791d 2/2 fixed on 2023/05/03 13:06
upstream KASAN: use-after-free Read in ext4_xattr_set_entry (5) ext4 2 873d 931d 0/28 auto-obsoleted due to no activity on 2022/11/22 17:19
android-5-10 general protection fault in ext4_xattr_set_entry (3) C error 9 587d 590d 2/2 fixed on 2023/05/08 19:06
upstream KASAN: use-after-free Read in ext4_xattr_set_entry (4) ext4 C error done 21 1027d 1414d 20/28 fixed on 2022/03/28 10:17
android-5-10 general protection fault in ext4_xattr_set_entry C error 2 814d 828d 0/2 closed as invalid on 2022/09/26 18:30
android-5-10 general protection fault in ext4_xattr_set_entry (5) C done 11 553d 555d 2/2 fixed on 2023/06/13 02:27
Last patch testing requests (4)
Created Duration User Patch Repo Result
2024/10/16 20:56 1h12m retest repro android13-5.10-lts report log
2024/10/16 20:56 1h11m retest repro android13-5.10-lts report log
2024/07/29 17:54 28m retest repro android13-5.10-lts report log
2023/10/04 02:45 8m retest repro android13-5.10-lts report log
Fix bisection attempts (7)
Created Duration User Patch Repo Result
2024/05/20 17:04 45m bisect fix android13-5.10-lts OK (0) job log
2024/04/16 22:07 1h18m bisect fix android13-5.10-lts OK (0) job log log
2024/03/14 11:41 1h47m bisect fix android13-5.10-lts OK (0) job log log
2024/02/11 02:19 1h09m bisect fix android13-5.10-lts OK (0) job log log
2024/01/05 01:17 1h12m bisect fix android13-5.10-lts OK (0) job log log
2023/12/05 19:48 1h18m bisect fix android13-5.10-lts OK (0) job log log
2023/11/04 13:28 1h06m bisect fix android13-5.10-lts OK (0) job log log

Sample crash report:
==================================================================
BUG: KASAN: out-of-bounds in ext4_xattr_set_entry+0x11b3/0x3a60 fs/ext4/xattr.c:1731
Read of size 18446744073709551600 at addr ffff888111798fb8 by task syz-executor308/288

CPU: 0 PID: 288 Comm: syz-executor308 Not tainted 5.10.226-syzkaller-00709-ge5e5644ea27f #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/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
 kasan_check_range+0x293/0x2a0 mm/kasan/generic.c:189
 memmove+0x2d/0x70 mm/kasan/shadow.c:54
 ext4_xattr_set_entry+0x11b3/0x3a60 fs/ext4/xattr.c:1731
 ext4_xattr_ibody_set+0x124/0x390 fs/ext4/xattr.c:2234
 ext4_destroy_inline_data_nolock+0x1d3/0x5d0 fs/ext4/inline.c:447
 ext4_convert_inline_data_nolock+0x3d8/0xd80 fs/ext4/inline.c:1240
 ext4_try_add_inline_entry+0x805/0xb60 fs/ext4/inline.c:1349
 ext4_add_entry+0x6c2/0x1280 fs/ext4/namei.c:2412
 ext4_add_nondir+0x97/0x270 fs/ext4/namei.c:2784
 ext4_create+0x348/0x530 fs/ext4/namei.c:2829
 lookup_open fs/namei.c:3247 [inline]
 open_last_lookups fs/namei.c:3317 [inline]
 path_openat+0x1377/0x3000 fs/namei.c:3506
 do_filp_open+0x21c/0x460 fs/namei.c:3536
 do_sys_openat2+0x13f/0x710 fs/open.c:1217
 do_sys_open fs/open.c:1233 [inline]
 __do_sys_openat fs/open.c:1249 [inline]
 __se_sys_openat fs/open.c:1244 [inline]
 __x64_sys_openat+0x243/0x290 fs/open.c:1244
 do_syscall_64+0x34/0x70
 entry_SYSCALL_64_after_hwframe+0x61/0xcb
RIP: 0033:0x7f684172b1a9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 17 00 00 90 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 b0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f68416e9218 EFLAGS: 00000246 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 00007f68417b2608 RCX: 00007f684172b1a9
RDX: 000000000000275a RSI: 0000000020000080 RDI: 00000000ffffff9c
RBP: 00007f68417b2600 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007f684177f4cc
R13: 0030656c69662f2e R14: 6f6f6c2f7665642f R15: 746174732e757063

The buggy address belongs to the page:
page:ffffea000445e600 refcount:3 mapcount:1 mapping:ffff888100448f50 index:0x1 pfn:0x111798
aops:def_blk_aops ino:0
flags: 0x400000000002203e(referenced|uptodate|dirty|lru|active|private|mappedtodisk)
raw: 400000000002203e ffffea0004217ec8 ffffea000421e0c8 ffff888100448f50
raw: 0000000000000001 ffff88811ca3fe70 0000000300000000 ffff888100146000
page dumped because: kasan: bad access detected
page->mem_cgroup:ffff888100146000
page_owner tracks the page as allocated
page last allocated via order 0, migratetype Movable, gfp_mask 0x108c48(GFP_NOFS|__GFP_NOFAIL|__GFP_HARDWALL|__GFP_MOVABLE), pid 288, ts 20950938917, free_ts 15269124046
 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:5348
 __alloc_pages include/linux/gfp.h:544 [inline]
 __alloc_pages_node include/linux/gfp.h:557 [inline]
 alloc_pages_node include/linux/gfp.h:571 [inline]
 alloc_pages include/linux/gfp.h:590 [inline]
 __page_cache_alloc include/linux/pagemap.h:290 [inline]
 pagecache_get_page+0x669/0x950 mm/filemap.c:1848
 find_or_create_page include/linux/pagemap.h:402 [inline]
 grow_dev_page fs/buffer.c:976 [inline]
 grow_buffers fs/buffer.c:1045 [inline]
 __getblk_slow fs/buffer.c:1072 [inline]
 __getblk_gfp+0x221/0x7e0 fs/buffer.c:1370
 sb_getblk include/linux/buffer_head.h:361 [inline]
 __ext4_get_inode_loc+0x4c2/0xbf0 fs/ext4/inode.c:4442
 __ext4_get_inode_loc_noinmem fs/ext4/inode.c:4552 [inline]
 __ext4_iget+0x516/0x41f0 fs/ext4/inode.c:4777
 ext4_fill_super+0x734e/0x9150 fs/ext4/super.c:4955
 mount_bdev+0x262/0x370 fs/super.c:1440
 ext4_mount+0x34/0x40 fs/ext4/super.c:6638
 legacy_get_tree+0xf1/0x190 fs/fs_context.c:593
 vfs_get_tree+0x88/0x290 fs/super.c:1570
 do_new_mount+0x2ba/0xb30 fs/namespace.c:2910
 path_mount+0x56f/0xcb0 fs/namespace.c:3240
 do_mount fs/namespace.c:3253 [inline]
 __do_sys_mount fs/namespace.c:3461 [inline]
 __se_sys_mount+0x2c4/0x3b0 fs/namespace.c:3438
 __x64_sys_mount+0xbf/0xd0 fs/namespace.c:3438
page last free stack trace:
 reset_page_owner include/linux/page_owner.h:28 [inline]
 free_pages_prepare mm/page_alloc.c:1349 [inline]
 free_pcp_prepare mm/page_alloc.c:1421 [inline]
 free_unref_page_prepare+0x2ae/0x2d0 mm/page_alloc.c:3336
 free_unref_page_list+0x122/0xb20 mm/page_alloc.c:3443
 release_pages+0xea0/0xef0 mm/swap.c:1103
 free_pages_and_swap_cache+0x8a/0xa0 mm/swap_state.c:356
 tlb_batch_pages_flush mm/mmu_gather.c:49 [inline]
 tlb_flush_mmu_free mm/mmu_gather.c:240 [inline]
 tlb_flush_mmu mm/mmu_gather.c:247 [inline]
 tlb_finish_mmu+0x177/0x320 mm/mmu_gather.c:326
 unmap_region+0x31c/0x370 mm/mmap.c:2810
 __do_munmap+0x699/0x8c0 mm/mmap.c:3041
 __vm_munmap mm/mmap.c:3064 [inline]
 __do_sys_munmap mm/mmap.c:3090 [inline]
 __se_sys_munmap+0x120/0x1a0 mm/mmap.c:3086
 __x64_sys_munmap+0x5b/0x70 mm/mmap.c:3086
 do_syscall_64+0x34/0x70
 entry_SYSCALL_64_after_hwframe+0x61/0xcb

Memory state around the buggy address:
 ffff888111798e80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff888111798f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff888111798f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                                        ^
 ffff888111799000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff888111799080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================
EXT4-fs error (device loop0): ext4_xattr_ibody_find:2210: inode #12: comm syz-executor308: corrupted in-inode xattr
EXT4-fs warning (device loop0): 

Crashes (4):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/10/02 20:37 android13-5.10-lts e5e5644ea27f 02f9582a .config strace log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-android-5-10 KASAN: out-of-bounds Read in ext4_xattr_set_entry
2023/09/20 02:39 android13-5.10-lts a27512601c2d 0b6a67ac .config strace log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro #1] [mounted in repro #2] [mounted in repro #3] ci2-android-5-10 KASAN: out-of-bounds Read in ext4_xattr_set_entry
2024/12/10 23:09 android13-5.10-lts 0eb852f47fe5 cfc402b4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-10 KASAN: out-of-bounds Read in ext4_xattr_set_entry
2024/11/22 13:20 android13-5.10-lts b14940b90491 4b25d554 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-10 KASAN: out-of-bounds Read in ext4_xattr_set_entry
* Struck through repros no longer work on HEAD.