BUG: setrlimit(RLIMIT_CORE) Error

Description

In Ubuntu 20.04 containers (i.e.: LXC, Docker), issuing a sudo command results in the following error:

setrlimit(RLIMIT_CORE): Operation not permitted

Cause:

Handling of RLIMIT_CORE appears to be buggy in Linux containers. When sudo tries to restore the original coredump limit (which appears to be RLIM_INFINITY) as uid 0 it gets EPERM, which should not happen. Sudo 1.8.28 just silently ignored the failure, in 1.8.29 and above a warning is written to the standard error.

Fix

A fix was implemented in sudo version sudo 1.8.31p1 and above, but a workaround exists if you can not update yet:

echo "Set disable_coredump false" >> /etc/sudo.conf

Reference

Last updated