/* Returns 0 if a subject with the object's smack could write to the task, an error code otherwise.  */
static int smack_file_send_sigiotask(struct task_struct *tsk, struct fown_struct *fown, int signum)
/* Returns 0 if a subject with the object's smack could write to the task, an error code otherwise.  */
static int smack_file_send_sigiotask(struct task_struct *tsk, struct fown_struct *fown, int signum)
{
	struct file *file;
	int rc;
	char *tsp = tsk->cred->security;
	struct smk_audit_info ad;
	file = container_of(fown, struct file, f_owner);
	rc = smk_access(file->f_security, tsp, MAY_WRITE, NULL);
	if (rc != 0 && has_capability(tsk, CAP_MAC_OVERRIDE))
		rc = 0;
	smk_ad_init(&ad, __func__, LSM_AUDIT_DATA_TASK);
	smk_ad_setfield_u_tsk(&ad, tsk);
	smack_log(file->f_security, tsp, MAY_WRITE, rc, &ad);
	return rc;
}