rlimit: avoid lowering Max rlimit
rlimit: avoid lowering Max rlimit

In an unprivileged process, the restore operation will always fail with EPERM,
since oldLimit.Max is always zero at the start of the function. Once
Max has been lowered, it's not possible to restore it without permissions.

This patch adds an extra Prlimit call to obtain an appropriate value for Max
so it is never blindly lowered to zero.

Signed-off-by: Timo Beckers <98c2d5a1e48c998bd9ba9dbc53d6857beae1c9bd@isovalent.com>

cilium/ebpf,cilium/ebpf