syzbot


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

Status: fixed on 2025/01/21 16:28
Bug presence: origin:upstream
Labels: missing-backport
[Documentation on labels]
Reported-by: syzbot+f0b9c081e1661c706b16@syzkaller.appspotmail.com
Fix commit: 9c356fc32a44 jfs: xattr: check invalid xattr size more strictly
First crash: 606d, last: 48d
Fix bisection: fixed by (bisect log) :
commit 9c356fc32a4480a2c0e537a05f2a8617633ddad0
Author: Artem Sadovnikov <ancowi69@gmail.com>
Date: Sat Oct 5 10:06:57 2024 +0000

  jfs: xattr: check invalid xattr size more strictly

  
Bug presence (3)
Date Name Commit Repro Result
2024/12/11 linux-6.1.y (ToT) e4d90d63d385 C [report] KASAN: slab-out-of-bounds Read in ea_get
2024/01/26 upstream (ToT) ecb1b8288dc7 C [report] KASAN: slab-out-of-bounds Read in ea_get
2024/12/11 upstream (ToT) f92f4749861b C Didn't crash
Similar bugs (6)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.19 KASAN: slab-out-of-bounds Read in ea_get 3 814d 846d 0/1 auto-obsoleted due to no activity on 2023/03/06 17:23
linux-5.15 KASAN: slab-out-of-bounds Read in ea_get origin:upstream missing-backport C error 18 64d 607d 0/3 upstream: reported C repro on 2023/06/01 07:39
upstream KASAN: slab-out-of-bounds Read in ea_get (2) jfs C 33 205d 270d 26/28 fixed on 2024/07/09 19:14
linux-4.14 KASAN: slab-out-of-bounds Read in ea_get C 1 706d 844d 0/1 upstream: reported C repro on 2022/10/07 03:56
upstream KASAN: slab-out-of-bounds Read in ea_get (3) jfs 4 167d 158d 0/28 auto-obsoleted due to no activity on 2024/11/21 23:18
upstream KASAN: slab-out-of-bounds Read in ea_get jfs C inconclusive 29 469d 847d 0/28 closed as dup on 2022/10/05 09:10
Fix bisection attempts (14)
Created Duration User Patch Repo Result
2025/01/21 04:45 4h22m bisect fix linux-6.1.y OK (1) job log
2024/11/03 02:27 2h20m bisect fix linux-6.1.y OK (0) job log log
2024/10/03 05:14 2h00m bisect fix linux-6.1.y OK (0) job log log
2024/08/21 16:22 1h06m bisect fix linux-6.1.y OK (0) job log log
2024/07/11 01:33 1h09m bisect fix linux-6.1.y OK (0) job log log
2024/06/01 16:26 1h39m bisect fix linux-6.1.y OK (0) job log log
2024/04/04 05:50 1h40m bisect fix linux-6.1.y OK (0) job log log
2024/03/04 17:38 1h16m bisect fix linux-6.1.y OK (0) job log log
2024/01/26 13:56 1h12m bisect fix linux-6.1.y OK (0) job log log
2023/12/26 06:33 1h26m bisect fix linux-6.1.y OK (0) job log log
2023/11/26 01:18 1h24m bisect fix linux-6.1.y OK (0) job log log
2023/10/24 05:22 1h24m bisect fix linux-6.1.y OK (0) job log log
2023/09/18 23:33 1h42m bisect fix linux-6.1.y OK (0) job log log
2023/07/05 02:56 4h07m bisect fix linux-6.1.y OK (0) job log log

Sample crash report:
000000007c10bc57: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
000000004dafcdf5: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
==================================================================
BUG: KASAN: slab-out-of-bounds in hex_dump_to_buffer+0x5dc/0x984 lib/hexdump.c:193
Read of size 1 at addr ffff0000df544040 by task syz-executor355/4222

CPU: 1 PID: 4222 Comm: syz-executor355 Not tainted 6.1.89-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024
Call trace:
 dump_backtrace+0x1c8/0x1f4 arch/arm64/kernel/stacktrace.c:158
 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:165
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106
 print_address_description mm/kasan/report.c:284 [inline]
 print_report+0x174/0x4c0 mm/kasan/report.c:395
 kasan_report+0xd4/0x130 mm/kasan/report.c:495
 __asan_report_load1_noabort+0x2c/0x38 mm/kasan/report_generic.c:348
 hex_dump_to_buffer+0x5dc/0x984 lib/hexdump.c:193
 print_hex_dump+0x140/0x248 lib/hexdump.c:276
 ea_get+0xa04/0xef0 fs/jfs/xattr.c:561
 __jfs_setxattr+0xe0/0x1338 fs/jfs/xattr.c:671
 __jfs_xattr_set+0xf8/0x190 fs/jfs/xattr.c:917
 jfs_xattr_set+0x58/0x70 fs/jfs/xattr.c:941
 __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:309
 do_setxattr fs/xattr.c:594 [inline]
 setxattr+0x230/0x294 fs/xattr.c:617
 path_setxattr+0x17c/0x258 fs/xattr.c:636
 __do_sys_lsetxattr fs/xattr.c:659 [inline]
 __se_sys_lsetxattr fs/xattr.c:655 [inline]
 __arm64_sys_lsetxattr+0xbc/0xd8 fs/xattr.c:655
 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
 invoke_syscall+0x98/0x2c0 arch/arm64/kernel/syscall.c:52
 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
 do_el0_svc+0x64/0x218 arch/arm64/kernel/syscall.c:206
 el0_svc+0x58/0x168 arch/arm64/kernel/entry-common.c:637
 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585

