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
7c583068
Commit
7c583068
authored
Mar 06, 2017
by
Christian Brauner
Committed by
GitHub
Mar 06, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1453 from hallyn/2017-03-06/seccomp
seccomp: set SCMP_FLTATR_ATL_TSKIP if available
parents
81e4574c
127c5293
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
1 deletion
+16
-1
seccomp.c
src/lxc/seccomp.c
+16
-1
No files found.
src/lxc/seccomp.c
View file @
7c583068
...
...
@@ -221,6 +221,11 @@ scmp_filter_ctx get_new_ctx(enum lxc_hostarch_t n_arch, uint32_t default_policy_
seccomp_release
(
ctx
);
return
NULL
;
}
#ifdef SCMP_FLTATR_ATL_TSKIP
if
(
seccomp_attr_set
(
ctx
,
SCMP_FLTATR_ATL_TSKIP
,
1
))
{
WARN
(
"Failed to turn on seccomp nop-skip, continuing"
);
}
#endif
ret
=
seccomp_arch_add
(
ctx
,
arch
);
if
(
ret
!=
0
)
{
ERROR
(
"Seccomp error %d (%s) adding arch: %d"
,
ret
,
...
...
@@ -396,6 +401,11 @@ static int parse_config_v2(FILE *f, char *line, struct lxc_conf *conf)
ERROR
(
"Failed to turn off n-new-privs."
);
return
-
1
;
}
#ifdef SCMP_FLTATR_ATL_TSKIP
if
(
seccomp_attr_set
(
conf
->
seccomp_ctx
,
SCMP_FLTATR_ATL_TSKIP
,
1
))
{
WARN
(
"Failed to turn on seccomp nop-skip, continuing"
);
}
#endif
}
while
(
fgets
(
line
,
1024
,
f
))
{
...
...
@@ -717,7 +727,7 @@ int lxc_read_seccomp_config(struct lxc_conf *conf)
return
-
1
;
}
/* turn of no-new-privs. We don't want it in lxc, and it breaks
/* turn of
f
no-new-privs. We don't want it in lxc, and it breaks
* with apparmor */
#if HAVE_SCMP_FILTER_CTX
check_seccomp_attr_set
=
seccomp_attr_set
(
conf
->
seccomp_ctx
,
SCMP_FLTATR_CTL_NNP
,
0
);
...
...
@@ -728,6 +738,11 @@ int lxc_read_seccomp_config(struct lxc_conf *conf)
ERROR
(
"Failed to turn off n-new-privs."
);
return
-
1
;
}
#ifdef SCMP_FLTATR_ATL_TSKIP
if
(
seccomp_attr_set
(
conf
->
seccomp_ctx
,
SCMP_FLTATR_ATL_TSKIP
,
1
))
{
WARN
(
"Failed to turn on seccomp nop-skip, continuing"
);
}
#endif
f
=
fopen
(
conf
->
seccomp
,
"r"
);
if
(
!
f
)
{
...
...
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