From: ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org (Eric W. Biederman)
To: Cedric Le Goater <clg-NmTC/0ZBporQT0dZR+AlfA@public.gmane.org>
Cc: "Denis V. Lunev" <den-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org>,
containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
Subject: Re: [patch -mm 1/5] mqueue namespace : add struct mq_namespace
Date: Wed, 03 Oct 2007 08:32:19 -0600 [thread overview]
Message-ID: <m13awsfevg.fsf@ebiederm.dsl.xmission.com> (raw)
In-Reply-To: <47034712.9060101-NmTC/0ZBporQT0dZR+AlfA@public.gmane.org> (Cedric Le Goater's message of "Wed, 03 Oct 2007 09:38:58 +0200")
Cedric Le Goater <clg-NmTC/0ZBporQT0dZR+AlfA@public.gmane.org> writes:
> [
> I have big fingers this morning and I managed to send this email
> while typing it ... see below for the end. I should be awake now :)
> ]
>
>> The really challenging case to handle here is what happens if we are
>> signaling to someone in a sibling pid namespace. What do we set the
>> parent pid in the siginfo struct to. I think we agreed that 0 (blame
>> the kernel) is the appropriate pid last time we talked about this.
>
> 0 seems appropriate for a signal coming from a parent namespace, yes. but
> here, we could be sending a signal from a child or sibling namespace.
Hmm. I finally see the part of this that is problematic and
that we aren't currently handling.
> sig_i.si_signo = info->notify.sigev_signo;
> sig_i.si_errno = 0;
> sig_i.si_code = SI_MESGQ;
> sig_i.si_value = info->notify.sigev_value;
> sig_i.si_pid = current->tgid;
> sig_i.si_uid = current->uid;
>
> kill_pid_info(info->notify.sigev_signo, &sig_i, info->notify_owner);
The filling in of the signal info structure. My gut feel says that
should be a struct pid reference. We need to be very careful with
the siginfo cases, and si_pid. Unless someone has built a mechanism
for dealing with this I haven't seen.
I still think the right approach here is that if the pid doesn't map
into the target processes pid namespace we should use 0.
I also strongly suspect that si_pid should be a struct pid and that we
should translate it in the receiving process if possible.
> Is there a way to catch this general issue (we have the same in sigio)
> in the kill*(struct pid) routines ? spit a big warning when the
> current->nsproxy->pid_ns is not a parent ?
The SIGIO case is even trickier, although that may count as always
coming from the kernel so this doesn't come up.
In both cases what is really happening a process in a sibling
pid namespace is doing something and the kernel is telling us about
it. So sending the signal is legitimate.
The difficulty is that the kernel can't express the process that did
something. From my perspective that appears to be a fundamental
limitation, and our only real choice is to send 0.
We have a similar limitation with the uid namespace as well in this
case.
We can implement this easily by passing a struct pid. And translating
just before we cross the kernel/user boundary. And if it doesn't
translate use 0. Basically this is just your check for seeing
if the destination pid namespace is the same or a parent of
the sending pid namespace. That is what I always envisioned
being in __pid_nr(). As I don't think it makes any sense to map
pids from sibling pid namespaces.
The reason we want in general to do the translation at the
destination process is because we may be sending a signal
to a process group which could have processes in multiple
pid namespaces.
Eric
next prev parent reply other threads:[~2007-10-03 14:32 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20071002084608.149781400@fr.ibm.com>
2007-10-02 8:46 ` [patch -mm 1/5] mqueue namespace : add struct mq_namespace Cedric Le Goater
2007-10-02 8:46 ` [patch -mm 2/5] mqueue namespace : add unshare support Cedric Le Goater
2007-10-02 8:46 ` [patch -mm 3/5] mqueue namespace : add get_sb_single_per_data() Cedric Le Goater
2007-10-02 8:46 ` [patch -mm 4/5] mqueue namespace : enable the namespace Cedric Le Goater
2007-10-02 8:46 ` [patch -mm 5/5] mqueue namespace : make sysctl work per namespace Cedric Le Goater
[not found] ` <20071002084906.477406083@fr.ibm.com>
[not found] ` <20071002084906.477406083-NmTC/0ZBporQT0dZR+AlfA@public.gmane.org>
2007-10-02 9:06 ` [patch -mm 1/5] mqueue namespace : add struct mq_namespace Kirill Korotaev
[not found] ` <47020A29.9060403-3ImXcnM4P+0@public.gmane.org>
2007-10-02 10:13 ` Cedric Le Goater
[not found] ` <470219BC.3050702-NmTC/0ZBporQT0dZR+AlfA@public.gmane.org>
2007-10-02 10:59 ` Eric W. Biederman
[not found] ` <m1ir5plr3c.fsf-T1Yj925okcoyDheHMi7gv2pdwda3JcWeAL8bYrjMMd8@public.gmane.org>
2007-10-02 12:21 ` Cedric Le Goater
[not found] ` <470237C7.5000902-NmTC/0ZBporQT0dZR+AlfA@public.gmane.org>
2007-10-02 16:30 ` sukadev-r/Jw6+rmf7HQT0dZR+AlfA
[not found] ` <20071002163020.GA11207-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2007-10-02 17:16 ` Eric W. Biederman
[not found] ` <m1k5q5jv29.fsf-T1Yj925okcoyDheHMi7gv2pdwda3JcWeAL8bYrjMMd8@public.gmane.org>
2007-10-03 7:12 ` Cedric Le Goater
[not found] ` <470340F8.50806-NmTC/0ZBporQT0dZR+AlfA@public.gmane.org>
2007-10-03 7:38 ` Cedric Le Goater
[not found] ` <47034712.9060101-NmTC/0ZBporQT0dZR+AlfA@public.gmane.org>
2007-10-03 14:32 ` Eric W. Biederman [this message]
2007-10-03 7:44 ` Cedric Le Goater
[not found] ` <47034868.5010505-NmTC/0ZBporQT0dZR+AlfA@public.gmane.org>
2007-10-03 13:59 ` Serge E. Hallyn
[not found] ` <20071003135955.GA7934-6s5zFf/epYLPQpwDFJZrxKsjOiXwFzmk@public.gmane.org>
2007-10-03 14:11 ` Cedric Le Goater
[not found] ` <4703A30F.2010007-NmTC/0ZBporQT0dZR+AlfA@public.gmane.org>
2007-10-03 16:56 ` sukadev-r/Jw6+rmf7HQT0dZR+AlfA
[not found] ` <20071003165644.GA338-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2007-10-03 17:03 ` Eric W. Biederman
[not found] ` <m1myv0ceqp.fsf-T1Yj925okcoyDheHMi7gv2pdwda3JcWeAL8bYrjMMd8@public.gmane.org>
2007-10-03 17:09 ` sukadev-r/Jw6+rmf7HQT0dZR+AlfA
[not found] ` <20071003170930.GB338-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2007-10-04 13:12 ` Cedric Le Goater
[not found] ` <4704E6C7.5010908-NmTC/0ZBporQT0dZR+AlfA@public.gmane.org>
2007-10-04 13:32 ` Serge E. Hallyn
2007-10-02 17:02 ` Eric W. Biederman
[not found] ` <20071002084608.149781400-NmTC/0ZBporQT0dZR+AlfA@public.gmane.org>
2007-10-02 10:50 ` [patch -mm 0/5] mqueue namespace Eric W. Biederman
[not found] ` <m1przxlrim.fsf-T1Yj925okcoyDheHMi7gv2pdwda3JcWeAL8bYrjMMd8@public.gmane.org>
2007-10-02 11:06 ` Cedric Le Goater
2007-10-02 11:01 ` Eric W. Biederman
[not found] ` <m1ejgdlr0a.fsf-T1Yj925okcoyDheHMi7gv2pdwda3JcWeAL8bYrjMMd8@public.gmane.org>
2007-10-02 11:41 ` Cedric Le Goater
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m13awsfevg.fsf@ebiederm.dsl.xmission.com \
--to=ebiederm-as9lmozglivwk0htik3j/w@public.gmane.org \
--cc=clg-NmTC/0ZBporQT0dZR+AlfA@public.gmane.org \
--cc=containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
--cc=den-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.