From: Casey Schaufler Date: Tue, 22 Oct 2013 18:47:45 +0000 (-0700) Subject: BACKPORT: Smack: Ptrace access check mode X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=83da89afe6f9271c4e2629f5d3053c0b12e8876d;p=platform%2Fkernel%2Flinux-stable.git BACKPORT: 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 (cherry-picked from upstream b5dfd8075bc26636d11c3d8888940198afbf5112) --- diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c index 7d4913c1ab24..a595a398a3fa 100644 --- a/security/smack/smack_lsm.c +++ b/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_setfield_u_tsk(&ad, ctp); - rc = smk_curacc(skp->smk_known, MAY_READWRITE, &ad); + rc = smk_curacc(skp->smk_known, mode, &ad); return rc; }