public inbox for util-linux@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Reisner <d@falconindy.com>
To: util-linux@vger.kernel.org
Subject: Re: [PATCH] fsck: don't free fstab table on parse failure
Date: Mon, 9 Apr 2012 10:12:26 -0400	[thread overview]
Message-ID: <20120409141226.GA843@rampage> (raw)
In-Reply-To: <1332852838-6188-1-git-send-email-dreisner@archlinux.org>

On Tue, Mar 27, 2012 at 08:53:58AM -0400, Dave Reisner wrote:
> Even if we fail parsing, fstab gets referenced later in the code (and
> will subsequently crash via heap corruption). Take the easy way out and
> simply avoid deallocating this table, as it will be freed for us on
> program exit regardless.
> 
> Signed-off-by: Dave Reisner <dreisner@archlinux.org>
> ---

Pinging this, as it doesn't seem it was merged...

d

> Crash reproducible with 'FSTAB_FILE=/dev/null fsck <any-blockdev>'
> 
>  disk-utils/fsck.c |    1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/disk-utils/fsck.c b/disk-utils/fsck.c
> index a019a69..44200d0 100644
> --- a/disk-utils/fsck.c
> +++ b/disk-utils/fsck.c
> @@ -430,7 +430,6 @@ static void load_fs_info(void)
>  	path = getenv("FSTAB_FILE");
>  
>  	if (mnt_table_parse_fstab(fstab, path)) {
> -		mnt_free_table(fstab);
>  		if (!path)
>  			path = mnt_get_fstab_path();
>  		if (errno)
> -- 
> 1.7.9.4
> 

  reply	other threads:[~2012-04-09 14:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-27 12:53 [PATCH] fsck: don't free fstab table on parse failure Dave Reisner
2012-04-09 14:12 ` Dave Reisner [this message]
2012-04-10  9:47   ` Karel Zak

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=20120409141226.GA843@rampage \
    --to=d@falconindy.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