projects
/
GitHub
/
moto-9609
/
android_kernel_motorola_exynos9610.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e661a58
)
Smack: Safer check for a socket in file_receive
author
Casey Schaufler
<casey@schaufler-ca.com>
Wed, 31 May 2017 15:53:42 +0000
(08:53 -0700)
committer
Casey Schaufler
<casey@schaufler-ca.com>
Thu, 1 Jun 2017 16:27:12 +0000
(09:27 -0700)
The check of S_ISSOCK() in smack_file_receive() is not
appropriate if the passed descriptor is a socket.
Reported-by: Stephen Smalley <sds@tyco.nsa.gov>
Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
security/smack/smack_lsm.c
patch
|
blob
|
blame
|
history
diff --git
a/security/smack/smack_lsm.c
b/security/smack/smack_lsm.c
index 658f5d8c7e76671a27b2629c61ba93eeb449d4a8..463af86812c7ac295e5d5c02b3c20a79c5f8242a 100644
(file)
--- a/
security/smack/smack_lsm.c
+++ b/
security/smack/smack_lsm.c
@@
-1915,7
+1915,7
@@
static int smack_file_receive(struct file *file)
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)
) {
+ if (
inode->i_sb->s_magic == SOCKFS_MAGIC
) {
sock = SOCKET_I(inode);
ssp = sock->sk->sk_security;
tsp = current_security();