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
4226b2e5
Unverified
Commit
4226b2e5
authored
Sep 03, 2020
by
Christian Brauner
Committed by
GitHub
Sep 03, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3532 from alliedtelesis/fix_lxc_attach_crash
avoid a NULL pointer dereference in lxc-attach
parents
9cc837ef
c3941f32
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
2 deletions
+12
-2
attach.c
src/lxc/attach.c
+1
-2
terminal.c
src/lxc/terminal.c
+10
-0
terminal.h
src/lxc/terminal.h
+1
-0
No files found.
src/lxc/attach.c
View file @
4226b2e5
...
...
@@ -1384,8 +1384,7 @@ int lxc_attach(struct lxc_container *container, lxc_attach_exec_t exec_function,
if
(
pid
==
0
)
{
if
(
options
->
attach_flags
&
LXC_ATTACH_TERMINAL
)
{
ret
=
pthread_sigmask
(
SIG_SETMASK
,
&
terminal
.
tty_state
->
oldmask
,
NULL
);
ret
=
lxc_terminal_signal_sigmask_safe_blocked
(
&
terminal
);
if
(
ret
<
0
)
{
SYSERROR
(
"Failed to reset signal mask"
);
_exit
(
EXIT_FAILURE
);
...
...
src/lxc/terminal.c
View file @
4226b2e5
...
...
@@ -147,6 +147,16 @@ struct lxc_terminal_state *lxc_terminal_signal_init(int srcfd, int dstfd)
return
move_ptr
(
ts
);
}
int
lxc_terminal_signal_sigmask_safe_blocked
(
struct
lxc_terminal
*
terminal
)
{
struct
lxc_terminal_state
*
state
=
terminal
->
tty_state
;
if
(
!
state
)
return
0
;
return
pthread_sigmask
(
SIG_SETMASK
,
&
state
->
oldmask
,
NULL
);
}
/**
* lxc_terminal_signal_fini: uninstall signal handler
*
...
...
src/lxc/terminal.h
View file @
4226b2e5
...
...
@@ -251,5 +251,6 @@ __hidden extern int lxc_terminal_prepare_login(int fd);
__hidden
extern
void
lxc_terminal_conf_free
(
struct
lxc_terminal
*
terminal
);
__hidden
extern
void
lxc_terminal_info_init
(
struct
lxc_terminal_info
*
terminal
);
__hidden
extern
void
lxc_terminal_init
(
struct
lxc_terminal
*
terminal
);
__hidden
extern
int
lxc_terminal_signal_sigmask_safe_blocked
(
struct
lxc_terminal
*
terminal
);
#endif
/* __LXC_TERMINAL_H */
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