-
Notifications
You must be signed in to change notification settings - Fork 602
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Liu Chao <[email protected]>
- Loading branch information
1 parent
32d5a76
commit f1520e3
Showing
11 changed files
with
58 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,6 +36,15 @@ | |
#ifndef PR_SET_NO_NEW_PRIVS | ||
#define PR_SET_NO_NEW_PRIVS 38 | ||
#endif | ||
#ifndef PR_CAP_AMBIENT | ||
#define PR_CAP_AMBIENT 47 | ||
#endif | ||
#ifndef PR_CAP_AMBIENT_IS_SET | ||
#define PR_CAP_AMBIENT_IS_SET 1 | ||
#endif | ||
#ifndef PR_CAP_AMBIENT_RAISE | ||
# define PR_CAP_AMBIENT_RAISE 2 | ||
Check warning on line 46 in criu/include/prctl.h GitHub Actions / build
|
||
#endif | ||
|
||
#ifndef PR_SET_MM | ||
#define PR_SET_MM 35 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -347,6 +347,21 @@ static int restore_creds(struct thread_creds_args *args, int procfd, int lsm_typ | |
return -1; | ||
} | ||
|
||
for (b = 0; b < CR_CAP_SIZE; b++) { | ||
for (i = 0; i < 32; i++) { | ||
if (b * 32 + i > args->cap_last_cap) | ||
break; | ||
if ((args->cap_amb[b] & (1 << i)) == 0) | ||
/* don't set */ | ||
continue; | ||
ret = sys_prctl(PR_CAP_AMBIENT, PR_CAP_AMBIENT_RAISE, i + b * 32, 0, 0); | ||
if (!ret) | ||
continue; | ||
pr_warn("Unable to raise ambient capability %d: %d\n", i + b * 32, ret); | ||
} | ||
} | ||
|
||
|
||
Check warning on line 364 in criu/pie/restorer.c GitHub Actions / build
|
||
if (lsm_type != LSMTYPE__SELINUX) { | ||
/* | ||
* SELinux does not support setting the process context for | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters