#1131890 super: High memory usage with LimitNOFILE=infinity

Package:
super
Source:
super
Description:
Execute commands setuid root
Submitter:
Alexander Motzkau
Date:
2026-04-11 15:05:01 UTC
Severity:
normal
Tags:
#1131890#5
Date:
2026-03-25 23:13:37 UTC
From:
To:
Dear Maintainer,

Starting with Debian Trixie, a systemd service with LimitNOFILE=infinity
will get an fd limit of 2^30 file descriptors (see #1029152). If such a
service (like inn2) is then executing a script via super, super will
allocate 4GB of memory just for option parsing (4 bytes per possible
file descriptor for storing a boolean, see option_local_clear_settings()).

This was a very unexpected regression after the update to Trixie, when two
simultaneous invocations almost brought a server to a standstill due to
excessive swapping.

With best regards,
Alex

#1131890#10
Date:
2026-04-11 15:03:46 UTC
From:
To:
Hi Alexander,

It seems to me that this is a reasonable complaint but that a fair
workaround on trixie would be to arrange for super to be invoked via
'/usr/bin/prlimit -n1024 or similar' for these scripts.

Hi, Robert,

I have created a patch for this that stores the fd options in a linked
list instead of an array (patch 20 attached).

Additionally I attach patch 21 as an optimisation to use close_range(2)
rather than invoking a syscall for every possible fd.

In writing this solution I came across a big in the TimeList handling
and patch 19 fixes this.

For a more convenient view of the patches, they are assembled on top of
the dgit patches applied view in my fork, here:
https://salsa.debian.org/abower/super/-/commits/close_range

I hope this is of use!

Andrew