archive mirror
 help / color / mirror / Atom feed
From: Lucas De Marchi <>
Cc: Jorge Lucangeli Obes <>,
	Lucas De Marchi <>
Subject: [PATCH] libkmod: reset was_space on second pass
Date: Mon, 20 Jan 2020 16:22:10 -0300	[thread overview]
Message-ID: <> (raw)

From: Lucas De Marchi <>

The softdep config parser uses a 2-pass approach to use a single
allocation for all the softdep struct. However "was_space" variable
isn't reset between them. This can lead to a buffer overflow.

Reported-by: Jorge Lucangeli Obes <>
 libkmod/libkmod-config.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libkmod/libkmod-config.c b/libkmod/libkmod-config.c
index aaac0a1..7b62367 100644
--- a/libkmod/libkmod-config.c
+++ b/libkmod/libkmod-config.c
@@ -335,6 +335,7 @@ static int kmod_config_add_softdep(struct kmod_config *config,
 	n_pre = 0;
 	n_post = 0;
 	mode = S_NONE;
+	was_space = false;
 	for (p = s = line; ; s++) {
 		size_t plen;

             reply	other threads:[~2020-01-20 19:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-20 19:22 Lucas De Marchi [this message]
2020-01-27 13:46 ` [PATCH] libkmod: reset was_space on second pass Lucas De Marchi
2020-01-28 15:03   ` Jorge Lucangeli Obes

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \

* 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).