LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [patch] fuse: fix permission checking
@ 2008-02-15 10:23 Miklos Szeredi
  2008-02-15 20:35 ` Harvey Harrison
  2008-02-22 23:19 ` [stable] " Greg KH
  0 siblings, 2 replies; 8+ messages in thread
From: Miklos Szeredi @ 2008-02-15 10:23 UTC (permalink / raw)
  To: akpm; +Cc: linux-kernel, stable

This is for 2.6.25 and 2.6.24.y, but NOT for 2.6.23.y.

Thanks,
Miklos
----

From: Miklos Szeredi <mszeredi@suse.cz>

I added a nasty local variable shadowing bug to fuse in 2.6.24, with
the result, that the 'default_permissions' mount option is basically
ignored.

How did this happen?

 - old err declaration in inner scope
 - new err getting declared in outer scope
 - 'return err' from inner scope getting removed
 - old declaration not being noticed

-Wshadow would have saved us, but it doesn't seem practical for
the kernel :(

More testing would have also saved us :((

Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
---

Index: linux/fs/fuse/dir.c
===================================================================
--- linux.orig/fs/fuse/dir.c	2008-02-15 10:46:06.000000000 +0100
+++ linux/fs/fuse/dir.c	2008-02-15 11:05:46.000000000 +0100
@@ -906,7 +906,7 @@ static int fuse_permission(struct inode 
 	}
 
 	if (fc->flags & FUSE_DEFAULT_PERMISSIONS) {
-		int err = generic_permission(inode, mask, NULL);
+		err = generic_permission(inode, mask, NULL);
 
 		/* If permission is denied, try to refresh file
 		   attributes.  This is also needed, because the root

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2008-02-25 10:45 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-15 10:23 [patch] fuse: fix permission checking Miklos Szeredi
2008-02-15 20:35 ` Harvey Harrison
2008-02-22 23:19 ` [stable] " Greg KH
2008-02-23  9:38   ` Miklos Szeredi
2008-02-23 19:08     ` Greg KH
2008-02-23 19:22       ` Andrew Morton
2008-02-23 19:40         ` Miklos Szeredi
2008-02-25 10:45   ` Miklos Szeredi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).