[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+55aFymtpNNnfrJDmTLBC8ga_L_ww+yz2VQttWq8+9fzp23YQ@mail.gmail.com>
Date: Mon, 16 Jul 2018 11:40:26 -0700
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: "Eric W. Biederman" <ebiederm@...ssion.com>
Cc: Oleg Nesterov <oleg@...hat.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Wen Yang <wen.yang99@....com.cn>, majiang <ma.jiang@....com.cn>
Subject: Re: [RFC][PATCH 07/11] signal: Deliver group signals via PIDTYPE_TGID
not PIDTYPE_PID
On Mon, Jul 16, 2018 at 11:02 AM Eric W. Biederman
<ebiederm@...ssion.com> wrote:
>
> There are two questions.
> a) Can we use the pid of a thread to find the thread group?
Yes. Just find the thread, and then use p->tgid.
However, that's not what the code used to do. It used to just find the
thread, and then do "do_send_sig_info()" on it.
And it's actually *slightly* different than "find the thread group
based on the thread". At least the permission checks are different.
The permission checks are done on the thread.
> b) Will the signal be queued in the thread group?
Yes.
pending = group ? &t->signal->shared_pending : &t->pending;
and "group" is true.
> > Now, it is possible that at none of the legacy uses use CLONE_THREAD
> > and thus aren't affected (because tgid will always be pid). So maybe
> > nobody notices.
>
> That is what I expect. I don't know think legacy is a good description.
> Calling other uses of CLONE_THREAD non-glibc seems better. The old
> LinuxThreads did not use CLONE_THREAD because it did not exist.
Again, don't get hung up about different libc implementations.
People have literally used clone() directly. And some of them use CLONE_THREAD.
Just google it. I guarantee you'll find examples of it, because I
found examples.
So stop the whole "libc" argument. That's not the point, and as long
as you make that argument, your argument is simply not valid.
People use clone() directly. Really. Really really.
Linus
Powered by blists - more mailing lists