[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200610154923.27510-4-mcgrof@kernel.org>
Date: Wed, 10 Jun 2020 15:49:21 +0000
From: "Luis R. Rodriguez" <mcgrof@...nel.org>
To: gregkh@...uxfoundation.org, viro@...iv.linux.org.uk,
philipp.reisner@...bit.com, lars.ellenberg@...bit.com,
axboe@...nel.dk, bfields@...ldses.org, chuck.lever@...cle.com,
roopa@...ulusnetworks.com, nikolay@...ulusnetworks.com,
davem@...emloft.net, kuba@...nel.org, dhowells@...hat.com,
jarkko.sakkinen@...ux.intel.com, jmorris@...ei.org,
serge@...lyn.com, christian.brauner@...ntu.com
Cc: slyfox@...too.org, ast@...nel.org, keescook@...omium.org,
josh@...htriplett.org, ravenexp@...il.com, chainsaw@...too.org,
linux-fsdevel@...r.kernel.org, linux-nfs@...r.kernel.org,
bridge@...ts.linux-foundation.org, keyrings@...r.kernel.org,
linux-security-module@...r.kernel.org,
linux-kernel@...r.kernel.org, Tiezhu Yang <yangtiezhu@...ngson.cn>,
Luis Chamberlain <mcgrof@...nel.org>
Subject: [PATCH 3/5] test_kmod: Avoid potential double free in trigger_config_run_type()
From: Tiezhu Yang <yangtiezhu@...ngson.cn>
Reset the member "test_fs" of the test configuration after a call
of the function "kfree_const" to a null pointer so that a double
memory release will not be performed.
Fixes: d9c6a72d6fa2 ("kmod: add test driver to stress test the module loader")
Acked-by: Luis Chamberlain <mcgrof@...nel.org>
Signed-off-by: Tiezhu Yang <yangtiezhu@...ngson.cn>
Signed-off-by: Luis Chamberlain <mcgrof@...nel.org>
---
lib/test_kmod.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/test_kmod.c b/lib/test_kmod.c
index e651c37d56db..eab52770070d 100644
--- a/lib/test_kmod.c
+++ b/lib/test_kmod.c
@@ -745,7 +745,7 @@ static int trigger_config_run_type(struct kmod_test_device *test_dev,
break;
case TEST_KMOD_FS_TYPE:
kfree_const(config->test_fs);
- config->test_driver = NULL;
+ config->test_fs = NULL;
copied = config_copy_test_fs(config, test_str,
strlen(test_str));
break;
--
2.26.2
Powered by blists - more mailing lists