summaryrefslogtreecommitdiff
path: root/libkmod
diff options
context:
space:
mode:
authorLucas De Marchi <lucas.demarchi@intel.com>2020-01-20 16:15:38 -0300
committerLucas De Marchi <lucas.demarchi@intel.com>2020-01-20 16:15:38 -0300
commitf975f6bfcc88ce8cb653efa580ea73a8c22e17df (patch)
tree840680600fa632c736efee74e8d91e69bb928c2a /libkmod
parent81dbf2bee644ef035d054e2101fceea86c50e07d (diff)
downloadkmod-f975f6bfcc88ce8cb653efa580ea73a8c22e17df.tar.gz
kmod-f975f6bfcc88ce8cb653efa580ea73a8c22e17df.tar.bz2
kmod-f975f6bfcc88ce8cb653efa580ea73a8c22e17df.zip
libkmod: reset was_space on second pass
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
Diffstat (limited to 'libkmod')
-rw-r--r--libkmod/libkmod-config.c1
1 files changed, 1 insertions, 0 deletions
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;