From 7ab90f622b201a35f74281a8a9ec53062ddaf3da Mon Sep 17 00:00:00 2001 From: Steven Whitehouse Date: Mon, 24 May 2010 14:36:48 +0100 Subject: [PATCH] --- yaml --- r: 198367 b: refs/heads/master c: 7df0e0397b9a18358573274db9fdab991941062f h: refs/heads/master i: 198365: 0ea24bbc18ad60cbf638fed949adf3b728f8a316 198363: d8a8f8114fb6cd737acb244140b2c6c2af64d66f 198359: c03ed397d401f9d4e8fa4e5bc3d46a94c63901e3 198351: 5224b302f476381a73b556bc70a05b6f43f23273 198335: c65c4f4ff2c601919d6843e6af48d07baf7a1297 v: v3 --- [refs] | 2 +- trunk/fs/gfs2/file.c | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 55165b4fe7e2..699847c7d15a 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: f72f2d2e2f3238e4dedf4afb5f9945b3227dd87e +refs/heads/master: 7df0e0397b9a18358573274db9fdab991941062f diff --git a/trunk/fs/gfs2/file.c b/trunk/fs/gfs2/file.c index e6dd2aec6f82..b20bfcc9fa2d 100644 --- a/trunk/fs/gfs2/file.c +++ b/trunk/fs/gfs2/file.c @@ -218,6 +218,11 @@ static int do_gfs2_set_flags(struct file *filp, u32 reqflags, u32 mask) if (error) goto out_drop_write; + error = -EACCES; + if (!is_owner_or_cap(inode)) + goto out; + + error = 0; flags = ip->i_diskflags; new_flags = (flags & ~mask) | (reqflags & mask); if ((new_flags ^ flags) == 0) @@ -275,8 +280,10 @@ static int gfs2_set_flags(struct file *filp, u32 __user *ptr) { struct inode *inode = filp->f_path.dentry->d_inode; u32 fsflags, gfsflags; + if (get_user(fsflags, ptr)) return -EFAULT; + gfsflags = fsflags_cvt(fsflags_to_gfs2, fsflags); if (!S_ISDIR(inode->i_mode)) { if (gfsflags & GFS2_DIF_INHERIT_JDATA)