libkmod: reset was_space on second pass
PATCH 1/1 libkmod: reset was_space on second pass
From: Lucas De Marchi <[email protected]>
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.
--- libkmod/libkmod-config.c | 1 + 1 file changed, 1 insertion(+)
libkmod/libkmod-config.c +1 -0
@@ -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;
Signature · 1 line
2.24.1
Lucas De Marchi
AppliedQuoted 10 lines · Lucas De Marchi
From: Lucas De Marchi <[email protected]>
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 <[email protected]>---
Applied,
Lucas De Marchi
Quoted 18 lines
libkmod/libkmod-config.c | 1 + 1 file changed, 1 insertion(+)libkmod/libkmod-config.c +1
-1@@ -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
Signature · 1 line
Lucas De Marchi
Thanks!
Quoted 40 lines · Lucas De Marchi
Quoted 10 lines · Lucas De Marchi
From: Lucas De Marchi <[email protected]>
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 <[email protected]>---
Applied,
Lucas De Marchi
Quoted 16 lines
libkmod/libkmod-config.c | 1 + 1 file changed, 1 insertion(+)libkmod/libkmod-config.c +1
-1@@ -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; --Quoted 2 lines
2.24.1
--
Lucas De Marchi