syzbot


KASAN: out-of-bounds Read in ext4_xattr_set_entry

Status: upstream: reported C repro on 2025/03/15 11:50
Bug presence: origin:upstream
[Documentation on labels]
Reported-by: syzbot+a6e8001e6c89306ea653@syzkaller.appspotmail.com
First crash: 65d, last: 6d19h
Bug presence (1)
Date Name Commit Repro Result
2025/04/05 upstream (ToT) a8662bcd2ff1 C [report] unregister_netdevice: waiting for DEV to become free
Similar bugs (17)
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 1345d 1803d 1/1 fixed on 2021/10/13 07:23
android-5-15 KASAN: out-of-bounds Read in ext4_xattr_set_entry 1 700d 700d 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 1689 3h55m 240d 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 754d 1520d 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 inconclusive 372 39d 731d 0/3 upstream: reported C repro on 2023/05/19 08:42
android-5-10 KASAN: out-of-bounds Read in ext4_xattr_set_entry C inconclusive 8 7h06m 607d 0/2 upstream: reported C repro on 2023/09/20 02:40
linux-4.14 KASAN: out-of-bounds Read in ext4_xattr_set_entry C error 2 984d 1498d 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 202 23d 371d 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 809d 889d 2/2 fixed on 2023/03/28 12:29
android-5-10 general protection fault in ext4_xattr_set_entry (4) C error 62 712d 741d 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 747d 947d 2/2 fixed on 2023/05/03 13:06
upstream KASAN: use-after-free Read in ext4_xattr_set_entry (5) ext4 2 1029d 1087d 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 743d 746d 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 1183d 1570d 20/28 fixed on 2022/03/28 10:17
android-5-10 general protection fault in ext4_xattr_set_entry C error 2 970d 984d 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 709d 711d 2/2 fixed on 2023/06/13 02:27
linux-4.14 KASAN: slab-out-of-bounds Read in ext4_xattr_set_entry 1 1801d 1801d 0/1 auto-closed as invalid on 2020/10/11 03:36
Last patch testing requests (1)
Created Duration User Patch Repo Result
2025/04/18 04:18 15m retest repro linux-5.15.y report log

Sample crash report:
EXT4-fs (loop0): mounted filesystem without journal. Opts: nogrpid,min_batch_time=0x0000000000000000,debug_want_extra_isize=0x0000000000000068,nobarrier,nodiscard,quota,,errors=continue. Quota mode: writeback.
==================================================================
BUG: KASAN: out-of-bounds in ext4_xattr_set_entry+0xe28/0x3078 fs/ext4/xattr.c:1738
Read of size 18446744073709551540 at addr ffff0000c9061070 by task syz-executor583/4018

CPU: 0 PID: 4018 Comm: syz-executor583 Not tainted 5.15.179-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025
Call trace:
 dump_backtrace+0x0/0x530 arch/arm64/kernel/stacktrace.c:152
 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:216
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106
 print_address_description+0x7c/0x3f0 mm/kasan/report.c:248
 __kasan_report mm/kasan/report.c:434 [inline]
 kasan_report+0x174/0x1e4 mm/kasan/report.c:451
 check_region_inline mm/kasan/generic.c:-1 [inline]
 kasan_check_range+0x274/0x2b4 mm/kasan/generic.c:189
 memmove+0x90/0xe8 mm/kasan/shadow.c:54
 ext4_xattr_set_entry+0xe28/0x3078 fs/ext4/xattr.c:1738
 ext4_xattr_block_set+0x8ec/0x2dcc fs/ext4/xattr.c:1995
 ext4_xattr_set_handle+0xe44/0x12d8 fs/ext4/xattr.c:2403
 ext4_xattr_set+0x220/0x340 fs/ext4/xattr.c:2513
 ext4_xattr_trusted_set+0x4c/0x64 fs/ext4/xattr_trusted.c:38
 __vfs_setxattr+0x388/0x3a4 fs/xattr.c:182
 __vfs_setxattr_noperm+0x110/0x528 fs/xattr.c:216
 __vfs_setxattr_locked+0x1ec/0x218 fs/xattr.c:277
 vfs_setxattr+0x1a8/0x344 fs/xattr.c:303
 do_setxattr fs/xattr.c:588 [inline]
 setxattr+0x250/0x2b4 fs/xattr.c:611
 path_setxattr+0x17c/0x258 fs/xattr.c:630
 __do_sys_lsetxattr fs/xattr.c:653 [inline]
 __se_sys_lsetxattr fs/xattr.c:649 [inline]
 __arm64_sys_lsetxattr+0xbc/0xd8 fs/xattr.c:649
 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
 invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52
 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
 do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181
 el0_svc+0x7c/0x1f0 arch/arm64/kernel/entry-common.c:608
 el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:626
 el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584

