** Description changed:
- See also https://discuss.linuxcontainers.org/t/limits-kernel-memlock-
- cannot-exceed-16777216/4856/5
+ [Impact]
+ * Since systemd commit fb3ae275cb ("main: bump RLIMIT_NOFILE for the root
user substantially") [https://github.com/systemd/systemd/commit/fb3ae275cb],
which is present in Bionic, the memlock ulimit value was bumped to 16M. It's an
adjustable limit, but the default (in previous Ubuntu releases/systemd
versions) was really small.
+ * Although bumping this value was a good thing, 16M is not enough and we can
see failures on mlock'ed allocations on Bionic, like the one hereby reported by
Kees or the recent introduced cryptsetup build failures (due to PPA builder
updates to Bionic) - see https://bugs.launchpad.net/bugs//1891473.
- In containers, the limits.kernel.memlock cannot exceed 16777216 when the
- container is bionic. The memlock setting is set to 16M in systemd and
- cannot be bumped up in an unprivileged container.
+ * It's especially harmful in containers to have such "small" limit, so
+ we are hereby SRUing a more recent bump from upstream systemd, in the
+ form of commit 91cfdd8d29 ("core: bump mlock ulimit to 64Mb")
+ [https://github.com/systemd/systemd/commit/91cfdd8d29]. Latest Ubuntu
+ releases, like Focal and subsequent ones, already include this patch so
+ effectively we're putting Bionic on-par with newer releases.
- This is fixed in upstream systemd.
+ * A discussion about this topic (leading to this SRU) is present in
+ ubuntu-devel ML: https://lists.ubuntu.com/archives/ubuntu-
+ devel/2020-September/041159.html.
- Container ubuntu version:
- Distributor ID: Ubuntu
- Description: Ubuntu 18.04.2 LTS
- Release: 18.04
- Codename: bionic
+ [Test Case]
+ * The straightforward test is to just look "ulimit -l" and "ulimit -Hl" in a
current Bionic system, and then install an updated version with the hereby
proposed SRU to see such limit bump from 16M to 64M (after a reboot) - a
version containing this fix is available at my PPA as of 2020-09-10 [0] (likely
to be deleted in next month or so).
- systemd package version: 237-3ubuntu10.21
+ * A more interesting test is to run a Focal container in a current
+ Bionic system and try to build the cryptsetup package - it'll fail in
+ some tests. After updating the host (Bionic) systemd to include the
+ mlock bump patch, the build succeeds in the Focal container.
+
+ [Regression Potential]
+ * Since it's a simple bump and it makes Bionic behave like Focal, I don't
foresee regressions. One potential issue would be if some users rely on the
lower default limit (16M) and this value is bumped by a package update, but
that could be circumvented by setting a lower limit in limits.conf. The
benefits for such bump are likely much bigger than any "regression" caused for
users relying on such default limit.
+
+
+ [0] https://launchpad.net/~gpiccoli/+archive/ubuntu/test1830746
** Also affects: systemd (Ubuntu Focal)
Importance: Undecided
Status: New
** Changed in: systemd (Ubuntu Focal)
Status: New => Fix Released
** Changed in: systemd (Ubuntu Focal)
Importance: Undecided => High
** Changed in: systemd (Ubuntu Focal)
Assignee: (unassigned) => Guilherme G. Piccoli (gpiccoli)
** Tags removed: patch rls-dd-incoming
** Tags added: seg
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1830746
Title:
memlock setting in systemd (pid 1) too low for containers (bionic)
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1830746/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs