Systemd - Bypassing MemoryDenyWriteExecution policy
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
| systemd (Ubuntu) |
Undecided
|
Unassigned | ||
| Xenial |
Undecided
|
Unassigned | ||
| Zesty |
Undecided
|
Unassigned | ||
| Artful |
Undecided
|
Unassigned | ||
| Bionic |
Undecided
|
Unassigned |
Bug Description
[Impact]
* MemoryDenyWrite
[Test Case]
* Check that MemoryDenyWrite
[Regression Potential]
* Upstream fix cherrypick, security vulnerability.
[Other Info]
* Original report
Hello,
We would like to report to you a vulnerability about systemd which allows to bypass the MemoryDenyWrite
The vulnerability is described in the attached PDF file.
Sincerely,
Thomas IMBERT
CVE References
Thomas Imbert (mastho) wrote : | #1 |
Marc Deslauriers (mdeslaur) wrote : | #2 |
Thomas Imbert (mastho) wrote : | #3 |
Hum I thought this was the way to report it to systemd developers.
(https:/
Marc Deslauriers (mdeslaur) wrote : | #4 |
Thanks, I was just making sure it wasn't already reported or public yet.
Marc Deslauriers (mdeslaur) wrote : | #5 |
Subscribing Martin to this issue.
Hi Martin, does upstream require an embargo for this issue?
No, we don't require an embargo, although I'd be thankful for making a delay of one day so that we can have a patch ready when this is made public.
I think the impact is low because the man page says "Note that this feature is fully available on x86-64, and partially on x86". I hope this sounds discouraging enough that nobody relies on this feature too much ;)
Upstream PR: https:/
information type: | Private Security → Public Security |
The attachment "0001-shared-
[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]
tags: | added: patch |
Martin Pitt (pitti) wrote : | #11 |
Patches backported into Debian packaging git: https:/
Changed in systemd (Ubuntu Bionic): | |
status: | New → Fix Committed |
Launchpad Janitor (janitor) wrote : | #12 |
This bug was fixed in the package systemd - 235-3ubuntu2
---------------
systemd (235-3ubuntu2) bionic; urgency=medium
* systemd-fsckd: Fix ADT tests to work on s390x too.
systemd (235-3ubuntu1) bionic; urgency=medium
* Merge 235-3 from debian:
- Drop UBUNTU-
* Remaining delta from Debian:
- ship dhclient enter hook for dhclient integration with resolved
- ship resolvconf integration via stub-resolv.conf
- ship s390x virtio interface names migration
- do not disable systemd-resolved upon libnss-resolve removal
- do not remote fs in containers, for non-degrated boot
- CVE-2017-15908 in resolved fix loop on packets with pseudo dns types
- Unlink invocation id key, upon chown failure in containers
- Change default to UseDomains by default
- Do not treat failure to set Nice= setting as error in containers
- Add a condition to systemd-
containers (fails)
- Build without any built-in/fallback DNS server setting
- Enable resolved by default
- Update autopkgtests for reliability/
defaults
- Always upgrade udev, when running adt tests
- Skip test-execute on armhf
- Cherry-pick a few testsuite fixes
* UBUNTU Do not use nested kvm during ADT tests.
systemd (235-3) unstable; urgency=medium
[ Michael Biebl ]
* Switch from XC-Package-Type to Package-Type. As of dpkg-dev 1.15.7
Package-Type is recognized as an official field name.
* Install modprobe configuration file to /lib/modprobe.d.
Otherwise it is not read by kmod. (Closes: #879191)
[ Felipe Sateler ]
* Backport upstream (partial) fix for combined DynamicUser= + User=
UID was not allowed to be different to GID, which is normally the case in
debian, due to the group users being allocated the GID 100 without an
equivalent UID 100 being allocated.
* Backport upstream patches to fully make DynamicUser=yes + static,
pre-existing User= work.
[ Martin Pitt ]
* Add missing python3-minimal dependency to systemd-tests
* Drop long-obsolete systemd-bus-proxy system user
systemd-
created any files. Thus clean up the obsolete system user on upgrades.
(Closes: #878182)
* Drop static systemd-
systemd-
to create this statically any more. Don't remove the user on upgrades
though, as there is likely still be a running process. (Closes: #878183)
* Use DynamicUser= for systemd-
* Add Recommends: libnss-systemd to systemd-sysv.
This is useful to actually be able to resolve dynamically created system
users with DynamicUser=true. This concept is going to be used much more
in future versions and (hopefully) third-party .services, so pulling it
into the default installation seems prudent now.
* resolved: Fix loop on packets with pseudo dns types.
(CVE-
* bpf-firewall: Properly handle kernels without BPF cgroup but with TRIE...
Changed in systemd (Ubuntu Bionic): | |
status: | Fix Committed → Fix Released |
Changed in systemd (Ubuntu Zesty): | |
status: | New → Won't Fix |
Changed in systemd (Ubuntu Xenial): | |
status: | New → Invalid |
Changed in systemd (Ubuntu Artful): | |
status: | New → In Progress |
description: | updated |
Hello Thomas, or anyone else affected,
Accepted systemd into artful-proposed. The package will build now and be available at https:/
Please help us by testing this new package. See https:/
If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-
Further information regarding the verification process can be found at https:/
Changed in systemd (Ubuntu Artful): | |
status: | In Progress → Fix Committed |
tags: | added: verification-needed verification-needed-artful |
Dimitri John Ledkov (xnox) wrote : | #14 |
Using test software from pkeys(7) manpage, modified to use PROT_WRITE | PROT_EXEC, created systemd unit that tries to use memory protection, and started it as a systemd unit.
Thus calling:
status = pkey_mprotect(
PROT_READ | PROT_WRITE | PROT_EXEC, pkey);
if (status == -1)
errExit(
fprintf(stderr, "about to read buffer again...\n");
$ systemctl cat test.service
# /etc/systemd/
[Service]
MemoryDenyWrite
ExecStart=
$ dpkg-query -W systemd
systemd 234-2ubuntu12.1
From journal:
a.out[6763]: buffer contains: 69
a.out[6763]: about to read buffer again...
Is bad, since it is expected that MemoryDenyWrite
Upgrading to:
$ dpkg-query -W systemd
systemd 234-2ubuntu12.3
Starting test.unit again, and journal now has:
a.out[17978]: buffer contains: 69
a.out[17978]: pkey_mprotect: Operation not permitted
systemd[1]: test.service: Main process exited, code=exited, status=1/FAILURE
Which is awesome =)
tags: |
added: verification-done verification-done-artful removed: verification-needed verification-needed-artful |
Launchpad Janitor (janitor) wrote : | #15 |
This bug was fixed in the package systemd - 234-2ubuntu12.3
---------------
systemd (234-2ubuntu12.3) artful; urgency=medium
[ Dimitri John Ledkov ]
* Fix test-functions failing with Ubuntu units. LP: #1750608
* tests: switch to using ext4 by default, instead of ext3. LP: #1750608
* Fix kdump service not starting, due to systemd not loading dropins.
Cherrypick a fix from upstream. (LP: #1708409)
* systemd-fsckd: Fix ADT tests to work on s390x too. (LP: #1736955)
* netwokrd: add support for RequiredForOnline stanza. (LP: #1737570)
* resolved.service: set DefaultDependen
* systemd.postinst: enable persistent journal. (LP: #1618188)
* core: add support for non-writable unified cgroup hierarchy for container support.
Rebase and de-fuzz. (LP: #1734410)
* Prevent MemoryDenyWrite
CVE-2017-15908 (LP: #1725348)
* networkd: enable promote_secondaries on networkd managed dhcp links.
This fixes failing to renew DHCP lease, on networkd managed devices.
(LP: #1721223)
[ Kleber Sacilotto de Souza ]
* systemd-rfkill service times out when a new rfkill device is added
- rfkill-
udev_
check the device received from udev monitor instead.
- rfkill-
-- Dimitri John Ledkov <email address hidden> Tue, 20 Feb 2018 16:11:58 +0000
Changed in systemd (Ubuntu Artful): | |
status: | Fix Committed → Fix Released |
The verification of the Stable Release Update for systemd has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.
Thanks for reporting this issue. Have you reported it to the systemd developers?