Skip to contentSkip to conversation

apparmor: fix module parameter handling

PATCH Applied Rusty Russell 3 participants 3 messages Dec 15, 2011 – Dec 16, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 8/15 apparmor: fix module parameter handling

The 'aabool' wrappers actually pass off to the 'bool' parse functions, so you should use the same check function. Similarly for aauint and uint.

(Note that 'bool' module parameters also allow 'int', which is why you got away with this, but that's changing very soon.)

---
 security/apparmor/lsm.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
security/apparmor/lsm.c +3 -3
@@ -671,7 +671,7 @@ static struct security_operations apparm
 
 static int param_set_aabool(const char *val, const struct kernel_param *kp);
 static int param_get_aabool(char *buffer, const struct kernel_param *kp);
-#define param_check_aabool(name, p) __param_check(name, p, int)
+#define param_check_aabool param_check_bool
 static struct kernel_param_ops param_ops_aabool = {
 	.set = param_set_aabool,
 	.get = param_get_aabool
@@ -679,7 +679,7 @@ static struct kernel_param_ops param_ops
 
 static int param_set_aauint(const char *val, const struct kernel_param *kp);
 static int param_get_aauint(char *buffer, const struct kernel_param *kp);
-#define param_check_aauint(name, p) __param_check(name, p, int)
+#define param_check_aauint param_check_uint
 static struct kernel_param_ops param_ops_aauint = {
 	.set = param_set_aauint,
 	.get = param_get_aauint
@@ -687,7 +687,7 @@ static struct kernel_param_ops param_ops
 
 static int param_set_aalockpolicy(const char *val, const struct kernel_param *kp);
 static int param_get_aalockpolicy(char *buffer, const struct kernel_param *kp);
-#define param_check_aalockpolicy(name, p) __param_check(name, p, int)
+#define param_check_aalockpolicy param_check_bool
 static struct kernel_param_ops param_ops_aalockpolicy = {
 	.set = param_set_aalockpolicy,
 	.get = param_get_aalockpolicy
maintainer Acked-by on v1 8/15
#1 lore raw
Quoted 4 lines · Rusty Russell

The 'aabool' wrappers actually pass off to the 'bool' parse functions, so you should use the same check function. Similarly for aauint and uint.

yep, thanks Rusty

Quoted 7 lines

(Note that 'bool' module parameters also allow 'int', which is why you got away with this, but that's changing very soon.)

Quoted 34 lines
---
 security/apparmor/lsm.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
security/apparmor/lsm.c +3 -3
@@ -671,7 +671,7 @@ static struct security_operations apparm
 
 static int param_set_aabool(const char *val, const struct kernel_param *kp);
 static int param_get_aabool(char *buffer, const struct kernel_param *kp);
-#define param_check_aabool(name, p) __param_check(name, p, int)
+#define param_check_aabool param_check_bool
 static struct kernel_param_ops param_ops_aabool = {
 	.set = param_set_aabool,
 	.get = param_get_aabool
@@ -679,7 +679,7 @@ static struct kernel_param_ops param_ops
 
 static int param_set_aauint(const char *val, const struct kernel_param *kp);
 static int param_get_aauint(char *buffer, const struct kernel_param *kp);
-#define param_check_aauint(name, p) __param_check(name, p, int)
+#define param_check_aauint param_check_uint
 static struct kernel_param_ops param_ops_aauint = {
 	.set = param_set_aauint,
 	.get = param_get_aauint
@@ -687,7 +687,7 @@ static struct kernel_param_ops param_ops
 
 static int param_set_aalockpolicy(const char *val, const struct kernel_param *kp);
 static int param_get_aalockpolicy(char *buffer, const struct kernel_param *kp);
-#define param_check_aalockpolicy(name, p) __param_check(name, p, int)
+#define param_check_aalockpolicy param_check_bool
 static struct kernel_param_ops param_ops_aalockpolicy = {
 	.set = param_set_aalockpolicy,
 	.get = param_get_aalockpolicy
maintainer
#2 lore raw
Quoted 7 lines · John Johansen
Quoted 4 lines · Rusty Russell

The 'aabool' wrappers actually pass off to the 'bool' parse functions, so you should use the same check function. Similarly for aauint and uint.

yep, thanks Rusty

Quoted 9 lines
Quoted 7 lines

(Note that 'bool' module parameters also allow 'int', which is why you got away with this, but that's changing very soon.)

Applied to
git://selinuxproject.org/~jmorris/linux-security next

Signature · 2 lines
James Morris
<[email protected]>