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
2be31fed
Unverified
Commit
2be31fed
authored
Feb 24, 2021
by
Stéphane Graber
Committed by
GitHub
Feb 24, 2021
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3695 from brauner/2021-02-24/fixes_3
commands: array hardening
parents
2ed90529
3d971319
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
6 deletions
+12
-6
commands.c
src/lxc/commands.c
+4
-4
commands.h
src/lxc/commands.h
+4
-2
compiler.h
src/lxc/compiler.h
+4
-0
No files found.
src/lxc/commands.c
View file @
2be31fed
...
...
@@ -376,9 +376,9 @@ static inline int rsp_one_fd(int fd, int fd_send, struct lxc_cmd_rsp *rsp)
return
LXC_CMD_REAP_CLIENT_FD
;
}
static
inline
int
rsp_many_fds
(
int
fd
,
__u32
fds_len
,
const
__s32
fds
[
KERNEL_SCM_MAX_FD
],
struct
lxc_cmd_rsp
*
rsp
)
__access_r
(
3
,
2
)
static
int
rsp_many_fds
(
int
fd
,
__u32
fds_len
,
const
__s32
fds
[
static
2
],
struct
lxc_cmd_rsp
*
rsp
)
{
ssize_t
ret
;
...
...
@@ -1280,7 +1280,7 @@ static int lxc_cmd_get_lxcpath_callback(int fd, struct lxc_cmd_req *req,
}
int
lxc_cmd_add_state_client
(
const
char
*
name
,
const
char
*
lxcpath
,
lxc_state_t
states
[
MAX_STATE
],
lxc_state_t
states
[
static
MAX_STATE
],
int
*
state_client_fd
)
{
__do_close
int
clientfd
=
-
EBADF
;
...
...
src/lxc/commands.h
View file @
2be31fed
...
...
@@ -112,8 +112,10 @@ __hidden extern int lxc_cmd_stop(const char *name, const char *lxcpath);
* via socket fd
* < MAX_STATE current container state
*/
__hidden
extern
int
lxc_cmd_add_state_client
(
const
char
*
name
,
const
char
*
lxcpath
,
lxc_state_t
states
[
MAX_STATE
],
int
*
state_client_fd
);
__hidden
__access_r_nosize
(
3
)
extern
int
lxc_cmd_add_state_client
(
const
char
*
name
,
const
char
*
lxcpath
,
lxc_state_t
states
[
static
MAX_STATE
],
int
*
state_client_fd
);
__hidden
extern
int
lxc_cmd_serve_state_clients
(
const
char
*
name
,
const
char
*
lxcpath
,
lxc_state_t
state
);
...
...
src/lxc/compiler.h
View file @
2be31fed
...
...
@@ -60,6 +60,7 @@
#define __cgfsng_ops
/* access attribute */
#define __access_r_nosize(x)
#define __access_r(x, y)
#define __access_w(x, y)
#define __access_rw(x, y)
...
...
@@ -69,6 +70,9 @@
#undef __access_r
#define __access_r(x, y) __attribute__((access(read_only, x, y)))
#undef __access_r_nosize
#define __access_r_nosize(x) __attribute__((access(read_only, x)))
#undef __access_w
#define __access_w(x, y) __attribute__((access(write_only, x, y)))
...
...
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