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
6fc8a0dd
Unverified
Commit
6fc8a0dd
authored
Feb 01, 2021
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lsm: harden read_file_at()
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
46bf13b7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
apparmor.c
src/lxc/lsm/apparmor.c
+1
-1
selinux.c
src/lxc/lsm/selinux.c
+1
-1
No files found.
src/lxc/lsm/apparmor.c
View file @
6fc8a0dd
...
@@ -447,7 +447,7 @@ static char *apparmor_process_label_get_at(struct lsm_ops *ops, int fd_pid)
...
@@ -447,7 +447,7 @@ static char *apparmor_process_label_get_at(struct lsm_ops *ops, int fd_pid)
__do_free
char
*
label
=
NULL
;
__do_free
char
*
label
=
NULL
;
size_t
len
;
size_t
len
;
label
=
read_file_at
(
fd_pid
,
"attr/current"
,
PROTECT_OPEN
,
0
);
label
=
read_file_at
(
fd_pid
,
"attr/current"
,
PROTECT_OPEN
,
PROTECT_LOOKUP_BENEATH
);
if
(
!
label
)
if
(
!
label
)
return
log_error_errno
(
NULL
,
errno
,
"Failed to get AppArmor context"
);
return
log_error_errno
(
NULL
,
errno
,
"Failed to get AppArmor context"
);
...
...
src/lxc/lsm/selinux.c
View file @
6fc8a0dd
...
@@ -57,7 +57,7 @@ static char *selinux_process_label_get_at(struct lsm_ops *ops, int fd_pid)
...
@@ -57,7 +57,7 @@ static char *selinux_process_label_get_at(struct lsm_ops *ops, int fd_pid)
__do_free
char
*
label
=
NULL
;
__do_free
char
*
label
=
NULL
;
size_t
len
;
size_t
len
;
label
=
read_file_at
(
fd_pid
,
"attr/current"
,
PROTECT_OPEN
,
0
);
label
=
read_file_at
(
fd_pid
,
"attr/current"
,
PROTECT_OPEN
,
PROTECT_LOOKUP_BENEATH
);
if
(
!
label
)
if
(
!
label
)
return
log_error_errno
(
NULL
,
errno
,
"Failed to get SELinux context"
);
return
log_error_errno
(
NULL
,
errno
,
"Failed to get SELinux context"
);
...
...
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