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
0e83121c
Unverified
Commit
0e83121c
authored
Mar 15, 2018
by
Christian Brauner
Committed by
GitHub
Mar 15, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2221 from tych0/fix-use-after-free
fix handler use-after-free
parents
d61bda5f
a3b4f3d6
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
13 additions
and
11 deletions
+13
-11
execute.c
src/lxc/execute.c
+2
-2
lxc.h
src/lxc/lxc.h
+2
-2
lxccontainer.c
src/lxc/lxccontainer.c
+2
-3
start.c
src/lxc/start.c
+5
-3
start.h
src/lxc/start.h
+2
-1
No files found.
src/lxc/execute.c
View file @
0e83121c
...
...
@@ -120,7 +120,7 @@ static struct lxc_operations execute_start_ops = {
int
lxc_execute
(
const
char
*
name
,
char
*
const
argv
[],
int
quiet
,
struct
lxc_handler
*
handler
,
const
char
*
lxcpath
,
bool
backgrounded
)
bool
backgrounded
,
int
*
error_num
)
{
struct
execute_args
args
=
{.
argv
=
argv
,
.
quiet
=
quiet
};
...
...
@@ -129,5 +129,5 @@ int lxc_execute(const char *name, char *const argv[], int quiet,
handler
->
conf
->
is_execute
=
1
;
return
__lxc_start
(
name
,
handler
,
&
execute_start_ops
,
&
args
,
lxcpath
,
backgrounded
);
backgrounded
,
error_num
);
}
src/lxc/lxc.h
View file @
0e83121c
...
...
@@ -54,7 +54,7 @@ struct lxc_handler;
*/
extern
int
lxc_start
(
const
char
*
name
,
char
*
const
argv
[],
struct
lxc_handler
*
handler
,
const
char
*
lxcpath
,
bool
backgrounded
);
bool
backgrounded
,
int
*
error_num
);
/*
* Start the specified command inside an application container
...
...
@@ -67,7 +67,7 @@ extern int lxc_start(const char *name, char *const argv[],
*/
extern
int
lxc_execute
(
const
char
*
name
,
char
*
const
argv
[],
int
quiet
,
struct
lxc_handler
*
handler
,
const
char
*
lxcpath
,
bool
backgrounded
);
bool
backgrounded
,
int
*
error_num
);
/*
* Close the fd associated with the monitoring
...
...
src/lxc/lxccontainer.c
View file @
0e83121c
...
...
@@ -1066,10 +1066,9 @@ reboot:
}
if
(
useinit
)
ret
=
lxc_execute
(
c
->
name
,
argv
,
1
,
handler
,
c
->
config_path
,
daemonize
);
ret
=
lxc_execute
(
c
->
name
,
argv
,
1
,
handler
,
c
->
config_path
,
daemonize
,
&
c
->
error_num
);
else
ret
=
lxc_start
(
c
->
name
,
argv
,
handler
,
c
->
config_path
,
daemonize
);
c
->
error_num
=
handler
->
exit_status
;
ret
=
lxc_start
(
c
->
name
,
argv
,
handler
,
c
->
config_path
,
daemonize
,
&
c
->
error_num
);
if
(
conf
->
reboot
==
1
)
{
INFO
(
"Container requested reboot"
);
...
...
src/lxc/start.c
View file @
0e83121c
...
...
@@ -1824,7 +1824,7 @@ out_abort:
int
__lxc_start
(
const
char
*
name
,
struct
lxc_handler
*
handler
,
struct
lxc_operations
*
ops
,
void
*
data
,
const
char
*
lxcpath
,
bool
backgrounded
)
bool
backgrounded
,
int
*
error_num
)
{
int
ret
,
status
;
struct
lxc_conf
*
conf
=
handler
->
conf
;
...
...
@@ -1920,6 +1920,8 @@ int __lxc_start(const char *name, struct lxc_handler *handler,
lxc_monitor_send_exit_code
(
name
,
status
,
handler
->
lxcpath
);
lxc_error_set_and_log
(
handler
->
pid
,
status
);
if
(
error_num
)
*
error_num
=
handler
->
exit_status
;
out_fini:
lxc_delete_network
(
handler
);
...
...
@@ -1965,13 +1967,13 @@ static struct lxc_operations start_ops = {
};
int
lxc_start
(
const
char
*
name
,
char
*
const
argv
[],
struct
lxc_handler
*
handler
,
const
char
*
lxcpath
,
bool
backgrounded
)
const
char
*
lxcpath
,
bool
backgrounded
,
int
*
error_num
)
{
struct
start_args
start_arg
=
{
.
argv
=
argv
,
};
return
__lxc_start
(
name
,
handler
,
&
start_ops
,
&
start_arg
,
lxcpath
,
backgrounded
);
return
__lxc_start
(
name
,
handler
,
&
start_ops
,
&
start_arg
,
lxcpath
,
backgrounded
,
error_num
);
}
static
void
lxc_destroy_container_on_signal
(
struct
lxc_handler
*
handler
,
...
...
src/lxc/start.h
View file @
0e83121c
...
...
@@ -165,7 +165,8 @@ extern void lxc_fini(const char *name, struct lxc_handler *handler);
extern
int
lxc_check_inherited
(
struct
lxc_conf
*
conf
,
bool
closeall
,
int
*
fds_to_ignore
,
size_t
len_fds
);
extern
int
__lxc_start
(
const
char
*
,
struct
lxc_handler
*
,
struct
lxc_operations
*
,
void
*
,
const
char
*
,
bool
);
struct
lxc_operations
*
,
void
*
,
const
char
*
,
bool
,
int
*
);
extern
int
resolve_clone_flags
(
struct
lxc_handler
*
handler
);
...
...
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