Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
lxc
Commits
f88d8e68
Unverified
Commit
f88d8e68
authored
Jun 30, 2020
by
Christian Brauner
Committed by
GitHub
Jun 30, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3466 from alivenets/fix-no-new-privs
attach: set no_new_privs flag after LSM label
parents
7c8b10e5
6ce8e678
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
attach.c
src/lxc/attach.c
+11
-11
No files found.
src/lxc/attach.c
View file @
f88d8e68
...
@@ -770,17 +770,6 @@ static int attach_child_main(struct attach_clone_payload *payload)
...
@@ -770,17 +770,6 @@ static int attach_child_main(struct attach_clone_payload *payload)
else
else
new_gid
=
ns_root_gid
;
new_gid
=
ns_root_gid
;
if
((
init_ctx
->
container
&&
init_ctx
->
container
->
lxc_conf
&&
init_ctx
->
container
->
lxc_conf
->
no_new_privs
)
||
(
options
->
attach_flags
&
LXC_ATTACH_NO_NEW_PRIVS
))
{
ret
=
prctl
(
PR_SET_NO_NEW_PRIVS
,
prctl_arg
(
1
),
prctl_arg
(
0
),
prctl_arg
(
0
),
prctl_arg
(
0
));
if
(
ret
<
0
)
goto
on_error
;
TRACE
(
"Set PR_SET_NO_NEW_PRIVS"
);
}
if
(
needs_lsm
)
{
if
(
needs_lsm
)
{
bool
on_exec
;
bool
on_exec
;
...
@@ -795,6 +784,17 @@ static int attach_child_main(struct attach_clone_payload *payload)
...
@@ -795,6 +784,17 @@ static int attach_child_main(struct attach_clone_payload *payload)
TRACE
(
"Set %s LSM label to
\"
%s
\"
"
,
lsm_name
(),
init_ctx
->
lsm_label
);
TRACE
(
"Set %s LSM label to
\"
%s
\"
"
,
lsm_name
(),
init_ctx
->
lsm_label
);
}
}
if
((
init_ctx
->
container
&&
init_ctx
->
container
->
lxc_conf
&&
init_ctx
->
container
->
lxc_conf
->
no_new_privs
)
||
(
options
->
attach_flags
&
LXC_ATTACH_NO_NEW_PRIVS
))
{
ret
=
prctl
(
PR_SET_NO_NEW_PRIVS
,
prctl_arg
(
1
),
prctl_arg
(
0
),
prctl_arg
(
0
),
prctl_arg
(
0
));
if
(
ret
<
0
)
goto
on_error
;
TRACE
(
"Set PR_SET_NO_NEW_PRIVS"
);
}
if
(
init_ctx
->
container
&&
init_ctx
->
container
->
lxc_conf
&&
if
(
init_ctx
->
container
&&
init_ctx
->
container
->
lxc_conf
&&
init_ctx
->
container
->
lxc_conf
->
seccomp
.
seccomp
)
{
init_ctx
->
container
->
lxc_conf
->
seccomp
.
seccomp
)
{
struct
lxc_conf
*
conf
=
init_ctx
->
container
->
lxc_conf
;
struct
lxc_conf
*
conf
=
init_ctx
->
container
->
lxc_conf
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment