lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20060803201857.GC5004@localhost.localdomain>
Date:	Thu, 3 Aug 2006 16:18:57 -0400
From:	Neil Horman <nhorman@...driver.com>
To:	Andrew Morton <akpm@...l.org>
Cc:	kernel-janitors@...ts.osdl.org, linuxsh-dev@...ts.sourceforge.net,
	lethal@...ux-sh.org, kkojima@...iij4u.or.jp,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] sh: fix proc file removal for superh store queue module

Patch to clean up proc file removal in sq module for superh arch.  currently on
a failed module load or on module unload a proc file is left registered which
can cause a random memory execution or oopses if read after unload.  This patch
cleans up that deregistration.

Thanks & Regards
Neil

Signed-off-by: Neil Horman <nhorman@...driver.com>


 sq.c |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)


diff --git a/arch/sh/kernel/cpu/sh4/sq.c b/arch/sh/kernel/cpu/sh4/sq.c
index 781dbb1..4b2b0b1 100644
--- a/arch/sh/kernel/cpu/sh4/sq.c
+++ b/arch/sh/kernel/cpu/sh4/sq.c
@@ -421,18 +421,22 @@ static struct miscdevice sq_dev = {
 
 static int __init sq_api_init(void)
 {
+	int ret;
 	printk(KERN_NOTICE "sq: Registering store queue API.\n");
 
-#ifdef CONFIG_PROC_FS
 	create_proc_read_entry("sq_mapping", 0, 0, sq_mapping_read_proc, 0);
-#endif
 
-	return misc_register(&sq_dev);
+	ret = misc_register(&sq_dev);
+	if (ret) 
+		remove_proc_entry("sq_mapping", NULL);
+
+	return ret;
 }
 
 static void __exit sq_api_exit(void)
 {
 	misc_deregister(&sq_dev);
+	remove_proc_entry("sq_mapping", NULL);
 }
 
 module_init(sq_api_init);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