[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220324055207.GA21683@kili>
Date: Thu, 24 Mar 2022 08:52:07 +0300
From: Dan Carpenter <dan.carpenter@...cle.com>
To: Luis Chamberlain <mcgrof@...nel.org>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
linux-kernel@...r.kernel.org, linux-modules@...r.kernel.org,
kernel-janitors@...r.kernel.org
Subject: [PATCH] lib/test: use after free in register_test_dev_kmod()
The "test_dev" pointer is freed but then returned to the caller.
Fixes: d9c6a72d6fa2 ("kmod: add test driver to stress test the module loader")
Signed-off-by: Dan Carpenter <dan.carpenter@...cle.com>
---
lib/test_kmod.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/lib/test_kmod.c b/lib/test_kmod.c
index ce1589391413..cb800b1d0d99 100644
--- a/lib/test_kmod.c
+++ b/lib/test_kmod.c
@@ -1149,6 +1149,7 @@ static struct kmod_test_device *register_test_dev_kmod(void)
if (ret) {
pr_err("could not register misc device: %d\n", ret);
free_test_dev_kmod(test_dev);
+ test_dev = NULL;
goto out;
}
--
2.20.1
Powered by blists - more mailing lists