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
7043e2b4
Unverified
Commit
7043e2b4
authored
Feb 04, 2021
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cgroups: restrict open calls in cgroup_attach_create_leaf()
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
6e2078de
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
cgfsng.c
src/lxc/cgroups/cgfsng.c
+2
-2
No files found.
src/lxc/cgroups/cgfsng.c
View file @
7043e2b4
...
@@ -2311,12 +2311,12 @@ static int cgroup_attach_create_leaf(const struct lxc_conf *conf,
...
@@ -2311,12 +2311,12 @@ static int cgroup_attach_create_leaf(const struct lxc_conf *conf,
if
(
ret
<
0
&&
errno
!=
EEXIST
)
if
(
ret
<
0
&&
errno
!=
EEXIST
)
return
log_error_errno
(
-
1
,
errno
,
"Failed to create leaf cgroup
\"
.lxc
\"
"
);
return
log_error_errno
(
-
1
,
errno
,
"Failed to create leaf cgroup
\"
.lxc
\"
"
);
target_fd0
=
open
at
(
unified_fd
,
".lxc/cgroup.procs"
,
O_WRONLY
|
O_CLOEXEC
|
O_NOFOLLOW
);
target_fd0
=
open
_at
(
unified_fd
,
".lxc/cgroup.procs"
,
PROTECT_OPEN_W
,
PROTECT_LOOKUP_BENEATH
,
0
);
if
(
target_fd0
<
0
)
if
(
target_fd0
<
0
)
return
log_error_errno
(
-
errno
,
errno
,
"Failed to open
\"
.lxc/cgroup.procs
\"
"
);
return
log_error_errno
(
-
errno
,
errno
,
"Failed to open
\"
.lxc/cgroup.procs
\"
"
);
target_fds
[
0
]
=
target_fd0
;
target_fds
[
0
]
=
target_fd0
;
target_fd1
=
open
at
(
unified_fd
,
"cgroup.procs"
,
O_WRONLY
|
O_CLOEXEC
|
O_NOFOLLOW
);
target_fd1
=
open
_at
(
unified_fd
,
"cgroup.procs"
,
PROTECT_OPEN_W
,
PROTECT_LOOKUP_BENEATH
,
0
);
if
(
target_fd1
<
0
)
if
(
target_fd1
<
0
)
return
log_error_errno
(
-
errno
,
errno
,
"Failed to open
\"
.lxc/cgroup.procs
\"
"
);
return
log_error_errno
(
-
errno
,
errno
,
"Failed to open
\"
.lxc/cgroup.procs
\"
"
);
target_fds
[
1
]
=
target_fd1
;
target_fds
[
1
]
=
target_fd1
;
...
...
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