]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
apparmor: fix dangling symlinks to policy rawdata after replacement
authorJohn Johansen <john.johansen@canonical.com>
Fri, 16 Mar 2018 05:31:38 +0000 (22:31 -0700)
committerSeth Forshee <seth.forshee@canonical.com>
Thu, 12 Apr 2018 15:35:32 +0000 (10:35 -0500)
commit29e1dd6bc2c2bb8b02ecce29c90d0daaf315883b
treef9ab82baca8a5654dbc9b13e286d5e320d0af800
parent146a3b2d491f51a70c902fac07d31991fb79d2cd
apparmor: fix dangling symlinks to policy rawdata after replacement

BugLink: http://bugs.launchpad.net/bugs/1763427
When policy replacement occurs the symlinks in the profile directory
need to be updated to point to the new rawdata, otherwise once the
old rawdata is removed the symlink becomes broken.

Fix this by dynamically generating the symlink everytime it is read.
These links are used enough that their value needs to be cached and
this way we can avoid needing locking to read and update the link
value.

Fixes: a481f4d917835 ("apparmor: add custom apparmorfs that will be used by policy namespace files")
BugLink: http://bugs.launchpad.net/bugs/1755563
Signed-off-by: John Johansen <john.johansen@canonical.com>
(cherry picked from commit 1180b4c757aab5506f1be367000364dd5cf5cd02
 git://git.kernel.org/pub/scm/linux/kernel/git/jj/linux-apparmor)
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
security/apparmor/apparmorfs.c