Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Simon Ruderich
passt-mac
Commits
bd943b31
Commit
bd943b31
authored
Jul 20, 2016
by
Lukas Braun
Committed by
Simon Ruderich
Aug 29, 2016
Browse files
slsm: try to handle MNT_INTERNAL files
parent
3353b316
Changes
1
Hide whitespace changes
Inline
Side-by-side
security/slsm/path.c
View file @
bd943b31
...
...
@@ -45,5 +45,18 @@ char *passt_get_path(const struct path *path, char **buf) {
*
buf
=
kzalloc
((
size_t
)
buflen
,
GFP_KERNEL
);
if
(
!*
buf
)
return
ERR_PTR
(
-
ENOMEM
);
/* FDs that don't correspond to an actual file, e.g. pipes via /dev/fd,
* aren't resolved to a path by d_absolute_path.
* I *think* these can only be files already opened anyway */
if
(
path
->
mnt
->
mnt_flags
&
MNT_INTERNAL
)
{
/* cases we saw of internal FSs were always IS_ROOT, treating them like
* / seems sensible enough */
if
(
IS_ROOT
(
path
->
dentry
))
{
*
buf
[
0
]
=
'/'
;
return
*
buf
;
}
/* no idea what this is */
return
ERR_PTR
(
-
EINVAL
);
}
return
d_absolute_path
(
path
,
*
buf
,
buflen
);
}
Write
Preview
Supports
Markdown
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