Re: [PATCH] private mounts

From: Jamie Lokier
Date: Fri Apr 29 2005 - 09:48:29 EST

Miklos Szeredi wrote:
> Removing the check makes chroot enter the tree under the other
> process's namespace. However it does not actually change the
> namespace, hence mount/umount won't work.
> So joinig a namespace does need a new syscall unfortunately.

It would be trivial to copy mnt->mnt_namespace to current->namespace
in set_fs_root. No need for a syscall just for that.

Given that it works, the right place to decide whether it's allowed is
the permissions on /proc/NNN/root. But remember that you can already
access another process' namespace using ptrace on that process, so
this doesn't relax security if /proc/NNN/root can be entered whenever
ptrace is allowed.

I would really like to know what the purpose of check_mnt() is in
namespace.c. In standard kernels you can't enter another process'
namespace (without the change you tried in proc/base.c), so I don't see
how check_mnt() can _ever_ fail. Can it?

And if it can't fail, is there any need for current->namespace, or can
it just be removed?

-- Jamie
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at