* [PATCH] userns: Allow the unprivileged users to mount mqueue fs
@ 2013-01-28 3:09 Gao feng
[not found] ` <1359342541-383-1-git-send-email-gaofeng-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
0 siblings, 1 reply; 4+ messages in thread
From: Gao feng @ 2013-01-28 3:09 UTC (permalink / raw)
To: ebiederm-aS9lmoZGLiVWk0Htik3J/w
Cc: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-fsdevel-u79uwXL29TY76Z2rM5mHXA,
akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b
This patch allow the unprivileged user to mount mqueuefs in
user ns.
If two userns share the same ipcns,the files in mqueue fs
should be seen in both these two userns.
If the userns has its own ipcns,it has its own mqueue fs too.
ipcns has already done this job well.
Signed-off-by: Gao feng <gaofeng-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
---
ipc/mqueue.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/ipc/mqueue.c b/ipc/mqueue.c
index 71a3ca1..023c986 100644
--- a/ipc/mqueue.c
+++ b/ipc/mqueue.c
@@ -1383,6 +1383,7 @@ static struct file_system_type mqueue_fs_type = {
.name = "mqueue",
.mount = mqueue_mount,
.kill_sb = kill_litter_super,
+ .fs_flags = FS_USERNS_MOUNT,
};
int mq_init_ns(struct ipc_namespace *ns)
--
1.7.11.7
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] userns: Allow the unprivileged users to mount mqueue fs
[not found] ` <1359342541-383-1-git-send-email-gaofeng-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
@ 2013-01-28 3:43 ` Eric W. Biederman
[not found] ` <87bocayntu.fsf-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
0 siblings, 1 reply; 4+ messages in thread
From: Eric W. Biederman @ 2013-01-28 3:43 UTC (permalink / raw)
To: Gao feng
Cc: linux-fsdevel-u79uwXL29TY76Z2rM5mHXA,
akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b,
containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
Gao feng <gaofeng-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org> writes:
> This patch allow the unprivileged user to mount mqueuefs in
> user ns.
>
> If two userns share the same ipcns,the files in mqueue fs
> should be seen in both these two userns.
>
> If the userns has its own ipcns,it has its own mqueue fs too.
> ipcns has already done this job well.
I am a little dense. When does userspace actually mount a mqueuefs?
My impression was that user space never needed to mount and actually
never could mount a mqueuefs. MS_NO_USER isn't set so mounting a
mqueuefs is possible but when does it happen and why?
I am trying to think through the logic here and I think this is safe
but since I don't understand why we would mount an mqueue fs I am
having trouble verifying that there are no silly reasons why this might
be a bad idea.
But from what I can tell so far this seems like a good patch.
Eric
> Signed-off-by: Gao feng <gaofeng-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
> ---
> ipc/mqueue.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/ipc/mqueue.c b/ipc/mqueue.c
> index 71a3ca1..023c986 100644
> --- a/ipc/mqueue.c
> +++ b/ipc/mqueue.c
> @@ -1383,6 +1383,7 @@ static struct file_system_type mqueue_fs_type = {
> .name = "mqueue",
> .mount = mqueue_mount,
> .kill_sb = kill_litter_super,
> + .fs_flags = FS_USERNS_MOUNT,
> };
>
> int mq_init_ns(struct ipc_namespace *ns)
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] userns: Allow the unprivileged users to mount mqueue fs
[not found] ` <87bocayntu.fsf-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
@ 2013-01-28 6:48 ` Gao feng
[not found] ` <51061F2F.6040104-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
0 siblings, 1 reply; 4+ messages in thread
From: Gao feng @ 2013-01-28 6:48 UTC (permalink / raw)
To: Eric W. Biederman
Cc: linux-fsdevel-u79uwXL29TY76Z2rM5mHXA,
akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b,
containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
On 2013/01/28 11:43, Eric W. Biederman wrote:
> Gao feng <gaofeng-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org> writes:
>
>> This patch allow the unprivileged user to mount mqueuefs in
>> user ns.
>>
>> If two userns share the same ipcns,the files in mqueue fs
>> should be seen in both these two userns.
>>
>> If the userns has its own ipcns,it has its own mqueue fs too.
>> ipcns has already done this job well.
>
> I am a little dense. When does userspace actually mount a mqueuefs?
> My impression was that user space never needed to mount and actually
> never could mount a mqueuefs. MS_NO_USER isn't set so mounting a
> mqueuefs is possible but when does it happen and why?
>
Actually the files which representative messgae queue in mqueuefs contains
some informations,such as QSIZE,NOTIFY,SIGNO,NOTIFY_PID.
My workstation is Fedora 17,mqueuefs is mounted on /dev/mqueue by default.
So I think at lest this patch is needed by some people.
Thanks!
Gao
> I am trying to think through the logic here and I think this is safe
> but since I don't understand why we would mount an mqueue fs I am
> having trouble verifying that there are no silly reasons why this might
> be a bad idea.
>
> But from what I can tell so far this seems like a good patch.
>
> Eric
>
>
>> Signed-off-by: Gao feng <gaofeng-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
>> ---
>> ipc/mqueue.c | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/ipc/mqueue.c b/ipc/mqueue.c
>> index 71a3ca1..023c986 100644
>> --- a/ipc/mqueue.c
>> +++ b/ipc/mqueue.c
>> @@ -1383,6 +1383,7 @@ static struct file_system_type mqueue_fs_type = {
>> .name = "mqueue",
>> .mount = mqueue_mount,
>> .kill_sb = kill_litter_super,
>> + .fs_flags = FS_USERNS_MOUNT,
>> };
>>
>> int mq_init_ns(struct ipc_namespace *ns)
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] userns: Allow the unprivileged users to mount mqueue fs
[not found] ` <51061F2F.6040104-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
@ 2013-01-28 7:14 ` Eric W. Biederman
0 siblings, 0 replies; 4+ messages in thread
From: Eric W. Biederman @ 2013-01-28 7:14 UTC (permalink / raw)
To: Gao feng
Cc: linux-fsdevel-u79uwXL29TY76Z2rM5mHXA,
akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b,
containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
Gao feng <gaofeng-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org> writes:
> On 2013/01/28 11:43, Eric W. Biederman wrote:
>> Gao feng <gaofeng-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org> writes:
>>
>>> This patch allow the unprivileged user to mount mqueuefs in
>>> user ns.
>>>
>>> If two userns share the same ipcns,the files in mqueue fs
>>> should be seen in both these two userns.
>>>
>>> If the userns has its own ipcns,it has its own mqueue fs too.
>>> ipcns has already done this job well.
>>
>> I am a little dense. When does userspace actually mount a mqueuefs?
>> My impression was that user space never needed to mount and actually
>> never could mount a mqueuefs. MS_NO_USER isn't set so mounting a
>> mqueuefs is possible but when does it happen and why?
>>
>
> Actually the files which representative messgae queue in mqueuefs contains
> some informations,such as QSIZE,NOTIFY,SIGNO,NOTIFY_PID.
>
> My workstation is Fedora 17,mqueuefs is mounted on /dev/mqueue by default.
> So I think at lest this patch is needed by some people.
I have just confirmed that the most you can do in a mounted mqueue fs is
to create files message queues.
Given that these filesystems exist anyway I don't see a problem.
Applied thanks.
Eric
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-01-28 7:14 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-28 3:09 [PATCH] userns: Allow the unprivileged users to mount mqueue fs Gao feng
[not found] ` <1359342541-383-1-git-send-email-gaofeng-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2013-01-28 3:43 ` Eric W. Biederman
[not found] ` <87bocayntu.fsf-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
2013-01-28 6:48 ` Gao feng
[not found] ` <51061F2F.6040104-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2013-01-28 7:14 ` Eric W. Biederman
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).