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>] [day] [month] [year] [list]
Message-ID: <001a114aa3789a2334055f771209@google.com>
Date:   Sun, 03 Dec 2017 14:25:01 -0800
From:   syzbot 
        <bot+86a008206e8012f85c5feebf2873716e50f33fc4@...kaller.appspotmail.com>
To:     adobriyan@...il.com, akinobu.mita@...il.com,
        akpm@...ux-foundation.org, dvyukov@...gle.com,
        ebiederm@...ssion.com, jani.nikula@...el.com,
        linux-kernel@...r.kernel.org, mingo@...nel.org,
        sfr@...b.auug.org.au, syzkaller-bugs@...glegroups.com,
        vegard.nossum@...cle.com
Subject: possible deadlock in lock_trace

syzkaller has found reproducer for the following crash on  
fb20eb9d798d2f4c1a75b7fe981d72dfa8d7270d
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



======================================================
WARNING: possible circular locking dependency detected
4.15.0-rc1-next-20171201+ #57 Not tainted
------------------------------------------------------
syzkaller485018/3189 is trying to acquire lock:
  (&sig->cred_guard_mutex){+.+.}, at: [<000000004ce5f5c7>]  
lock_trace+0x44/0xc0 fs/proc/base.c:407

but task is already holding lock:
  (&p->lock){+.+.}, at: [<00000000d9677bbd>] seq_read+0xd5/0x13d0  
fs/seq_file.c:165

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #2 (&p->lock){+.+.}:
        lock_acquire+0x1d5/0x580 kernel/locking/lockdep.c:4004
        __mutex_lock_common kernel/locking/mutex.c:756 [inline]
        __mutex_lock+0x16f/0x1a80 kernel/locking/mutex.c:893
        mutex_lock_nested+0x16/0x20 kernel/locking/mutex.c:908
        seq_read+0xd5/0x13d0 fs/seq_file.c:165
        do_loop_readv_writev fs/read_write.c:673 [inline]
        do_iter_read+0x3db/0x5b0 fs/read_write.c:897
        vfs_readv+0x121/0x1c0 fs/read_write.c:959
        kernel_readv fs/splice.c:361 [inline]
        default_file_splice_read+0x508/0xae0 fs/splice.c:416
        do_splice_to+0x110/0x170 fs/splice.c:880
        do_splice fs/splice.c:1173 [inline]
        SYSC_splice fs/splice.c:1402 [inline]
        SyS_splice+0x11a8/0x1630 fs/splice.c:1382
        entry_SYSCALL_64_fastpath+0x1f/0x96

-> #1 (&pipe->mutex/1){+.+.}:
        lock_acquire+0x1d5/0x580 kernel/locking/lockdep.c:4004
        __mutex_lock_common kernel/locking/mutex.c:756 [inline]
        __mutex_lock+0x16f/0x1a80 kernel/locking/mutex.c:893
        mutex_lock_nested+0x16/0x20 kernel/locking/mutex.c:908
        __pipe_lock fs/pipe.c:88 [inline]
        fifo_open+0x15c/0xa40 fs/pipe.c:916
        do_dentry_open+0x682/0xd70 fs/open.c:752
        vfs_open+0x107/0x230 fs/open.c:866
        do_last fs/namei.c:3376 [inline]
        path_openat+0x1157/0x3530 fs/namei.c:3516
        do_filp_open+0x25b/0x3b0 fs/namei.c:3551
        do_open_execat+0x1b9/0x5c0 fs/exec.c:849
        do_execveat_common.isra.30+0x90c/0x22a0 fs/exec.c:1742
        do_execve fs/exec.c:1849 [inline]
        SYSC_execve fs/exec.c:1930 [inline]
        SyS_execve+0x39/0x50 fs/exec.c:1925
        do_syscall_64+0x26c/0x920 arch/x86/entry/common.c:285
        return_from_SYSCALL_64+0x0/0x75

