Re: [PATCH 1/1] CLONE_PARENT shouldn't allow to set ->exit_signal

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 03/18, Linus Torvalds wrote:
>
> On Wed, Mar 14, 2012 at 11:55 AM, Oleg Nesterov <oleg@xxxxxxxxxx> wrote:
> > +       if (clone_flags & CLONE_THREAD)
> > +               p->exit_signal = -1;
> > +       else if (clone_flags & CLONE_PARENT)
> > +               p->exit_signal = current->group_leader->exit_signal;
> > +       else
> > +               p->exit_signal = (clone_flags & CSIGNAL);
>
> So why is it "current->group_leader->exit_signal" rather than the much
> more logical (imho) and simpler "current->exit_signal"?

This would be wrong if current is not the main thread. In this
case current->exit_signal = -1. Only group_leader has the "real"
exit_signal used for notification.

Historically "exit_signal = -1" meant different things, currently
it only means "I am not the leader", see thread_group_leader().

I'll write another email tomorrow. Yes, I do remember I promised
the security fixes in this area, sorry for delay.

Oleg.

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


[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux