syzbot


KASAN: use-after-free Read in ext4_xattr_set_entry (5)

Status: auto-obsoleted due to no activity on 2022/11/22 17:19
Subsystems: ext4
[Documentation on labels]
Reported-by: syzbot+43ddf9603437b6bad4e0@syzkaller.appspotmail.com
First crash: 674d, last: 611d
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] KASAN: use-after-free Read in ext4_xattr_set_entry (5) 0 (1) 2022/05/28 08:51
Similar bugs (23)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.14 KASAN: use-after-free Read in ext4_xattr_set_entry (3) C error 1 761d 1247d 0/1 upstream: reported C repro on 2020/10/28 15:08
android-414 KASAN: use-after-free Read in ext4_xattr_set_entry (2) 6 1610d 1665d 0/1 auto-closed as invalid on 2020/02/28 13:35
linux-4.14 KASAN: use-after-free Read in ext4_xattr_set_entry (2) 1 1466d 1466d 0/1 auto-closed as invalid on 2020/07/21 03:20
linux-4.19 KASAN: use-after-free Read in ext4_xattr_set_entry (2) C done 7 927d 1386d 1/1 fixed on 2021/10/13 07:23
upstream KASAN: use-after-free Read in ext4_xattr_set_entry ext4 1 2070d 2070d 0/26 closed as invalid on 2018/07/29 11:55
android-414 KASAN: use-after-free Read in ext4_xattr_set_entry 4 1917d 1810d 0/1 auto-closed as invalid on 2019/06/26 01:15
upstream KASAN: use-after-free Read in ext4_xattr_set_entry (3) ext4 4 1362d 1480d 0/26 auto-closed as invalid on 2020/11/02 08:32
linux-4.19 KASAN: use-after-free Read in ext4_xattr_set_entry syz done 10 1489d 1737d 1/1 fixed on 2020/03/30 09:03
upstream KASAN: use-after-free Read in ext4_xattr_set_entry (4) ext4 C error done 21 766d 1153d 20/26 fixed on 2022/03/28 10:17
upstream KASAN: use-after-free Read in ext4_xattr_set_entry (2) ext4 C done 19 1564d 1973d 15/26 fixed on 2020/02/14 01:19
android-54 KASAN: use-after-free Read in ext4_xattr_set_entry 6 1329d 1510d 0/2 auto-closed as invalid on 2020/12/04 21:44
linux-4.14 KASAN: use-after-free Read in ext4_xattr_set_entry C done 9 1517d 1610d 1/1 fixed on 2020/03/01 21:06
android-5-15 general protection fault in ext4_xattr_set_entry C error 1 391d 471d 2/2 fixed on 2023/03/28 12:29
android-5-15 KASAN: out-of-bounds Read in ext4_xattr_set_entry 1 283d 283d 0/2 auto-obsoleted due to no activity on 2023/09/17 07:02
android-5-10 general protection fault in ext4_xattr_set_entry (4) C error 62 295d 324d 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 330d 530d 2/2 fixed on 2023/05/03 13:06
android-54 KASAN: out-of-bounds Read in ext4_xattr_set_entry ext4 C 14 337d 1102d 0/2 auto-obsoleted due to no activity on 2023/08/23 09:06
android-5-10 general protection fault in ext4_xattr_set_entry (3) C error 9 325d 328d 2/2 fixed on 2023/05/08 19:06
linux-6.1 KASAN: out-of-bounds Read in ext4_xattr_set_entry origin:upstream missing-backport syz unreliable 1 283d 314d 0/3 upstream: reported syz repro on 2023/05/19 08:42
android-5-10 general protection fault in ext4_xattr_set_entry C error 2 552d 567d 0/2 closed as invalid on 2022/09/26 18:30
android-5-10 KASAN: out-of-bounds Read in ext4_xattr_set_entry C 1 14d 190d 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 567d 1081d 0/1 upstream: reported C repro on 2021/04/12 14:20
android-5-10 general protection fault in ext4_xattr_set_entry (5) C done 11 292d 294d 2/2 fixed on 2023/06/13 02:27

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in ext4_xattr_set_entry+0x212/0x2034 fs/ext4/xattr.c:1593
Read of size 4 at addr ffffaf800f7f7ffe by task syz-executor.1/3929

