mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-25 13:14:07 +08:00
apparmor: add check for apparmor enabled in module parameters missing it
Signed-off-by: John Johansen <john.johansen@canonical.com>
This commit is contained in:
parent
d4669f0b03
commit
ca4bd5ae0a
@ -750,6 +750,8 @@ static int param_get_aalockpolicy(char *buffer, const struct kernel_param *kp)
|
||||
{
|
||||
if (!policy_view_capable(NULL))
|
||||
return -EPERM;
|
||||
if (!apparmor_enabled)
|
||||
return -EINVAL;
|
||||
return param_get_bool(buffer, kp);
|
||||
}
|
||||
|
||||
@ -757,6 +759,8 @@ static int param_set_aabool(const char *val, const struct kernel_param *kp)
|
||||
{
|
||||
if (!policy_admin_capable(NULL))
|
||||
return -EPERM;
|
||||
if (!apparmor_enabled)
|
||||
return -EINVAL;
|
||||
return param_set_bool(val, kp);
|
||||
}
|
||||
|
||||
@ -764,6 +768,8 @@ static int param_get_aabool(char *buffer, const struct kernel_param *kp)
|
||||
{
|
||||
if (!policy_view_capable(NULL))
|
||||
return -EPERM;
|
||||
if (!apparmor_enabled)
|
||||
return -EINVAL;
|
||||
return param_get_bool(buffer, kp);
|
||||
}
|
||||
|
||||
@ -771,6 +777,8 @@ static int param_set_aauint(const char *val, const struct kernel_param *kp)
|
||||
{
|
||||
if (!policy_admin_capable(NULL))
|
||||
return -EPERM;
|
||||
if (!apparmor_enabled)
|
||||
return -EINVAL;
|
||||
return param_set_uint(val, kp);
|
||||
}
|
||||
|
||||
@ -778,6 +786,8 @@ static int param_get_aauint(char *buffer, const struct kernel_param *kp)
|
||||
{
|
||||
if (!policy_view_capable(NULL))
|
||||
return -EPERM;
|
||||
if (!apparmor_enabled)
|
||||
return -EINVAL;
|
||||
return param_get_uint(buffer, kp);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user