Prakash Sangappa <prakash.sangappa@xxxxxxxxxx> writes:
With regards to security, the question basically is what is the consequenceThere is also the issue that the receiving process could look, not see
of passing the wrong id. As I understand it, Interpreting the id to be pid
or tid, the effective uid and gid will be the same. It would be a problem
only if the incorrect interpretation of the id would refer a different process.
But that cannot happen as the the global tid(gettid() of a thread is
unique.
the pid in proc and assume the sending process is dead. That I suspect
is the larger danger.
As long as the thread is alive, that id cannot reference another process / thread.Largely I agree.
Unless the thread were to exit and the id gets recycled and got used for another
thread or process. This would be no different from a process exiting and its
pid getting recycled which is the case now.
If all you want are pid translations I suspect the are far easier ways
thant updating the SCM_CREDENTIALS code.
Eric