CPU: 1 PID: 3929 Comm: syz-executor.1 Not tainted 5.17.0-rc1-syzkaller-00002-g0966d385830d #0
Hardware name: riscv-virtio,qemu (DT)
Call Trace:
[<ffffffff8000a228>] dump_backtrace+0x2e/0x3c arch/riscv/kernel/stacktrace.c:113
[<ffffffff831668cc>] show_stack+0x34/0x40 arch/riscv/kernel/stacktrace.c:119
[<ffffffff831756ba>] __dump_stack lib/dump_stack.c:88 [inline]
[<ffffffff831756ba>] dump_stack_lvl+0xe4/0x150 lib/dump_stack.c:106
[<ffffffff8047479e>] print_address_description.constprop.0+0x2a/0x330 mm/kasan/report.c:255
[<ffffffff80474d4c>] __kasan_report mm/kasan/report.c:442 [inline]
[<ffffffff80474d4c>] kasan_report+0x184/0x1e0 mm/kasan/report.c:459
[<ffffffff804759f4>] check_region_inline mm/kasan/generic.c:183 [inline]
[<ffffffff804759f4>] __asan_load4+0x6e/0x96 mm/kasan/generic.c:255
[<ffffffff807c17b4>] ext4_xattr_set_entry+0x212/0x2034 fs/ext4/xattr.c:1593
[<ffffffff807c6c80>] ext4_xattr_ibody_set+0x5c/0x158 fs/ext4/xattr.c:2210
[<ffffffff807c73da>] ext4_xattr_set_handle+0x65e/0xea0 fs/ext4/xattr.c:2367
[<ffffffff807c7e6e>] ext4_xattr_set+0x12e/0x2b4 fs/ext4/xattr.c:2480
[<ffffffff807c9abc>] ext4_xattr_trusted_set+0x34/0x46 fs/ext4/xattr_trusted.c:38
[<ffffffff8052af96>] __vfs_setxattr+0x106/0x172 fs/xattr.c:180
[<ffffffff8052cd3e>] __vfs_setxattr_noperm+0xca/0x378 fs/xattr.c:214
[<ffffffff8052d156>] __vfs_setxattr_locked+0x16a/0x186 fs/xattr.c:275
[<ffffffff8052d2a8>] vfs_setxattr+0x136/0x296 fs/xattr.c:301
[<ffffffff8052d61a>] setxattr+0x212/0x29a fs/xattr.c:575
[<ffffffff8052d844>] path_setxattr+0x1a2/0x1bc fs/xattr.c:595
[<ffffffff8052db12>] __do_sys_lsetxattr fs/xattr.c:618 [inline]
[<ffffffff8052db12>] sys_lsetxattr+0x36/0x48 fs/xattr.c:614
[<ffffffff80005716>] ret_from_syscall+0x0/0x2

The buggy address belongs to the page:
page:ffffaf807aaa4d78 refcount:2 mapcount:0 mapping:ffffaf800ababf10 index:0xb8 pfn:0x8f9f7
memcg:ffffaf80073e0000
aops:def_blk_aops ino:fd00000
flags: 0x880000203a(referenced|dirty|lru|active|private|section=17|node=0|zone=0)
raw: 000000880000203a ffffaf807aaa4d38 ffffaf807aaa4708 ffffaf800ababf10
raw: 00000000000000b8 ffffaf8007752d98 00000002ffffffff ffffaf80073e0000
raw: 00000000000007ff
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 0, migratetype Unmovable, gfp_mask 0x148c40(GFP_NOFS|__GFP_NOFAIL|__GFP_COMP|__GFP_HARDWALL), pid 1, ts 535544763000, free_ts 0
 __set_page_owner+0x48/0x136 mm/page_owner.c:183
 set_page_owner include/linux/page_owner.h:31 [inline]
 post_alloc_hook+0xd0/0x10a mm/page_alloc.c:2427
 prep_new_page mm/page_alloc.c:2434 [inline]
 get_page_from_freelist+0x8da/0x12d8 mm/page_alloc.c:4165
 __alloc_pages+0x150/0x3b6 mm/page_alloc.c:5389
 alloc_pages+0x132/0x2a6 mm/mempolicy.c:2271
 folio_alloc+0x24/0x30 mm/mempolicy.c:2281
 filemap_alloc_folio mm/filemap.c:987 [inline]
 __filemap_get_folio+0x63c/0xd58 mm/filemap.c:1990
 pagecache_get_page+0x2e/0x230 mm/folio-compat.c:125
 find_or_create_page include/linux/pagemap.h:488 [inline]
 grow_dev_page fs/buffer.c:949 [inline]
 grow_buffers fs/buffer.c:1014 [inline]
 __getblk_slow+0x1f2/0x738 fs/buffer.c:1041
 __getblk_gfp+0x74/0x78 fs/buffer.c:1334
 sb_getblk_gfp include/linux/buffer_head.h:334 [inline]
 ext4_sb_breadahead_unmovable+0x46/0xa8 fs/ext4/super.c:264
 __ext4_get_inode_loc+0x9d6/0xc08 fs/ext4/inode.c:4488
 __ext4_get_inode_loc_noinmem+0xb2/0x138 fs/ext4/inode.c:4518
 __ext4_iget+0x348/0x20f8 fs/ext4/inode.c:4711
 ext4_lookup fs/ext4/namei.c:1785 [inline]
 ext4_lookup+0x28a/0x4ea fs/ext4/namei.c:1760
 lookup_open.isra.0+0x6a6/0xd4a fs/namei.c:3308
page_owner free stack trace missing

Memory state around the buggy address:
 ffffaf800f7f7f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffffaf800f7f7f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffffaf800f7f8000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                   ^
 ffffaf800f7f8080: fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc
 ffffaf800f7f8100: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb
==================================================================
EXT4-fs error (device vda): ext4_xattr_set_entry:1596: inode #640: comm syz-executor.1: corrupted xattr entries

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2022/07/25 17:18 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes 0966d385830d 664c519c .config console log report info ci-qemu2-riscv64 KASAN: use-after-free Read in ext4_xattr_set_entry
2022/05/23 22:56 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes 0966d385830d e7f9308d .config console log report info ci-qemu2-riscv64 KASAN: use-after-free Read in ext4_xattr_set_entry
* Struck through repros no longer work on HEAD.