]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blame - src/patches/suse-2.6.27.25/patches.apparmor/d_namespace_path_oops_fix.diff
Reenabled linux-xen and xen-image build
[people/pmueller/ipfire-2.x.git] / src / patches / suse-2.6.27.25 / patches.apparmor / d_namespace_path_oops_fix.diff
CommitLineData
8f69975d
BS
1From: Miklos Szeredi <mszeredi@suse.cz>
2Subject: fix oops in d_namespace_path
3Patch-mainline: no
4References: bnc#433504
5
6d_namespace_path uses the current->fs->root to get the current
7namespace. If root is detached root.mnt->mnt_ns will be NULL, causing
8an Oops. Fix by checking this before dereferencing the mnt_ns.
9
10Signed-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@@ -2312,7 +2312,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);