Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
aa98b942
Commit
aa98b942
authored
Dec 26, 2015
by
James Morris
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'smack-for-4.5' of
https://github.com/cschaufler/smack-next
into next
parents
37babe4e
81bd0d56
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
1 deletion
+23
-1
security/smack/smack_lsm.c
security/smack/smack_lsm.c
+23
-1
No files found.
security/smack/smack_lsm.c
View file @
aa98b942
...
...
@@ -1860,12 +1860,34 @@ static int smack_file_receive(struct file *file)
int
may
=
0
;
struct
smk_audit_info
ad
;
struct
inode
*
inode
=
file_inode
(
file
);
struct
socket
*
sock
;
struct
task_smack
*
tsp
;
struct
socket_smack
*
ssp
;
if
(
unlikely
(
IS_PRIVATE
(
inode
)))
return
0
;
smk_ad_init
(
&
ad
,
__func__
,
LSM_AUDIT_DATA_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.
*/
...
...
@@ -3758,7 +3780,7 @@ static int smack_socket_sendmsg(struct socket *sock, struct msghdr *msg,
if
(
sip
==
NULL
)
return
0
;
switch
(
s
ip
->
sin
_family
)
{
switch
(
s
ock
->
sk
->
sk
_family
)
{
case
AF_INET
:
rc
=
smack_netlabel_send
(
sock
->
sk
,
sip
);
break
;
...
...
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