syzbot


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

Status: upstream: reported on 2024/12/20 06:16
Reported-by: syzbot+3efd51211299ab916cbe@syzkaller.appspotmail.com
First crash: 1d10h, last: 1d10h
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: slab-out-of-bounds Read in reiserfs_xattr_get (2) reiserfs 1 327d 323d 0/28 auto-obsoleted due to no activity on 2024/05/07 19:35
upstream KASAN: slab-out-of-bounds Read in reiserfs_xattr_get reiserfs 106 462d 1348d 0/28 auto-obsoleted due to no activity on 2023/12/25 15:39

Sample crash report:
loop2: detected capacity change from 0 to 32768
==================================================================
BUG: KASAN: slab-out-of-bounds in reiserfs_xattr_get+0xd0/0x96c fs/reiserfs/xattr.c:674
Read of size 8 at addr ffff0000f8794d98 by task syz.2.8648/23577

CPU: 1 PID: 23577 Comm: syz.2.8648 Tainted: G        W          6.1.121-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/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:316 [inline]
 print_report+0x174/0x4c0 mm/kasan/report.c:427
 kasan_report+0xd4/0x130 mm/kasan/report.c:531
 __asan_report_load8_noabort+0x2c/0x38 mm/kasan/report_generic.c:351
 reiserfs_xattr_get+0xd0/0x96c fs/reiserfs/xattr.c:674
 reiserfs_get_acl+0x94/0x624 fs/reiserfs/xattr_acl.c:214
 get_acl+0x15c/0x338 fs/posix_acl.c:153
 check_acl+0x40/0x184 fs/namei.c:309
 acl_permission_check fs/namei.c:354 [inline]
 generic_permission+0x340/0x478 fs/namei.c:407
 reiserfs_permission+0x74/0xa8 fs/reiserfs/xattr.c:954
 do_inode_permission fs/namei.c:461 [inline]
 inode_permission+0x1d0/0x3b4 fs/namei.c:528
 may_open+0x290/0x3bc fs/namei.c:3254
 do_open fs/namei.c:3624 [inline]
 path_openat+0x1cec/0x2548 fs/namei.c:3783
 do_filp_open+0x1bc/0x3cc fs/namei.c:3810
 do_sys_openat2+0x128/0x3e0 fs/open.c:1318
 do_sys_open fs/open.c:1334 [inline]
 __do_sys_openat fs/open.c:1350 [inline]
 __se_sys_openat fs/open.c:1345 [inline]
 __arm64_sys_openat+0x1f0/0x240 fs/open.c:1345
 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
 invoke_syscall+0x98/0x2bc arch/arm64/kernel/syscall.c:52
 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:140
 do_el0_svc+0x58/0x13c arch/arm64/kernel/syscall.c:204
 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 4808:
 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_kmalloc mm/kasan/common.c:374 [inline]
 __kasan_kmalloc+0xac/0xc4 mm/kasan/common.c:383
 kasan_kmalloc include/linux/kasan.h:211 [inline]
 __do_kmalloc_node mm/slab_common.c:936 [inline]
 __kmalloc+0xd8/0x1c4 mm/slab_common.c:949
 kmalloc include/linux/slab.h:568 [inline]
 kzalloc include/linux/slab.h:699 [inline]
 fib_create_info+0x920/0x1e60 net/ipv4/fib_semantics.c:1459
 fib_table_insert+0x1a4/0x1574 net/ipv4/fib_trie.c:1236
 fib_magic net/ipv4/fib_frontend.c:1104 [inline]
 fib_add_ifaddr+0xba0/0x122c net/ipv4/fib_frontend.c:1148
 fib_netdev_event+0x56c/0x6b0 net/ipv4/fib_frontend.c:1486
 notifier_call_chain kernel/notifier.c:87 [inline]
 raw_notifier_call_chain+0xd4/0x164 kernel/notifier.c:455
 __dev_notify_flags+0x2ac/0x534
 dev_change_flags+0xc8/0x154 net/core/dev.c:8669
 do_setlink+0xacc/0x3318 net/core/rtnetlink.c:2830
 __rtnl_newlink net/core/rtnetlink.c:3605 [inline]
 rtnl_newlink+0x1424/0x1b74 net/core/rtnetlink.c:3652
 rtnetlink_rcv_msg+0x72c/0xd94 net/core/rtnetlink.c:6150
 netlink_rcv_skb+0x20c/0x3b8 net/netlink/af_netlink.c:2493
 rtnetlink_rcv+0x28/0x38 net/core/rtnetlink.c:6168
 netlink_unicast_kernel net/netlink/af_netlink.c:1311 [inline]
 netlink_unicast+0x65c/0x898 net/netlink/af_netlink.c:1337
 netlink_sendmsg+0x834/0xb18 net/netlink/af_netlink.c:1859
 sock_sendmsg_nosec net/socket.c:718 [inline]
 __sock_sendmsg net/socket.c:730 [inline]
 __sys_sendto+0x3b8/0x508 net/socket.c:2153
 __do_sys_sendto net/socket.c:2165 [inline]
 __se_sys_sendto net/socket.c:2161 [inline]
 __arm64_sys_sendto+0xd8/0xf8 net/socket.c:2161
 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
 invoke_syscall+0x98/0x2bc arch/arm64/kernel/syscall.c:52
 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:140
 do_el0_svc+0x58/0x13c arch/arm64/kernel/syscall.c:204
 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 ffff0000f8794c00
 which belongs to the cache kmalloc-256 of size 256
The buggy address is located 152 bytes to the right of
 256-byte region [ffff0000f8794c00, ffff0000f8794d00)

The buggy address belongs to the physical page:
page:0000000059d419ec refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x138794
head:0000000059d419ec order:1 compound_mapcount:0 compound_pincount:0
flags: 0x5ffc00000010200(slab|head|node=0|zone=2|lastcpupid=0x7ff)
raw: 05ffc00000010200 0000000000000000 dead000000000001 ffff0000c0002480
raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff0000f8794c80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
 ffff0000f8794d00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff0000f8794d80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
                            ^
 ffff0000f8794e00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff0000f8794e80: 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================
JFS: metapage_get_blocks failed
ERROR: (device loop2): release_metapage: write_one_page() failed

ERROR: (device loop2): remounting filesystem as read-only
JFS: metapage_get_blocks failed
ERROR: (device loop2): release_metapage: write_one_page() failed

------------[ cut here ]------------
DEBUG_RWSEMS_WARN_ON(sem->magic != sem): count = 0x1, magic = 0x0, owner = 0xffff0000fbca9bc0, curr 0xffff0000fbca9bc0, list not empty
WARNING: CPU: 1 PID: 23577 at kernel/locking/rwsem.c:1366 __up_write kernel/locking/rwsem.c:1366 [inline]
WARNING: CPU: 1 PID: 23577 at kernel/locking/rwsem.c:1366 up_write+0x4e4/0x76c kernel/locking/rwsem.c:1626
Modules linked in:
CPU: 1 PID: 23577 Comm: syz.2.8648 Tainted: G    B   W          6.1.121-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : __up_write kernel/locking/rwsem.c:1366 [inline]
pc : up_write+0x4e4/0x76c kernel/locking/rwsem.c:1626
lr : __up_write kernel/locking/rwsem.c:1366 [inline]
lr : up_write+0x4e4/0x76c kernel/locking/rwsem.c:1626
sp : ffff800022377440
x29: ffff8000223774c0 x28: ffff800022377600 x27: 1fffe0002013b347
x26: dfff800000000000 x25: 0000000000000001 x24: ffff0000fbca9bc0
x23: ffff0000fbca9bc0 x22: 0000000000000000 x21: ffff0001009d9a28
x20: ffff0001009d9a38 x19: ffff0001009d99d0 x18: 1fffe000367a0176
x17: ffff800015a8d000 x16: ffff80001232ae34 x15: ffff0001b3d00bbc
x14: ffff0001b3d00bb8 x13: 1fffe000367a0176 x12: 0000000000000001
x11: 0000000000ff0100 x10: 0000000040000002 x9 : 06e8afa9cc02a100
x8 : 06e8afa9cc02a100 x7 : 1fffe000367a0177 x6 : ffff800008278b0c
x5 : 0000000000000000 x4 : 0000000000000001 x3 : 0000000000000000
x2 : ffff800022376fa0 x1 : 0000000000000000 x0 : ffff800008278bac
Call trace:
 __up_write kernel/locking/rwsem.c:1366 [inline]
 up_write+0x4e4/0x76c kernel/locking/rwsem.c:1626
 __jfs_setxattr+0xd34/0x1338 fs/jfs/xattr.c:793
 __jfs_xattr_set+0xf8/0x190 fs/jfs/xattr.c:936
 jfs_xattr_set+0x58/0x70 fs/jfs/xattr.c:960
 __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_setxattr fs/xattr.c:652 [inline]
 __se_sys_setxattr fs/xattr.c:648 [inline]
 __arm64_sys_setxattr+0xbc/0xd8 fs/xattr.c:648
 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
 invoke_syscall+0x98/0x2bc arch/arm64/kernel/syscall.c:52
 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:140
 do_el0_svc+0x58/0x13c arch/arm64/kernel/syscall.c:204
 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
