Skip to content
  • Simon McVittie's avatar
    bus: Try to raise soft fd limit to match hard limit · 94bacc69
    Simon McVittie authored
    Linux systems have traditionally set the soft limit to 1024 and the hard
    limit to 4096. Recent versions of systemd keep the soft fd limit at
    1024 to avoid breaking programs that still use select(), but raise the
    hard limit to 512*1024, while in recent Debian versions a complicated
    interaction between components gives a soft limit of 1024 and a hard
    limit of 1024*1024. If we can, we might as well elevate our soft limit
    to match the hard limit, minimizing the chance that we will run out of
    file descriptor slots.
    
    Unlike the previous code to raise the hard and soft limits to at least
    65536, we do this even if we don't have privileges: privileges are
    unnecessary to raise the soft limit up to the hard limit.
    
    If we *do* have privileges, we also continue to raise the hard and soft
    limits to at least 65536 if they weren't already that high, making
    it harder to carry out a denial of service attack on the system bus on
    systems that use the traditional limit (CVE-...
    94bacc69