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 for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 01 Feb 2018 16:58:00 -0800
From:   syzbot <syzbot+bacbe5d8791f30c9cee5@...kaller.appspotmail.com>
To:     akpm@...ux-foundation.org, aneesh.kumar@...ux.vnet.ibm.com,
        dan.j.williams@...el.com, james.morse@....com,
        kirill.shutemov@...ux.intel.com, linux-kernel@...r.kernel.org,
        linux-mm@...ck.org, mingo@...nel.org,
        syzkaller-bugs@...glegroups.com, viro@...iv.linux.org.uk
Subject: possible deadlock in get_user_pages_unlocked

Hello,

syzbot hit the following crash on upstream commit
7109a04eae81c41ed529da9f3c48c3655ccea741 (Thu Feb 1 17:37:30 2018 +0000)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/ide

So far this crash happened 2 times on upstream.
C reproducer is attached.
syzkaller reproducer is attached.
Raw console output is attached.
compiler: gcc (GCC) 7.1.1 20170620
.config is attached.

IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: syzbot+bacbe5d8791f30c9cee5@...kaller.appspotmail.com
It will help syzbot understand when the bug is fixed. See footer for  
details.
If you forward the report, please keep this part and the footer.


============================================
WARNING: possible recursive locking detected
4.15.0+ #291 Not tainted
--------------------------------------------
syzkaller746568/4446 is trying to acquire lock:
  (&mm->mmap_sem){++++}, at: [<000000006212449e>] __get_user_pages_locked  
mm/gup.c:909 [inline]
  (&mm->mmap_sem){++++}, at: [<000000006212449e>]  
get_user_pages_unlocked+0x218/0x4f0 mm/gup.c:990

but task is already holding lock:
  (&mm->mmap_sem){++++}, at: [<000000009bfdb3c4>]  
get_user_pages_unlocked+0xff/0x4f0 mm/gup.c:989

other info that might help us debug this:
  Possible unsafe locking scenario:

        CPU0
        ----
   lock(&mm->mmap_sem);
   lock(&mm->mmap_sem);

  *** DEADLOCK ***

  May be due to missing lock nesting notation

3 locks held by syzkaller746568/4446:
  #0:  (&vcpu->mutex){+.+.}, at: [<00000000d22fa6cb>] vcpu_load+0x1c/0x70  
arch/x86/kvm/../../../virt/kvm/kvm_main.c:158
  #1:  (&kvm->srcu){....}, at: [<000000007ac6ea14>] vcpu_enter_guest  
arch/x86/kvm/x86.c:7064 [inline]
  #1:  (&kvm->srcu){....}, at: [<000000007ac6ea14>] vcpu_run  
arch/x86/kvm/x86.c:7143 [inline]
  #1:  (&kvm->srcu){....}, at: [<000000007ac6ea14>]  
kvm_arch_vcpu_ioctl_run+0x1b11/0x5bf0 arch/x86/kvm/x86.c:7310
  #2:  (&mm->mmap_sem){++++}, at: [<000000009bfdb3c4>]  
get_user_pages_unlocked+0xff/0x4f0 mm/gup.c:989

stack backtrace:
CPU: 0 PID: 4446 Comm: syzkaller746568 Not tainted 4.15.0+ #291
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS  
Google 01/01/2011
Call Trace:
  __dump_stack lib/dump_stack.c:17 [inline]
  dump_stack+0x194/0x257 lib/dump_stack.c:53
  print_deadlock_bug kernel/locking/lockdep.c:1761 [inline]
  check_deadlock kernel/locking/lockdep.c:1805 [inline]
  validate_chain kernel/locking/lockdep.c:2401 [inline]
  __lock_acquire+0xe8f/0x3e00 kernel/locking/lockdep.c:3431
  lock_acquire+0x1d5/0x580 kernel/locking/lockdep.c:3920
  down_read+0x96/0x150 kernel/locking/rwsem.c:24
  __get_user_pages_locked mm/gup.c:909 [inline]
  get_user_pages_unlocked+0x218/0x4f0 mm/gup.c:990
  hva_to_pfn_slow arch/x86/kvm/../../../virt/kvm/kvm_main.c:1388 [inline]
  hva_to_pfn arch/x86/kvm/../../../virt/kvm/kvm_main.c:1493 [inline]
  __gfn_to_pfn_memslot+0x386/0xf80  
arch/x86/kvm/../../../virt/kvm/kvm_main.c:1549
  try_async_pf+0x13b/0xc40 arch/x86/kvm/mmu.c:3802
  tdp_page_fault+0x40a/0xa70 arch/x86/kvm/mmu.c:3898
  kvm_mmu_page_fault+0x10d/0x2f0 arch/x86/kvm/mmu.c:4928
  handle_ept_violation+0x198/0x550 arch/x86/kvm/vmx.c:6550
  vmx_handle_exit+0x25d/0x1ce0 arch/x86/kvm/vmx.c:8893
  vcpu_enter_guest arch/x86/kvm/x86.c:7081 [inline]
  vcpu_run arch/x86/kvm/x86.c:7143 [inline]
  kvm_arch_vcpu_ioctl_run+0x1c69/0x5bf0 arch/x86/kvm/x86.c:7310
  kvm_vcpu_ioctl+0x64c/0x1010 arch/x86/kvm/../../../virt/kvm/kvm_main.c:2564
  vfs_ioctl fs/ioctl.c:46 [inline]
  do_vfs_ioctl+0x1b1/0x1520 fs/ioctl.c:686
  SYSC_ioctl fs/ioctl.c:701 [inline]
  SyS_ioctl+0x8f/0xc0 fs/ioctl.c:692
  entry_SYSCALL_64_fastpath+0x29/0xa0
RIP: 0033:0x448fc9
RSP: 002b:00007ff4b260ada8 EFLAGS: 00000297 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007ff4b260b700 RCX: 0000000000448fc9
RDX: 0000000000000000 RSI: 000000000000ae80 RDI: 0000000000000008
RBP: 00007fffca7f9900 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000297 R12: 0000000000000000
R13: 00007fffca7f985f R14: 00007ff4b260b9c0 R15: 000000000000000d
WARNING: CPU: 0 PID: 4446 at mm/gup.c:498 faultin_page mm/gup.c:498 [inline]
WARNING: CPU: 0 PID: 4446 at mm/gup.c:498 __get_user_pages+0x10a7/0x15f0  
mm/gup.c:699


---
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.
If you forgot to add the Reported-by tag, once the fix for this bug is  
merged
into any tree, please reply to this email with:
#syz fix: exact-commit-title
If you want to test a patch for this bug, please reply with:
#syz test: git://repo/address.git branch
and provide the patch inline or as an attachment.
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.
Note: all commands must start from beginning of the line in the email body.

View attachment "raw.log.txt" of type "text/plain" (16534 bytes)

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

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

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