Re: [PATCH] user namespace: make signal.c respect user namespaces

From: Oleg Nesterov
Date: Sun Oct 09 2011 - 15:07:45 EST


On 10/08, Serge E. Hallyn wrote:
>
> Quoting Oleg Nesterov (oleg@xxxxxxxxxx):
> >
> > +static inline fixup_uid(struct siginfo *info, struct task_struct *t)
> > +{
> > +#ifdef CONFIG_USER_NS
> > + if (current_user_ns() == task_cred_xxx(t, user_ns)))
> > +#endif
> > + return;
> > +
> > + if (SI_FROMKERNEL(info))
> > + switch (info->si_code & __SI_MASK) {
> > + default:
> > + return;
> > +
> > + case __SI_CHLD:
>
> After looking a bit more, I really think the __SI_CHLD case just needs to
> always be converted at the callers (i.e. do_notify_parent).

Yes, unfortunately.

> > + case __SI_MESGQ:
>
> This can be done like this, but if this is going to be the only case of
> a SI_FROMKERNEL not being converted at the caller, and there is aiui only
> one caller (__do_notivy in ipc/mmqueue.c), it seems better to just have
> fixup_uid() always return for SI_FROMKERNEL(info).

Yes, agreed.

Oleg.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/