pid randomness
hi everyone,
I don't know if this has been discussed before... but I'd like to ask why isn't the pids randomized by default?
I mean, of course it's not required for normal functioning but it'd be nice to have a Kconfig option to make it happen.
The (newbie) way I see it, it'd not be hard to do... generate pid, check if it's unique, give pid to process. It could bring some minor security enhancements while taking a slight performance hit (seek & compare algorithm for used pids).
What are the pros and cons of this? What are your oppinions on this subjet?
regards,
pedro venda.
Signature · 9 lines
Pedro João Lopes Venda email: [email protected] http://maxwell.rnl.ist.utl.pt Equipa de Administração de Sistemas Rede das Novas Licenciaturas (RNL) Instituto Superior Técnico http://www.rnl.ist.utl.pt http://mega.ist.utl.pt
Quoted 3 lines
I don't know if this has been discussed before... but I'd like to ask why isn't the pids randomized by default?
What are the pros and cons of this? What are your oppinions on this subjet?
Why would _you_ need it?
Jan Engelhardt
Signature · 1 line
ENOSPC
Quoted 6 lines · Jan Engelhardt
Quoted 3 lines
I don't know if this has been discussed before... but I'd like to ask why isn't the pids randomized by default?
What are the pros and cons of this? What are your oppinions on this subjet?Why would _you_ need it?
It's a simple security measure that I think is easy to implement.
I'd agree that it's not there because of the golden rule: "keep it simple", but I'd also like to know if that's really the reason it's not there.
and yes, I know there are some patch sets that already implement this.
regards,
pedro venda.
Signature · 9 lines
Pedro João Lopes Venda email: [email protected] http://maxwell.rnl.ist.utl.pt Equipa de Administração de Sistemas Rede das Novas Licenciaturas (RNL) Instituto Superior Técnico http://www.rnl.ist.utl.pt http://mega.ist.utl.pt
Hi,
You have an implementation of this and other stuff on grsecurity (www.grsecurity.net) patch for both 2.4 and 2.6 kernel. It is intented for servers, critical machines, or just paranoic users :)
cheers,
david.
Quoted 17 lines · you
hi everyone,
I don't know if this has been discussed before... but I'd like to ask why isn't the pids randomized by default?
I mean, of course it's not required for normal functioning but it'd be nice to have a
Kconfigoption to make it happen.The (newbie) way I see it, it'd not be hard to do... generate pid, check if it's unique, give pid to process. It could bring some minor security enhancements while taking a slight performance hit (seek & compare algorithm for used pids).
What are the pros and cons of this? What are your oppinions on this subjet?
regards,
pedro venda.
Signature · 5 lines
This device complies with part 15 of the FCC rules. Operation is
subject to the following two conditions:
(1) This device may not cause harmful interference,
(2) This device must accept any interference received, including
interference that may cause undesired operation.Quoted 2 lines · Pedro Venda (SYSADM)
I don't know if this has been discussed before... but I'd like to ask why isn't the pids randomized by default?
It's a pretty easy thing to do, actually. There's a patch for that in Grsecurity, and I did one up myself a while ago...
One big problem that remains beyond my technical skill to fix - for the 32 bit machines, there's some funkiness in the /proc filesystem code where it invents inode numbers based in the process ID that restrict the effective value of max_pid to 64K. Unfortunately, if you're in the camp that believes that randomizing the PID is useful at *all*, you probably want a bigger space for the random number. So you can either fix that issue (and whatever *OTHER* issues lurk after that one) or only deploy on 64 bit boxen...
A secondary issue that I've never been able to test is whether over time, a "randomized" PID ends up sparsely dirtying the list of pidmap pages (so you have enough pages to hold 4M PID bits, but only 1 or 2 bits per page are actually set), or do the occasional long-lived processes end up essentially leaving at least one process on each page anyhow? Any operational experience on that one from the big-system guys?
At worst, 4M pids will take 128 4K pages (or equivalent for other page sizes) - is that considered "unacceptable" on 64-bit boxes that want to do this?