All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Kirill A. Shutemov" <kirill@shutemov.name>
To: Michal Hocko <mhocko@suse.cz>
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Dmitry Vyukov <dvyukov@google.com>,
	linux-mm@kvack.org, Peter Zijlstra <peterz@infradead.org>,
	Andrea Arcangeli <aarcange@redhat.com>
Subject: Re: [PATCH] mm: fix locking order in mm_take_all_locks()
Date: Tue, 12 Jan 2016 16:52:19 +0200	[thread overview]
Message-ID: <20160112145219.GA11419@node.shutemov.name> (raw)
In-Reply-To: <20160112144521.GL25337@dhcp22.suse.cz>

On Tue, Jan 12, 2016 at 03:45:21PM +0100, Michal Hocko wrote:
> On Mon 11-01-16 14:05:28, Kirill A. Shutemov wrote:
> > Dmitry Vyukov has reported[1] possible deadlock (triggered by his syzkaller
> > fuzzer):
> > 
> >  Possible unsafe locking scenario:
> > 
> >        CPU0                    CPU1
> >        ----                    ----
> >   lock(&hugetlbfs_i_mmap_rwsem_key);
> >                                lock(&mapping->i_mmap_rwsem);
> >                                lock(&hugetlbfs_i_mmap_rwsem_key);
> >   lock(&mapping->i_mmap_rwsem);
> > 
> > Both traces points to mm_take_all_locks() as a source of the problem.
> > It doesn't take care about ordering or hugetlbfs_i_mmap_rwsem_key (aka
> > mapping->i_mmap_rwsem for hugetlb mapping) vs. i_mmap_rwsem.
> 
> Hmm, but huge_pmd_share is called with mmap_sem held no?

Why does it matter?

Both mappings can be mapped to different processes, so mmap_sem is no good
here.

-- 
 Kirill A. Shutemov

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2016-01-12 14:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-11 11:05 [PATCH] mm: fix locking order in mm_take_all_locks() Kirill A. Shutemov
2016-01-12 14:45 ` Michal Hocko
2016-01-12 14:52   ` Kirill A. Shutemov [this message]
2016-01-12 15:20     ` Michal Hocko

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=20160112145219.GA11419@node.shutemov.name \
    --to=kirill@shutemov.name \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=dvyukov@google.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.cz \
    --cc=peterz@infradead.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.