summaryrefslogtreecommitdiff
path: root/fs/fuse/fuse_i.h
diff options
context:
space:
mode:
authorSeth Forshee <seth.forshee@canonical.com>2014-07-02 16:29:19 -0500
committerMiklos Szeredi <mszeredi@redhat.com>2017-04-18 16:58:38 +0200
commit0b6e9ea041e6c932f5b3a86fae2d60cbcfad4dd2 (patch)
treecd3865a34605be80a272a920713b11df7efcb35b /fs/fuse/fuse_i.h
parent095fc40ace5ffccd306f39fdd1a40b4faa41b8a0 (diff)
downloadlwn-0b6e9ea041e6c932f5b3a86fae2d60cbcfad4dd2.tar.gz
lwn-0b6e9ea041e6c932f5b3a86fae2d60cbcfad4dd2.zip
fuse: Add support for pid namespaces
When the userspace process servicing fuse requests is running in a pid namespace then pids passed via the fuse fd are not being translated into that process' namespace. Translation is necessary for the pid to be useful to that process. Since no use case currently exists for changing namespaces all translations can be done relative to the pid namespace in use when fuse_conn_init() is called. For fuse this translates to mount time, and for cuse this is when /dev/cuse is opened. IO for this connection from another namespace will return errors. Requests from processes whose pid cannot be translated into the target namespace will have a value of 0 for in.h.pid. File locking changes based on previous work done by Eric Biederman. Signed-off-by: Seth Forshee <seth.forshee@canonical.com> Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/fuse/fuse_i.h')
-rw-r--r--fs/fuse/fuse_i.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h
index 6c649f0c58f9..041521d29d33 100644
--- a/fs/fuse/fuse_i.h
+++ b/fs/fuse/fuse_i.h
@@ -24,6 +24,7 @@
#include <linux/workqueue.h>
#include <linux/kref.h>
#include <linux/xattr.h>
+#include <linux/pid_namespace.h>
#include <linux/refcount.h>
/** Max number of pages that can be used in a single read request */
@@ -462,6 +463,9 @@ struct fuse_conn {
/** The group id for this mount */
kgid_t group_id;
+ /** The pid namespace for this mount */
+ struct pid_namespace *pid_ns;
+
/** Maximum read size */
unsigned max_read;