Allocated by task 4222:
 kasan_save_stack mm/kasan/common.c:45 [inline]
 kasan_set_track+0x4c/0x80 mm/kasan/common.c:52
 kasan_save_alloc_info+0x24/0x30 mm/kasan/generic.c:505
 __kasan_slab_alloc+0x74/0x8c mm/kasan/common.c:328
 kasan_slab_alloc include/linux/kasan.h:201 [inline]
 slab_post_alloc_hook+0x74/0x458 mm/slab.h:737
 slab_alloc_node mm/slub.c:3398 [inline]
 slab_alloc mm/slub.c:3406 [inline]
 __kmem_cache_alloc_lru mm/slub.c:3413 [inline]
 kmem_cache_alloc_lru+0x1ac/0x2f8 mm/slub.c:3429
 alloc_inode_sb include/linux/fs.h:3193 [inline]
 jfs_alloc_inode+0x2c/0x68 fs/jfs/super.c:105
 alloc_inode fs/inode.c:261 [inline]
 iget_locked+0x170/0x708 fs/inode.c:1330
 jfs_iget+0x30/0x364 fs/jfs/inode.c:29
 jfs_lookup+0x1e8/0x39c fs/jfs/namei.c:1467
 __lookup_slow+0x250/0x374 fs/namei.c:1690
 lookup_slow+0x60/0x84 fs/namei.c:1707
 walk_component+0x280/0x36c fs/namei.c:1998
 lookup_last fs/namei.c:2455 [inline]
 path_lookupat+0x13c/0x3d0 fs/namei.c:2479
 filename_lookup+0x1d4/0x4e0 fs/namei.c:2508
 user_path_at_empty+0x5c/0x84 fs/namei.c:2907
 user_path_at include/linux/namei.h:57 [inline]
 path_setxattr+0xbc/0x258 fs/xattr.c:631
 __do_sys_lsetxattr fs/xattr.c:659 [inline]
 __se_sys_lsetxattr fs/xattr.c:655 [inline]
 __arm64_sys_lsetxattr+0xbc/0xd8 fs/xattr.c:655
 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
 invoke_syscall+0x98/0x2c0 arch/arm64/kernel/syscall.c:52
 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
 do_el0_svc+0x64/0x218 arch/arm64/kernel/syscall.c:206
 el0_svc+0x58/0x168 arch/arm64/kernel/entry-common.c:637
 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585

The buggy address belongs to the object at ffff0000df543780
 which belongs to the cache jfs_ip of size 2240
The buggy address is located 0 bytes to the right of
 2240-byte region [ffff0000df543780, ffff0000df544040)

The buggy address belongs to the physical page:
page:000000006a5c3b39 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x11f540
head:000000006a5c3b39 order:3 compound_mapcount:0 compound_pincount:0
flags: 0x5ffe00000010200(slab|head|node=0|zone=2|lastcpupid=0xfff)
raw: 05ffe00000010200 0000000000000000 dead000000000122 ffff0000c7414f00
raw: 0000000000000000 00000000800d000d 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff0000df543f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff0000df543f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff0000df544000: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc
                                           ^
 ffff0000df544080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff0000df544100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================
00000000e09ffb11: c0 40 54 df 00 00 ff ff 7e 10 00 00 8e 02 58 06  .@T.....~.....X.
00000000c31c989c: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
000000003a985ee2: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
00000000cfdafc34: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
00000000fb424136: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
000000005ed964da: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
00000000f67b24f9: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
00000000873ed57f: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0000000045937693: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0000000086614544: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
00000000ed633e76: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
00000000d0e3d543: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
00000000ca0092b7: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
000000004fffbfc5: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0000000001899849: 00 00 00 00 00 00 00 00 00 00 00 ff 00 00 00 00  ................
000000009491ea4f: 00 00 00 00 00 00 00 00 00 00 00 00 ad 4e ad de  .............N..
0000000091ec6877: ff ff ff ff 00 00 00 00 ff ff ff ff ff ff ff ff  ................
00000000a46c16ec: 20 5b a3 19 00 80 ff ff 00 00 00 00 00 00 00 00   [..............
00000000e173dd6f: 00 00 00 00 00 00 00 00 20 c1 61 12 00 80 ff ff  ........ .a.....
000000006cddf292: 00 02 00 00 00 00 00 00 78 41 54 df 00 00 ff ff  ........xAT.....
000000002f1fb8d5: 78 41 54 df 00 00 ff ff 00 00 00 00 00 00 00 00  xAT.............
000000009b3ddab9: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
00000000b44fd7f8: 00 00 00 00 ad 4e ad de ff ff ff ff 00 00 00 00  .....N..........
00000000eea58be4: ff ff ff ff ff ff ff ff 30 bf 39 18 00 80 ff ff  ........0.9.....
0000000080adcbd3: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
000000005ad42d2d: c0 bb 2b 12 00 80 ff ff 00 02 00 00 00 00 00 00  ..+.............

Crashes (5):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/04/29 19:40 linux-6.1.y dcbc050cb0d3 27e33c58 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-6-1-kasan-arm64 KASAN: slab-out-of-bounds Read in ea_get
2023/06/02 15:15 linux-6.1.y d2869ace6eeb a4ae4f42 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-6-1-kasan-arm64 KASAN: slab-out-of-bounds Read in ea_get
2024/04/29 18:49 linux-6.1.y dcbc050cb0d3 27e33c58 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: slab-out-of-bounds Read in ea_get
2023/07/09 01:00 linux-6.1.y 61fd484b2cf6 668cb1fa .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-6-1-kasan KASAN: slab-out-of-bounds Read in ea_get
2024/04/29 18:44 linux-6.1.y dcbc050cb0d3 27e33c58 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: slab-out-of-bounds Read in ea_get
* Struck through repros no longer work on HEAD.