Public bug reported:

The kernel.pid_max sysctl defaults to 32768. This is a very historic
limit to provide compatibility with ancient binaries.

Moving on to the year 2020 multicore CPU:s for desktops, laptops and
servers is the standard, and together with PID randomization wraparound
happens rather quickly on many-core machines with lots of activity.
Wraparounds in itself is not a big issue, but there are corner cases
like scripts that checks if a PID is alive etc that run into trouble if
another process has started using the PID it expects, scripts
(erroneously) using PIDs for work/temporary files, etc.

To avoid problems within the lifetime of Ubuntu Focal, it's time to
increase kernel.pid_max by default in the distribution by including
tuning in a file in /etc/sysctl.d/

Our suggestion is to ship the following tuning by default:

# Make PID-rollover not happen as often.
# Default is 32768
kernel.pid_max = 999999

with the following motivation:

1) It achieves a 30-fold increase in the available number-space,
reducing the likelihood of PID wraparound/collisions.

2) It only adds one digit to the PID, so it's still possible to remember
a PID

3) Output in top, ps, etc is still nicely readable

3) We have used it for years on Ubuntu 14.04 and onwards, on 1000+
machines and with a wide array of commercial and scientific software
without any issues.

4) One could argue that it is a preventive security measure, there are a
lot of weirdly written scripts and software out there that behaves badly
upon PID reuse/collissions.

** Affects: procps (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1867949

Title:
  It's time to increase the default pid_max from 32768 to avoid PID
  wraparounds/collossions

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/procps/+bug/1867949/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to