Skip to contentSkip to conversation

random PID patch

DISCUSSION Heusden van, FJJ (Folkert) 4 participants 4 messages Nov 11, 2002 – Nov 12, 2002

lore
Share & tools
lore
#0 lore raw
Quoted 5 lines

I've ported my random-PID-patch from 2.2.19 to 2.4.19. It should be downloadable from
http://www.vanheusden.com/Linux/fp-2.4.19.patch.gz
(or follow the link from
http://www.vanheusden.com/Linux/kernel_patches.php3 )

RSK> hm
RSK> what's the point of random PIDs?

Sometimes, (well; frequently) programs that create temporary files let the filename depend on their PID. A hacker could use that knowledge. So if you know that the application that you're starting uses the last PID+1, you could make sure that that file already exists or create a symlink with that name or whatsoever causing the application you're starting to do things it's not supposed to. Like forcing suid apps to create a file in the startup-scripts dir. or something.

================================================
De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren.
================================================
The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail.

#1 lore raw
Quoted 8 lines
Quoted 5 lines

I've ported my random-PID-patch from 2.2.19 to 2.4.19. It should be downloadable from
http://www.vanheusden.com/Linux/fp-2.4.19.patch.gz
(or follow the link from
http://www.vanheusden.com/Linux/kernel_patches.php3 )

RSK> hm
RSK> what's the point of random PIDs?

Quoted 8 lines

Sometimes, (well; frequently) programs that create temporary files let the filename depend on their PID. A hacker could use that knowledge. So if you know that the application that you're starting uses the last PID+1, you could make sure that that file already exists or create a symlink with that name or whatsoever causing the application you're starting to do things it's not supposed to. Like forcing suid apps to create a file in the startup-scripts dir. or something.

How about I create 2^15 symlinks then?
Really, the only true solution to this problem is to fix the apps.

Signature · 1 line
Tomas Szepe <[email protected]>
#2 lore raw
In reply to Heusden van, FJJ (Folkert)
Quoted 3 lines · FJJ (Folkert)

Sometimes, (well; frequently) programs that create temporary files let the filename depend on their PID. A hacker could use that knowledge. So if you know that the application that

Still can if its random. The attacker can be the one who exec's the vulnerable app. The attacker can use dnotify

Quoted 2 lines

things it's not supposed to. Like forcing suid apps to create a file in the startup-scripts dir. or something.

Just use namespaces and give every login their own /tmp

#3 lore raw

Hi!

Quoted 11 lines
Quoted 3 lines

Sometimes, (well; frequently) programs that create temporary files let the filename depend on their PID. A hacker could use that knowledge. So if you know that the application that

Still can if its random. The attacker can be the one who exec's the vulnerable app. The attacker can use dnotify

Quoted 2 lines

things it's not supposed to. Like forcing suid apps to create a file in the startup-scripts dir. or something.

Just use namespaces and give every login their own /tmp

Use namespaces? I thought export TMPDIR= was the solution ;-).

Pavel

Signature · 1 line
When do you have heart between your knees?