Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
passt-mac
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Simon Ruderich
passt-mac
Commits
06305643
Commit
06305643
authored
Apr 11, 2016
by
Simon Ruderich
Browse files
Options
Downloads
Patches
Plain Diff
slsm: add casts
parent
1f12bf86
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
security/slsm/lsm.c
+4
-4
4 additions, 4 deletions
security/slsm/lsm.c
security/slsm/passtfs.c
+2
-2
2 additions, 2 deletions
security/slsm/passtfs.c
security/slsm/tree.c
+1
-1
1 addition, 1 deletion
security/slsm/tree.c
with
7 additions
and
7 deletions
security/slsm/lsm.c
+
4
−
4
View file @
06305643
...
@@ -104,7 +104,7 @@ static int passt_bprm_set_creds(struct linux_binprm *bprm) {
...
@@ -104,7 +104,7 @@ static int passt_bprm_set_creds(struct linux_binprm *bprm) {
/* buffer freed below, name is pointer into buffer */
/* buffer freed below, name is pointer into buffer */
name
=
passt_get_path
(
&
bprm
->
file
->
f_path
,
&
buffer
);
name
=
passt_get_path
(
&
bprm
->
file
->
f_path
,
&
buffer
);
if
(
IS_ERR
(
name
))
{
if
(
IS_ERR
(
name
))
{
error
=
PTR_ERR
(
name
);
error
=
(
int
)
PTR_ERR
(
name
);
name
=
bprm
->
filename
;
name
=
bprm
->
filename
;
goto
audit
;
goto
audit
;
}
}
...
@@ -175,7 +175,7 @@ static int passt_path_common(const struct path *path, const struct cred *cred,
...
@@ -175,7 +175,7 @@ static int passt_path_common(const struct path *path, const struct cred *cred,
name
=
passt_get_path
(
path
,
&
buffer
);
name
=
passt_get_path
(
path
,
&
buffer
);
if
(
IS_ERR
(
name
))
{
if
(
IS_ERR
(
name
))
{
error
=
PTR_ERR
(
name
);
error
=
(
int
)
PTR_ERR
(
name
);
goto
cleanup
;
goto
cleanup
;
}
}
...
@@ -223,14 +223,14 @@ static int passt_path_link(struct dentry *old_dentry, struct path *new_dir,
...
@@ -223,14 +223,14 @@ static int passt_path_link(struct dentry *old_dentry, struct path *new_dir,
target_name
=
passt_get_path
(
&
target
,
&
target_buffer
);
target_name
=
passt_get_path
(
&
target
,
&
target_buffer
);
if
(
IS_ERR
(
target_name
))
{
if
(
IS_ERR
(
target_name
))
{
ret
=
PTR_ERR
(
target_name
);
ret
=
(
int
)
PTR_ERR
(
target_name
);
goto
cleanup
;
goto
cleanup
;
}
}
perms
=
slsm_query_perms
(
target_name
,
pt
->
label
);
perms
=
slsm_query_perms
(
target_name
,
pt
->
label
);
link_name
=
passt_get_path
(
&
link
,
&
link_buffer
);
link_name
=
passt_get_path
(
&
link
,
&
link_buffer
);
if
(
IS_ERR
(
link_name
))
{
if
(
IS_ERR
(
link_name
))
{
ret
=
PTR_ERR
(
link_name
);
ret
=
(
int
)
PTR_ERR
(
link_name
);
goto
cleanup
;
goto
cleanup
;
}
}
would_get
=
slsm_query_perms
(
link_name
,
pt
->
label
);
would_get
=
slsm_query_perms
(
link_name
,
pt
->
label
);
...
...
This diff is collapsed.
Click to expand it.
security/slsm/passtfs.c
+
2
−
2
View file @
06305643
...
@@ -136,7 +136,7 @@ static int __init create_passtfs(void)
...
@@ -136,7 +136,7 @@ static int __init create_passtfs(void)
passtfs_dir
=
securityfs_create_dir
(
"slsm"
,
NULL
);
passtfs_dir
=
securityfs_create_dir
(
"slsm"
,
NULL
);
if
(
IS_ERR
(
passtfs_dir
))
{
if
(
IS_ERR
(
passtfs_dir
))
{
printk
(
KERN_ERR
"slsm: unable to create securityfs dir
\n
"
);
printk
(
KERN_ERR
"slsm: unable to create securityfs dir
\n
"
);
return
PTR_ERR
(
passtfs_dir
);
return
(
int
)
PTR_ERR
(
passtfs_dir
);
}
}
passtfs_profiles
=
securityfs_create_file
(
"profiles"
,
0600
,
passtfs_dir
,
passtfs_profiles
=
securityfs_create_file
(
"profiles"
,
0600
,
passtfs_dir
,
...
@@ -144,7 +144,7 @@ static int __init create_passtfs(void)
...
@@ -144,7 +144,7 @@ static int __init create_passtfs(void)
if
(
IS_ERR
(
passtfs_profiles
))
{
if
(
IS_ERR
(
passtfs_profiles
))
{
securityfs_remove
(
passtfs_dir
);
securityfs_remove
(
passtfs_dir
);
printk
(
KERN_ERR
"slsm: unable to create securityfs file
\n
"
);
printk
(
KERN_ERR
"slsm: unable to create securityfs file
\n
"
);
return
PTR_ERR
(
passtfs_profiles
);
return
(
int
)
PTR_ERR
(
passtfs_profiles
);
}
}
return
0
;
return
0
;
...
...
This diff is collapsed.
Click to expand it.
security/slsm/tree.c
+
1
−
1
View file @
06305643
...
@@ -57,7 +57,7 @@ static const char *next_path_component(const char **path, size_t *length) {
...
@@ -57,7 +57,7 @@ static const char *next_path_component(const char **path, size_t *length) {
const
char
*
start
=
*
path
;
const
char
*
start
=
*
path
;
const
char
*
next
=
strchr
(
*
path
,
'/'
);
const
char
*
next
=
strchr
(
*
path
,
'/'
);
if
(
next
)
{
if
(
next
)
{
*
length
=
next
-
start
;
*
length
=
(
size_t
)(
next
-
start
)
;
next
++
;
/* skip '/' */
next
++
;
/* skip '/' */
}
else
{
}
else
{
*
length
=
strlen
(
start
);
*
length
=
strlen
(
start
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment