diff options
-rw-r--r-- | security/commoncap.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/security/commoncap.c b/security/commoncap.c index 0cf4b53480a7..0ecf4ba321cb 100644 --- a/security/commoncap.c +++ b/security/commoncap.c | |||
@@ -505,6 +505,11 @@ int cap_bprm_set_creds(struct linux_binprm *bprm) | |||
505 | } | 505 | } |
506 | skip: | 506 | skip: |
507 | 507 | ||
508 | /* if we have fs caps, clear dangerous personality flags */ | ||
509 | if (!cap_issubset(new->cap_permitted, old->cap_permitted)) | ||
510 | bprm->per_clear |= PER_CLEAR_ON_SETID; | ||
511 | |||
512 | |||
508 | /* Don't let someone trace a set[ug]id/setpcap binary with the revised | 513 | /* Don't let someone trace a set[ug]id/setpcap binary with the revised |
509 | * credentials unless they have the appropriate permit | 514 | * credentials unless they have the appropriate permit |
510 | */ | 515 | */ |