-> #0 (&sig->cred_guard_mutex){+.+.}:
        check_prevs_add kernel/locking/lockdep.c:2031 [inline]
        validate_chain kernel/locking/lockdep.c:2473 [inline]
        __lock_acquire+0x3498/0x47f0 kernel/locking/lockdep.c:3500
        lock_acquire+0x1d5/0x580 kernel/locking/lockdep.c:4004
        __mutex_lock_common kernel/locking/mutex.c:756 [inline]
        __mutex_lock+0x16f/0x1a80 kernel/locking/mutex.c:893
        mutex_lock_killable_nested+0x16/0x20 kernel/locking/mutex.c:923
        lock_trace+0x44/0xc0 fs/proc/base.c:407
        proc_pid_syscall+0xa3/0x550 fs/proc/base.c:624
        proc_single_show+0xf8/0x170 fs/proc/base.c:746
        seq_read+0x385/0x13d0 fs/seq_file.c:234
        do_loop_readv_writev fs/read_write.c:673 [inline]
        do_iter_read+0x3db/0x5b0 fs/read_write.c:897
        vfs_readv+0x121/0x1c0 fs/read_write.c:959
        kernel_readv fs/splice.c:361 [inline]
        default_file_splice_read+0x508/0xae0 fs/splice.c:416
        do_splice_to+0x110/0x170 fs/splice.c:880
        do_splice fs/splice.c:1173 [inline]
        SYSC_splice fs/splice.c:1402 [inline]
        SyS_splice+0x11a8/0x1630 fs/splice.c:1382
        entry_SYSCALL_64_fastpath+0x1f/0x96

other info that might help us debug this:

Chain exists of:
   &sig->cred_guard_mutex --> &pipe->mutex/1 --> &p->lock

  Possible unsafe locking scenario:

        CPU0                    CPU1
        ----                    ----
   lock(&p->lock);
                                lock(&pipe->mutex/1);
                                lock(&p->lock);
   lock(&sig->cred_guard_mutex);

  *** DEADLOCK ***

2 locks held by syzkaller485018/3189:
  #0:  (&pipe->mutex/1){+.+.}, at: [<000000002b08f5a4>] pipe_lock_nested  
fs/pipe.c:67 [inline]
  #0:  (&pipe->mutex/1){+.+.}, at: [<000000002b08f5a4>] pipe_lock+0x56/0x70  
fs/pipe.c:75
  #1:  (&p->lock){+.+.}, at: [<00000000d9677bbd>] seq_read+0xd5/0x13d0  
fs/seq_file.c:165

stack backtrace:
CPU: 1 PID: 3189 Comm: syzkaller485018 Not tainted  
4.15.0-rc1-next-20171201+ #57
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_circular_bug+0x42d/0x610 kernel/locking/lockdep.c:1271
  check_prev_add+0x666/0x15f0 kernel/locking/lockdep.c:1914
  check_prevs_add kernel/locking/lockdep.c:2031 [inline]
  validate_chain kernel/locking/lockdep.c:2473 [inline]
  __lock_acquire+0x3498/0x47f0 kernel/locking/lockdep.c:3500
  lock_acquire+0x1d5/0x580 kernel/locking/lockdep.c:4004
  __mutex_lock_common kernel/locking/mutex.c:756 [inline]
  __mutex_lock+0x16f/0x1a80 kernel/locking/mutex.c:893
  mutex_lock_killable_nested+0x16/0x20 kernel/locking/mutex.c:923
  lock_trace+0x44/0xc0 fs/proc/base.c:407
  proc_pid_syscall+0xa3/0x550 fs/proc/base.c:624
  proc_single_show+0xf8/0x170 fs/proc/base.c:746
  seq_read+0x385/0x13d0 fs/seq_file.c:234
  do_loop_readv_writev fs/read_write.c:673 [inline]
  do_iter_read+0x3db/0x5b0 fs/read_write.c:897
  vfs_readv+0x121/0x1c0 fs/read_write.c:959
  kernel_readv fs/splice.c:361 [inline]
  default_file_splice_read+0x508/0xae0 fs/splice.c:416
  do_splice_to+0x110/0x170 fs/splice.c:880
  do_splice fs/splice.c:1173 [inline]
  SYSC_splice fs/splice.c:1402 [inline]
  SyS_splice+0x11a8/0x1630 fs/splice.c:1382
  entry_SYSCALL_64_fastpath+0x1f/0x96
RIP: 0033:0x446bb9
RSP: 002b:00007f3977fa9cf8 EFLAGS: 00000212 ORIG_RAX: 0000000000000113
RAX: ffffffffffffffda RBX: 00007f3977faa700 RCX: 0000000000446bb9
RDX: 0000000000000005 RSI: 0000000000000000 RDI: 0000000000000006
RBP: 00007ffe29b9f8c0 R08: 000000000000a3ea R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000212 R12: 0000000000000000
R13: 00007ffe29b9f8bf R14: 00007f3977faa9c0 R15: 0000000000000000


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

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

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

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