Commit fca87a33 authored by Seth Forshee's avatar Seth Forshee Committed by Stefan Bader

UBUNTU: SAUCE: (namespace) fuse: Permit requests from other pid namespaces

BugLink: http://bugs.launchpad.net/bugs/1605344

As a precaution, the pid namespace support in fuse was written
to refuse to send requests from processes whose pid has no
mapping into the pid namespace of the userspace fuse process.
This has caused a regression for at least one user, who is
mounting a fuse filesystem within a container and exporting
a file within the fuse fs to the host via a loop device.

Change this to send the request when the pid has no mapping and
fill in the pid field in the fuse request with 0. This behavior
was settled on in consultation with upstream. The risk of doing
this is that a fuse fs which receives this invalid pid might not
be prepared to handle it, but it would already be receiving pids
not valid in its namespace if used in this manner.
Signed-off-by: default avatarSeth Forshee <seth.forshee@canonical.com>
Acked-by: default avatarTim Gardner <tim.gardner@canonical.com>
Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
parent 81da0ec6
...@@ -186,8 +186,7 @@ static struct fuse_req *__fuse_get_req(struct fuse_conn *fc, unsigned npages, ...@@ -186,8 +186,7 @@ static struct fuse_req *__fuse_get_req(struct fuse_conn *fc, unsigned npages,
__set_bit(FR_WAITING, &req->flags); __set_bit(FR_WAITING, &req->flags);
if (for_background) if (for_background)
__set_bit(FR_BACKGROUND, &req->flags); __set_bit(FR_BACKGROUND, &req->flags);
if (req->in.h.pid == 0 || req->in.h.uid == (uid_t)-1 || if (req->in.h.uid == (uid_t)-1 || req->in.h.gid == (gid_t)-1) {
req->in.h.gid == (gid_t)-1) {
fuse_put_request(fc, req); fuse_put_request(fc, req);
return ERR_PTR(-EOVERFLOW); return ERR_PTR(-EOVERFLOW);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment