]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - src/patches/suse-2.6.27.39/patches.apparmor/d_namespace_path_oops_fix.diff
Fix oinkmaster patch.
[people/pmueller/ipfire-2.x.git] / src / patches / suse-2.6.27.39 / patches.apparmor / d_namespace_path_oops_fix.diff
1 From: Miklos Szeredi <mszeredi@suse.cz>
2 Subject: fix oops in d_namespace_path
3 Patch-mainline: no
4 References: bnc#433504
5
6 d_namespace_path uses the current->fs->root to get the current
7 namespace. If root is detached root.mnt->mnt_ns will be NULL, causing
8 an Oops. Fix by checking this before dereferencing the mnt_ns.
9
10 Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
11 ---
12 fs/namespace.c | 2 +-
13 1 file changed, 1 insertion(+), 1 deletion(-)
14
15 --- a/fs/namespace.c
16 +++ b/fs/namespace.c
17 @@ -2370,7 +2370,7 @@ char *d_namespace_path(struct dentry *de
18 path_get(&current->fs->root);
19 read_unlock(&current->fs->lock);
20 spin_lock(&vfsmount_lock);
21 - if (root.mnt)
22 + if (root.mnt && root.mnt->mnt_ns)
23 ns_root.mnt = mntget(root.mnt->mnt_ns->root);
24 if (ns_root.mnt)
25 ns_root.dentry = dget(ns_root.mnt->mnt_root);