Skip to contentSkip to conversation

linux: adjust Solarflare module_param() permissions

PATCH In review Jan Beulich 2 participants 2 messages Feb 21, 2008 Xen hypervisor interface

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 linux: adjust Solarflare module_param() permissions

Using permissions with bit 1 set (i.e. 0666) is prohibited on module parameters on 2.6.20+. Presumably it was never meant to permit writes by everyone?

As usual, written and tested on 2.6.24.1 and made apply to the 2.6.18 tree without further testing.

drivers/xen/sfc_netback/accel.c +1 -1
Index: head-2008-02-20/drivers/xen/sfc_netback/accel.c
===================================================================
@@ -72,7 +72,7 @@ static struct notifier_block netback_acc
 
 
 unsigned max_pages = NETBACK_ACCEL_DEFAULT_MAX_BUF_PAGES;
-module_param(max_pages, int, 0666);
+module_param(max_pages, int, 0644);
 MODULE_PARM_DESC(max_pages, 
 		 "The number of buffer pages to enforce on each guest");
 
drivers/xen/sfc_netfront/accel_netfront.c +2 -2
Index: head-2008-02-20/drivers/xen/sfc_netfront/accel_netfront.c
===================================================================
@@ -235,11 +235,11 @@ struct netfront_accel_hooks accel_hooks 
 
 
 unsigned max_pages = NETFRONT_ACCEL_DEFAULT_BUF_PAGES;
-module_param (max_pages, int, 0666);
+module_param(max_pages, int, 0644);
 MODULE_PARM_DESC(max_pages, "Number of buffer pages to request");
 
 unsigned buffer_split = 2;
-module_param (buffer_split, int, 0666);
+module_param(buffer_split, int, 0644);
 MODULE_PARM_DESC(buffer_split, "Fraction of buffers to use for TX, rest for RX");
 
 
#1 lore raw
Quoted 3 lines · Jan Beulich

Using permissions with bit 1 set (i.e. 0666) is prohibited on module parameters on 2.6.20+. Presumably it was never meant to permit writes by everyone?

Correct, sorry - due my being lazy when first writing the code and forgetting to do it properly later.

This is a good change, but the patch will conflict with the earlier fix to prevent the module parameter names clashing when statically compiled. Attached is a re-spin that should apply cleanly to the staging tree.

Signed-off-by Kieran Mansley <[email protected]>

drivers/xen/sfc_netback/accel.c +1 -1
diff -r 0569bf9338ba drivers/xen/sfc_netback/accel.c
@@ -72,7 +72,7 @@ static struct notifier_block netback_acc
 
 
 unsigned sfc_netback_max_pages = NETBACK_ACCEL_DEFAULT_MAX_BUF_PAGES;
-module_param_named(max_pages, sfc_netback_max_pages, uint, 0666);
+module_param_named(max_pages, sfc_netback_max_pages, uint, 0644);
 MODULE_PARM_DESC(max_pages, 
 		 "The number of buffer pages to enforce on each guest");
 
drivers/xen/sfc_netfront/accel_netfront.c +1 -2
diff -r 0569bf9338ba drivers/xen/sfc_netfront/accel_netfront.c
@@ -235,11 +235,11 @@ struct netfront_accel_hooks accel_hooks 
 
 
 unsigned sfc_netfront_max_pages = NETFRONT_ACCEL_DEFAULT_BUF_PAGES;
-module_param_named (max_pages, sfc_netfront_max_pages, uint, 0666);
+module_param_named (max_pages, sfc_netfront_max_pages, uint, 0644);
 MODULE_PARM_DESC(max_pages, "Number of buffer pages to request");
 
 unsigned sfc_netfront_buffer_split = 2;
-module_param_named (buffer_split, sfc_netfront_buffer_split, uint,

0666);
+module_param_named (buffer_split, sfc_netfront_buffer_split, uint, 0644);
MODULE_PARM_DESC(buffer_split,
"Fraction of buffers to use for TX, rest for RX");

drivers/xen/sfc_netback/accel.c +1 -1
diff -r 0569bf9338ba drivers/xen/sfc_netback/accel.c
@@ -72,7 +72,7 @@ static struct notifier_block netback_acc
 
 
 unsigned sfc_netback_max_pages = NETBACK_ACCEL_DEFAULT_MAX_BUF_PAGES;
-module_param_named(max_pages, sfc_netback_max_pages, uint, 0666);
+module_param_named(max_pages, sfc_netback_max_pages, uint, 0644);
 MODULE_PARM_DESC(max_pages, 
 		 "The number of buffer pages to enforce on each guest");
 
drivers/xen/sfc_netfront/accel_netfront.c +2 -2
diff -r 0569bf9338ba drivers/xen/sfc_netfront/accel_netfront.c
@@ -235,11 +235,11 @@ struct netfront_accel_hooks accel_hooks 
 
 
 unsigned sfc_netfront_max_pages = NETFRONT_ACCEL_DEFAULT_BUF_PAGES;
-module_param_named (max_pages, sfc_netfront_max_pages, uint, 0666);
+module_param_named (max_pages, sfc_netfront_max_pages, uint, 0644);
 MODULE_PARM_DESC(max_pages, "Number of buffer pages to request");
 
 unsigned sfc_netfront_buffer_split = 2;
-module_param_named (buffer_split, sfc_netfront_buffer_split, uint, 0666);
+module_param_named (buffer_split, sfc_netfront_buffer_split, uint, 0644);
 MODULE_PARM_DESC(buffer_split, 
 		 "Fraction of buffers to use for TX, rest for RX");
 

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel