* [Buildroot] [PATCH] package/busybox: disable sha1/sha256 hwaccel with x86 musl toolchains
@ 2023-05-02 22:04 Romain Naour
2023-05-07 13:03 ` Yann E. MORIN
2023-06-05 20:10 ` Peter Korsgaard
0 siblings, 2 replies; 4+ messages in thread
From: Romain Naour @ 2023-05-02 22:04 UTC (permalink / raw)
To: buildroot; +Cc: Romain Naour
Buxybox's init segfault when built with x86 musl toolchain due to
recent changes about sha1 and sha156 hwaccel support in Busybox 1.36.0.
From Alpinelinux [1]:
"main/busybox: disable sha hwaccel
the flag check for this seems incorrect- it triggers sha_ni use when
the instructions aren't available, but avx512vl/bw is - Elly on irc
causes failures in github actions, which have avx512 but no sha_no"
The flag check should be fixed upstream by commit [2].
But init still crash with the latest 1_36_stable (with backported patch)
and master branch...
Disable sha hwaccel with x86 musl toolchains until the issue is fixed.
Checked that qemu_x86_64_defconfig with musl for x86_64 for core2 boot
as expected with sha hwaccel enabled.
The same workaround has been applied to openembedded-core [3].
[1] https://git.alpinelinux.org/aports/commit/main/busybox?id=ae2cfdf6f6da3dc46ee09d8ceafa26921f6e058e
[2] https://git.busybox.net/busybox/commit/?id=bd76b75f72f717150b909e8c64edfda725cabe11
[3] https://github.com/openembedded/openembedded-core/commit/22f639d61127f4b82a79008c5305e44e090a3680
Fixes:
https://gitlab.com/buildroot.org/toolchains-builder/-/jobs/4202276721
Signed-off-by: Romain Naour <romain.naour@gmail.com>
---
package/busybox/busybox.mk | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/package/busybox/busybox.mk b/package/busybox/busybox.mk
index 1633ca525d..eb70f12f86 100644
--- a/package/busybox/busybox.mk
+++ b/package/busybox/busybox.mk
@@ -276,6 +276,15 @@ define BUSYBOX_INSTALL_INDIVIDUAL_BINARIES
endef
endif
+# Disable SHA1 and SHA256 HWACCEL with x86 musl toolchains
+# to avoid segfault with init.
+ifeq ($(BR2_TOOLCHAIN_USES_MUSL):$(BR2_i386),y:y)
+define BUSYBOX_MUSL_DISABLE_SHA_HWACCEL
+ $(call KCONFIG_DISABLE_OPT,CONFIG_SHA1_HWACCEL)
+ $(call KCONFIG_DISABLE_OPT,CONFIG_SHA256_HWACCEL)
+endef
+endif
+
# Only install our logging scripts if no other package does it.
ifeq ($(BR2_PACKAGE_SYSKLOGD)$(BR2_PACKAGE_RSYSLOG)$(BR2_PACKAGE_SYSLOG_NG),)
define BUSYBOX_INSTALL_LOGGING_SCRIPT
@@ -364,6 +373,7 @@ endef
BUSYBOX_TARGET_FINALIZE_HOOKS += BUSYBOX_INSTALL_ADD_TO_SHELLS
define BUSYBOX_KCONFIG_FIXUP_CMDS
+ $(BUSYBOX_MUSL_DISABLE_SHA_HWACCEL)
$(BUSYBOX_SET_MMU)
$(BUSYBOX_PREFER_STATIC)
$(BUSYBOX_SET_MDEV)
--
2.34.3
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Buildroot] [PATCH] package/busybox: disable sha1/sha256 hwaccel with x86 musl toolchains
2023-05-02 22:04 [Buildroot] [PATCH] package/busybox: disable sha1/sha256 hwaccel with x86 musl toolchains Romain Naour
@ 2023-05-07 13:03 ` Yann E. MORIN
2023-05-10 9:04 ` Romain Naour
2023-06-05 20:10 ` Peter Korsgaard
1 sibling, 1 reply; 4+ messages in thread
From: Yann E. MORIN @ 2023-05-07 13:03 UTC (permalink / raw)
To: Romain Naour; +Cc: buildroot
Romain, All,
On 2023-05-03 00:04 +0200, Romain Naour spake thusly:
> Buxybox's init segfault when built with x86 musl toolchain due to
> recent changes about sha1 and sha156 hwaccel support in Busybox 1.36.0.
>
> From Alpinelinux [1]:
> "main/busybox: disable sha hwaccel
> the flag check for this seems incorrect- it triggers sha_ni use when
> the instructions aren't available, but avx512vl/bw is - Elly on irc
>
> causes failures in github actions, which have avx512 but no sha_no"
>
> The flag check should be fixed upstream by commit [2].
>
> But init still crash with the latest 1_36_stable (with backported patch)
> and master branch...
>
> Disable sha hwaccel with x86 musl toolchains until the issue is fixed.
But why is it special to musl, if the issue if about hardware
instructions not being available?
And indeed, the OE patch you referenced also states "we see same on
glibc systems too".
The referenced thread in the busybox ML seem to hint at a musl dynamic
linker issue, because ebx is clobbered. So there is no reason the issue
can't happen with the other C libraries...
Applied to master, thanks.
Regards,
Yann E. MORIN.
> Checked that qemu_x86_64_defconfig with musl for x86_64 for core2 boot
> as expected with sha hwaccel enabled.
>
> The same workaround has been applied to openembedded-core [3].
>
> [1] https://git.alpinelinux.org/aports/commit/main/busybox?id=ae2cfdf6f6da3dc46ee09d8ceafa26921f6e058e
> [2] https://git.busybox.net/busybox/commit/?id=bd76b75f72f717150b909e8c64edfda725cabe11
> [3] https://github.com/openembedded/openembedded-core/commit/22f639d61127f4b82a79008c5305e44e090a3680
>
> Fixes:
> https://gitlab.com/buildroot.org/toolchains-builder/-/jobs/4202276721
>
> Signed-off-by: Romain Naour <romain.naour@gmail.com>
> ---
> package/busybox/busybox.mk | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/package/busybox/busybox.mk b/package/busybox/busybox.mk
> index 1633ca525d..eb70f12f86 100644
> --- a/package/busybox/busybox.mk
> +++ b/package/busybox/busybox.mk
> @@ -276,6 +276,15 @@ define BUSYBOX_INSTALL_INDIVIDUAL_BINARIES
> endef
> endif
>
> +# Disable SHA1 and SHA256 HWACCEL with x86 musl toolchains
> +# to avoid segfault with init.
> +ifeq ($(BR2_TOOLCHAIN_USES_MUSL):$(BR2_i386),y:y)
> +define BUSYBOX_MUSL_DISABLE_SHA_HWACCEL
> + $(call KCONFIG_DISABLE_OPT,CONFIG_SHA1_HWACCEL)
> + $(call KCONFIG_DISABLE_OPT,CONFIG_SHA256_HWACCEL)
> +endef
> +endif
> +
> # Only install our logging scripts if no other package does it.
> ifeq ($(BR2_PACKAGE_SYSKLOGD)$(BR2_PACKAGE_RSYSLOG)$(BR2_PACKAGE_SYSLOG_NG),)
> define BUSYBOX_INSTALL_LOGGING_SCRIPT
> @@ -364,6 +373,7 @@ endef
> BUSYBOX_TARGET_FINALIZE_HOOKS += BUSYBOX_INSTALL_ADD_TO_SHELLS
>
> define BUSYBOX_KCONFIG_FIXUP_CMDS
> + $(BUSYBOX_MUSL_DISABLE_SHA_HWACCEL)
> $(BUSYBOX_SET_MMU)
> $(BUSYBOX_PREFER_STATIC)
> $(BUSYBOX_SET_MDEV)
> --
> 2.34.3
>
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Buildroot] [PATCH] package/busybox: disable sha1/sha256 hwaccel with x86 musl toolchains
2023-05-07 13:03 ` Yann E. MORIN
@ 2023-05-10 9:04 ` Romain Naour
0 siblings, 0 replies; 4+ messages in thread
From: Romain Naour @ 2023-05-10 9:04 UTC (permalink / raw)
To: Yann E. MORIN, Romain Naour; +Cc: buildroot
Hi Yann, All,
Le 07/05/2023 à 15:03, Yann E. MORIN a écrit :
> Romain, All,
>
> On 2023-05-03 00:04 +0200, Romain Naour spake thusly:
>> Buxybox's init segfault when built with x86 musl toolchain due to
>> recent changes about sha1 and sha156 hwaccel support in Busybox 1.36.0.
>>
>> From Alpinelinux [1]:
>> "main/busybox: disable sha hwaccel
>> the flag check for this seems incorrect- it triggers sha_ni use when
>> the instructions aren't available, but avx512vl/bw is - Elly on irc
>>
>> causes failures in github actions, which have avx512 but no sha_no"
>>
>> The flag check should be fixed upstream by commit [2].
>>
>> But init still crash with the latest 1_36_stable (with backported patch)
>> and master branch...
>>
>> Disable sha hwaccel with x86 musl toolchains until the issue is fixed.
>
> But why is it special to musl, if the issue if about hardware
> instructions not being available?
Sorry, I was running out of time to investigate further the issue.
>
> And indeed, the OE patch you referenced also states "we see same on
> glibc systems too".
I was not able to reproduce with glibc.
>
> The referenced thread in the busybox ML seem to hint at a musl dynamic
> linker issue, because ebx is clobbered. So there is no reason the issue
> can't happen with the other C libraries...
Ok.
>
> Applied to master, thanks.
Note: the define is still named BUSYBOX_MUSL_DISABLE_SHA_HWACCEL after your
rework :)
Best regards,
Romain
>
> Regards,
> Yann E. MORIN.
>
>> Checked that qemu_x86_64_defconfig with musl for x86_64 for core2 boot
>> as expected with sha hwaccel enabled.
>>
>> The same workaround has been applied to openembedded-core [3].
>>
>> [1] https://git.alpinelinux.org/aports/commit/main/busybox?id=ae2cfdf6f6da3dc46ee09d8ceafa26921f6e058e
>> [2] https://git.busybox.net/busybox/commit/?id=bd76b75f72f717150b909e8c64edfda725cabe11
>> [3] https://github.com/openembedded/openembedded-core/commit/22f639d61127f4b82a79008c5305e44e090a3680
>>
>> Fixes:
>> https://gitlab.com/buildroot.org/toolchains-builder/-/jobs/4202276721
>>
>> Signed-off-by: Romain Naour <romain.naour@gmail.com>
>> ---
>> package/busybox/busybox.mk | 10 ++++++++++
>> 1 file changed, 10 insertions(+)
>>
>> diff --git a/package/busybox/busybox.mk b/package/busybox/busybox.mk
>> index 1633ca525d..eb70f12f86 100644
>> --- a/package/busybox/busybox.mk
>> +++ b/package/busybox/busybox.mk
>> @@ -276,6 +276,15 @@ define BUSYBOX_INSTALL_INDIVIDUAL_BINARIES
>> endef
>> endif
>>
>> +# Disable SHA1 and SHA256 HWACCEL with x86 musl toolchains
>> +# to avoid segfault with init.
>> +ifeq ($(BR2_TOOLCHAIN_USES_MUSL):$(BR2_i386),y:y)
>> +define BUSYBOX_MUSL_DISABLE_SHA_HWACCEL
>> + $(call KCONFIG_DISABLE_OPT,CONFIG_SHA1_HWACCEL)
>> + $(call KCONFIG_DISABLE_OPT,CONFIG_SHA256_HWACCEL)
>> +endef
>> +endif
>> +
>> # Only install our logging scripts if no other package does it.
>> ifeq ($(BR2_PACKAGE_SYSKLOGD)$(BR2_PACKAGE_RSYSLOG)$(BR2_PACKAGE_SYSLOG_NG),)
>> define BUSYBOX_INSTALL_LOGGING_SCRIPT
>> @@ -364,6 +373,7 @@ endef
>> BUSYBOX_TARGET_FINALIZE_HOOKS += BUSYBOX_INSTALL_ADD_TO_SHELLS
>>
>> define BUSYBOX_KCONFIG_FIXUP_CMDS
>> + $(BUSYBOX_MUSL_DISABLE_SHA_HWACCEL)
>> $(BUSYBOX_SET_MMU)
>> $(BUSYBOX_PREFER_STATIC)
>> $(BUSYBOX_SET_MDEV)
>> --
>> 2.34.3
>>
>> _______________________________________________
>> buildroot mailing list
>> buildroot@buildroot.org
>> https://lists.buildroot.org/mailman/listinfo/buildroot
>
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Buildroot] [PATCH] package/busybox: disable sha1/sha256 hwaccel with x86 musl toolchains
2023-05-02 22:04 [Buildroot] [PATCH] package/busybox: disable sha1/sha256 hwaccel with x86 musl toolchains Romain Naour
2023-05-07 13:03 ` Yann E. MORIN
@ 2023-06-05 20:10 ` Peter Korsgaard
1 sibling, 0 replies; 4+ messages in thread
From: Peter Korsgaard @ 2023-06-05 20:10 UTC (permalink / raw)
To: Romain Naour; +Cc: buildroot
>>>>> "Romain" == Romain Naour <romain.naour@gmail.com> writes:
> Buxybox's init segfault when built with x86 musl toolchain due to
> recent changes about sha1 and sha156 hwaccel support in Busybox 1.36.0.
> From Alpinelinux [1]:
> "main/busybox: disable sha hwaccel
> the flag check for this seems incorrect- it triggers sha_ni use when
> the instructions aren't available, but avx512vl/bw is - Elly on irc
> causes failures in github actions, which have avx512 but no sha_no"
> The flag check should be fixed upstream by commit [2].
> But init still crash with the latest 1_36_stable (with backported patch)
> and master branch...
> Disable sha hwaccel with x86 musl toolchains until the issue is fixed.
> Checked that qemu_x86_64_defconfig with musl for x86_64 for core2 boot
> as expected with sha hwaccel enabled.
> The same workaround has been applied to openembedded-core [3].
> [1]
> https://git.alpinelinux.org/aports/commit/main/busybox?id=ae2cfdf6f6da3dc46ee09d8ceafa26921f6e058e
> [2] https://git.busybox.net/busybox/commit/?id=bd76b75f72f717150b909e8c64edfda725cabe11
> [3]
> https://github.com/openembedded/openembedded-core/commit/22f639d61127f4b82a79008c5305e44e090a3680
> Fixes:
> https://gitlab.com/buildroot.org/toolchains-builder/-/jobs/4202276721
> Signed-off-by: Romain Naour <romain.naour@gmail.com>
Committed to 2023.02.x, thanks.
--
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-06-05 20:10 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-02 22:04 [Buildroot] [PATCH] package/busybox: disable sha1/sha256 hwaccel with x86 musl toolchains Romain Naour
2023-05-07 13:03 ` Yann E. MORIN
2023-05-10 9:04 ` Romain Naour
2023-06-05 20:10 ` Peter Korsgaard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox