1
Index: b/security/apparmor/main.c
2
===================================================================
3
--- a/security/apparmor/main.c
4
+++ b/security/apparmor/main.c
6
#include <linux/security.h>
7
#include <linux/namei.h>
8
#include <linux/audit.h>
9
+#include <linux/mount.h>
13
@@ -486,38 +487,20 @@ out:
16
* Returns fully qualified path name on sucess, NULL on failure.
17
- * aa_put_name must be used to free allocated buffer.
18
+ * aa_put_name must be used to free the allocated buffer.
20
char *aa_get_name(struct dentry *dentry, struct vfsmount *mnt)
24
page = (char *)__get_free_page(GFP_KERNEL);
26
- name = ERR_PTR(-ENOMEM);
30
+ return ERR_PTR(-ENOMEM);
32
- name = d_path(dentry, mnt, page, PAGE_SIZE);
33
- /* check for (deleted) that d_path appends to pathnames if the dentry
34
- * has been removed from the cache.
35
- * The size > deleted_size and strcmp checks are redundant safe guards.
38
+ name = d_namespace_path(dentry, mnt, page, PAGE_SIZE);
40
free_page((unsigned long)page);
42
- const char deleted_str[] = " (deleted)";
43
- const size_t deleted_size = sizeof(deleted_str) - 1;
45
- size = strlen(name);
46
- if (!IS_ROOT(dentry) && d_unhashed(dentry) &&
47
- size > deleted_size &&
48
- strcmp(name + size - deleted_size, deleted_str) == 0)
49
- name[size - deleted_size] = '\0';
50
- AA_DEBUG("%s: full_path=%s\n", __FUNCTION__, name);