Skip to contentSkip to conversation

systemd: Remove clearly incorrect musl patches

RFC PATCH In review Adrian Bunk 4 participants 7 messages Jun 14, 2019 – Jun 22, 2019

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 systemd: Remove clearly incorrect musl patches

This removes clearly incorrect musl patches and marks systemd as incompatible with musl until these issues are fixed.

The previous status quo where systemd was made compiling with patches that are known to introduce bugs and security vulnerabilities silently delivered a sub-standard package to users, this change makes it clear where work is needed to be done by people interested in systemd on musl.

Patches that are merely questionable or not upstreamable are not touched.

---
 ...en-secure-versions-are-not-available.patch |  32 ----
 ...002-don-t-use-glibc-specific-qsort_r.patch | 163 ------------------
 ...LOB_BRACE-and-GLOB_ALTDIRFUNC-is-not.patch | 155 -----------------
 ...008-add-missing-FTW_-macros-for-musl.patch |  47 -----
 meta/recipes-core/systemd/systemd_242.bb      |   8 +-
 5 files changed, 4 insertions(+), 401 deletions(-)
 delete mode 100644 meta/recipes-core/systemd/systemd/0001-Use-getenv-when-secure-versions-are-not-available.patch
 delete mode 100644 meta/recipes-core/systemd/systemd/0002-don-t-use-glibc-specific-qsort_r.patch
 delete mode 100644 meta/recipes-core/systemd/systemd/0007-don-t-fail-if-GLOB_BRACE-and-GLOB_ALTDIRFUNC-is-not.patch
 delete mode 100644 meta/recipes-core/systemd/systemd/0008-add-missing-FTW_-macros-for-musl.patch
meta/recipes-core/systemd/systemd/0001-Use-getenv-when-secure-versions-are-not-available.patch deleted +0 -32
deleted file mode 100644
index 37979755d0..0000000000
@@ -1,32 +0,0 @@
-From b8055a61b5df6b43b8d3117936587b874b0a339b Mon Sep 17 00:00:00 2001
-From: Chen Qi <[email protected]>
-Date: Mon, 25 Feb 2019 11:01:18 +0800
-Subject: [PATCH 01/24] Use getenv when secure versions are not available
-
-musl doesnt implement secure version, so we default
-to it if configure does not detect a secure implementation
-
-Signed-off-by: Khem Raj <[email protected]>
-
-Upstream-Status: Denied
-
-Signed-off-by: Chen Qi <[email protected]>
----
- src/basic/missing_stdlib.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/basic/missing_stdlib.h b/src/basic/missing_stdlib.h
-index 188a8d4..c0ffe86 100644
---- a/src/basic/missing_stdlib.h
-+++ b/src/basic/missing_stdlib.h
-@@ -8,6 +8,6 @@
- #  if HAVE___SECURE_GETENV
- #    define secure_getenv __secure_getenv
- #  else
--#    error "neither secure_getenv nor __secure_getenv are available"
-+#    define secure_getenv getenv
- #  endif
- #endif
--- 
-2.7.4
-
meta/recipes-core/systemd/systemd/0002-don-t-use-glibc-specific-qsort_r.patch deleted +0 -163

163 lines not on this page · raw message

meta/recipes-core/systemd/systemd/0007-don-t-fail-if-GLOB_BRACE-and-GLOB_ALTDIRFUNC-is-not.patch deleted +0 -155

155 lines not on this page · raw message

meta/recipes-core/systemd/systemd/0008-add-missing-FTW_-macros-for-musl.patch deleted +0 -47

47 lines not on this page · raw message

meta/recipes-core/systemd/systemd_242.bb +4 -4
index 90f235be3d..1667e3ead5 100644
@@ -28,14 +28,11 @@ SRC_URI += "file://touchscreen.rules \
 
 # patches needed by musl
 SRC_URI_append_libc-musl = " ${SRC_URI_MUSL}"
