* [PATCH 8/15] apparmor: fix module parameter handling
@ 2011-12-15 3:11 Rusty Russell
2011-12-15 13:21 ` John Johansen
0 siblings, 1 reply; 3+ messages in thread
From: Rusty Russell @ 2011-12-15 3:11 UTC (permalink / raw)
To: lkml - Kernel Mailing List
Cc: Pawel Moll, John Johansen, James Morris, linux-security-module
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.)
Cc: John Johansen <john.johansen@canonical.com>
Cc: James Morris <jmorris@namei.org>
Cc: linux-security-module@vger.kernel.org
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
---
security/apparmor/lsm.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c
--- a/security/apparmor/lsm.c
+++ b/security/apparmor/lsm.c
@@ -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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 8/15] apparmor: fix module parameter handling
2011-12-15 3:11 [PATCH 8/15] apparmor: fix module parameter handling Rusty Russell
@ 2011-12-15 13:21 ` John Johansen
2011-12-16 1:47 ` James Morris
0 siblings, 1 reply; 3+ messages in thread
From: John Johansen @ 2011-12-15 13:21 UTC (permalink / raw)
To: Rusty Russell
Cc: lkml - Kernel Mailing List, Pawel Moll, James Morris,
linux-security-module
On 12/14/2011 07:11 PM, Rusty Russell wrote:
> 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
> (Note that 'bool' module parameters also allow 'int', which is why you
> got away with this, but that's changing very soon.)
>
> Cc: John Johansen <john.johansen@canonical.com>
> Cc: James Morris <jmorris@namei.org>
> Cc: linux-security-module@vger.kernel.org
> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Acked-by: John Johansen <john.johansen@canonical.com>
> ---
> security/apparmor/lsm.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c
> --- a/security/apparmor/lsm.c
> +++ b/security/apparmor/lsm.c
> @@ -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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 8/15] apparmor: fix module parameter handling
2011-12-15 13:21 ` John Johansen
@ 2011-12-16 1:47 ` James Morris
0 siblings, 0 replies; 3+ messages in thread
From: James Morris @ 2011-12-16 1:47 UTC (permalink / raw)
To: John Johansen
Cc: Rusty Russell, lkml - Kernel Mailing List, Pawel Moll,
linux-security-module
On Thu, 15 Dec 2011, John Johansen wrote:
> On 12/14/2011 07:11 PM, Rusty Russell wrote:
> > 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
>
> > (Note that 'bool' module parameters also allow 'int', which is why you
> > got away with this, but that's changing very soon.)
> >
> > Cc: John Johansen <john.johansen@canonical.com>
> > Cc: James Morris <jmorris@namei.org>
> > Cc: linux-security-module@vger.kernel.org
> > Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
> Acked-by: John Johansen <john.johansen@canonical.com>
>
Applied to
git://selinuxproject.org/~jmorris/linux-security next
--
James Morris
<jmorris@namei.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-12-16 1:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-15 3:11 [PATCH 8/15] apparmor: fix module parameter handling Rusty Russell
2011-12-15 13:21 ` John Johansen
2011-12-16 1:47 ` James Morris
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.