mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-04 08:24:42 +01:00
Subject: libapparmor: fix aa_change_hat token format string
This patch fixes the format string for the magic token in aa_change_hat to match the type of the magic token (long). Without this, on 64 bit platforms, only the bottom 32 bits of the token would be used. aa_change_hatv() has the correct format string, so an aa_change_hatv() call followed by an exiting aa_change_hat() call would result in the latter having a different token, which would cause the process to be killed by apparmor. (Hat tip to John Johansen for spotting the actual bug.) Signed-off-by: Steve Beattie <steve@nxnw.org> Acked-by: John Johansen <john.johansen@canonical.com>
This commit is contained in:
parent
960a8aee87
commit
2d504e3c71
1 changed files with 1 additions and 1 deletions
|
@ -355,7 +355,7 @@ int aa_change_hat(const char *subprofile, unsigned long token)
|
|||
int rc = -1;
|
||||
int len = 0;
|
||||
char *buf = NULL;
|
||||
const char *fmt = "changehat %016x^%s";
|
||||
const char *fmt = "changehat %016lx^%s";
|
||||
|
||||
/* both may not be null */
|
||||
if (!(token || subprofile)) {
|
||||
|
|
Loading…
Add table
Reference in a new issue