Util-Linux package development
 help / color / mirror / Atom feed
From: Stanislav Brabec <sbrabec@suse.cz>
To: util-linux@vger.kernel.org
Cc: Stefan Schubert <schubi@suse.de>
Subject: Re: [PATCH] libblkid: Fix crash while parsing config with libeconf
Date: Tue, 20 May 2025 16:24:07 +0200	[thread overview]
Message-ID: <da40323d-e642-4535-9a9a-ce9054de0241@suse.cz> (raw)
In-Reply-To: <20250516013111.1099053-1-sbrabec@suse.cz>

Stanislav Brabec wrote:
>As the whhole econf_file structure is freed by econf_free(file) at the end

> of blkid_read_config, econf_file structure cannot be defined as static and
> initialized only once. The econf_free() is not robust enough and keeps a
> pointer to the garbage after the first call. And if /etc/blkid.conf does
> not exist, it is called second time.

However the patch is correct and fixes the crash, there are still open questions:

- Why blkid_read_config() and econf_readConfig() are called twice with the same parameters? Is it intended behavior?

- If yes, why we don't recycle the configuration and call econf_free()?
- If not, why it happens?
- And finally, is a similar code in logindefs.c vulnerable to a similar type of crash?


-- 
Best Regards / S pozdravem,

Stanislav Brabec
software developer
---------------------------------------------------------------------
SUSE LINUX, s. r. o.                         e-mail: sbrabec@suse.com
Křižíkova 148/34 (Corso IIa)                    tel: +420 284 084 060
186 00 Praha 8-Karlín                          fax:  +420 284 084 001
Czech Republic                                    http://www.suse.cz/
PGP: 830B 40D5 9E05 35D8 5E27 6FA3 717C 209F A04F CD76


  parent reply	other threads:[~2025-05-20 14:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-16  1:31 [PATCH] libblkid: Fix crash while parsing config with libeconf Stanislav Brabec
2025-05-16  7:53 ` Stanislav Brabec
2025-05-20 14:24 ` Stanislav Brabec [this message]
2025-05-21  6:55   ` Karel Zak
2025-05-21  7:58     ` 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=da40323d-e642-4535-9a9a-ce9054de0241@suse.cz \
    --to=sbrabec@suse.cz \
    --cc=schubi@suse.de \
    --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