"sudo: setrlimit(RLIMIT_CORE): Operation not permitted" error when using sudo in 20.04 LXD container

Bug #1868456 reported by Jeff Lane 
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
lxd (Ubuntu)
Invalid
Undecided
Unassigned
sudo (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

I fired up a LXD container using ubuntu-daily:f on my machine and every time I issue a comment inside the container using sudo, I get this error:

sudo: setrlimit(RLIMIT_CORE): Operation not permitted

I did some digging online and found this was reported against Fedora last fall which lead me to this bugzilla report:
https://bugzilla.redhat.com/show_bug.cgi?id=1773148

which seems to tie this to a change in sudo between 1.8.28 and 1.8.29.

Focal has 1.8.31:
bladernr@focal-builder:~/development/kernels-ubuntu/focal$ apt-cache policy sudo
sudo:
  Installed: 1.8.31-1ubuntu1
  Candidate: 1.8.31-1ubuntu1
  Version table:
 *** 1.8.31-1ubuntu1 500
        500 http://archive.ubuntu.com/ubuntu focal/main amd64 Packages
        100 /var/lib/dpkg/status

This is not an issue on Bionic:
bladernr@galactica:~/development/kernels-upstream/mainline$ apt-cache policy sudo
sudo:
  Installed: 1.8.21p2-3ubuntu1.2
  Candidate: 1.8.21p2-3ubuntu1.2
  Version table:
 *** 1.8.21p2-3ubuntu1.2 500
        500 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages
        100 /var/lib/dpkg/status
     1.8.21p2-3ubuntu1 500
        500 http://archive.ubuntu.com/ubuntu bionic/main amd64 Packages

From the redhat bug, the described workaround does clear these messages up:

# set disable_coredump false

Once I've done that, the error messages go away.

Jeff Lane  (bladernr)
description: updated
affects: lxd (Ubuntu) → sudo (Ubuntu)
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in sudo (Ubuntu):
status: New → Confirmed
Revision history for this message
Jan-Otto Kröpke (jokroepke) wrote :

There is a upstream issue: https://github.com/sudo-project/sudo/issues/42

A fixed versions is released, maybe it can be backported to ubuntu.

Revision history for this message
Johan Ehnberg (johan-ehnberg) wrote :

Workaround:
echo "Set disable_coredump false" | sudo tee -a /etc/sudo.conf

Revision history for this message
Johan Ehnberg (johan-ehnberg) wrote :

Container management seems to be the source of the error, sudo just suppresses it. So a potential fix is in LXD or related packages.

Revision history for this message
Stéphane Graber (stgraber) wrote :

We'll want that sudo fix included in Ubuntu.

It's the usual catch with unprivileged containers only being able to lower their limits and never raise them so there's nothing we can really do about it in LXD.

Changed in lxd (Ubuntu):
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.