linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Liam R. Howlett" <Liam.Howlett@oracle.com>
To: syzbot <syzbot+c0f0941337ade4c26ed1@syzkaller.appspotmail.com>
Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org, lorenzo.stoakes@oracle.com,
	syzkaller-bugs@googlegroups.com, vbabka@suse.cz,
	peili.dev@gmail.com
Subject: Re: [syzbot] [mm?] possible deadlock in mmap_read_lock
Date: Fri, 19 Jul 2024 21:39:55 -0400	[thread overview]
Message-ID: <v6jvhxxb2t7dh5ox6feqvc3xnlkgjwrdofkxodmg3t4rrtew2u@hxghrcqhk2n4> (raw)
In-Reply-To: <000000000000d8474e061d9f28be@google.com>

* syzbot <syzbot+c0f0941337ade4c26ed1@syzkaller.appspotmail.com> [240719 16:01]:
> Hello,
> 
> syzbot found the following issue on:

This bug doesn't exist anymore.

> 
> HEAD commit:    3fe121b62282 Add linux-next specific files for 20240712
> git tree:       linux-next
> console output: https://syzkaller.appspot.com/x/log.txt?x=1769e695980000
> kernel config:  https://syzkaller.appspot.com/x/.config?x=98dd8c4bab5cdce
> dashboard link: https://syzkaller.appspot.com/bug?extid=c0f0941337ade4c26ed1
> compiler:       Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
> 
> Unfortunately, I don't have any reproducer for this issue yet.
> 
> Downloadable assets:
> disk image: https://storage.googleapis.com/syzbot-assets/8c6fbf69718d/disk-3fe121b6.raw.xz
> vmlinux: https://storage.googleapis.com/syzbot-assets/39fc7e43dfc1/vmlinux-3fe121b6.xz
> kernel image: https://storage.googleapis.com/syzbot-assets/0a78e70e4b4e/bzImage-3fe121b6.xz
> 
> IMPORTANT: if you fix the issue, please add the following tag to the commit:
> Reported-by: syzbot+c0f0941337ade4c26ed1@syzkaller.appspotmail.com
> 
> 
> ============================================
> WARNING: possible recursive locking detected
> 6.10.0-rc7-next-20240712-syzkaller #0 Not tainted
> --------------------------------------------
> mount/4518 is trying to acquire lock:
> ffff88801d2b1498 (&mm->mmap_lock){++++}-{3:3}, at: mmap_read_lock+0x1c/0x60 include/linux/mmap_lock.h:144
> 
> but task is already holding lock:
> ffff88801d2b1498 (&mm->mmap_lock){++++}-{3:3}, at: mmap_read_lock include/linux/mmap_lock.h:144 [inline]
> ffff88801d2b1498 (&mm->mmap_lock){++++}-{3:3}, at: exit_mmap+0x159/0xc80 mm/mmap.c:3396
> 
> other info that might help us debug this:
>  Possible unsafe locking scenario:
> 
>        CPU0
>        ----
>   lock(&mm->mmap_lock);
>   lock(&mm->mmap_lock);
> 
>  *** DEADLOCK ***
> 
>  May be due to missing lock nesting notation
> 
> 1 lock held by mount/4518:
>  #0: ffff88801d2b1498 (&mm->mmap_lock){++++}-{3:3}, at: mmap_read_lock include/linux/mmap_lock.h:144 [inline]
>  #0: ffff88801d2b1498 (&mm->mmap_lock){++++}-{3:3}, at: exit_mmap+0x159/0xc80 mm/mmap.c:3396
> 
> stack backtrace:
> CPU: 1 UID: 0 PID: 4518 Comm: mount Not tainted 6.10.0-rc7-next-20240712-syzkaller #0
> Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024
> Call Trace:
>  <TASK>
>  __dump_stack lib/dump_stack.c:94 [inline]
>  dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120
>  print_deadlock_bug+0x483/0x620 kernel/locking/lockdep.c:3034
>  check_deadlock kernel/locking/lockdep.c:3086 [inline]
>  validate_chain+0x15e2/0x5920 kernel/locking/lockdep.c:3888
>  __lock_acquire+0x1384/0x2050 kernel/locking/lockdep.c:5199
>  lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5822
>  down_read+0xb1/0xa40 kernel/locking/rwsem.c:1526
>  mmap_read_lock+0x1c/0x60 include/linux/mmap_lock.h:144
>  unmap_single_vma+0x2a0/0x330 mm/memory.c:1832
>  unmap_vmas+0x3cc/0x5f0 mm/memory.c:1904
>  exit_mmap+0x264/0xc80 mm/mmap.c:3412
>  __mmput+0x115/0x390 kernel/fork.c:1347
>  exit_mm+0x220/0x310 kernel/exit.c:571

This is discussed here [1].  There is some case where unmap_single_vma()
was reached without the lock held in write mode and the flag seems to
have been misunderstood.


[1.] https://lore.kernel.org/all/20240710-bug12-v1-1-0e5440f9b8d3@gmail.com/


Thanks,
Liam


      reply	other threads:[~2024-07-20  1:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-19 20:01 syzbot
2024-07-20  1:39 ` Liam R. Howlett [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=v6jvhxxb2t7dh5ox6feqvc3xnlkgjwrdofkxodmg3t4rrtew2u@hxghrcqhk2n4 \
    --to=liam.howlett@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lorenzo.stoakes@oracle.com \
    --cc=peili.dev@gmail.com \
    --cc=syzbot+c0f0941337ade4c26ed1@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    --cc=vbabka@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox