Skip to contentSkip to conversation

Fix Permissions on module_param Usage

PATCH New Rusty Russell 1 participant 1 message Aug 16, 2004

Subsystems (7)
USB ACPI PCI NFS client +3 more subsystems
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix Permissions on module_param Usage

I have a patch which checks for sane perms at compile time, but it bloats modules, so I haven't included it.

Name: Fix Permissions on module_param Usage
Status: Tested on 2.6.8-rc4-bk1

module_param() and family take a "perms" argument; several people has incorrectly "644" instead of "0644".

drivers/pci/hotplug/acpiphp_core.c +1 -1
diff -urpN --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal .6168-linux-2.6.8-rc4-bk1/drivers/pci/hotplug/acpiphp_core.c .6168-linux-2.6.8-rc4-bk1.updated/drivers/pci/hotplug/acpiphp_core.c
@@ -60,7 +60,7 @@ MODULE_AUTHOR(DRIVER_AUTHOR);
 MODULE_DESCRIPTION(DRIVER_DESC);
 MODULE_LICENSE("GPL");
 MODULE_PARM_DESC(debug, "Debugging mode enabled or not");
-module_param(debug, bool, 644);
+module_param(debug, bool, 0644);
 
 static int enable_slot		(struct hotplug_slot *slot);
 static int disable_slot		(struct hotplug_slot *slot);
drivers/pci/hotplug/cpcihp_zt5550.c +2 -2
diff -urpN --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal .6168-linux-2.6.8-rc4-bk1/drivers/pci/hotplug/cpcihp_zt5550.c .6168-linux-2.6.8-rc4-bk1.updated/drivers/pci/hotplug/cpcihp_zt5550.c
@@ -298,7 +298,7 @@ module_exit(zt5550_exit);
 MODULE_AUTHOR(DRIVER_AUTHOR);
 MODULE_DESCRIPTION(DRIVER_DESC);
 MODULE_LICENSE("GPL");
-module_param(debug, bool, 644);
+module_param(debug, bool, 0644);
 MODULE_PARM_DESC(debug, "Debugging mode enabled or not");
-module_param(poll, bool, 644);
+module_param(poll, bool, 0644);
 MODULE_PARM_DESC(poll, "#ENUM polling mode enabled or not");
drivers/pci/hotplug/cpqphp_core.c +2 -2
diff -urpN --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal .6168-linux-2.6.8-rc4-bk1/drivers/pci/hotplug/cpqphp_core.c .6168-linux-2.6.8-rc4-bk1.updated/drivers/pci/hotplug/cpqphp_core.c
@@ -69,10 +69,10 @@ MODULE_AUTHOR(DRIVER_AUTHOR);
 MODULE_DESCRIPTION(DRIVER_DESC);
 MODULE_LICENSE("GPL");
 
-module_param(power_mode, bool, 644);
+module_param(power_mode, bool, 0644);
 MODULE_PARM_DESC(power_mode, "Power mode enabled or not");
 
-module_param(debug, bool, 644);
+module_param(debug, bool, 0644);
 MODULE_PARM_DESC(debug, "Debugging mode enabled or not");
 
 #define CPQHPC_MODULE_MINOR 208
drivers/pci/hotplug/pci_hotplug_core.c +1 -1
diff -urpN --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal .6168-linux-2.6.8-rc4-bk1/drivers/pci/hotplug/pci_hotplug_core.c .6168-linux-2.6.8-rc4-bk1.updated/drivers/pci/hotplug/pci_hotplug_core.c
@@ -701,7 +701,7 @@ module_exit(pci_hotplug_exit);
 MODULE_AUTHOR(DRIVER_AUTHOR);
 MODULE_DESCRIPTION(DRIVER_DESC);
 MODULE_LICENSE("GPL");
-module_param(debug, bool, 644);
+module_param(debug, bool, 0644);
 MODULE_PARM_DESC(debug, "Debugging mode enabled or not");
 
 EXPORT_SYMBOL_GPL(pci_hotplug_slots_subsys);
drivers/pci/hotplug/pciehp_core.c +3 -3
diff -urpN --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal .6168-linux-2.6.8-rc4-bk1/drivers/pci/hotplug/pciehp_core.c .6168-linux-2.6.8-rc4-bk1.updated/drivers/pci/hotplug/pciehp_core.c
@@ -57,9 +57,9 @@ MODULE_AUTHOR(DRIVER_AUTHOR);
 MODULE_DESCRIPTION(DRIVER_DESC);
 MODULE_LICENSE("GPL");
 
-module_param(pciehp_debug, bool, 644);
-module_param(pciehp_poll_mode, bool, 644);
-module_param(pciehp_poll_time, int, 644);
+module_param(pciehp_debug, bool, 0644);
+module_param(pciehp_poll_mode, bool, 0644);
+module_param(pciehp_poll_time, int, 0644);
 MODULE_PARM_DESC(pciehp_debug, "Debugging mode enabled or not");
 MODULE_PARM_DESC(pciehp_poll_mode, "Using polling mechanism for hot-plug events or not");
 MODULE_PARM_DESC(pciehp_poll_time, "Polling mechanism frequency, in seconds");
drivers/pci/hotplug/pcihp_skeleton.c +1 -1
diff -urpN --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal .6168-linux-2.6.8-rc4-bk1/drivers/pci/hotplug/pcihp_skeleton.c .6168-linux-2.6.8-rc4-bk1.updated/drivers/pci/hotplug/pcihp_skeleton.c
@@ -70,7 +70,7 @@ static int num_slots;
 MODULE_AUTHOR(DRIVER_AUTHOR);
 MODULE_DESCRIPTION(DRIVER_DESC);
 MODULE_LICENSE("GPL");
-module_param(debug, bool, 644);
+module_param(debug, bool, 0644);
 MODULE_PARM_DESC(debug, "Debugging mode enabled or not");
 
 static int enable_slot		(struct hotplug_slot *slot);
drivers/pci/hotplug/shpchp_core.c +3 -3
diff -urpN --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal .6168-linux-2.6.8-rc4-bk1/drivers/pci/hotplug/shpchp_core.c .6168-linux-2.6.8-rc4-bk1.updated/drivers/pci/hotplug/shpchp_core.c
@@ -57,9 +57,9 @@ MODULE_AUTHOR(DRIVER_AUTHOR);
 MODULE_DESCRIPTION(DRIVER_DESC);
 MODULE_LICENSE("GPL");
 
-module_param(shpchp_debug, bool, 644);
-module_param(shpchp_poll_mode, bool, 644);
-module_param(shpchp_poll_time, int, 644);
+module_param(shpchp_debug, bool, 0644);
+module_param(shpchp_poll_mode, bool, 0644);
+module_param(shpchp_poll_time, int, 0644);
 MODULE_PARM_DESC(shpchp_debug, "Debugging mode enabled or not");
 MODULE_PARM_DESC(shpchp_poll_mode, "Using polling mechanism for hot-plug events or not");
 MODULE_PARM_DESC(shpchp_poll_time, "Polling mechanism frequency, in seconds");
drivers/usb/input/ati_remote.c +2 -2
diff -urpN --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal .6168-linux-2.6.8-rc4-bk1/drivers/usb/input/ati_remote.c .6168-linux-2.6.8-rc4-bk1.updated/drivers/usb/input/ati_remote.c
@@ -112,11 +112,11 @@
 #define ATI_INPUTNUM      1     /* Which input device to register as */
 
 static unsigned long channel_mask = 0;
-module_param(channel_mask, ulong, 444);
+module_param(channel_mask, ulong, 0444);
 MODULE_PARM_DESC(channel_mask, "Bitmask of remote control channels to ignore");
 
 static int debug = 0;
-module_param(debug, int, 444);
+module_param(debug, int, 0444);
 MODULE_PARM_DESC(debug, "Enable extra debug messages and information");
 
 #define dbginfo(dev, format, arg...) do { if (debug) dev_info(dev , format , ## arg); } while (0)
fs/jfs/super.c +1 -1
diff -urpN --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal .6168-linux-2.6.8-rc4-bk1/fs/jfs/super.c .6168-linux-2.6.8-rc4-bk1.updated/fs/jfs/super.c
@@ -58,7 +58,7 @@ DECLARE_COMPLETION(jfsIOwait);
 
 #ifdef CONFIG_JFS_DEBUG
 int jfsloglevel = JFS_LOGLEVEL_WARN;
-module_param(jfsloglevel, int, 644);
+module_param(jfsloglevel, int, 0644);
 MODULE_PARM_DESC(jfsloglevel, "Specify JFS loglevel (0, 1 or 2)");
 #endif
 
fs/lockd/svc.c +4 -4
diff -urpN --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal .6168-linux-2.6.8-rc4-bk1/fs/lockd/svc.c .6168-linux-2.6.8-rc4-bk1.updated/fs/lockd/svc.c
@@ -409,13 +409,13 @@ MODULE_DESCRIPTION("NFS file locking ser
 MODULE_LICENSE("GPL");
 
 module_param_call(nlm_grace_period, param_set_grace_period, param_get_ulong,
-		  &nlm_grace_period, 644);
+		  &nlm_grace_period, 0644);
 module_param_call(nlm_timeout, param_set_timeout, param_get_ulong,
-		  &nlm_timeout, 644);
+		  &nlm_timeout, 0644);
 module_param_call(nlm_udpport, param_set_port, param_get_int,
-		  &nlm_udpport, 644);
+		  &nlm_udpport, 0644);
 module_param_call(nlm_tcpport, param_set_port, param_get_int,
-		  &nlm_tcpport, 644);
+		  &nlm_tcpport, 0644);
 
 /*
  * Initialising and terminating the module.
Signature · 1 line
Anyone who quotes me in their signature is an idiot -- Rusty Russell