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
a55e2ad1
Unverified
Commit
a55e2ad1
authored
Apr 13, 2018
by
Stéphane Graber
Committed by
GitHub
Apr 13, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2275 from brauner/2018-04-13/improve_seccomp
seccomp: handle all errors
parents
2c80e9cf
adfee3a8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
5 deletions
+19
-5
seccomp.c
src/lxc/seccomp.c
+19
-5
No files found.
src/lxc/seccomp.c
View file @
a55e2ad1
...
@@ -371,20 +371,34 @@ scmp_filter_ctx get_new_ctx(enum lxc_hostarch_t n_arch, uint32_t default_policy_
...
@@ -371,20 +371,34 @@ scmp_filter_ctx get_new_ctx(enum lxc_hostarch_t n_arch, uint32_t default_policy_
}
}
#endif
#endif
if
(
seccomp_arch_exist
(
ctx
,
arch
)
==
-
EEXIST
)
{
ret
=
seccomp_arch_exist
(
ctx
,
arch
);
if
(
ret
<
0
)
{
if
(
ret
!=
-
EEXIST
)
{
ERROR
(
"%s - Failed to determine whether arch %d is "
"already present in the main seccomp context"
,
strerror
(
-
ret
),
(
int
)
n_arch
);
seccomp_release
(
ctx
);
return
NULL
;
}
ret
=
seccomp_arch_add
(
ctx
,
arch
);
ret
=
seccomp_arch_add
(
ctx
,
arch
);
if
(
ret
!=
0
)
{
if
(
ret
!=
0
)
{
ERROR
(
"
Seccomp error %d (%s) adding arch: %d"
,
ret
,
ERROR
(
"
%s - Failed to add arch %d to main seccomp context"
,
strerror
(
-
ret
),
(
int
)
n_arch
);
strerror
(
-
ret
),
(
int
)
n_arch
);
seccomp_release
(
ctx
);
seccomp_release
(
ctx
);
return
NULL
;
return
NULL
;
}
}
TRACE
(
"Added arch %d to main seccomp context"
,
(
int
)
n_arch
);
if
(
seccomp_arch_remove
(
ctx
,
SCMP_ARCH_NATIVE
)
!=
0
)
{
ret
=
seccomp_arch_remove
(
ctx
,
SCMP_ARCH_NATIVE
);
ERROR
(
"Seccomp error removing native arch"
);
if
(
ret
!=
0
)
{
ERROR
(
"Failed to remove native arch from main seccomp context"
);
seccomp_release
(
ctx
);
seccomp_release
(
ctx
);
return
NULL
;
return
NULL
;
}
}
TRACE
(
"Removed native arch from main seccomp context"
);
}
else
{
TRACE
(
"Arch %d already present in main seccomp context"
,
(
int
)
n_arch
);
}
}
return
ctx
;
return
ctx
;
...
...
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