linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: "Dae R. Jeong" <threeearcat@gmail.com>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	byoungyoung@purdue.edu, kt0755@gmail.com, bammanag@purdue.edu
Subject: Re: KASAN: use-after-free Read in link_path_walk
Date: Mon, 6 Aug 2018 14:01:47 +0100	[thread overview]
Message-ID: <20180806130147.GL15082@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20180724051726.GH30522@ZenIV.linux.org.uk>

On Tue, Jul 24, 2018 at 06:17:26AM +0100, Al Viro wrote:

> Do we have LOOKUP_RCU in nd->flags at that point?  And how in hell
> did we get that dentry there?  In LOOKUP_RCU mode no freeing should
> be happening until after we call rcu_read_unlock(), unless the final
> dput() has happened before rcu_read_lock().  In which case we shouldn't
> have gotten to that dentry in the first place.

... except that we never set DCACHE_RCUACCESS for root dentry.  Which
invalidates the normal "if we run into dentry in lazy mode, its memory
won't be freed until we drop rcu_read_lock"...  d_make_root() definitely
needs to set DCACHE_RCUACCESS; whether it's all there is or you are
hitting something else is a separate question, of course...

>  And in non-LOOKUP_RCU
> mode we are bloody well holding references to everything (vfsmount
> and dentry alike), so that deactivate_super() shouldn't have been
> called as long as we are holding that reference.
> 
> Details, please.  Ideally - how to reproduce that.

Is there any way to tell KASAN that we want a crashdump triggered?
That would've been really useful for post-mortems...

  parent reply	other threads:[~2018-08-06 13:01 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-24  3:45 KASAN: use-after-free Read in link_path_walk Dae R. Jeong
2018-07-24  4:08 ` DaeRyong Jeong
2018-07-24  5:17 ` Al Viro
2018-07-24  5:29   ` Al Viro
2018-07-24  5:54     ` DaeRyong Jeong
2018-08-06 13:01   ` Al Viro [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-11-28 17:40 syzbot
2019-03-25  4:52 ` syzbot

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=20180806130147.GL15082@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=bammanag@purdue.edu \
    --cc=byoungyoung@purdue.edu \
    --cc=kt0755@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=threeearcat@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).