From: Casey Schaufler Date: Wed, 28 Jan 2009 03:56:30 +0000 (-0800) Subject: smackfs load append mode fix X-Git-Tag: v2.6.29-rc3~5 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=152a649b647a8ef47bb74ff9e11850fa6001bedc;p=linux-2.6-omap-h63xx.git smackfs load append mode fix 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 Reviewed-by: James Morris Signed-off-by: Linus Torvalds --- diff --git a/security/smack/smackfs.c b/security/smack/smackfs.c index 71e2b914363..8e42800878f 100644 --- a/security/smack/smackfs.c +++ b/security/smack/smackfs.c @@ -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;