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
0954f6ce
Unverified
Commit
0954f6ce
authored
Feb 17, 2021
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cgroups: prevent NULL pointer deref
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
8f45c49b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
cgfsng.c
src/lxc/cgroups/cgfsng.c
+8
-5
No files found.
src/lxc/cgroups/cgfsng.c
View file @
0954f6ce
...
@@ -3212,15 +3212,17 @@ static bool __cgfsng_delegate_controllers(struct cgroup_ops *ops, const char *cg
...
@@ -3212,15 +3212,17 @@ static bool __cgfsng_delegate_controllers(struct cgroup_ops *ops, const char *cg
{
{
__do_close
int
dfd_final
=
-
EBADF
;
__do_close
int
dfd_final
=
-
EBADF
;
__do_free
char
*
add_controllers
=
NULL
,
*
copy
=
NULL
;
__do_free
char
*
add_controllers
=
NULL
,
*
copy
=
NULL
;
struct
hierarchy
*
unified
=
ops
->
unified
;
int
dfd_cur
=
unified
->
dfd_base
;
int
ret
;
size_t
full_len
=
0
;
size_t
full_len
=
0
;
struct
hierarchy
*
unified
;
int
dfd_cur
,
ret
;
char
*
cur
;
char
*
cur
;
char
**
it
;
char
**
it
;
if
(
!
ops
->
hierarchies
||
!
pure_unified_layout
(
ops
)
||
if
(
!
ops
->
hierarchies
||
!
pure_unified_layout
(
ops
))
!
unified
->
controllers
[
0
])
return
true
;
unified
=
ops
->
unified
;
if
(
!
unified
->
controllers
[
0
])
return
true
;
return
true
;
/* For now we simply enable all controllers that we have detected by
/* For now we simply enable all controllers that we have detected by
...
@@ -3252,6 +3254,7 @@ static bool __cgfsng_delegate_controllers(struct cgroup_ops *ops, const char *cg
...
@@ -3252,6 +3254,7 @@ static bool __cgfsng_delegate_controllers(struct cgroup_ops *ops, const char *cg
* intentional because of the cgroup2 delegation model. It enforces
* intentional because of the cgroup2 delegation model. It enforces
* that leaf cgroups don't have any controllers enabled for delegation.
* that leaf cgroups don't have any controllers enabled for delegation.
*/
*/
dfd_cur
=
unified
->
dfd_base
;
lxc_iterate_parts
(
cur
,
copy
,
"/"
)
{
lxc_iterate_parts
(
cur
,
copy
,
"/"
)
{
/*
/*
* Even though we vetted the paths when we parsed the config
* Even though we vetted the paths when we parsed the config
...
...
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