]> git.baikalelectronics.ru Git - 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)
committerJohn Johansen <john.johansen@canonical.com>
Sat, 24 Mar 2018 00:33:52 +0000 (17:33 -0700)
commit847eac1325bad76ce60b030b66bc3c4b7b0b7868
treeeb142855036307a48aef79de645a0169d408f836
parent17e24af80d3c44909b45ae1291cf76ed48321051
apparmor: fix dangling symlinks to policy rawdata after replacement

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: 442e2ac2b1f33 ("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>
security/apparmor/apparmorfs.c