Allocated by task 4018:
 kasan_save_stack mm/kasan/common.c:38 [inline]
 kasan_set_track mm/kasan/common.c:46 [inline]
 set_alloc_info mm/kasan/common.c:434 [inline]
 ____kasan_kmalloc+0xbc/0xfc mm/kasan/common.c:513
 __kasan_kmalloc+0x10/0x1c mm/kasan/common.c:522
 kasan_kmalloc include/linux/kasan.h:264 [inline]
 __kmalloc_track_caller+0x218/0x3d8 mm/slub.c:4930
 kmemdup+0xcc/0x144 mm/util.c:128
 ext4_xattr_block_set+0x7c0/0x2dcc fs/ext4/xattr.c:1943
 ext4_xattr_set_handle+0xe44/0x12d8 fs/ext4/xattr.c:2403
 ext4_xattr_set+0x220/0x340 fs/ext4/xattr.c:2513
 ext4_xattr_trusted_set+0x4c/0x64 fs/ext4/xattr_trusted.c:38
 __vfs_setxattr+0x388/0x3a4 fs/xattr.c:182
 __vfs_setxattr_noperm+0x110/0x528 fs/xattr.c:216
 __vfs_setxattr_locked+0x1ec/0x218 fs/xattr.c:277
 vfs_setxattr+0x1a8/0x344 fs/xattr.c:303
 do_setxattr fs/xattr.c:588 [inline]
 setxattr+0x250/0x2b4 fs/xattr.c:611
 path_setxattr+0x17c/0x258 fs/xattr.c:630
 __do_sys_lsetxattr fs/xattr.c:653 [inline]
 __se_sys_lsetxattr fs/xattr.c:649 [inline]
 __arm64_sys_lsetxattr+0xbc/0xd8 fs/xattr.c:649
 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
 invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52
 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
 do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181
 el0_svc+0x7c/0x1f0 arch/arm64/kernel/entry-common.c:608
 el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:626
 el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584

The buggy address belongs to the object at ffff0000c9061000
 which belongs to the cache kmalloc-1k of size 1024
The buggy address is located 112 bytes inside of
 1024-byte region [ffff0000c9061000, ffff0000c9061400)
The buggy address belongs to the page:
page:00000000b4c33ad1 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x109060
head:00000000b4c33ad1 order:3 compound_mapcount:0 compound_pincount:0
flags: 0x5ffc00000010200(slab|head|node=0|zone=2|lastcpupid=0x7ff)
raw: 05ffc00000010200 0000000000000000 dead000000000122 ffff0000c0002780
raw: 0000000000000000 0000000080100010 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff0000c9060f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff0000c9060f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff0000c9061000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                                                             ^
 ffff0000c9061080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff0000c9061100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================

Crashes (6):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/04/04 04:18 linux-5.15.y 0c935c049b5c d7ae3a11 .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro (clean fs)] ci2-linux-5-15-kasan-arm64 KASAN: out-of-bounds Read in ext4_xattr_set_entry
2025/03/15 11:49 linux-5.15.y 0c935c049b5c e2826670 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: out-of-bounds Read in ext4_xattr_set_entry
2025/05/12 07:49 linux-5.15.y 3b8db0e4f263 77908e5f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: out-of-bounds Read in ext4_xattr_set_entry
2025/04/04 03:18 linux-5.15.y 0c935c049b5c d7ae3a11 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: out-of-bounds Read in ext4_xattr_set_entry
2025/05/13 05:59 linux-5.15.y 3b8db0e4f263 f6671af7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: slab-out-of-bounds Read in ext4_xattr_set_entry
2025/05/13 05:58 linux-5.15.y 3b8db0e4f263 f6671af7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: slab-out-of-bounds Read in ext4_xattr_set_entry
* Struck through repros no longer work on HEAD.