linux-modules.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] libkmod: reset was_space on second pass
@ 2020-01-20 19:22 Lucas De Marchi
  2020-01-27 13:46 ` Lucas De Marchi
  0 siblings, 1 reply; 3+ messages in thread
From: Lucas De Marchi @ 2020-01-20 19:22 UTC (permalink / raw)
  To: linux-modules; +Cc: Jorge Lucangeli Obes, Lucas De Marchi

From: Lucas De Marchi <lucas.demarchi@intel.com>

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 <jorgelo@google.com>
Link: https://lore.kernel.org/linux-modules/CAKYuF5QhGCPCazHQjN-=kFc5kHs7Ok8WqmmGLo31CiOEN8TYdA@mail.gmail.com
---
 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;
 
-- 
2.24.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-01-28 15:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-20 19:22 [PATCH] libkmod: reset was_space on second pass Lucas De Marchi
2020-01-27 13:46 ` Lucas De Marchi
2020-01-28 15:03   ` Jorge Lucangeli Obes

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