[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200820091600.774879189@linuxfoundation.org>
Date: Thu, 20 Aug 2020 11:21:43 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org, Tiezhu Yang <yangtiezhu@...ngson.cn>,
Luis Chamberlain <mcgrof@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Alexei Starovoitov <ast@...nel.org>,
Al Viro <viro@...iv.linux.org.uk>,
Christian Brauner <christian.brauner@...ntu.com>,
Chuck Lever <chuck.lever@...cle.com>,
David Howells <dhowells@...hat.com>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
James Morris <jmorris@...ei.org>,
Jarkko Sakkinen <jarkko.sakkinen@...ux.intel.com>,
"J. Bruce Fields" <bfields@...ldses.org>,
Jens Axboe <axboe@...nel.dk>,
Josh Triplett <josh@...htriplett.org>,
Kees Cook <keescook@...omium.org>,
Lars Ellenberg <lars.ellenberg@...bit.com>,
Nikolay Aleksandrov <nikolay@...ulusnetworks.com>,
Philipp Reisner <philipp.reisner@...bit.com>,
Roopa Prabhu <roopa@...ulusnetworks.com>,
"Serge E. Hallyn" <serge@...lyn.com>,
Sergei Trofimovich <slyfox@...too.org>,
Sergey Kvachonok <ravenexp@...il.com>,
Shuah Khan <shuah@...nel.org>,
Tony Vroon <chainsaw@...too.org>,
Christoph Hellwig <hch@...radead.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Sasha Levin <sashal@...nel.org>
Subject: [PATCH 5.4 136/152] test_kmod: avoid potential double free in trigger_config_run_type()
From: Tiezhu Yang <yangtiezhu@...ngson.cn>
[ Upstream commit 0776d1231bec0c7ab43baf440a3f5ef5f49dd795 ]
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")
Signed-off-by: Tiezhu Yang <yangtiezhu@...ngson.cn>
Signed-off-by: Luis Chamberlain <mcgrof@...nel.org>
Signed-off-by: Andrew Morton <akpm@...ux-foundation.org>
Acked-by: Luis Chamberlain <mcgrof@...nel.org>
Cc: Alexei Starovoitov <ast@...nel.org>
Cc: Al Viro <viro@...iv.linux.org.uk>
Cc: Christian Brauner <christian.brauner@...ntu.com>
Cc: Chuck Lever <chuck.lever@...cle.com>
Cc: David Howells <dhowells@...hat.com>
Cc: David S. Miller <davem@...emloft.net>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Jakub Kicinski <kuba@...nel.org>
Cc: James Morris <jmorris@...ei.org>
Cc: Jarkko Sakkinen <jarkko.sakkinen@...ux.intel.com>
Cc: J. Bruce Fields <bfields@...ldses.org>
Cc: Jens Axboe <axboe@...nel.dk>
Cc: Josh Triplett <josh@...htriplett.org>
Cc: Kees Cook <keescook@...omium.org>
Cc: Lars Ellenberg <lars.ellenberg@...bit.com>
Cc: Nikolay Aleksandrov <nikolay@...ulusnetworks.com>
Cc: Philipp Reisner <philipp.reisner@...bit.com>
Cc: Roopa Prabhu <roopa@...ulusnetworks.com>
Cc: "Serge E. Hallyn" <serge@...lyn.com>
Cc: Sergei Trofimovich <slyfox@...too.org>
Cc: Sergey Kvachonok <ravenexp@...il.com>
Cc: Shuah Khan <shuah@...nel.org>
Cc: Tony Vroon <chainsaw@...too.org>
Cc: Christoph Hellwig <hch@...radead.org>
Link: http://lkml.kernel.org/r/20200610154923.27510-4-mcgrof@kernel.org
Signed-off-by: Linus Torvalds <torvalds@...ux-foundation.org>
Signed-off-by: Sasha Levin <sashal@...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 9cf77628fc913..87a0cc750ea23 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.25.1
Powered by blists - more mailing lists