Skip to content

Commit

Permalink
Smack: correct final mmap check comparison
Browse files Browse the repository at this point in the history
The mmap policy enforcement checks the access of the
SMACK64MMAP subject against the current subject incorrectly.
The check as written works correctly only if the access
rules involved have the same access. This is the common
case, so initial testing did not find a problem.

Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
  • Loading branch information
Casey Schaufler committed Feb 10, 2011
1 parent db904aa commit 75a2563
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion security/smack/smack_lsm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1218,7 +1218,7 @@ static int smack_file_mmap(struct file *file,
* not available to a SMACK64MMAP subject
* deny access.
*/
if ((may | mmay) != may) {
if ((may | mmay) != mmay) {
rc = -EACCES;
break;
}
Expand Down

0 comments on commit 75a2563

Please sign in to comment.