aboutsummaryrefslogtreecommitdiffstats
path: root/fs/fuse/inode.c
diff options
context:
space:
mode:
authorMiklos Szeredi <miklos@szeredi.hu>2006-06-25 08:48:55 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-06-25 13:01:20 -0400
commit9c8ef5614da22666e339b125263d315cfaa89109 (patch)
tree860044f1b2c0c6189143b1c9daf263bd8ff5e5e0 /fs/fuse/inode.c
parenta4d27e75ffb7b8ecb7eed0c7db0df975525f3fd7 (diff)
[PATCH] fuse: scramble lock owner ID
VFS uses current->files pointer as lock owner ID, and it wouldn't be prudent to expose this value to userspace. So scramble it with XTEA using a per connection random key, known only to the kernel. Only one direction needs to be implemented, since the ID is never sent in the reverse direction. The XTEA algorithm is implemented inline since it's simple enough to do so, and this adds less complexity than if the crypto API were used. Thanks to Jesper Juhl for the idea. Signed-off-by: Miklos Szeredi <miklos@szeredi.hu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/fuse/inode.c')
-rw-r--r--fs/fuse/inode.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c
index e21ef8a3ad30..5ceb8bd7a189 100644
--- a/fs/fuse/inode.c
+++ b/fs/fuse/inode.c
@@ -16,6 +16,7 @@
16#include <linux/module.h> 16#include <linux/module.h>
17#include <linux/parser.h> 17#include <linux/parser.h>
18#include <linux/statfs.h> 18#include <linux/statfs.h>
19#include <linux/random.h>
19 20
20MODULE_AUTHOR("Miklos Szeredi <miklos@szeredi.hu>"); 21MODULE_AUTHOR("Miklos Szeredi <miklos@szeredi.hu>");
21MODULE_DESCRIPTION("Filesystem in Userspace"); 22MODULE_DESCRIPTION("Filesystem in Userspace");
@@ -387,6 +388,7 @@ static struct fuse_conn *new_conn(void)
387 fc->bdi.unplug_io_fn = default_unplug_io_fn; 388 fc->bdi.unplug_io_fn = default_unplug_io_fn;
388 fc->reqctr = 0; 389 fc->reqctr = 0;
389 fc->blocked = 1; 390 fc->blocked = 1;
391 get_random_bytes(&fc->scramble_key, sizeof(fc->scramble_key));
390 } 392 }
391 return fc; 393 return fc;
392} 394}