Skip to contentSkip to conversation

systemd: fix musl compilation

PATCH Superseded Sinan Kaya 3 participants 6 messages Mar 29, 2019 – Apr 10, 2019

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Sinan Kaya

author
#0 lore raw

PATCH 1/1 systemd: fix musl compilation

musl compilation has been broken since systemd: fix CVE-2018-6954. Fixing this by placing #ifdef for glob definition.

---
 .../systemd/0036-Fix-musl-compilation.patch   | 27 +++++++++++++++++++
 meta/recipes-core/systemd/systemd_237.bb      |  1 +
 2 files changed, 28 insertions(+)
 create mode 100644 meta/recipes-core/systemd/systemd/0036-Fix-musl-compilation.patch
meta/recipes-core/systemd/systemd/0036-Fix-musl-compilation.patch new file +27 -0
new file mode 100644
index 00000000000..d12b0415f65
@@ -0,0 +1,27 @@
+From 8795fe183a92e6bc6a1221a5aad4103eaca13823 Mon Sep 17 00:00:00 2001
+From: Sinan Kaya <[email protected]>
+Date: Tue, 26 Mar 2019 02:45:53 +0000
+Subject: [PATCH] Fix musl compilation
+
+Signed-off-by: Sinan Kaya <[email protected]>
+---
+ src/tmpfiles/tmpfiles.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c
+index d59ccbaa3..8d1ab0767 100644
+--- a/src/tmpfiles/tmpfiles.c
++++ b/src/tmpfiles/tmpfiles.c
+@@ -1899,7 +1899,9 @@ static int glob_item(Item *i, action_t action) {
+ 
+ static int glob_item_recursively(Item *i, fdaction_t action) {
+         _cleanup_globfree_ glob_t g = {
++#ifdef GLOB_ALTDIRFUNC
+                 .gl_opendir = (void *(*)(const char *)) opendir_nomod,
++#endif
+         };
+         int r = 0, k;
+         char **fn;
+-- 
+2.21.0
+
meta/recipes-core/systemd/systemd_237.bb +1 -0
index a0e5d512e00..3b5222a2943 100644
@@ -65,6 +65,7 @@ SRC_URI += "file://touchscreen.rules \
            file://0002-Make-tmpfiles-safe.patch \
            file://CVE-2019-6454.patch \
            file://sd-bus-if-we-receive-an-invalid-dbus-message-ignore-.patch \
+           file://0036-Fix-musl-compilation.patch \
            "
 SRC_URI_append_qemuall = " file://0001-core-device.c-Change-the-default-device-timeout-to-2.patch"
 
Signature · 1 line
2.21.0
author
#1 lore raw
Quoted 4 lines · Sinan Kaya

musl compilation has been broken since systemd: fix CVE-2018-6954. Fixing this by placing #ifdef for glob definition.

I didn't see any comments here but I wanted to let everyone know that sumo-next branch is currently broken with MUSL unless this patch is applied.

#2 lore raw
Quoted 10 lines · Sinan Kaya
Quoted 5 lines · Sinan Kaya

musl compilation has been broken since systemd: fix CVE-2018-6954. Fixing this
by placing #ifdef for glob definition.

I didn't see any comments here but I wanted to let everyone know that sumo-next branch is currently broken with MUSL unless this patch is applied.

Thanks for the reminder. it will be in my next merge series.

- armin

#3 lore raw
In reply to Sinan Kaya
Quoted 10 lines · Sinan Kaya
Quoted 5 lines · Sinan Kaya

musl compilation has been broken since systemd: fix CVE-2018-6954. Fixing this
by placing #ifdef for glob definition.

I didn't see any comments here but I wanted to let everyone know that sumo-next branch is currently broken with MUSL unless this patch is applied.

After closer look, I don't the "Upstream-Status:" nor a signoff in the patch being added in the bb file.

Does this issue affect later branches ?

- armin

author
#4 lore raw
Quoted 4 lines · akuster

After closer look, I don't the "Upstream-Status:" nor a signoff in the patch being added in the bb file.

Does this issue affect later branches ?

I can fix this. The issue was introduced while backporting a CVE patch from debian.

So, we are fixing a problem by patching "the patch".

We'd squash this into the original CVE under normal circumstances but original patch has been already checked in.

Can I assume that upstream status would be "inappropriate"?

I can add these tags once we reach to an agreement.

#5 lore raw
Quoted 10 lines · Sinan Kaya
Quoted 4 lines · akuster

After closer look, I don't the "Upstream-Status:" nor a signoff in the patch being added in the bb file.

Does this issue affect later branches ?

I can fix this. The issue was introduced while backporting a CVE patch from debian.

So, we are fixing a problem by patching "the patch".

Ah, sorry that didn't register.

Quoted 5 lines

We'd squash this into the original CVE under normal circumstances but original patch has been already checked in.

Can I assume that upstream status would be "inappropriate"?

Its not applicable in this case.

Maybe a note for the patch and your signoff seems more than enough unless the broader community has an issue with that. .

thanks,
Armin

Quoted 2 lines

I can add these tags once we reach to an agreement.