]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blobdiff - fs/exec.c
UBUNTU: SAUCE: Revert "audit: fix auditd/kernel connection state tracking"
[mirror_ubuntu-zesty-kernel.git] / fs / exec.c
index e579466107335bf4b704863469a4162c8c335adb..1825e64f8bf3c84959167838176c50c4fd1e95e4 100644 (file)
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -58,6 +58,8 @@
 #include <linux/compat.h>
 #include <linux/vmalloc.h>
 
+#include <trace/events/fs.h>
+
 #include <linux/uaccess.h>
 #include <asm/mmu_context.h>
 #include <asm/tlb.h>
@@ -104,6 +106,14 @@ bool path_noexec(const struct path *path)
        return (path->mnt->mnt_flags & MNT_NOEXEC) ||
               (path->mnt->mnt_sb->s_iflags & SB_I_NOEXEC);
 }
+EXPORT_SYMBOL_GPL(path_noexec);
+
+bool path_nosuid(const struct path *path)
+{
+       return !mnt_may_suid(path->mnt) ||
+              (path->mnt->mnt_sb->s_iflags & SB_I_NOSUID);
+}
+EXPORT_SYMBOL(path_nosuid);
 
 #ifdef CONFIG_USELIB
 /*
@@ -838,6 +848,8 @@ static struct file *do_open_execat(int fd, struct filename *name, int flags)
        if (name->name[0] != '\0')
                fsnotify_open(file);
 
+       trace_open_exec(name->name);
+
 out:
        return file;
 
@@ -1473,7 +1485,7 @@ static void bprm_fill_uid(struct linux_binprm *bprm)
        bprm->cred->euid = current_euid();
        bprm->cred->egid = current_egid();
 
-       if (!mnt_may_suid(bprm->file->f_path.mnt))
+       if (path_nosuid(&bprm->file->f_path))
                return;
 
        if (task_no_new_privs(current))