Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
linux
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Martyn Welch
linux
Commits
aa98b942
Commit
aa98b942
authored
9 years ago
by
James Morris
Browse files
Options
Downloads
Plain Diff
Merge branch 'smack-for-4.5' of
https://github.com/cschaufler/smack-next
into next
parents
37babe4e
81bd0d56
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
security/smack/smack_lsm.c
+23
-1
23 additions, 1 deletion
security/smack/smack_lsm.c
with
23 additions
and
1 deletion
security/smack/smack_lsm.c
+
23
−
1
View file @
aa98b942
...
@@ -1860,12 +1860,34 @@ static int smack_file_receive(struct file *file)
...
@@ -1860,12 +1860,34 @@ static int smack_file_receive(struct file *file)
int
may
=
0
;
int
may
=
0
;
struct
smk_audit_info
ad
;
struct
smk_audit_info
ad
;
struct
inode
*
inode
=
file_inode
(
file
);
struct
inode
*
inode
=
file_inode
(
file
);
struct
socket
*
sock
;
struct
task_smack
*
tsp
;
struct
socket_smack
*
ssp
;
if
(
unlikely
(
IS_PRIVATE
(
inode
)))
if
(
unlikely
(
IS_PRIVATE
(
inode
)))
return
0
;
return
0
;
smk_ad_init
(
&
ad
,
__func__
,
LSM_AUDIT_DATA_PATH
);
smk_ad_init
(
&
ad
,
__func__
,
LSM_AUDIT_DATA_PATH
);
smk_ad_setfield_u_fs_path
(
&
ad
,
file
->
f_path
);
smk_ad_setfield_u_fs_path
(
&
ad
,
file
->
f_path
);
if
(
S_ISSOCK
(
inode
->
i_mode
))
{
sock
=
SOCKET_I
(
inode
);
ssp
=
sock
->
sk
->
sk_security
;
tsp
=
current_security
();
/*
* If the receiving process can't write to the
* passed socket or if the passed socket can't
* write to the receiving process don't accept
* the passed socket.
*/
rc
=
smk_access
(
tsp
->
smk_task
,
ssp
->
smk_out
,
MAY_WRITE
,
&
ad
);
rc
=
smk_bu_file
(
file
,
may
,
rc
);
if
(
rc
<
0
)
return
rc
;
rc
=
smk_access
(
ssp
->
smk_in
,
tsp
->
smk_task
,
MAY_WRITE
,
&
ad
);
rc
=
smk_bu_file
(
file
,
may
,
rc
);
return
rc
;
}
/*
/*
* This code relies on bitmasks.
* This code relies on bitmasks.
*/
*/
...
@@ -3758,7 +3780,7 @@ static int smack_socket_sendmsg(struct socket *sock, struct msghdr *msg,
...
@@ -3758,7 +3780,7 @@ static int smack_socket_sendmsg(struct socket *sock, struct msghdr *msg,
if
(
sip
==
NULL
)
if
(
sip
==
NULL
)
return
0
;
return
0
;
switch
(
s
ip
->
sin
_family
)
{
switch
(
s
ock
->
sk
->
sk
_family
)
{
case
AF_INET
:
case
AF_INET
:
rc
=
smack_netlabel_send
(
sock
->
sk
,
sip
);
rc
=
smack_netlabel_send
(
sock
->
sk
,
sip
);
break
;
break
;
...
...
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
register
or
sign in
to comment