提交 d83d2c26 编写于 作者: M Marcin Niesluchowski 提交者: Casey Schaufler

Smack: Fix setting label on successful file open

While opening with CAP_MAC_OVERRIDE file label is not set.
Other calls may access it after CAP_MAC_OVERRIDE is dropped from process.
Signed-off-by: NMarcin Niesluchowski <m.niesluchow@samsung.com>
上级 da1b6356
...@@ -1477,8 +1477,10 @@ static int smack_file_open(struct file *file, const struct cred *cred) ...@@ -1477,8 +1477,10 @@ static int smack_file_open(struct file *file, const struct cred *cred)
struct smk_audit_info ad; struct smk_audit_info ad;
int rc; int rc;
if (smack_privileged(CAP_MAC_OVERRIDE)) if (smack_privileged(CAP_MAC_OVERRIDE)) {
file->f_security = isp->smk_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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册