linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* KASAN: stack-out-of-bounds Write in read_extent_buffer
@ 2020-09-21 14:32 syzbot
  2020-09-21 14:45 ` Johannes Thumshirn
  0 siblings, 1 reply; 3+ messages in thread
From: syzbot @ 2020-09-21 14:32 UTC (permalink / raw)
  To: clm, dsterba, josef, linux-btrfs, linux-kernel, syzkaller-bugs

Hello,

syzbot found the following issue on:

HEAD commit:    860461e4 Add linux-next specific files for 20200917
git tree:       linux-next
console output: https://syzkaller.appspot.com/x/log.txt?x=141fc5d9900000
kernel config:  https://syzkaller.appspot.com/x/.config?x=f2392812d6c63d5c
dashboard link: https://syzkaller.appspot.com/bug?extid=1d393803acac53c985a0
compiler:       gcc (GCC) 10.1.0-syz 20200507
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=16778b07900000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=1216f8ad900000

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

==================================================================
BUG: KASAN: stack-out-of-bounds in memcpy include/linux/string.h:399 [inline]
BUG: KASAN: stack-out-of-bounds in read_extent_buffer+0x114/0x150 fs/btrfs/extent_io.c:5674
Write of size 8 at addr ffffc90000dd79f0 by task kworker/u4:1/21

CPU: 1 PID: 21 Comm: kworker/u4:1 Not tainted 5.9.0-rc5-next-20200917-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Workqueue: btrfs-endio-meta btrfs_work_helper
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x198/0x1fb lib/dump_stack.c:118
 print_address_description.constprop.0.cold+0x5/0x497 mm/kasan/report.c:385
 __kasan_report mm/kasan/report.c:545 [inline]
 kasan_report.cold+0x1f/0x37 mm/kasan/report.c:562
 check_memory_region_inline mm/kasan/generic.c:186 [inline]
 check_memory_region+0x13d/0x180 mm/kasan/generic.c:192
 memcpy+0x39/0x60 mm/kasan/common.c:106
 memcpy include/linux/string.h:399 [inline]
 read_extent_buffer+0x114/0x150 fs/btrfs/extent_io.c:5674
 btree_readpage_end_io_hook+0x7de/0x950 fs/btrfs/disk-io.c:641
 end_bio_extent_readpage+0x4de/0x10c0 fs/btrfs/extent_io.c:2854
 bio_endio+0x3d3/0x7a0 block/bio.c:1449
 end_workqueue_fn+0x114/0x170 fs/btrfs/disk-io.c:1696
 btrfs_work_helper+0x20a/0xd20 fs/btrfs/async-thread.c:318
 process_one_work+0x933/0x15a0 kernel/workqueue.c:2269
 worker_thread+0x64c/0x1120 kernel/workqueue.c:2415
 kthread+0x3af/0x4a0 kernel/kthread.c:292
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:296


addr ffffc90000dd79f0 is located in stack of task kworker/u4:1/21 at offset 48 in frame:
 btree_readpage_end_io_hook+0x0/0x950 fs/btrfs/disk-io.c:201

this frame has 4 objects:
 [48, 52) 'val'
 [64, 80) 'fsid'
 [96, 128) 'result'
 [160, 192) 'found'

Memory state around the buggy address:
 ffffc90000dd7880: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffffc90000dd7900: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffffc90000dd7980: 00 00 00 00 00 00 00 00 f1 f1 f1 f1 f1 f1 04 f2
                                                             ^
 ffffc90000dd7a00: 00 00 f2 f2 00 00 00 00 f2 f2 f2 f2 00 00 00 00
 ffffc90000dd7a80: f3 f3 f3 f3 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================


---
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.
syzbot can test patches for this issue, for details see:
https://goo.gl/tpsmEJ#testing-patches

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: KASAN: stack-out-of-bounds Write in read_extent_buffer
  2020-09-21 14:32 KASAN: stack-out-of-bounds Write in read_extent_buffer syzbot
@ 2020-09-21 14:45 ` Johannes Thumshirn
  2020-09-21 20:33   ` syzbot
  0 siblings, 1 reply; 3+ messages in thread
From: Johannes Thumshirn @ 2020-09-21 14:45 UTC (permalink / raw)
  To: syzbot, clm, dsterba, josef, linux-btrfs, linux-kernel, syzkaller-bugs

On 21/09/2020 16:32, syzbot wrote:
> Hello,
> 
> syzbot found the following issue on:
> 
> HEAD commit:    860461e4 Add linux-next specific files for 20200917
> git tree:       linux-next
> console output: https://syzkaller.appspot.com/x/log.txt?x=141fc5d9900000
> kernel config:  https://syzkaller.appspot.com/x/.config?x=f2392812d6c63d5c
> dashboard link: https://syzkaller.appspot.com/bug?extid=1d393803acac53c985a0
> compiler:       gcc (GCC) 10.1.0-syz 20200507
> syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=16778b07900000
> C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=1216f8ad900000
> 
> IMPORTANT: if you fix the issue, please add the following tag to the commit:
> Reported-by: syzbot+1d393803acac53c985a0@syzkaller.appspotmail.com
> 
> ==================================================================
> BUG: KASAN: stack-out-of-bounds in memcpy include/linux/string.h:399 [inline]
> BUG: KASAN: stack-out-of-bounds in read_extent_buffer+0x114/0x150 fs/btrfs/extent_io.c:5674
> Write of size 8 at addr ffffc90000dd79f0 by task kworker/u4:1/21
> 
> CPU: 1 PID: 21 Comm: kworker/u4:1 Not tainted 5.9.0-rc5-next-20200917-syzkaller #0
> Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
> Workqueue: btrfs-endio-meta btrfs_work_helper
> Call Trace:
>  __dump_stack lib/dump_stack.c:77 [inline]
>  dump_stack+0x198/0x1fb lib/dump_stack.c:118
>  print_address_description.constprop.0.cold+0x5/0x497 mm/kasan/report.c:385
>  __kasan_report mm/kasan/report.c:545 [inline]
>  kasan_report.cold+0x1f/0x37 mm/kasan/report.c:562
>  check_memory_region_inline mm/kasan/generic.c:186 [inline]
>  check_memory_region+0x13d/0x180 mm/kasan/generic.c:192
>  memcpy+0x39/0x60 mm/kasan/common.c:106
>  memcpy include/linux/string.h:399 [inline]
>  read_extent_buffer+0x114/0x150 fs/btrfs/extent_io.c:5674
>  btree_readpage_end_io_hook+0x7de/0x950 fs/btrfs/disk-io.c:641
>  end_bio_extent_readpage+0x4de/0x10c0 fs/btrfs/extent_io.c:2854
>  bio_endio+0x3d3/0x7a0 block/bio.c:1449
>  end_workqueue_fn+0x114/0x170 fs/btrfs/disk-io.c:1696
>  btrfs_work_helper+0x20a/0xd20 fs/btrfs/async-thread.c:318
>  process_one_work+0x933/0x15a0 kernel/workqueue.c:2269
>  worker_thread+0x64c/0x1120 kernel/workqueue.c:2415
>  kthread+0x3af/0x4a0 kernel/kthread.c:292
>  ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:296
> 
> 
> addr ffffc90000dd79f0 is located in stack of task kworker/u4:1/21 at offset 48 in frame:
>  btree_readpage_end_io_hook+0x0/0x950 fs/btrfs/disk-io.c:201
> 
> this frame has 4 objects:
>  [48, 52) 'val'
>  [64, 80) 'fsid'
>  [96, 128) 'result'
>  [160, 192) 'found'
> 
> Memory state around the buggy address:
>  ffffc90000dd7880: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>  ffffc90000dd7900: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>> ffffc90000dd7980: 00 00 00 00 00 00 00 00 f1 f1 f1 f1 f1 f1 04 f2
>                                                              ^
>  ffffc90000dd7a00: 00 00 f2 f2 00 00 00 00 f2 f2 f2 f2 00 00 00 00
>  ffffc90000dd7a80: f3 f3 f3 f3 00 00 00 00 00 00 00 00 00 00 00 00
> ==================================================================
> 
> 
> ---
> 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.
> syzbot can test patches for this issue, for details see:
> https://goo.gl/tpsmEJ#testing-patches
> 

#syz test: git://github.com/kdave/btrfs-devel.git misc-5.9

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: KASAN: stack-out-of-bounds Write in read_extent_buffer
  2020-09-21 14:45 ` Johannes Thumshirn
@ 2020-09-21 20:33   ` syzbot
  0 siblings, 0 replies; 3+ messages in thread
From: syzbot @ 2020-09-21 20:33 UTC (permalink / raw)
  To: Johannes.Thumshirn, clm, dsterba, josef, linux-btrfs,
	linux-kernel, syzkaller-bugs

Hello,

syzbot has tested the proposed patch and the reproducer did not trigger any issue:

Reported-and-tested-by: syzbot+1d393803acac53c985a0@syzkaller.appspotmail.com

Tested on:

commit:         d1db82c9 btrfs: move btrfs_rm_dev_replace_free_srcdev outs..
git tree:       git://github.com/kdave/btrfs-devel.git misc-5.9
kernel config:  https://syzkaller.appspot.com/x/.config?x=7885f44dc5918569
dashboard link: https://syzkaller.appspot.com/bug?extid=1d393803acac53c985a0
compiler:       gcc (GCC) 10.1.0-syz 20200507

Note: testing is done by a robot and is best-effort only.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-09-21 20:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-21 14:32 KASAN: stack-out-of-bounds Write in read_extent_buffer syzbot
2020-09-21 14:45 ` Johannes Thumshirn
2020-09-21 20:33   ` syzbot

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).