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
29a01c37
Unverified
Commit
29a01c37
authored
Jul 03, 2020
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cgroups: update terminology
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
ffa68840
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
10 deletions
+10
-10
cgfsng.c
src/lxc/cgroups/cgfsng.c
+2
-2
cgroup2_devices.c
src/lxc/cgroups/cgroup2_devices.c
+4
-4
conf.h
src/lxc/conf.h
+4
-4
No files found.
src/lxc/cgroups/cgfsng.c
View file @
29a01c37
...
...
@@ -2562,8 +2562,8 @@ static int device_cgroup_rule_parse(struct device_item *device, const char *key,
device
->
major
=
-
1
;
device
->
minor
=
-
1
;
device
->
global_rule
=
device
->
allow
?
LXC_BPF_DEVICE_CGROUP_
BLACK
LIST
:
LXC_BPF_DEVICE_CGROUP_
WHITE
LIST
;
?
LXC_BPF_DEVICE_CGROUP_
DENY
LIST
:
LXC_BPF_DEVICE_CGROUP_
ALLOW
LIST
;
device
->
allow
=
-
1
;
return
0
;
}
...
...
src/lxc/cgroups/cgroup2_devices.c
View file @
29a01c37
...
...
@@ -176,7 +176,7 @@ struct bpf_program *bpf_program_new(uint32_t prog_type)
/*
* By default a whitelist is used unless the user tells us otherwise.
*/
prog
->
device_list_type
=
LXC_BPF_DEVICE_CGROUP_
WHITE
LIST
;
prog
->
device_list_type
=
LXC_BPF_DEVICE_CGROUP_
ALLOW
LIST
;
return
move_ptr
(
prog
);
}
...
...
@@ -298,7 +298,7 @@ int bpf_program_finalize(struct bpf_program *prog)
return
ret_set_errno
(
-
1
,
EINVAL
);
TRACE
(
"Implementing %s bpf device cgroup program"
,
prog
->
device_list_type
==
LXC_BPF_DEVICE_CGROUP_
BLACK
LIST
prog
->
device_list_type
==
LXC_BPF_DEVICE_CGROUP_
DENY
LIST
?
"blacklist"
:
"whitelist"
);
...
...
@@ -450,10 +450,10 @@ int bpf_list_add_device(struct lxc_conf *conf, struct device_item *device)
if
(
cur
->
global_rule
>
LXC_BPF_DEVICE_CGROUP_LOCAL_RULE
&&
device
->
global_rule
>
LXC_BPF_DEVICE_CGROUP_LOCAL_RULE
)
{
TRACE
(
"Switched from %s to %s"
,
cur
->
global_rule
==
LXC_BPF_DEVICE_CGROUP_
WHITE
LIST
cur
->
global_rule
==
LXC_BPF_DEVICE_CGROUP_
ALLOW
LIST
?
"whitelist"
:
"blacklist"
,
device
->
global_rule
==
LXC_BPF_DEVICE_CGROUP_
WHITE
LIST
device
->
global_rule
==
LXC_BPF_DEVICE_CGROUP_
ALLOW
LIST
?
"whitelist"
:
"blacklist"
);
cur
->
global_rule
=
device
->
global_rule
;
...
...
src/lxc/conf.h
View file @
29a01c37
...
...
@@ -215,8 +215,8 @@ struct lxc_state_client {
enum
{
LXC_BPF_DEVICE_CGROUP_LOCAL_RULE
=
-
1
,
LXC_BPF_DEVICE_CGROUP_
WHITE
LIST
=
0
,
LXC_BPF_DEVICE_CGROUP_
BLACK
LIST
=
1
,
LXC_BPF_DEVICE_CGROUP_
ALLOW
LIST
=
0
,
LXC_BPF_DEVICE_CGROUP_
DENY
LIST
=
1
,
};
struct
device_item
{
...
...
@@ -227,8 +227,8 @@ struct device_item {
int
allow
;
/*
* LXC_BPF_DEVICE_CGROUP_LOCAL_RULE -> no global rule
* LXC_BPF_DEVICE_CGROUP_
WHITELIST -> white
list (deny all)
* LXC_BPF_DEVICE_CGROUP_
BLACKLIST -> black
list (allow all)
* LXC_BPF_DEVICE_CGROUP_
ALLOWLIST -> allow
list (deny all)
* LXC_BPF_DEVICE_CGROUP_
DENYLIST -> deny
list (allow all)
*/
int
global_rule
;
};
...
...
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