diff mbox series

[SRU,X,1/1] apparmor: provide userspace flag indicating binfmt_elf_mmap change

Message ID 20190530012656.15769-2-sbeattie@ubuntu.com
State New
Headers show
Series [SRU,X,1/1] apparmor: provide userspace flag indicating binfmt_elf_mmap change | expand

Commit Message

Steve Beattie May 30, 2019, 1:26 a.m. UTC
From: John Johansen <john.johansen@canonical.com>

BugLink: http://bugs.launchpad.net/bugs/1830984

commit 34c426acb75cc21bdf84685e106db0c1a3565057 upstream.

Commit 9f834ec18def ("binfmt_elf: switch to new creds when switching to new mm")
changed when the creds are installed by the binfmt_elf handler. This
affects which creds are used to mmap the executable into the address
space. Which can have an affect on apparmor policy.

Add a flag to apparmor at
/sys/kernel/security/apparmor/features/domain/fix_binfmt_elf_mmap

to make it possible to detect this semantic change so that the userspace
tools and the regression test suite can correctly deal with the change.

BugLink: http://bugs.launchpad.net/bugs/1630069
Signed-off-by: John Johansen <john.johansen@canonical.com>
[steve.beattie@canonical.com: resolved context conflict]
Signed-off-by: Steve Beattie <steve.beattie@canonical.com>

---
 security/apparmor/apparmorfs.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c
index 6950d27105e6a..b8ba1bb2ddea2 100644
--- a/security/apparmor/apparmorfs.c
+++ b/security/apparmor/apparmorfs.c
@@ -1532,6 +1532,7 @@  static struct aa_fs_entry aa_fs_entry_domain[] = {
 	AA_FS_FILE_BOOLEAN("change_onexec",	1),
 	AA_FS_FILE_BOOLEAN("change_profile",	1),
 	AA_FS_FILE_BOOLEAN("stack",		1),
+	AA_FS_FILE_BOOLEAN("fix_binfmt_elf_mmap",	1),
 	AA_FS_FILE_STRING("version", "1.2"),
 	{ }
 };