irq event stamp: 73979
hardirqs last  enabled at (73979): [<ffff800008278bac>] raw_spin_rq_unlock_irq kernel/sched/sched.h:1367 [inline]
hardirqs last  enabled at (73979): [<ffff800008278bac>] finish_lock_switch+0xbc/0x1e8 kernel/sched/core.c:5000
hardirqs last disabled at (73978): [<ffff8000123f8f60>] __schedule+0x2a4/0x1d44 kernel/sched/core.c:6456
softirqs last  enabled at (73906): [<ffff800008030408>] local_bh_enable+0x10/0x34 include/linux/bottom_half.h:32
softirqs last disabled at (73904): [<ffff8000080303d4>] local_bh_disable+0x10/0x34 include/linux/bottom_half.h:19
---[ end trace 0000000000000000 ]---
list_del corruption, ffff0001009d9898->next is NULL
------------[ cut here ]------------
kernel BUG at lib/list_debug.c:50!
Internal error: Oops - BUG: 00000000f2000800 [#1] PREEMPT SMP
Modules linked in:
CPU: 1 PID: 23577 Comm: syz.2.8648 Tainted: G    B   W          6.1.121-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : __list_del_entry_valid+0xe0/0x158 lib/list_debug.c:49
lr : __list_del_entry_valid+0xe0/0x158 lib/list_debug.c:49
sp : ffff800022377430
x29: ffff800022377430 x28: dfff800000000000 x27: 1ffff00004120427
x26: ffff0001009d9850 x25: ffff0001009d9c10 x24: 0000000000000001
x23: 0000000000000001 x22: dfff800000000000 x21: 0000000000000000
x20: 0000000000000000 x19: ffff0001009d9898 x18: 1fffe000367a0176
x17: 0000000000000000 x16: ffff80001232c2f4 x15: 0000000000000002
x14: 00000000ffffffff x13: 0000000000065180 x12: 0000000000080000
x11: 000000000001fde9 x10: ffff800027749000 x9 : 06e8afa9cc02a100
x8 : 06e8afa9cc02a100 x7 : 0000000000065180 x6 : 0000000000065140
x5 : ffff800022376d38 x4 : ffff800015b48880 x3 : ffff80000ab388ec
x2 : ffff0001b3d00cd0 x1 : 0000000100000001 x0 : 0000000000000033
Call trace:
 __list_del_entry_valid+0xe0/0x158 lib/list_debug.c:49
 __list_del_entry include/linux/list.h:134 [inline]
 list_del_init include/linux/list.h:206 [inline]
 txCommit+0x688/0x5574 fs/jfs/jfs_txnmgr.c:1247
 __jfs_xattr_set+0x12c/0x190 fs/jfs/xattr.c:938
 jfs_xattr_set+0x58/0x70 fs/jfs/xattr.c:960
 __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_setxattr fs/xattr.c:652 [inline]
 __se_sys_setxattr fs/xattr.c:648 [inline]
 __arm64_sys_setxattr+0xbc/0xd8 fs/xattr.c:648
 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
 invoke_syscall+0x98/0x2bc arch/arm64/kernel/syscall.c:52
 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:140
 do_el0_svc+0x58/0x13c arch/arm64/kernel/syscall.c:204
 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
Code: b003ef60 91088000 aa1303e1 95de09a5 (d4210000) 
---[ end trace 0000000000000000 ]---

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/12/20 06:15 linux-6.1.y 29f02ec58a94 0f61b415 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: slab-out-of-bounds Read in reiserfs_xattr_get
* Struck through repros no longer work on HEAD.