mirror of
https://github.com/AuxXxilium/kmod.git
synced 2024-11-23 23:10:53 +07:00
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
This commit is contained in:
parent
81dbf2bee6
commit
f975f6bfcc
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user