All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] test_kmod: fix rmmod double free
@ 2018-11-24  5:05 Luis Chamberlain
  0 siblings, 0 replies; only message in thread
From: Luis Chamberlain @ 2018-11-24  5:05 UTC (permalink / raw)
  To: akpm; +Cc: rdunlap, linux-kernel, Luis Chamberlain, stable

We double free the misc device string twice on rmmod, fix this.
Without this we cannot remove the module without crashing.

Cc: <stable@vger.kernel.org>      # for v4.12 and up
Reported-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
---
 lib/test_kmod.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/lib/test_kmod.c b/lib/test_kmod.c
index e3ddd836491f..d82d022111e0 100644
--- a/lib/test_kmod.c
+++ b/lib/test_kmod.c
@@ -1214,7 +1214,6 @@ void unregister_test_dev_kmod(struct kmod_test_device *test_dev)
 
 	dev_info(test_dev->dev, "removing interface\n");
 	misc_deregister(&test_dev->misc_dev);
-	kfree(&test_dev->misc_dev.name);
 
 	mutex_unlock(&test_dev->config_mutex);
 	mutex_unlock(&test_dev->trigger_mutex);
-- 
2.19.1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-11-24  5:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-24  5:05 [PATCH] test_kmod: fix rmmod double free Luis Chamberlain

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.