mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
Smack: Safer check for a socket in file_receive
The check of S_ISSOCK() in smack_file_receive() is not appropriate if the passed descriptor is a socket. Reported-by: Stephen Smalley <[email protected]> Signed-off-by: Casey Schaufler <[email protected]>
This commit is contained in:
parent
e661a58279
commit
51d59af26f
1 changed files with 1 additions and 1 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Reference in a new issue