smackfs load append mode fix
authorCasey Schaufler <casey@schaufler-ca.com>
Wed, 28 Jan 2009 03:56:30 +0000 (19:56 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 28 Jan 2009 04:13:32 +0000 (20:13 -0800)
Given just how hard it is to find the code that uses MAY_APPEND
it's probably not a big surprise that this went unnoticed for so
long. The Smack rules loading code is incorrectly setting the
MAY_READ bit when MAY_APPEND is requested.

Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
Reviewed-by: James Morris <jmorris@namei.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
security/smack/smackfs.c

index 71e2b914363e2cf5490fe9698b7bd76fa23eb9c9..8e42800878f468912c56cece9336e7c8c6bfa727 100644 (file)
@@ -334,7 +334,7 @@ static ssize_t smk_write_load(struct file *file, const char __user *buf,
                break;
        case 'a':
        case 'A':
-               rule.smk_access |= MAY_READ;
+               rule.smk_access |= MAY_APPEND;
                break;
        default:
                goto out;