Skip to content

Commit 5265fc6

Browse files
rostedtrustyrussell
authored andcommitted
module/lsm: Have apparmor module parameters work with no args
The apparmor module parameters for param_ops_aabool and param_ops_aalockpolicy are both based off of the param_ops_bool, and can handle a NULL value passed in as val. Have it enable the new KERNEL_PARAM_FL_NOARGS flag to allow the parameters to be set without having to state "=y" or "=1". Cc: John Johansen <john.johansen@canonical.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
1 parent 0ce8140 commit 5265fc6

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎security/apparmor/lsm.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -666,6 +666,7 @@ static int param_set_aabool(const char *val, const struct kernel_param *kp);
666666
static int param_get_aabool(char *buffer, const struct kernel_param *kp);
667667
#define param_check_aabool param_check_bool
668668
static struct kernel_param_ops param_ops_aabool = {
669+
.flags = KERNEL_PARAM_FL_NOARG,
669670
.set = param_set_aabool,
670671
.get = param_get_aabool
671672
};
@@ -682,6 +683,7 @@ static int param_set_aalockpolicy(const char *val, const struct kernel_param *kp
682683
static int param_get_aalockpolicy(char *buffer, const struct kernel_param *kp);
683684
#define param_check_aalockpolicy param_check_bool
684685
static struct kernel_param_ops param_ops_aalockpolicy = {
686+
.flags = KERNEL_PARAM_FL_NOARG,
685687
.set = param_set_aalockpolicy,
686688
.get = param_get_aalockpolicy
687689
};

0 commit comments

Comments
 (0)