Process ids again
Process ids again
Posted Jun 6, 2025 16:51 UTC (Fri) by AClwn (subscriber, #131323)In reply to: Process ids again by epa
Parent article: Slowing the flow of core-dump-related CVEs
The obvious retort is that Linux doesn't randomize PIDs and it never will, so the only things you lose by extending PIDs to 64 bits are (1) a little bit of space wherever they're stored and (2) an entire class of PID-reuse security vulnerabilities, and that this is a pretty good tradeoff. I have nothing to say to that; I just wanted to mention PID randomization.
Posted Jun 7, 2025 5:45 UTC (Sat)
by epa (subscriber, #39769)
[Link] (1 responses)
Posted Jun 22, 2025 9:10 UTC (Sun)
by l0kod (subscriber, #111864)
[Link]
For more details, see https://git.kernel.org/torvalds/c/d9d2a68ed44bbae598a81cb...
Posted Jun 8, 2025 9:20 UTC (Sun)
by jreiser (subscriber, #11027)
[Link] (6 responses)
Um, no. A Linear Feedback Shift Register (LFSR) that is based on an irreducible polynomial guarantees uniqueness over its entire period, which is near to 2**N. Just initialize it to a random point in its sequence.
Posted Jun 8, 2025 10:03 UTC (Sun)
by dezgeg (subscriber, #92243)
[Link] (5 responses)
Posted Jun 8, 2025 18:11 UTC (Sun)
by bmenrigh (subscriber, #63018)
[Link] (4 responses)
Posted Jun 9, 2025 12:00 UTC (Mon)
by bluca (subscriber, #118303)
[Link] (3 responses)
Posted Jun 12, 2025 8:48 UTC (Thu)
by donald.buczek (subscriber, #112892)
[Link] (2 responses)
Posted Jun 12, 2025 11:15 UTC (Thu)
by bluca (subscriber, #118303)
[Link] (1 responses)
Posted Jun 14, 2025 9:45 UTC (Sat)
by donald.buczek (subscriber, #112892)
[Link]
Note, that although pidfd_open(2) says opening a "/proc/[PID]" directory would be an alternative way to get a PID file descriptor, this is only half true: You can use such a file descriptor with pidfd_* calls, but it is another type of file descriptor with f_type == PROC_SUPER_MAGIC ( 0x9fa0 ) and you can't use the inode number from that kind of file descriptor as a unique process identifier.
I still wish, processes had UUIDs.
Posted Jun 9, 2025 16:37 UTC (Mon)
by dsfch (subscriber, #176007)
[Link]
Process ids again
Process ids again
- They are unique during the lifetime of the running system thanks to
the 64-bit values: at worse, 2^60 - 2*2^32 useful IDs.
- They are always greater than 2^32 and must then be stored in 64-bit
integer types.
- The initial ID (at boot time) is randomly picked between 2^32 and
2^33, which limits collisions in logs across different boots.
- IDs are sequential, which enables users to order them.
- IDs may not be consecutive but increase with a random 2^4 step, which
limits side channels.
Unique randomized wide PIDs
Unique randomized wide PIDs
Unique randomized wide PIDs
Unique randomized wide PIDs
However, I wonder how userspace can easily determine whether a pidfd inode number comes from a system that guarantees uniqueness.
Unique randomized wide PIDs
Unique randomized wide PIDs
Unique randomized wide PIDs
Process ids again