* [syzbot] [ntfs3?] KASAN: slab-out-of-bounds Read in mi_enum_attr
@ 2024-02-01 15:17 syzbot
2024-02-02 3:33 ` [PATCH] fs/ntfs3: fix oob " Lizhi Xu
0 siblings, 1 reply; 6+ messages in thread
From: syzbot @ 2024-02-01 15:17 UTC (permalink / raw)
To: almaz.alexandrovich, linux-fsdevel, linux-kernel, ntfs3,
syzkaller-bugs
Hello,
syzbot found the following issue on:
HEAD commit: 8a696a29c690 Merge tag 'platform-drivers-x86-v6.8-2' of gi..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=16753f17e80000
kernel config: https://syzkaller.appspot.com/x/.config?x=9247001bfee478be
dashboard link: https://syzkaller.appspot.com/bug?extid=a426cde6dee8c2884b0b
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=12c4efc3e80000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=16a562f3e80000
Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/e52b675ecac5/disk-8a696a29.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/4fc98d5eb84b/vmlinux-8a696a29.xz
kernel image: https://storage.googleapis.com/syzbot-assets/5d4769a0b908/bzImage-8a696a29.xz
mounted in repro: https://storage.googleapis.com/syzbot-assets/d57d4609374b/mount_0.gz
IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+a426cde6dee8c2884b0b@syzkaller.appspotmail.com
==================================================================
BUG: KASAN: slab-out-of-bounds in mi_enum_attr+0x850/0x9e0 fs/ntfs3/record.c:246
Read of size 4 at addr ffff88807483335d by task syz-executor171/9769
CPU: 0 PID: 9769 Comm: syz-executor171 Not tainted 6.8.0-rc1-syzkaller-00356-g8a696a29c690 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x1e7/0x2d0 lib/dump_stack.c:106
print_address_description mm/kasan/report.c:377 [inline]
print_report+0x163/0x540 mm/kasan/report.c:488
kasan_report+0x142/0x170 mm/kasan/report.c:601
mi_enum_attr+0x850/0x9e0 fs/ntfs3/record.c:246
mi_find_attr+0x1c5/0x2b0 fs/ntfs3/record.c:353
ni_find_attr+0x609/0x8d0 fs/ntfs3/frecord.c:218
ntfs_readlink_hlp+0xa6/0xcb0 fs/ntfs3/inode.c:1922
ntfs_get_link+0x79/0x110 fs/ntfs3/inode.c:2068
pick_link+0x638/0xd70
step_into+0xc9f/0x1080 fs/namei.c:1871
open_last_lookups fs/namei.c:3588 [inline]
path_openat+0x187c/0x31e0 fs/namei.c:3795
do_filp_open+0x234/0x490 fs/namei.c:3825
do_sys_openat2+0x13e/0x1d0 fs/open.c:1404
do_sys_open fs/open.c:1419 [inline]
__do_sys_open fs/open.c:1427 [inline]
__se_sys_open fs/open.c:1423 [inline]
__x64_sys_open+0x225/0x270 fs/open.c:1423
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xf5/0x230 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x63/0x6b
RIP: 0033:0x7f1b33964c19
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 81 1d 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 b0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f1b338d3218 EFLAGS: 00000246 ORIG_RAX: 0000000000000002
RAX: ffffffffffffffda RBX: 00007f1b33a06708 RCX: 00007f1b33964c19
RDX: 0000000000000065 RSI: 0000000000000080 RDI: 0000000020000440
RBP: 0000000000000020 R08: 0000000000000000 R09: 0000000000000000
R10: 00007ffcb7e5f0f7 R11: 0000000000000246 R12: 00007f1b33a06700
R13: 00007f1b339d2024 R14: 0030656c69662f2e R15: 0031656c69662f2e
</TASK>
Allocated by task 5096:
kasan_save_stack mm/kasan/common.c:47 [inline]
kasan_save_track+0x3f/0x70 mm/kasan/common.c:68
poison_kmalloc_redzone mm/kasan/common.c:372 [inline]
__kasan_kmalloc+0x98/0xb0 mm/kasan/common.c:389
kasan_kmalloc include/linux/kasan.h:211 [inline]
__do_kmalloc_node mm/slub.c:3981 [inline]
__kmalloc+0x22e/0x490 mm/slub.c:3994
kmalloc include/linux/slab.h:594 [inline]
tomoyo_realpath_from_path+0xcf/0x5e0 security/tomoyo/realpath.c:251
tomoyo_get_realpath security/tomoyo/file.c:151 [inline]
tomoyo_path_perm+0x2b7/0x730 security/tomoyo/file.c:822
security_inode_getattr+0xd3/0x120 security/security.c:2237
vfs_getattr+0x46/0x430 fs/stat.c:173
vfs_statx+0x1a5/0x4e0 fs/stat.c:248
vfs_fstatat+0x135/0x190 fs/stat.c:304
__do_sys_newfstatat fs/stat.c:468 [inline]
__se_sys_newfstatat fs/stat.c:462 [inline]
__x64_sys_newfstatat+0x117/0x190 fs/stat.c:462
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xf5/0x230 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x63/0x6b
Freed by task 5096:
kasan_save_stack mm/kasan/common.c:47 [inline]
kasan_save_track+0x3f/0x70 mm/kasan/common.c:68
kasan_save_free_info+0x4e/0x60 mm/kasan/generic.c:640
poison_slab_object+0xa6/0xe0 mm/kasan/common.c:241
__kasan_slab_free+0x34/0x60 mm/kasan/common.c:257
kasan_slab_free include/linux/kasan.h:184 [inline]
slab_free_hook mm/slub.c:2121 [inline]
slab_free mm/slub.c:4299 [inline]
kfree+0x14a/0x380 mm/slub.c:4409
tomoyo_realpath_from_path+0x5a3/0x5e0 security/tomoyo/realpath.c:286
tomoyo_get_realpath security/tomoyo/file.c:151 [inline]
tomoyo_path_perm+0x2b7/0x730 security/tomoyo/file.c:822
security_inode_getattr+0xd3/0x120 security/security.c:2237
vfs_getattr+0x46/0x430 fs/stat.c:173
vfs_statx+0x1a5/0x4e0 fs/stat.c:248
vfs_fstatat+0x135/0x190 fs/stat.c:304
__do_sys_newfstatat fs/stat.c:468 [inline]
__se_sys_newfstatat fs/stat.c:462 [inline]
__x64_sys_newfstatat+0x117/0x190 fs/stat.c:462
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xf5/0x230 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x63/0x6b
The buggy address belongs to the object at ffff888074832000
which belongs to the cache kmalloc-4k of size 4096
The buggy address is located 861 bytes to the right of
allocated 4096-byte region [ffff888074832000, ffff888074833000)
The buggy address belongs to the physical page:
page:ffffea0001d20c00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x74830
head:ffffea0001d20c00 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0
flags: 0xfff00000000840(slab|head|node=0|zone=1|lastcpupid=0x7ff)
page_type: 0xffffffff()
raw: 00fff00000000840 ffff888013042140 dead000000000100 dead000000000122
raw: 0000000000000000 0000000000040004 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 0x1d2040(__GFP_IO|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 4500, tgid 4500 (udevd), ts 828902194240, free_ts 828781426813
set_page_owner include/linux/page_owner.h:31 [inline]
post_alloc_hook+0x1e6/0x210 mm/page_alloc.c:1533
prep_new_page mm/page_alloc.c:1540 [inline]
get_page_from_freelist+0x33ea/0x3570 mm/page_alloc.c:3311
__alloc_pages+0x255/0x680 mm/page_alloc.c:4567
__alloc_pages_node include/linux/gfp.h:238 [inline]
alloc_pages_node include/linux/gfp.h:261 [inline]
alloc_slab_page+0x5f/0x160 mm/slub.c:2190
allocate_slab mm/slub.c:2354 [inline]
new_slab+0x84/0x2f0 mm/slub.c:2407
___slab_alloc+0xd17/0x13d0 mm/slub.c:3540
__slab_alloc mm/slub.c:3625 [inline]
__slab_alloc_node mm/slub.c:3678 [inline]
slab_alloc_node mm/slub.c:3850 [inline]
__do_kmalloc_node mm/slub.c:3980 [inline]
__kmalloc+0x2dc/0x490 mm/slub.c:3994
kmalloc include/linux/slab.h:594 [inline]
tomoyo_realpath_from_path+0xcf/0x5e0 security/tomoyo/realpath.c:251
tomoyo_get_realpath security/tomoyo/file.c:151 [inline]
tomoyo_check_open_permission+0x255/0x500 security/tomoyo/file.c:771
security_file_open+0x66/0x560 security/security.c:2932
do_dentry_open+0x327/0x1590 fs/open.c:940
do_open fs/namei.c:3641 [inline]
path_openat+0x2823/0x31e0 fs/namei.c:3798
do_filp_open+0x234/0x490 fs/namei.c:3825
do_sys_openat2+0x13e/0x1d0 fs/open.c:1404
do_sys_open fs/open.c:1419 [inline]
__do_sys_openat fs/open.c:1435 [inline]
__se_sys_openat fs/open.c:1430 [inline]
__x64_sys_openat+0x247/0x290 fs/open.c:1430
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xf5/0x230 arch/x86/entry/common.c:83
page last free pid 4500 tgid 4500 stack trace:
reset_page_owner include/linux/page_owner.h:24 [inline]
free_pages_prepare mm/page_alloc.c:1140 [inline]
free_unref_page_prepare+0x959/0xa80 mm/page_alloc.c:2346
free_unref_page+0x37/0x3f0 mm/page_alloc.c:2486
discard_slab mm/slub.c:2453 [inline]
__put_partials+0xeb/0x130 mm/slub.c:2922
put_cpu_partial+0x17b/0x250 mm/slub.c:2997
__slab_free+0x2fe/0x410 mm/slub.c:4166
qlink_free mm/kasan/quarantine.c:160 [inline]
qlist_free_all+0x6d/0xd0 mm/kasan/quarantine.c:176
kasan_quarantine_reduce+0x14b/0x160 mm/kasan/quarantine.c:283
__kasan_slab_alloc+0x23/0x70 mm/kasan/common.c:324
kasan_slab_alloc include/linux/kasan.h:201 [inline]
slab_post_alloc_hook mm/slub.c:3813 [inline]
slab_alloc_node mm/slub.c:3860 [inline]
kmem_cache_alloc_lru+0x172/0x340 mm/slub.c:3879
__d_alloc+0x31/0x750 fs/dcache.c:1624
d_alloc+0x4b/0x190 fs/dcache.c:1704
lookup_one_qstr_excl+0xce/0x250 fs/namei.c:1604
do_unlinkat+0x297/0x830 fs/namei.c:4386
__do_sys_unlink fs/namei.c:4446 [inline]
__se_sys_unlink fs/namei.c:4444 [inline]
__x64_sys_unlink+0x49/0x50 fs/namei.c:4444
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xf5/0x230 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x63/0x6b
Memory state around the buggy address:
ffff888074833200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff888074833280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff888074833300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
^
ffff888074833380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff888074833400: 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 syzkaller@googlegroups.com.
syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title
If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.
If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)
If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report
If you want to undo deduplication, reply with:
#syz undup
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] fs/ntfs3: fix oob in mi_enum_attr
2024-02-01 15:17 [syzbot] [ntfs3?] KASAN: slab-out-of-bounds Read in mi_enum_attr syzbot
@ 2024-02-02 3:33 ` Lizhi Xu
0 siblings, 0 replies; 6+ messages in thread
From: Lizhi Xu @ 2024-02-02 3:33 UTC (permalink / raw)
To: syzbot+a426cde6dee8c2884b0b
Cc: almaz.alexandrovich, linux-fsdevel, linux-kernel, ntfs3,
syzkaller-bugs
When the value of attr->size is too large, it can cause overflow when taking
the next attr. Here, off is used to determine the offset first to avoid problems.
Reported-and-tested-by: syzbot+a426cde6dee8c2884b0b@syzkaller.appspotmail.com
Signed-off-by: Lizhi Xu <lizhi.xu@windriver.com>
---
fs/ntfs3/record.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/ntfs3/record.c b/fs/ntfs3/record.c
index 53629b1f65e9..a435df98c2b1 100644
--- a/fs/ntfs3/record.c
+++ b/fs/ntfs3/record.c
@@ -243,14 +243,14 @@ struct ATTRIB *mi_enum_attr(struct mft_inode *mi, struct ATTRIB *attr)
off += asize;
}
- asize = le32_to_cpu(attr->size);
-
/* Can we use the first field (attr->type). */
if (off + 8 > used) {
static_assert(ALIGN(sizeof(enum ATTR_TYPE), 8) == 8);
return NULL;
}
+ asize = le32_to_cpu(attr->size);
+
if (attr->type == ATTR_END) {
/* End of enumeration. */
return NULL;
--
2.43.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [syzbot] [ntfs3?] KASAN: slab-out-of-bounds Read in mi_enum_attr
[not found] <CACT4Y+ZWjUE6-q1YF=ZaPjKgGZBw4JLD1v2DphSgCAVf1RzE8g@mail.gmail.com>
@ 2024-07-05 13:52 ` Lizhi Xu
2024-07-08 6:54 ` Dmitry Vyukov
0 siblings, 1 reply; 6+ messages in thread
From: Lizhi Xu @ 2024-07-05 13:52 UTC (permalink / raw)
To: dvyukov
Cc: almaz.alexandrovich, linux-kernel, ntfs3, linux-fsdevel,
syzbot+a426cde6dee8c2884b0b, syzkaller-bugs
On Thu, 4 Jul 2024 15:44:02 +0200, Dmitry Vyukov wrote:
> > index 53629b1f65e9..a435df98c2b1 100644
> > --- a/fs/ntfs3/record.c
> > +++ b/fs/ntfs3/record.c
> > @@ -243,14 +243,14 @@ struct ATTRIB *mi_enum_attr(struct mft_inode *mi, struct ATTRIB *attr)
> > off += asize;
> > }
> >
> > - asize = le32_to_cpu(attr->size);
> > -
> > /* Can we use the first field (attr->type). */
> > if (off + 8 > used) {
> > static_assert(ALIGN(sizeof(enum ATTR_TYPE), 8) == 8);
> > return NULL;
> > }
> >
> > + asize = le32_to_cpu(attr->size);
> > +
> > if (attr->type == ATTR_END) {
> > /* End of enumeration. */
> > return NULL;
>
> Hi Lizhi,
>
> I don't see this fix mailed as a patch. Do you plan to submit it officially?
Hi Dmitry Vyukov,
Here: https://lore.kernel.org/all/20240202033334.1784409-1-lizhi.xu@windriver.com
--
Lizhi
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [syzbot] [ntfs3?] KASAN: slab-out-of-bounds Read in mi_enum_attr
2024-07-05 13:52 ` [syzbot] [ntfs3?] KASAN: slab-out-of-bounds Read " Lizhi Xu
@ 2024-07-08 6:54 ` Dmitry Vyukov
2024-07-11 8:27 ` Konstantin Komarov
0 siblings, 1 reply; 6+ messages in thread
From: Dmitry Vyukov @ 2024-07-08 6:54 UTC (permalink / raw)
To: Lizhi Xu
Cc: almaz.alexandrovich, linux-kernel, ntfs3, linux-fsdevel,
syzbot+a426cde6dee8c2884b0b, syzkaller-bugs, Kees Cook
On Fri, 5 Jul 2024 at 15:52, Lizhi Xu <lizhi.xu@windriver.com> wrote:
>
> On Thu, 4 Jul 2024 15:44:02 +0200, Dmitry Vyukov wrote:
> > > index 53629b1f65e9..a435df98c2b1 100644
> > > --- a/fs/ntfs3/record.c
> > > +++ b/fs/ntfs3/record.c
> > > @@ -243,14 +243,14 @@ struct ATTRIB *mi_enum_attr(struct mft_inode *mi, struct ATTRIB *attr)
> > > off += asize;
> > > }
> > >
> > > - asize = le32_to_cpu(attr->size);
> > > -
> > > /* Can we use the first field (attr->type). */
> > > if (off + 8 > used) {
> > > static_assert(ALIGN(sizeof(enum ATTR_TYPE), 8) == 8);
> > > return NULL;
> > > }
> > >
> > > + asize = le32_to_cpu(attr->size);
> > > +
> > > if (attr->type == ATTR_END) {
> > > /* End of enumeration. */
> > > return NULL;
> >
> > Hi Lizhi,
> >
> > I don't see this fix mailed as a patch. Do you plan to submit it officially?
> Hi Dmitry Vyukov,
> Here: https://lore.kernel.org/all/20240202033334.1784409-1-lizhi.xu@windriver.com
I don't see this patch merged upstream. Was it lost? Perhaps it needs
to be resent.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [syzbot] [ntfs3?] KASAN: slab-out-of-bounds Read in mi_enum_attr
2024-07-08 6:54 ` Dmitry Vyukov
@ 2024-07-11 8:27 ` Konstantin Komarov
2024-08-20 10:53 ` lei lu
0 siblings, 1 reply; 6+ messages in thread
From: Konstantin Komarov @ 2024-07-11 8:27 UTC (permalink / raw)
To: Dmitry Vyukov, Lizhi Xu
Cc: linux-kernel, ntfs3, linux-fsdevel, syzbot+a426cde6dee8c2884b0b,
syzkaller-bugs, Kees Cook
On 08.07.2024 09:54, Dmitry Vyukov wrote:
> On Fri, 5 Jul 2024 at 15:52, Lizhi Xu <lizhi.xu@windriver.com> wrote:
>> On Thu, 4 Jul 2024 15:44:02 +0200, Dmitry Vyukov wrote:
>>>> index 53629b1f65e9..a435df98c2b1 100644
>>>> --- a/fs/ntfs3/record.c
>>>> +++ b/fs/ntfs3/record.c
>>>> @@ -243,14 +243,14 @@ struct ATTRIB *mi_enum_attr(struct mft_inode *mi, struct ATTRIB *attr)
>>>> off += asize;
>>>> }
>>>>
>>>> - asize = le32_to_cpu(attr->size);
>>>> -
>>>> /* Can we use the first field (attr->type). */
>>>> if (off + 8 > used) {
>>>> static_assert(ALIGN(sizeof(enum ATTR_TYPE), 8) == 8);
>>>> return NULL;
>>>> }
>>>>
>>>> + asize = le32_to_cpu(attr->size);
>>>> +
>>>> if (attr->type == ATTR_END) {
>>>> /* End of enumeration. */
>>>> return NULL;
>>> Hi Lizhi,
>>>
>>> I don't see this fix mailed as a patch. Do you plan to submit it officially?
>> Hi Dmitry Vyukov,
>> Here: https://lore.kernel.org/all/20240202033334.1784409-1-lizhi.xu@windriver.com
> I don't see this patch merged upstream. Was it lost? Perhaps it needs
> to be resent.
Hi, Lizhi, Dmitry, This patch is indeed not present in either the
upstream or our repository. I will retest it and figure out why I didn't
add it. Around the same time, I was making changes to mi_enum_attr, so I
might have mixed something up. Thanks for your attention! Regards,
Konstantin
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [syzbot] [ntfs3?] KASAN: slab-out-of-bounds Read in mi_enum_attr
2024-07-11 8:27 ` Konstantin Komarov
@ 2024-08-20 10:53 ` lei lu
0 siblings, 0 replies; 6+ messages in thread
From: lei lu @ 2024-08-20 10:53 UTC (permalink / raw)
To: almaz.alexandrovich
Cc: dvyukov, keescook, linux-fsdevel, linux-kernel, lizhi.xu, ntfs3,
syzbot+a426cde6dee8c2884b0b, syzkaller-bugs
Hi, Konstantin,
I think this patch is not fully considered. The root cause is there is a lack of
verification of the space occupied by the fixed members of attr before accessing.
In this patch, 'if (off + 8 > used)' just ensure that type and size field don't
stry beyond valid memory region without considering other members.
We can make a PoC as below to trigger out-of-bound read in 'if (!attr->non_res)',
because if the attr is the first ATTRIB, it will not call
'if (asize < SIZEOF_REDISENT)'. So 'if (off + asize < off || off + asize > used)'
is an invalid check.
PoC:
MFT_REC for MFT_REC_VOL located at: 0x660c00
MFT_REC.rhdr.sign: 0x454c4946 (FILE)
MFT_REC.rhdr.fix_off: 0x30
MFT_REC.rhdr.fix_num: 0x3
MFT_REC.rhdr.lsn: 0x10550c
MFT_REC.seq: 0x3
MFT_REC.hard_links: 0x1
MFT_REC.attr_off: 0x38 --> 0x3f8
MFT_REC.flags: 0x1
MFT_REC.used: 0x178 --> 0x400
MFT_REC.total: 0x400
MFT_REC.parent_ref.low: 0x0
MFT_REC.parent_ref.high: 0x0
MFT_REC.parent_ref.seq: 0x0
MFT_REC.next_attr_id: 0x6
MFT_REC.res: 0x0
MFT_REC.mft_record: 0x3
ATTRIB[0] located at: 0x660ff8
ATTRIB[0].type: 0x0 --> 0x10
ATTRIB[0].size: 0x20000 --> 0x8
KASAN report:
[ 611.082411] ==================================================================
[ 611.082411] BUG: KASAN: slab-out-of-bounds in mi_enum_attr+0x762/0x810
[ 611.082411] Read of size 1 at addr ffff88810e853c00 by task mount/298
[ 611.082411]
[ 611.082411] CPU: 1 PID: 298 Comm: mount Not tainted 6.8.2 #2
[ 611.082411] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1 04/01/2014
[ 611.082411] Call Trace:
[ 611.082411] <TASK>
[ 611.082411] dump_stack_lvl+0x50/0x70
[ 611.082411] print_report+0xcc/0x620
[ 611.082411] ? __virt_addr_valid+0xcb/0x320
[ 611.082411] ? mi_enum_attr+0x762/0x810
[ 611.082411] kasan_report+0xb0/0xe0
[ 611.082411] ? mi_enum_attr+0x762/0x810
[ 611.082411] mi_enum_attr+0x762/0x810
[ 611.082411] ni_enum_attr_ex+0x2fc/0x3e0
[ 611.082411] ? ntfs_read_bh+0x48/0xa0
[ 611.082411] ? __pfx_ni_enum_attr_ex+0x10/0x10
[ 611.082411] ? mi_read+0x32b/0x540
[ 611.082411] ntfs_iget5+0x86c/0x2dc0
[ 611.082411] ? __pfx_ntfs_iget5+0x10/0x10
[ 611.082411] ? __brelse+0x7c/0xa0
[ 611.082411] ntfs_fill_super+0x1686/0x3c00
[ 611.082411] ? __pfx_ntfs_fill_super+0x10/0x10
[ 611.082411] ? set_blocksize+0xbe/0x3a0
[ 611.082411] ? set_blocksize+0x28c/0x3a0
[ 611.082411] ? sb_set_blocksize+0xde/0x110
[ 611.082411] ? setup_bdev_super+0x331/0x690
[ 611.082411] get_tree_bdev+0x32b/0x590
[ 611.082411] ? __pfx_ntfs_fill_super+0x10/0x10
[ 611.082411] ? __pfx_get_tree_bdev+0x10/0x10
[ 611.082411] ? __pfx_vfs_parse_fs_string+0x10/0x10
[ 611.082411] ? cap_capable+0x199/0x200
[ 611.082411] ? security_capable+0x8d/0xc0
[ 611.082411] vfs_get_tree+0x8c/0x300
[ 611.082411] path_mount+0x507/0x1a30
[ 611.082411] ? sysvec_apic_timer_interrupt+0xf/0x80
[ 611.082411] ? __pfx_path_mount+0x10/0x10
[ 611.082411] __x64_sys_mount+0x23b/0x2d0
[ 611.082411] ? __pfx___x64_sys_mount+0x10/0x10
[ 611.082411] ? __do_softirq+0x18a/0x575
[ 611.082411] do_syscall_64+0xb3/0x1b0
[ 611.082411] entry_SYSCALL_64_after_hwframe+0x6f/0x77
[ 611.082411] RIP: 0033:0x7f2d7417566a
[ 611.082411] Code: 48 8b 0d 29 18 0d 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 8
[ 611.082411] RSP: 002b:00007fff27f71598 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5
[ 611.082411] RAX: ffffffffffffffda RBX: 00007f2d742a9264 RCX: 00007f2d7417566a
[ 611.082411] RDX: 000055ec2ff0cf80 RSI: 000055ec2ff0cfc0 RDI: 000055ec2ff0cfa0
[ 611.082411] RBP: 000055ec2ff0cd50 R08: 0000000000000000 R09: 00007f2d74247be0
[ 611.082411] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
[ 611.082411] R13: 000055ec2ff0cfa0 R14: 000055ec2ff0cf80 R15: 000055ec2ff0cd50
[ 611.082411] </TASK>
[ 611.082411]
[ 611.082411] Allocated by task 298:
[ 611.082411] kasan_save_stack+0x24/0x50
[ 611.082411] kasan_save_track+0x14/0x30
[ 611.082411] __kasan_kmalloc+0x7f/0x90
[ 611.082411] __kmalloc+0x179/0x370
[ 611.082411] mi_init+0x90/0x100
[ 611.082411] ntfs_iget5+0x3d1/0x2dc0
[ 611.082411] ntfs_fill_super+0x1686/0x3c00
[ 611.082411] get_tree_bdev+0x32b/0x590
[ 611.082411] vfs_get_tree+0x8c/0x300
[ 611.082411] path_mount+0x507/0x1a30
[ 611.082411] __x64_sys_mount+0x23b/0x2d0
[ 611.082411] do_syscall_64+0xb3/0x1b0
[ 611.082411] entry_SYSCALL_64_after_hwframe+0x6f/0x77
[ 611.082411]
[ 611.082411] The buggy address belongs to the object at ffff88810e853800
[ 611.082411] which belongs to the cache kmalloc-1k of size 1024
[ 611.082411] The buggy address is located 0 bytes to the right of
[ 611.082411] allocated 1024-byte region [ffff88810e853800, ffff88810e853c00)
[ 611.082411]
[ 611.082411] The buggy address belongs to the physical page:
[ 611.082411] page:00000000a08f2d1e refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10e850
[ 611.082411] head:00000000a08f2d1e order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[ 611.082411] flags: 0x200000000000840(slab|head|node=0|zone=2)
[ 611.082411] page_type: 0xffffffff()
[ 611.082411] raw: 0200000000000840 ffff888100041dc0 dead000000000122 0000000000000000
[ 611.082411] raw: 0000000000000000 0000000080100010 00000001ffffffff 0000000000000000
[ 611.082411] page dumped because: kasan: bad access detected
[ 611.082411]
[ 611.082411] Memory state around the buggy address:
[ 611.082411] ffff88810e853b00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[ 611.082411] ffff88810e853b80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[ 611.082411] >ffff88810e853c00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[ 611.082411] ^
[ 611.082411] ffff88810e853c80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[ 611.082411] ffff88810e853d00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[ 611.082411] ==================================================================
Thanks,
LL
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2024-08-20 10:54 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-01 15:17 [syzbot] [ntfs3?] KASAN: slab-out-of-bounds Read in mi_enum_attr syzbot
2024-02-02 3:33 ` [PATCH] fs/ntfs3: fix oob " Lizhi Xu
[not found] <CACT4Y+ZWjUE6-q1YF=ZaPjKgGZBw4JLD1v2DphSgCAVf1RzE8g@mail.gmail.com>
2024-07-05 13:52 ` [syzbot] [ntfs3?] KASAN: slab-out-of-bounds Read " Lizhi Xu
2024-07-08 6:54 ` Dmitry Vyukov
2024-07-11 8:27 ` Konstantin Komarov
2024-08-20 10:53 ` lei lu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).