mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-17 16:47:50 +00:00
lsm: use attr/apparmor/current to get apparmor label
On some kernels, attr/current can be intercepted by BPF LSM, causing errors (#2033). Using attr/apparmor/current is preferable, because it is guaranteed to return the apparmor label. attr/current will still be used as a fallback for older kernels. Fixes: #2033 Signed-off-by: Filip Hejsek <filip.hejsek@gmail.com>
This commit is contained in:
parent
80c280610e
commit
a8c5e11715
1 changed files with 3 additions and 1 deletions
|
|
@ -29,7 +29,9 @@ static int apparmor_get_label(pid_t pid, char **profile_name)
|
|||
FILE *f;
|
||||
char *space;
|
||||
|
||||
f = fopen_proc(pid, "attr/current");
|
||||
f = fopen_proc(pid, "attr/apparmor/current");
|
||||
if (!f)
|
||||
f = fopen_proc(pid, "attr/current");
|
||||
if (!f)
|
||||
return -1;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue