lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <001a114c9224e34a49055c842032@google.com>
Date:   Fri, 27 Oct 2017 02:44:00 -0700
From:   syzbot 
        <bot+998c483ca801a50e3ce5b63a845216588ada5e2a@...kaller.appspotmail.com>
To:     linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
        syzkaller-bugs@...glegroups.com, viro@...iv.linux.org.uk
Subject: KASAN: use-after-free Read in handle_userfault

Hello,

syzkaller hit the following crash on  
a31cc455c512f3f1dd5f79cac8e29a7c8a617af8
git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/master
compiler: gcc (GCC) 7.1.1 20170620
.config is attached
Raw console output is attached.
C reproducer is attached
syzkaller reproducer is attached. See https://goo.gl/kgGztJ
for information about syzkaller reproducers


BUG: KASAN: use-after-free in handle_userfault+0x206f/0x2390  
fs/userfaultfd.c:371
Read of size 8 at addr ffff8801ce9cad88 by task syzkaller547101/2993

CPU: 0 PID: 2993 Comm: syzkaller547101 Not tainted 4.13.0-next-20170911+ #19
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS  
Google 01/01/2011
Call Trace:
  __dump_stack lib/dump_stack.c:16 [inline]
  dump_stack+0x194/0x257 lib/dump_stack.c:52
  print_address_description+0x73/0x250 mm/kasan/report.c:252
  kasan_report_error mm/kasan/report.c:351 [inline]
  kasan_report+0x24e/0x340 mm/kasan/report.c:409
  __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:430
  handle_userfault+0x206f/0x2390 fs/userfaultfd.c:371
  do_anonymous_page mm/memory.c:3095 [inline]
  handle_pte_fault mm/memory.c:3908 [inline]
  __handle_mm_fault+0x2d46/0x39c0 mm/memory.c:4034
  handle_mm_fault+0x334/0x8d0 mm/memory.c:4071
  __do_page_fault+0x4f6/0xb60 arch/x86/mm/fault.c:1445
  do_page_fault+0xee/0x720 arch/x86/mm/fault.c:1520
  page_fault+0x22/0x30 arch/x86/entry/entry_64.S:1066
RIP: 0033:0x445455
RSP: 002b:0000000020013000 EFLAGS: 00010217
RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000445449
RDX: 0000000020059ffc RSI: 0000000020013000 RDI: 0000000000000400
RBP: 0000000000000000 R08: 0000000020058ffd R09: 00007f14ef18c700
R10: 0000000020058ffc R11: 0000000000000202 R12: 0000000000000000
R13: 00007ffca43554df R14: 00007f14ef18c9c0 R15: 0000000000000000

Allocated by task 2991:
  save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59
  save_stack+0x43/0xd0 mm/kasan/kasan.c:447
  set_track mm/kasan/kasan.c:459 [inline]
  kasan_kmalloc+0xad/0xe0 mm/kasan/kasan.c:551
  kasan_slab_alloc+0x12/0x20 mm/kasan/kasan.c:489
  kmem_cache_alloc+0x12e/0x760 mm/slab.c:3561
  dup_userfaultfd+0x21c/0x890 fs/userfaultfd.c:653
  dup_mmap kernel/fork.c:658 [inline]
  dup_mm kernel/fork.c:1179 [inline]
  copy_mm+0xa38/0x1310 kernel/fork.c:1233
  copy_process.part.36+0x1eae/0x4af0 kernel/fork.c:1735
  copy_process kernel/fork.c:1548 [inline]
  _do_fork+0x1ef/0xfe0 kernel/fork.c:2027
  SYSC_clone kernel/fork.c:2137 [inline]
  SyS_clone+0x37/0x50 kernel/fork.c:2131
  do_syscall_64+0x26c/0x8c0 arch/x86/entry/common.c:287
  return_from_SYSCALL_64+0x0/0x7a

Freed by task 2991:
  save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59
  save_stack+0x43/0xd0 mm/kasan/kasan.c:447
  set_track mm/kasan/kasan.c:459 [inline]
  kasan_slab_free+0x71/0xc0 mm/kasan/kasan.c:524
  __cache_free mm/slab.c:3503 [inline]
  kmem_cache_free+0x77/0x280 mm/slab.c:3763
  userfaultfd_ctx_put+0x50c/0x740 fs/userfaultfd.c:165
  userfaultfd_event_wait_completion+0x754/0x910 fs/userfaultfd.c:599
  dup_fctx fs/userfaultfd.c:687 [inline]
  dup_userfaultfd_complete+0x2de/0x480 fs/userfaultfd.c:695
  dup_mmap kernel/fork.c:726 [inline]
  dup_mm kernel/fork.c:1179 [inline]
  copy_mm+0xe9b/0x1310 kernel/fork.c:1233
  copy_process.part.36+0x1eae/0x4af0 kernel/fork.c:1735
  copy_process kernel/fork.c:1548 [inline]
  _do_fork+0x1ef/0xfe0 kernel/fork.c:2027
  SYSC_clone kernel/fork.c:2137 [inline]
  SyS_clone+0x37/0x50 kernel/fork.c:2131
  do_syscall_64+0x26c/0x8c0 arch/x86/entry/common.c:287
  return_from_SYSCALL_64+0x0/0x7a

The buggy address belongs to the object at ffff8801ce9cac00
  which belongs to the cache userfaultfd_ctx_cache of size 400
The buggy address is located 392 bytes inside of
  400-byte region [ffff8801ce9cac00, ffff8801ce9cad90)
The buggy address belongs to the page:
page:ffffea00073a7280 count:1 mapcount:0 mapping:ffff8801ce9ca000  
index:0xffff8801cf2f5300
flags: 0x200000000000100(slab)
raw: 0200000000000100 ffff8801ce9ca000 ffff8801cf2f5300 0000000100000008
raw: ffff8801d56d6f50 ffff8801d56d6f50 ffff8801d56d2600 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
  ffff8801ce9cac80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
  ffff8801ce9cad00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
> ffff8801ce9cad80: fb fb fc fc fc fc fc fc fc fc fc fc fc fc fc fc
                       ^
  ffff8801ce9cae00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
  ffff8801ce9cae80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================


---
This bug is generated by a dumb bot. It may contain errors.
See https://goo.gl/tpsmEJ for details.
Direct all questions to syzkaller@...glegroups.com.

syzbot will keep track of this bug report.
Once a fix for this bug is committed, please reply to this email with:
#syz fix: exact-commit-title
To mark this as a duplicate of another syzbot report, please reply with:
#syz dup: exact-subject-of-another-report
If it's a one-off invalid bug report, please reply with:
#syz invalid
Note: if the crash happens again, it will cause creation of a new bug  
report.

View attachment "config.txt" of type "text/plain" (123749 bytes)

Download attachment "raw.log" of type "application/octet-stream" (10365 bytes)

View attachment "repro.txt" of type "text/plain" (605 bytes)

Download attachment "repro.c" of type "application/octet-stream" (1502 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