提交 51d59af2 编写于 作者: C Casey Schaufler

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: NStephen Smalley <sds@tyco.nsa.gov>
Signed-off-by: NCasey Schaufler <casey@schaufler-ca.com>
上级 e661a582
...@@ -1915,7 +1915,7 @@ static int smack_file_receive(struct file *file) ...@@ -1915,7 +1915,7 @@ static int smack_file_receive(struct file *file)
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)) { if (inode->i_sb->s_magic == SOCKFS_MAGIC) {
sock = SOCKET_I(inode); sock = SOCKET_I(inode);
ssp = sock->sk->sk_security; ssp = sock->sk->sk_security;
tsp = current_security(); tsp = current_security();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册