Util-Linux package development
 help / color / mirror / Atom feed
From: Stanislav Brabec <sbrabec@suse.cz>
To: Karel Zak <kzak@redhat.com>
Cc: util-linux@vger.kernel.org
Subject: Re: [PATCH] Fix possible NULL dereference in get_btrfs_fs_root()
Date: Fri, 1 Apr 2016 15:59:41 +0200	[thread overview]
Message-ID: <56FE7ECD.2040804@suse.cz> (raw)
In-Reply-To: <20160331095433.kt6skftq5agqrxje@ws.net.home>

On Mar 31, 2016 at 11:54 Karel Zak wrote:
> On Wed, Mar 30, 2016 at 10:49:43PM +0200, Stanislav Brabec wrote:
>> set_fs_root() got it as upd->mountinfo being NULL from utab_new_entry(). That
>> got it from mnt_update_set_fs(), that from mnt_context_prepare_update() (where
>> it is cxt->update->mountinfo).
>>
>> At least the constructor mnt_new_update() can create context with cxt->update
>> being not NULL and cxt->update->mountinfo being NULL.
>>
>> It is also possible to pass to mnt_context_prepare_update() with cxt->update not
>> being NULL but cxt->update->mountinfo being NULL created by mnt_new_context(),
>> e. g. from mnt_context_mount().
>
> It's seems better to read mountinfo when really necessary than always.
> I have applied something else:
>
> https://github.com/karelzak/util-linux/commit/e9cd2e2bd9ec91a0b1050c4aa79555d142985924

I just got a positive feedback. My original patch as well as your patch
fix the crash.

Thanks.

-- 
Best Regards / S pozdravem,

Stanislav Brabec
software developer
---------------------------------------------------------------------
SUSE LINUX, s. r. o.                         e-mail: sbrabec@suse.com
Lihovarská 1060/12                            tel: +49 911 7405384547
190 00 Praha 9                                 fax:  +420 284 084 001
Czech Republic                                    http://www.suse.cz/
PGP: 830B 40D5 9E05 35D8 5E27 6FA3 717C 209F A04F CD76

      reply	other threads:[~2016-04-01 13:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-30 20:49 [PATCH] Fix possible NULL dereference in get_btrfs_fs_root() Stanislav Brabec
2016-03-31  9:54 ` Karel Zak
2016-04-01 13:59   ` Stanislav Brabec [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=56FE7ECD.2040804@suse.cz \
    --to=sbrabec@suse.cz \
    --cc=kzak@redhat.com \
    --cc=util-linux@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox