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
52315758
Unverified
Commit
52315758
authored
Feb 02, 2021
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
attach: explicitly close seccomp notifier fd
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
fd910d78
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
1 deletion
+13
-1
attach.c
src/lxc/attach.c
+1
-0
lxcseccomp.h
src/lxc/lxcseccomp.h
+12
-0
seccomp.c
src/lxc/seccomp.c
+0
-1
No files found.
src/lxc/attach.c
View file @
52315758
...
@@ -1208,6 +1208,7 @@ __noreturn static void do_attach(struct attach_payload *ap)
...
@@ -1208,6 +1208,7 @@ __noreturn static void do_attach(struct attach_payload *ap)
ret
=
lxc_seccomp_send_notifier_fd
(
&
conf
->
seccomp
,
ap
->
ipc_socket
);
ret
=
lxc_seccomp_send_notifier_fd
(
&
conf
->
seccomp
,
ap
->
ipc_socket
);
if
(
ret
<
0
)
if
(
ret
<
0
)
goto
on_error
;
goto
on_error
;
lxc_seccomp_close_notifier_fd
(
&
conf
->
seccomp
);
}
}
if
(
!
lxc_switch_uid_gid
(
ctx
->
target_ns_uid
,
ctx
->
target_ns_gid
))
if
(
!
lxc_switch_uid_gid
(
ctx
->
target_ns_uid
,
ctx
->
target_ns_gid
))
...
...
src/lxc/lxcseccomp.h
View file @
52315758
...
@@ -91,6 +91,14 @@ __hidden extern int lxc_seccomp_send_notifier_fd(struct lxc_seccomp *seccomp, in
...
@@ -91,6 +91,14 @@ __hidden extern int lxc_seccomp_send_notifier_fd(struct lxc_seccomp *seccomp, in
__hidden
extern
int
lxc_seccomp_recv_notifier_fd
(
struct
lxc_seccomp
*
seccomp
,
int
socket_fd
);
__hidden
extern
int
lxc_seccomp_recv_notifier_fd
(
struct
lxc_seccomp
*
seccomp
,
int
socket_fd
);
__hidden
extern
int
lxc_seccomp_add_notifier
(
const
char
*
name
,
const
char
*
lxcpath
,
__hidden
extern
int
lxc_seccomp_add_notifier
(
const
char
*
name
,
const
char
*
lxcpath
,
struct
lxc_seccomp
*
seccomp
);
struct
lxc_seccomp
*
seccomp
);
static
inline
void
lxc_seccomp_close_notifier_fd
(
struct
lxc_seccomp
*
seccomp
)
{
#if HAVE_DECL_SECCOMP_NOTIFY_FD
if
(
seccomp
->
notifier
.
wants_supervision
)
close_prot_errno_disarm
(
seccomp
->
notifier
.
notify_fd
);
#endif
}
static
inline
int
lxc_seccomp_get_notify_fd
(
struct
lxc_seccomp
*
seccomp
)
static
inline
int
lxc_seccomp_get_notify_fd
(
struct
lxc_seccomp
*
seccomp
)
{
{
#if HAVE_DECL_SECCOMP_NOTIFY_FD
#if HAVE_DECL_SECCOMP_NOTIFY_FD
...
@@ -162,5 +170,9 @@ static inline int lxc_seccomp_get_notify_fd(struct lxc_seccomp *seccomp)
...
@@ -162,5 +170,9 @@ static inline int lxc_seccomp_get_notify_fd(struct lxc_seccomp *seccomp)
return
-
EBADF
;
return
-
EBADF
;
}
}
static
inline
void
lxc_seccomp_close_notifier_fd
(
struct
lxc_seccomp
*
seccomp
)
{
}
#endif
/* HAVE_SECCOMP */
#endif
/* HAVE_SECCOMP */
#endif
/* __LXC_LXCSECCOMP_H */
#endif
/* __LXC_LXCSECCOMP_H */
src/lxc/seccomp.c
View file @
52315758
...
@@ -1638,7 +1638,6 @@ int lxc_seccomp_recv_notifier_fd(struct lxc_seccomp *seccomp, int socket_fd)
...
@@ -1638,7 +1638,6 @@ int lxc_seccomp_recv_notifier_fd(struct lxc_seccomp *seccomp, int socket_fd)
int
lxc_seccomp_add_notifier
(
const
char
*
name
,
const
char
*
lxcpath
,
int
lxc_seccomp_add_notifier
(
const
char
*
name
,
const
char
*
lxcpath
,
struct
lxc_seccomp
*
seccomp
)
struct
lxc_seccomp
*
seccomp
)
{
{
#if HAVE_DECL_SECCOMP_NOTIFY_FD
#if HAVE_DECL_SECCOMP_NOTIFY_FD
if
(
seccomp
->
notifier
.
wants_supervision
)
{
if
(
seccomp
->
notifier
.
wants_supervision
)
{
int
ret
;
int
ret
;
...
...
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