Skip to content

Commit

Permalink
apparmor: fail task profile update if current_cred isn't real_cred
Browse files Browse the repository at this point in the history
Trying to update the task cred while the task current cred is not the
real cred will result in an error at the cred layer. Avoid this by
failing early and delaying the update.

Signed-off-by: John Johansen <[email protected]>
  • Loading branch information
John Johansen committed Jan 16, 2017
1 parent b7fd2c0 commit a20aa95
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions security/apparmor/context.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ int aa_replace_current_profile(struct aa_profile *profile)
if (cxt->profile == profile)
return 0;

if (current_cred() != current_real_cred())
return -EBUSY;

new = prepare_creds();
if (!new)
return -ENOMEM;
Expand Down

0 comments on commit a20aa95

Please sign in to comment.