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

8 views
Skip to first unread message

syzbot

unread,
Oct 4, 2022, 7:36:42 PM10/4/22
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 3f8a27f9e27b Linux 4.19.211
git tree: linux-4.19.y
console output: https://syzkaller.appspot.com/x/log.txt?x=1209cc92880000
kernel config: https://syzkaller.appspot.com/x/.config?x=9b9277b418617afe
dashboard link: https://syzkaller.appspot.com/bug?extid=c4d13e4b96dc976b3208
compiler: gcc version 10.2.1 20210110 (Debian 10.2.1-6)

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/98c0bdb4abb3/disk-3f8a27f9.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/ea228ff02669/vmlinux-3f8a27f9.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+c4d13e...@syzkaller.appspotmail.com

0000000060d4d980: 00 00 00 00 00 00 00 00 e0 6a 90 4e 80 88 ff ff .........j.N....
00000000deffe9e4: e0 6a 90 4e 80 88 ff ff 00 00 00 00 00 00 00 00 .j.N............
000000000d8a61f5: 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00000000d830b0eb: 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+0xc76/0xca0 lib/hexdump.c:175
Read of size 1 at addr ffff88804e906b18 by task syz-executor.3/10604

CPU: 0 PID: 10604 Comm: syz-executor.3 Not tainted 4.19.211-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/22/2022
Call Trace:
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack+0x1fc/0x2ef lib/dump_stack.c:118
print_address_description.cold+0x54/0x219 mm/kasan/report.c:256
kasan_report_error.cold+0x8a/0x1b9 mm/kasan/report.c:354
kasan_report mm/kasan/report.c:412 [inline]
__asan_report_load1_noabort+0x88/0x90 mm/kasan/report.c:430
hex_dump_to_buffer+0xc76/0xca0 lib/hexdump.c:175
print_hex_dump+0x12f/0x1d0 lib/hexdump.c:258
ea_get.cold+0x59/0x75 fs/jfs/xattr.c:574
__jfs_setxattr+0xdb/0xf50 fs/jfs/xattr.c:684
__jfs_xattr_set+0xc9/0x150 fs/jfs/xattr.c:930
__vfs_setxattr+0x10e/0x170 fs/xattr.c:149
__vfs_setxattr_noperm+0x11a/0x420 fs/xattr.c:180
__vfs_setxattr_locked+0x176/0x250 fs/xattr.c:238
vfs_setxattr+0xe5/0x270 fs/xattr.c:255
setxattr+0x23d/0x330 fs/xattr.c:520
path_setxattr+0x170/0x190 fs/xattr.c:539
__do_sys_setxattr fs/xattr.c:554 [inline]
__se_sys_setxattr fs/xattr.c:550 [inline]
__x64_sys_setxattr+0xc0/0x160 fs/xattr.c:550
do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x7f04902e85a9
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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:00007f048ec5c168 EFLAGS: 00000246 ORIG_RAX: 00000000000000bc
RAX: ffffffffffffffda RBX: 00007f0490409f80 RCX: 00007f04902e85a9
RDX: 0000000020005380 RSI: 0000000020000080 RDI: 0000000020000040
RBP: 00007f0490343580 R08: 0000000000000002 R09: 0000000000000000
R10: 0000000000000014 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ffc0b0ba0af R14: 00007f048ec5c300 R15: 0000000000022000

Allocated by task 10604:
kmem_cache_alloc+0x122/0x370 mm/slab.c:3559
jfs_alloc_inode+0x18/0x50 fs/jfs/super.c:118
alloc_inode+0x5d/0x180 fs/inode.c:211
iget_locked+0x193/0x480 fs/inode.c:1176
jfs_iget+0x1a/0x4d0 fs/jfs/inode.c:41
jfs_lookup+0x19e/0x1c0 fs/jfs/namei.c:1474
__lookup_slow+0x246/0x4a0 fs/namei.c:1672
lookup_slow fs/namei.c:1689 [inline]
walk_component+0x7ac/0xda0 fs/namei.c:1811
lookup_last fs/namei.c:2274 [inline]
path_lookupat+0x1ff/0x8d0 fs/namei.c:2319
filename_lookup+0x1ac/0x5a0 fs/namei.c:2349
user_path_at include/linux/namei.h:57 [inline]
path_setxattr+0x95/0x190 fs/xattr.c:534
__do_sys_setxattr fs/xattr.c:554 [inline]
__se_sys_setxattr fs/xattr.c:550 [inline]
__x64_sys_setxattr+0xc0/0x160 fs/xattr.c:550
do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
entry_SYSCALL_64_after_hwframe+0x49/0xbe

Freed by task 18:
__cache_free mm/slab.c:3503 [inline]
kmem_cache_free+0x7f/0x260 mm/slab.c:3765
__rcu_reclaim kernel/rcu/rcu.h:236 [inline]
rcu_do_batch kernel/rcu/tree.c:2584 [inline]
invoke_rcu_callbacks kernel/rcu/tree.c:2897 [inline]
__rcu_process_callbacks kernel/rcu/tree.c:2864 [inline]
rcu_process_callbacks+0x8ff/0x18b0 kernel/rcu/tree.c:2881
__do_softirq+0x265/0x980 kernel/softirq.c:292

The buggy address belongs to the object at ffff88804e906380
which belongs to the cache jfs_ip of size 1944
The buggy address is located 0 bytes to the right of
1944-byte region [ffff88804e906380, ffff88804e906b18)
The buggy address belongs to the page:
page:ffffea00013a4180 count:1 mapcount:0 mapping:ffff8880b0f24a80 index:0xffff88804e906fff
flags: 0xfff00000000100(slab)
raw: 00fff00000000100 ffffea00013a5708 ffffea00022b1748 ffff8880b0f24a80
raw: ffff88804e906fff ffff88804e906380 0000000100000001 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff88804e906a00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff88804e906a80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff88804e906b00: 00 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc
^
ffff88804e906b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88804e906c00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

syzbot

unread,
Oct 6, 2022, 11:56:41 PM10/6/22
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 9d5c0b3a8e1a Linux 4.14.295
git tree: linux-4.14.y
console output: https://syzkaller.appspot.com/x/log.txt?x=17df67ec880000
kernel config: https://syzkaller.appspot.com/x/.config?x=746c079015a92425
dashboard link: https://syzkaller.appspot.com/bug?extid=4bccd045a7fdc8d1811f
compiler: gcc version 10.2.1 20210110 (Debian 10.2.1-6)
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=14fa052a880000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=14d4eca2880000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/ed6fcf5895a2/disk-9d5c0b3a.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/341aa3534116/vmlinux-9d5c0b3a.xz
mounted in repro: https://storage.googleapis.com/syzbot-assets/1e42f7176171/mount_0.gz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+4bccd0...@syzkaller.appspotmail.com

ffff88809ed658d8: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
ffff88809ed658e8: e8 58 d6 9e 80 88 ff ff e8 58 d6 9e 80 88 ff ff .X.......X......
ffff88809ed658f8: 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 ................
ffff88809ed65908: 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+0x9d1/0xaa0 lib/hexdump.c:196
Read of size 1 at addr ffff88809ed65920 by task syz-executor100/7983

CPU: 0 PID: 7983 Comm: syz-executor100 Not tainted 4.14.295-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/22/2022
Call Trace:
__dump_stack lib/dump_stack.c:17 [inline]
dump_stack+0x1b2/0x281 lib/dump_stack.c:58
print_address_description.cold+0x54/0x1d3 mm/kasan/report.c:252
kasan_report_error.cold+0x8a/0x191 mm/kasan/report.c:351
kasan_report mm/kasan/report.c:409 [inline]
__asan_report_load1_noabort+0x68/0x70 mm/kasan/report.c:427
hex_dump_to_buffer+0x9d1/0xaa0 lib/hexdump.c:196
print_hex_dump+0xef/0x170 lib/hexdump.c:279
ea_get.cold+0x59/0x75 fs/jfs/xattr.c:574
__jfs_getxattr+0xae/0x340 fs/jfs/xattr.c:820
jfs_get_acl+0xf3/0x150 fs/jfs/acl.c:48
get_acl fs/posix_acl.c:140 [inline]
get_acl+0x11f/0x210 fs/posix_acl.c:95
posix_acl_create.part.0+0x2c/0x250 fs/posix_acl.c:594
posix_acl_create+0x10a/0x150 fs/posix_acl.c:628
jfs_init_acl+0x71/0x230 fs/jfs/acl.c:142
jfs_mkdir.part.0+0x175/0x7e0 fs/jfs/namei.c:249
jfs_mkdir+0x35/0x50 fs/jfs/namei.c:223
vfs_mkdir+0x463/0x6e0 fs/namei.c:3851
SYSC_mkdirat fs/namei.c:3874 [inline]
SyS_mkdirat+0x1fd/0x270 fs/namei.c:3858
do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
entry_SYSCALL_64_after_hwframe+0x46/0xbb
RIP: 0033:0x7fc171493d69
RSP: 002b:00007ffe621de068 EFLAGS: 00000246 ORIG_RAX: 0000000000000102
RAX: ffffffffffffffda RBX: 0030656c69662f2e RCX: 00007fc171493d69
RDX: 0000000000000050 RSI: 0000000020000040 RDI: 0000000000000003
RBP: 00007fc1714535d0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00000000f8008000
R13: 0000000000000000 R14: 00080000000000f4 R15: 0000000000000000

Allocated by task 7983:
save_stack mm/kasan/kasan.c:447 [inline]
set_track mm/kasan/kasan.c:459 [inline]
kasan_kmalloc+0xeb/0x160 mm/kasan/kasan.c:551
kmem_cache_alloc+0x124/0x3c0 mm/slab.c:3552
jfs_alloc_inode+0x18/0x50 fs/jfs/super.c:118
alloc_inode+0x5d/0x170 fs/inode.c:210
iget_locked+0x151/0x400 fs/inode.c:1127
jfs_iget+0x1e/0x480 fs/jfs/inode.c:41
jfs_lookup+0x156/0x170 fs/jfs/namei.c:1478
lookup_open+0x5c4/0x1750 fs/namei.c:3220
do_last fs/namei.c:3334 [inline]
path_openat+0x14bb/0x2970 fs/namei.c:3571
do_filp_open+0x179/0x3c0 fs/namei.c:3605
do_sys_open+0x296/0x410 fs/open.c:1081
do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
entry_SYSCALL_64_after_hwframe+0x46/0xbb

Freed by task 0:
(stack is not available)

The buggy address belongs to the object at ffff88809ed65180
which belongs to the cache jfs_ip of size 1952
The buggy address is located 0 bytes to the right of
1952-byte region [ffff88809ed65180, ffff88809ed65920)
The buggy address belongs to the page:
page:ffffea00027b5940 count:1 mapcount:0 mapping:ffff88809ed65180 index:0xffff88809ed65fff
flags: 0xfff00000000100(slab)
raw: 00fff00000000100 ffff88809ed65180 ffff88809ed65fff 0000000100000001
raw: ffffea000251ad20 ffffea000237d5a0 ffff8882393f36c0 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff88809ed65800: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff88809ed65880: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff88809ed65900: 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc fc
^
ffff88809ed65980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88809ed65a00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
syzbot can test patches for this issue, for details see:
https://goo.gl/tpsmEJ#testing-patches

syzbot

unread,
Mar 6, 2023, 12:23:37 PM3/6/23
to syzkaller...@googlegroups.com
Auto-closing this bug as obsolete.
Crashes did not happen for a while, no reproducer and no activity.
Reply all
Reply to author
Forward
0 new messages