-SRC_URI_MUSL = "file://0001-Use-getenv-when-secure-versions-are-not-available.patch \
-               file://0002-don-t-use-glibc-specific-qsort_r.patch \
+SRC_URI_MUSL = " \
                file://0003-missing_type.h-add-__compare_fn_t-and-comparison_fn_.patch \
                file://0004-add-fallback-parse_printf_format-implementation.patch \
                file://0005-src-basic-missing.h-check-for-missing-strndupa.patch \
                file://0006-Include-netinet-if_ether.h.patch \
-               file://0007-don-t-fail-if-GLOB_BRACE-and-GLOB_ALTDIRFUNC-is-not.patch \
-               file://0008-add-missing-FTW_-macros-for-musl.patch \
                file://0010-fix-missing-of-__register_atfork-for-non-glibc-build.patch \
                file://0011-Use-uintmax_t-for-handling-rlim_t.patch \
                file://0001-Replace-the-legacy-ULONG_LONG_MAX-with-the-C99-ULLON.patch \
@@ -54,6 +51,9 @@ SRC_URI_MUSL = "file://0001-Use-getenv-when-secure-versions-are-not-available.pa
                file://0001-do-not-disable-buffer-in-writing-files.patch \
                "
 
+# Several musl problems do not yet have a correct fix
+COMPATIBLE_HOST_libc-musl = "null"
+
 PAM_PLUGINS = " \
     pam-plugin-unix \
     pam-plugin-loginuid \
Signature · 1 line
2.17.1
#1 lore raw
Quoted 4 lines · Adrian Bunk

This removes clearly incorrect musl patches and marks systemd as incompatible with musl until these issues are fixed.

Quoted 8 lines

The previous status quo where systemd was made compiling with patches that are known to introduce bugs and security vulnerabilities silently delivered a sub-standard package to users, this change makes it clear where work is needed to be done by people interested in systemd on musl.

Patches that are merely questionable or not upstreamable are not touched.

I'll be interested to see what others think of this, I can't imagine this move being very popular...

You can make arguments both ways.

Cheers,

Richard

#2 lore raw
Quoted 11 lines · Richard Purdie
Quoted 10 lines · Adrian Bunk

This removes clearly incorrect musl patches and marks systemd as incompatible with musl until these issues are fixed.

The previous status quo where systemd was made compiling with patches that are known to introduce bugs and security vulnerabilities silently delivered a sub-standard package to users, this change makes it clear where work is needed to be done by people interested in systemd on musl.

Quoted 6 lines
Quoted 2 lines

Patches that are merely questionable or not upstreamable are not touched.

I'll be interested to see what others think of this, I can't imagine this move being very popular...

There are real products using this combination
And this is not a good message, eventually we want to either fix or stop supporting this but I think now is not the time

Quoted 13 lines

You can make arguments both ways.

Cheers,

Richard

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

#3 lore raw
Quoted 14 lines · Khem Raj
Quoted 11 lines · Richard Purdie
Quoted 10 lines · Adrian Bunk

This removes clearly incorrect musl patches and marks systemd as incompatible with musl until these issues are fixed.

The previous status quo where systemd was made compiling with patches that are known to introduce bugs and security vulnerabilities silently delivered a sub-standard package to users, this change makes it clear where work is needed to be done by people interested in systemd on musl.

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

Patches that are merely questionable or not upstreamable are not touched.

I'll be interested to see what others think of this, I can't imagine this move being very popular...

There are real products using this combination

An OE-only combination neither upstream supports.

Quoted 2 lines

And this is not a good message, eventually we want to either fix or stop supporting this but I think now is not the time

When is the time?

In a month?
Before the Yocto 2.8 branching?
After the Yocto 2.8 branching?

The best solution would be if someone would step up to properly maintain the systemd/musl combination, but usually such "either fix or stop" only work with a clear deadline.

cu
Adrian

Signature · 4 lines
       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed
#4 lore raw
Quoted 26 lines · Adrian Bunk
Quoted 14 lines · Khem Raj
Quoted 11 lines · Richard Purdie
Quoted 10 lines · Adrian Bunk

This removes clearly incorrect musl patches and marks systemd as incompatible with musl until these issues are fixed.

The previous status quo where systemd was made compiling with patches that are known to introduce bugs and security vulnerabilities silently delivered a sub-standard package to users, this change makes it clear where work is needed to be done by people interested in systemd on musl.

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

