]> Git Repo - linux.git/commitdiff
Smack: correct final mmap check comparison
authorCasey Schaufler <[email protected]>
Thu, 10 Feb 2011 03:58:42 +0000 (19:58 -0800)
committerCasey Schaufler <[email protected]>
Thu, 10 Feb 2011 03:58:42 +0000 (19:58 -0800)
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 <[email protected]>
security/smack/smack_lsm.c

index 92cb71507f5ba0f1c03aeeac2e72043710378d66..5ab3f39442f2bc4d4b5bf55656997f06450ca69d 100644 (file)
@@ -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;
                }
This page took 0.057934 seconds and 4 git commands to generate.