Quellcode durchsuchen

Smack: Ptrace access check mode

When the ptrace security hooks were split the addition of
a mode parameter was not taken advantage of in the Smack
ptrace access check. This changes the access check from
always looking for read and write access to using the
passed mode. This will make use of /proc much happier.

Targeted for git://git.gitorious.org/smack-next/kernel.git

Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
Casey Schaufler vor 11 Jahren
Ursprung
Commit
b5dfd8075b
1 geänderte Dateien mit 1 neuen und 1 gelöschten Zeilen
  1. 1 1
      security/smack/smack_lsm.c

+ 1 - 1
security/smack/smack_lsm.c

@@ -185,7 +185,7 @@ static int smack_ptrace_access_check(struct task_struct *ctp, unsigned int mode)
 	smk_ad_init(&ad, __func__, LSM_AUDIT_DATA_TASK);
 	smk_ad_init(&ad, __func__, LSM_AUDIT_DATA_TASK);
 	smk_ad_setfield_u_tsk(&ad, ctp);
 	smk_ad_setfield_u_tsk(&ad, ctp);
 
 
-	rc = smk_curacc(skp->smk_known, MAY_READWRITE, &ad);
+	rc = smk_curacc(skp->smk_known, mode, &ad);
 	return rc;
 	return rc;
 }
 }