Patches that are merely questionable or not upstreamable are not touched.

I'll be interested to see what others think of this, I can't imagine this move being very popular...

There are real products using this combination

An OE-only combination neither upstream supports.

Quoted 9 lines
Quoted 2 lines

And this is not a good message, eventually we want to either fix or stop supporting this but I think now is not the time

When is the time?

In a month?
Before the Yocto 2.8 branching?
After the Yocto 2.8 branching?

When users that I know stop using it, and that might be a release or two. Meanwhile
I think it will be good to address the issues with patches, if they introduce bugs or secvulns
that I think will help the user community instead of removing the support.

meanwhile, I would think that we can still work slowly towards making things better
musl has provided a lot of good cleanup patches for systemd so this is not a wasted
effort even if upstream systemd does not officially support anything besides glibc.

Quoted 17 lines

The best solution would be if someone would step up to properly maintain the systemd/musl combination, but usually such "either fix or stop" only work with a clear deadline.

cu
Adrian

--

"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed

#5 lore raw
Quoted 43 lines · Khem Raj
Quoted 26 lines · Adrian Bunk
Quoted 14 lines · Khem Raj
Quoted 11 lines · Richard Purdie
Quoted 10 lines · Adrian Bunk

This removes clearly incorrect musl patches and marks systemd as incompatible with musl until these issues are fixed.

The previous status quo where systemd was made compiling with patches that are known to introduce bugs and security vulnerabilities silently delivered a sub-standard package to users, this change makes it clear where work is needed to be done by people interested in systemd on musl.

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

Patches that are merely questionable or not upstreamable are not touched.

I'll be interested to see what others think of this, I can't imagine this move being very popular...

There are real products using this combination

An OE-only combination neither upstream supports.

Quoted 9 lines
Quoted 2 lines

And this is not a good message, eventually we want to either fix or stop supporting this but I think now is not the time

When is the time?

In a month?
Before the Yocto 2.8 branching?
After the Yocto 2.8 branching?

When users that I know stop using it, and that might be a release or two. Meanwhile
I think it will be good to address the issues with patches, if they introduce bugs or secvulns
that I think will help the user community instead of removing the support.

Quoted 6 lines

meanwhile, I would think that we can still work slowly towards making things better
musl has provided a lot of good cleanup patches for systemd so this is not a wasted
effort even if upstream systemd does not officially support anything besides glibc.

I don't use systemd/musl combination myself, but I agree with Khem.

As long as these bad musl related patches are applied to systemd only when musl is used, then it's no harm to people not using systemd/musl combo.

We can even PNBLACKLIST systemd when musl is being used with warning that these patches are wrong and create security issues (more details would be useful for the user to make educated decisions).

If we just remove them, then people who use this combo (for whatever reason) will just import them to their layers and either fix them locally (and never share it back) or use this bad version forever.

Keeping them with blacklist in oe-core will prevent people accidentally assuming that systemd/musl is well supported combination while allowing interested people to collaborate on fixing the patches in oe-core.

Regards,

Quoted 22 lines
Quoted 17 lines

The best solution would be if someone would step up to properly maintain the systemd/musl combination, but usually such "either fix or stop" only work with a clear deadline.

cu
Adrian

--

"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed

Signature · 4 lines
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core
Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]
#6 lore raw
In reply to Khem Raj
Quoted 6 lines · Khem Raj

...
musl has provided a lot of good cleanup patches for systemd so this is not a wasted
effort even if upstream systemd does not officially support anything besides glibc.
...

I have yet to see a patch that provides actual benefits for upstream, and my overall impression of musl support patches is that they do more harm than good for everything except making musl build.

Like I have a WTF feeling each time !defined(__GLIBC__) is used instead of defined(__MUSL__) for musl-only code - as if there were only two C libraries in the world.

You already did a lot regarding taking code from gnulib to add glibc functionality on top of musl, and that's the direction that would have to be followed for more functionality that is missing in musl or where musl provides the POSIX version instead of the GNU version of a function (e.g. strerror_r()).

All this is doable, but it's a lot of hacks and workarounds and not much in generally useful cleanups.

cu
Adrian

Signature · 4 lines
       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed