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: 606d, last: 21d
Fix bisection: the issue occurs on the latest tested release (bisect log)
  
Similar bugs (16)
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 1344d 1802d 1/1 fixed on 2021/10/13 07:23
android-5-15 KASAN: out-of-bounds Read in ext4_xattr_set_entry 1 699d 699d 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 1681 4h03m 238d 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 753d 1519d 0/2 auto-obsoleted due to no activity on 2023/08/23 09:06
linux-5.15 KASAN: out-of-bounds Read in ext4_xattr_set_entry origin:upstream C 6 5d17h 64d 0/3 upstream: reported C repro on 2025/03/15 11:50
linux-6.1 KASAN: out-of-bounds Read in ext4_xattr_set_entry missing-backport origin:lts-only C inconclusive 372 38d 730d 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 983d 1497d 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 21d 370d 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 808d 888d 2/2 fixed on 2023/03/28 12:29
android-5-10 general protection fault in ext4_xattr_set_entry (4) C error 62 711d 740d 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 746d 946d 2/2 fixed on 2023/05/03 13:06
upstream KASAN: use-after-free Read in ext4_xattr_set_entry (5) ext4 2 1028d 1086d 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 742d 745d 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 1182d 1569d 20/28 fixed on 2022/03/28 10:17
android-5-10 general protection fault in ext4_xattr_set_entry C error 2 969d 983d 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 708d 710d 2/2 fixed on 2023/06/13 02:27
Last patch testing requests (9)
Created Duration User Patch Repo Result
2025/04/27 05:28 13m retest repro android13-5.10-lts report log
2025/04/06 02:51 10m retest repro android13-5.10-lts report log
2025/03/09 02:38 1h05m retest repro android13-5.10-lts report log
2024/12/29 01:36 13m retest repro android13-5.10-lts OK log
2024/12/29 01:36 5m retest repro android13-5.10-lts report log
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 18446744073709551540 at addr ffff88810d35e070 by task syz-executor131/288

CPU: 0 PID: 288 Comm: syz-executor131 Not tainted 5.10.234-syzkaller-00157-ge0b88ee5f09c #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025
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
 check_region_inline mm/kasan/generic.c:-1 [inline]
 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_block_set+0x8f9/0x3400 fs/ext4/xattr.c:1988
 ext4_xattr_set_handle+0x11cd/0x14e0 fs/ext4/xattr.c:2394
 ext4_xattr_set+0x231/0x3d0 fs/ext4/xattr.c:2504
 ext4_xattr_trusted_set+0x3b/0x50 fs/ext4/xattr_trusted.c:37
 __vfs_setxattr+0x404/0x450 fs/xattr.c:177
 __vfs_setxattr_noperm+0x11d/0x4f0 fs/xattr.c:208
 __vfs_setxattr_locked+0x1f9/0x210 fs/xattr.c:266
 vfs_setxattr+0x112/0x2c0 fs/xattr.c:283
 setxattr+0x1ea/0x3f0 fs/xattr.c:548
 path_setxattr+0x169/0x240 fs/xattr.c:567
 __do_sys_lsetxattr fs/xattr.c:589 [inline]
 __se_sys_lsetxattr fs/xattr.c:585 [inline]
 __x64_sys_lsetxattr+0xc2/0xe0 fs/xattr.c:585
 do_syscall_64+0x34/0x70 arch/x86/entry/common.c:-1
 entry_SYSCALL_64_after_hwframe+0x61/0xcb
RIP: 0033:0x7fc30565db39
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 61 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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fff2d210858 EFLAGS: 00000246 ORIG_RAX: 00000000000000bd
RAX: ffffffffffffffda RBX: 0072657070752e79 RCX: 00007fc30565db39
RDX: 0000200000000040 RSI: 00002000000000c0 RDI: 0000200000000100
RBP: 0031656c69662f2e R08: 0000000000000000 R09: 0000000000000000
R10: 000000000000fe37 R11: 0000000000000246 R12: 0000000000000001
R13: 00007fff2d210a38 R14: 0000000000000001 R15: 0000000000000001

Allocated by task 0:
(stack is not available)

The buggy address belongs to the object at ffff88810d35e000
 which belongs to the cache kmalloc-1k of size 1024
The buggy address is located 112 bytes inside of
 1024-byte region [ffff88810d35e000, ffff88810d35e400)
The buggy address belongs to the page:
page:ffffea000434d600 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10d358
head:ffffea000434d600 order:3 compound_mapcount:0 compound_pincount:0
flags: 0x4000000000010200(slab|head)
raw: 4000000000010200 dead000000000100 dead000000000122 ffff888100042f00
raw: 0000000000000000 0000000080100010 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 84, ts 23094282442, free_ts 23060860230
 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_slab_page mm/slub.c:-1 [inline]
 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]
 __kmalloc_track_caller+0x1f8/0x320 mm/slub.c:4536
 __kmalloc_reserve net/core/skbuff.c:144 [inline]
 __alloc_skb+0xbc/0x510 net/core/skbuff.c:212
 alloc_skb include/linux/skbuff.h:1126 [inline]
 alloc_skb_with_frags+0xa1/0x570 net/core/skbuff.c:5993
 sock_alloc_send_pskb+0x915/0xa50 net/core/sock.c:2388
 unix_dgram_sendmsg+0x700/0x1f90 net/unix/af_unix.c:1725
 sock_sendmsg_nosec net/socket.c:652 [inline]
 __sock_sendmsg net/socket.c:664 [inline]
 __sys_sendto+0x545/0x700 net/socket.c:2006
 __do_sys_sendto net/socket.c:2018 [inline]
 __se_sys_sendto net/socket.c:2014 [inline]
 __x64_sys_sendto+0xe5/0x100 net/socket.c:2014
 do_syscall_64+0x34/0x70 arch/x86/entry/common.c:-1
 entry_SYSCALL_64_after_hwframe+0x61/0xcb
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_pages_ok+0x82c/0x850 mm/page_alloc.c:1629
 free_the_page+0x76/0x370 mm/page_alloc.c:5409
 __free_pages+0x67/0xc0 mm/page_alloc.c:5418
 __free_slab+0xcf/0x190 mm/slub.c:1894
 free_slab mm/slub.c:1909 [inline]
 discard_slab mm/slub.c:1915 [inline]
 unfreeze_partials+0x15e/0x190 mm/slub.c:2410
 put_cpu_partial+0xbf/0x180 mm/slub.c:2446
 __slab_free+0x2c8/0x3a0 mm/slub.c:3095
 do_slab_free mm/slub.c:3191 [inline]
 ___cache_free+0x111/0x130 mm/slub.c:3210
 qlink_free+0x50/0x90 mm/kasan/quarantine.c:157
 qlist_free_all+0x47/0xb0 mm/kasan/quarantine.c:176
 kasan_quarantine_reduce+0x15a/0x170 mm/kasan/quarantine.c:283
 __kasan_slab_alloc+0x2f/0xe0 mm/kasan/common.c:440
 kasan_slab_alloc include/linux/kasan.h:244 [inline]
 slab_post_alloc_hook+0x61/0x2f0 mm/slab.h:583
 slab_alloc_node mm/slub.c:2947 [inline]
 slab_alloc mm/slub.c:2955 [inline]
 kmem_cache_alloc+0x168/0x2e0 mm/slub.c:2960
 getname_flags+0xba/0x520 fs/namei.c:141
 user_path_at_empty+0x2d/0x50 fs/namei.c:2740

Memory state around the buggy address:
 ffff88810d35df00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff88810d35df80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff88810d35e000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                                                             ^
 ffff88810d35e080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff88810d35e100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

Crashes (8):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/04/13 00:43 android13-5.10-lts e0b88ee5f09c 0bd6db41 .config strace log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro (clean fs)] ci2-android-5-10 KASAN: out-of-bounds Read in ext4_xattr_set_entry
2025/03/22 17:36 android13-5.10-lts 094fc3778d6b c6512ef7 .config strace log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro (corrupt fs)] 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
2025/01/07 18:37 android13-5.10-lts 49e8ba0a684f f3558dbf .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/12/30 23:50 android13-5.10-lts 49e8ba0a684f d3ccff63 .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/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
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
* Struck through repros no longer work on HEAD.