Re: Killing clones

Andries.Brouwer@cwi.nl
Thu, 14 Aug 1997 16:27:36 +0200 (MET DST)


Linus Torvalds:

: On Thu, 14 Aug 1997, Albert D. Cahalan wrote:
::
:: To make threaded apps very compatible:
:: getpid() could return just the bottom 16 bits to make userspace
:: even more happy. Then a gettid() function gets the whole 32 bits.
:: Normal kill() handles both just fine.

: Works for me.

:: Symmetry requires numbering unthreaded processes from 0x10000.
:: They still show up with low numbers and can be killed with the
:: low numbers.
:: That gets rid of some special case code for thread #1.

: Sure, I can live with this (in fact I think I prefer it to my original
: setup).

I have one comment: Several Linux applications have security holes
caused by the fact that a pid has only 16 bits (so that one can
trick some suid process into sending a signal to some other privileged
process by spawning 32000 processes).
Because of such and other reasons it might be a good idea to move to
a 32-bit pid in the future, so that pid's will be unique for a process.

This again might mean that the outside world must know as little
as possible about the structure of a tid.

Andries