From: John Johansen Date: Wed, 31 Jan 2018 10:23:41 +0000 (+0100) Subject: UBUNTU: SAUCE: apparmor: fix display of .ns_name for containers X-Git-Tag: Ubuntu-4.13.0-38.43~139 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=126a371a56e3653cdeb4d208ee231548d4b9932d;p=mirror_ubuntu-artful-kernel.git UBUNTU: SAUCE: apparmor: fix display of .ns_name for containers BugLink: http://bugs.launchpad.net/bugs/1746463 The .ns_name should not be virtualized by the current ns view. It needs to report the ns base name as that is being used during startup as part of determining apparmor policy namespace support. Fixes: d9f02d9c237aa ("apparmor: fix display of ns name") Reported-by: Serge Hallyn Tested-by: Serge Hallyn Signed-off-by: John Johansen Acked-by: Seth Forshee Acked-by: Colin Ian King Signed-off-by: Khalid Elmously --- diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c index 63a8a462fc96..bbc3c1c44f93 100644 --- a/security/apparmor/apparmorfs.c +++ b/security/apparmor/apparmorfs.c @@ -1189,9 +1189,7 @@ static int seq_ns_level_show(struct seq_file *seq, void *v) static int seq_ns_name_show(struct seq_file *seq, void *v) { struct aa_label *label = begin_current_label_crit_section(); - - seq_printf(seq, "%s\n", aa_ns_name(labels_ns(label), - labels_ns(label), true)); + seq_printf(seq, "%s\n", labels_ns(label)->base.name); end_current_label_crit_section(label); return 0;