summaryrefslogtreecommitdiffstats
path: root/security/apparmor/apparmorfs.c
diff options
context:
space:
mode:
authorJohn Johansen <john.johansen@canonical.com>2017-01-16 09:42:34 +0100
committerJohn Johansen <john.johansen@canonical.com>2017-01-16 10:18:28 +0100
commit73688d1ed0b8f800f312f7bc9d583463858da861 (patch)
tree41d58fc6558b4a07554da9dc3ff4db3a36d1ad59 /security/apparmor/apparmorfs.c
parentapparmor: update policy_destroy to use new debug asserts (diff)
downloadlinux-73688d1ed0b8f800f312f7bc9d583463858da861.tar.xz
linux-73688d1ed0b8f800f312f7bc9d583463858da861.zip
apparmor: refactor prepare_ns() and make usable from different views
prepare_ns() will need to be called from alternate views, and namespaces will need to be created via different interfaces. So refactor and allow specifying the view ns. Signed-off-by: John Johansen <john.johansen@canonical.com>
Diffstat (limited to 'security/apparmor/apparmorfs.c')
-rw-r--r--security/apparmor/apparmorfs.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c
index 96a02ee9c499..2b48be2169cb 100644
--- a/security/apparmor/apparmorfs.c
+++ b/security/apparmor/apparmorfs.c
@@ -125,7 +125,8 @@ static ssize_t profile_load(struct file *f, const char __user *buf, size_t size,
error = PTR_ERR(data);
if (!IS_ERR(data)) {
- error = aa_replace_profiles(data, size, PROF_ADD);
+ error = aa_replace_profiles(__aa_current_profile()->ns, data,
+ size, PROF_ADD);
kvfree(data);
}
@@ -147,7 +148,8 @@ static ssize_t profile_replace(struct file *f, const char __user *buf,
data = aa_simple_write_to_buffer(OP_PROF_REPL, buf, size, size, pos);
error = PTR_ERR(data);
if (!IS_ERR(data)) {
- error = aa_replace_profiles(data, size, PROF_REPLACE);
+ error = aa_replace_profiles(__aa_current_profile()->ns, data,
+ size, PROF_REPLACE);
kvfree(data);
}