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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,
I found the following issue using syzkaller on:
HEAD commit : e60276b8c11ab4a8be23807bc67b04
8cfb937dfa (v6.0.8)
git tree: stable

C Reproducer : https://gist.github.com/oswalpalash/af178d2eb8f1ecb3edc400803c80e411
Kernel .config :
https://gist.github.com/oswalpalash/0962c70d774e5ec736a047bba917cecb

Console log :
==================================================================
BUG: KASAN: slab-out-of-bounds in hdr_find_e.isra.0+0x527/0x590
Read of size 2 at addr ffff888039fdb820 by task syz-executor.3/9218

CPU: 0 PID: 9218 Comm: syz-executor.3 Not tainted 6.0.8-pasta #2
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
1.13.0-1ubuntu1.1 04/01/2014
Call Trace:
 <TASK>
 dump_stack_lvl+0xcd/0x134
 print_report.cold+0xe5/0x63a
 kasan_report+0x8a/0x1b0
 hdr_find_e.isra.0+0x527/0x590
 indx_find+0x4f4/0x970
 dir_search_u+0x232/0x3f0
 ntfs_lookup+0x174/0x1e0
 lookup_open+0xa95/0x1640
 path_openat+0xa42/0x2840
 do_filp_open+0x1ca/0x2a0
 do_sys_openat2+0x61b/0x990
 do_sys_open+0xc3/0x140
 do_syscall_64+0x35/0xb0
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f564fa8eacd
Code: 02 b8 ff ff ff ff c3 66 0f 1f 44 00 00 f3 0f 1e fa 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:00007f5650853bf8 EFLAGS: 00000246 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 00007f564fbbbf80 RCX: 00007f564fa8eacd
RDX: 000000000000275a RSI: 00000000200001c0 RDI: ffffffffffffff9c
RBP: 00007f564fafcb05 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ffcd2c9779f R14: 00007ffcd2c97940 R15: 00007f5650853d80
 </TASK>

Allocated by task 9097:
 kasan_save_stack+0x1e/0x40
 __kasan_slab_alloc+0x85/0xb0
 kmem_cache_alloc+0x204/0xcc0
 getname_flags+0xd2/0x5b0
 vfs_fstatat+0x73/0xb0
 __do_sys_newlstat+0x8b/0x110
 do_syscall_64+0x35/0xb0
 entry_SYSCALL_64_after_hwframe+0x63/0xcd

Freed by task 9097:
 kasan_save_stack+0x1e/0x40
 kasan_set_track+0x21/0x30
 kasan_set_free_info+0x20/0x30
 __kasan_slab_free+0xf5/0x180
 kmem_cache_free.part.0+0xfc/0x4a0
 putname+0xfe/0x140
 vfs_fstatat+0x97/0xb0
 __do_sys_newlstat+0x8b/0x110
 do_syscall_64+0x35/0xb0
 entry_SYSCALL_64_after_hwframe+0x63/0xcd

The buggy address belongs to the object at ffff888039fda800
 which belongs to the cache names_cache of size 4096
The buggy address is located 32 bytes to the right of
 4096-byte region [ffff888039fda800, ffff888039fdb800)

The buggy address belongs to the physical page:
page:ffffea0000e7f680 refcount:1 mapcount:0 mapping:0000000000000000
index:0x0 pfn:0x39fda
head:ffffea0000e7f680 order:1 compound_mapcount:0 compound_pincount:0
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 ffffea0000ea8c08 ffffea0000704a08 ffff888012391500
raw: 0000000000000000 ffff888039fda800 0000000100000001 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 1, migratetype Unmovable, gfp_mask
0x2420c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_COMP|__GFP_THISNODE),
pid 9097, tgid 9097 (systemd-udevd), ts 83117357051, free_ts
82883501668
 prep_new_page+0x2c6/0x350
 get_page_from_freelist+0xae9/0x3a80
 __alloc_pages+0x321/0x710
 cache_grow_begin+0x75/0x360
 kmem_cache_alloc+0xb69/0xcc0
 getname_flags+0xd2/0x5b0
 vfs_fstatat+0x73/0xb0
 __do_sys_newlstat+0x8b/0x110
 do_syscall_64+0x35/0xb0
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
page last free stack trace:
 free_pcp_prepare+0x5ab/0xd00
 free_unref_page+0x19/0x410
 slab_destroy+0x14/0x50
 slabs_destroy+0x6a/0x90
 ___cache_free+0x1e3/0x3b0
 qlist_free_all+0x51/0x1c0
 kasan_quarantine_reduce+0x13d/0x180
 __kasan_slab_alloc+0x97/0xb0
 kmem_cache_alloc+0x204/0xcc0
 getname_flags+0xd2/0x5b0
 do_sys_openat2+0x448/0x990
 do_sys_open+0xc3/0x140
 do_syscall_64+0x35/0xb0
 entry_SYSCALL_64_after_hwframe+0x63/0xcd

Memory state around the buggy address:
 ffff888039fdb700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff888039fdb780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff888039fdb800: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
                               ^
 ffff888039fdb880: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff888039fdb900: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux