All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nikolay Borisov <kernel@kyup.com>
To: dsterba@suse.cz, clm@fb.com, linux-btrfs@vger.kernel.org
Subject: Re: [RESEND PATCH] btrfs: Handle uninitialised inode eviction
Date: Mon, 11 Jul 2016 13:57:10 +0300	[thread overview]
Message-ID: <57837B86.9070604@kyup.com> (raw)
In-Reply-To: <20160711084800.GR13336@twin.jikos.cz>



On 07/11/2016 11:48 AM, David Sterba wrote:
> On Mon, Jul 11, 2016 at 09:43:09AM +0300, Nikolay Borisov wrote:
>> The code flow in btrfs_new_inode allows for btrfs_evict_inode to be
>> called with not fully initialised inode (e.g. ->root member not
>> being set). This can happen when btrfs_set_inode_index in
>> btrfs_new_inode fails, which in turn would call iput for the newly
>> allocated inode. This in turn leads to vfs calling into btrfs_evict_inode.
>> This leads to null pointer dereference. To handle this situation check whether
>> the passed inode has root set and just free it in case it doesn't.
>>
>> Signed-off-by: Nikolay Borisov <kernel@kyup.com>
>> Reviewed-by: Josef Bacik <jbacik@fb.com>
>> ---
>>  fs/btrfs/inode.c | 9 ++++++++-
>>  1 file changed, 8 insertions(+), 1 deletion(-)
>>
>> Hello, 
>>
>> I belive this is fixes the issue reported in 
>> http://thread.gmane.org/gmane.comp.file-systems.btrfs/57809
> 
> There's some time left before 4.7 release, so I'll send another pull
> request, including this patch.

Now that I think about it, shouldn't this also be queued for stable as well?

  reply	other threads:[~2016-07-11 10:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-11  6:43 [RESEND PATCH] btrfs: Handle uninitialised inode eviction Nikolay Borisov
2016-07-11  8:48 ` David Sterba
2016-07-11 10:57   ` Nikolay Borisov [this message]
2016-07-11 11:20     ` David Sterba

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=57837B86.9070604@kyup.com \
    --to=kernel@kyup.com \
    --cc=clm@fb.com \
    --cc=dsterba@suse.cz \
    --cc=linux-btrfs@vger.kernel.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.