Skip to contentSkip to conversation

libressl: enable for noMMU

PATCH New Waldemar Brodkorb 2 participants 2 messages Dec 10, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libressl: enable for noMMU

We need to use pthread_atfork for Linuxthreads. Add a check if fork() is available, otherwise use vfork().

---
 package/libressl/0003-uclibc-linuxthreads.patch | 12 ++++++
 package/libressl/0004-uclibc-fork.patch         | 52 +++++++++++++++++++++++++
 package/openssl/Config.in                       |  2 -
 3 files changed, 64 insertions(+), 2 deletions(-)
 create mode 100644 package/libressl/0003-uclibc-linuxthreads.patch
 create mode 100644 package/libressl/0004-uclibc-fork.patch
package/libressl/0003-uclibc-linuxthreads.patch new file +12 -0
new file mode 100644
index 0000000000..4ea702e5fa
@@ -0,0 +1,12 @@
+diff -Nur libressl-2.6.3.orig/crypto/compat/arc4random_linux.h libressl-2.6.3/crypto/compat/arc4random_linux.h
+--- libressl-2.6.3.orig/crypto/compat/arc4random_linux.h	2017-11-06 00:15:17.000000000 +0100
++++ libressl-2.6.3/crypto/compat/arc4random_linux.h	2017-12-02 02:12:55.407388811 +0100
+@@ -32,7 +32,7 @@
+ #define _ARC4_LOCK()   pthread_mutex_lock(&arc4random_mtx)
+ #define _ARC4_UNLOCK() pthread_mutex_unlock(&arc4random_mtx)
+ 
+-#ifdef __GLIBC__
++#if defined __GLIBC__ && !defined __UCLIBC_HAS_LINUXTHREADS__
+ extern void *__dso_handle;
+ extern int __register_atfork(void (*)(void), void(*)(void), void (*)(void), void *);
+ #define _ARC4_ATFORK(f) __register_atfork(NULL, NULL, (f), __dso_handle)
package/libressl/0004-uclibc-fork.patch new file +52 -0

52 lines not on this page · raw message

package/openssl/Config.in +0 -2
index d84033141f..e33320afc5 100644
@@ -48,8 +48,6 @@ endif
 config BR2_PACKAGE_LIBRESSL
 	bool "libressl"
 	depends on !BR2_PACKAGE_OPENSSL_FORCE_LIBOPENSSL
-	# uClibc on noMMU doesn't provide __register_atfork()
-	depends on !(BR2_TOOLCHAIN_USES_UCLIBC && !BR2_USE_MMU)
 	help
 	  LibreSSL is a version of the TLS/crypto stack forked from
 	  OpenSSL in 2014, with goals of modernizing the codebase,
Signature · 1 line
2.11.0
#1 lore raw

PATCH 1/1 libressl: enable for noMMU

Quoted 5 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Waldemar" == Waldemar Brodkorb <[email protected]> writes:

We need to use pthread_atfork for Linuxthreads. Add a check if fork() is available, otherwise use vfork().

Quoted 8 lines
---
 package/libressl/0003-uclibc-linuxthreads.patch | 12 ++++++
 package/libressl/0004-uclibc-fork.patch         | 52 +++++++++++++++++++++++++
 package/openssl/Config.in                       |  2 -
 3 files changed, 64 insertions(+), 2 deletions(-)
 create mode 100644 package/libressl/0003-uclibc-linuxthreads.patch
 create mode 100644 package/libressl/0004-uclibc-fork.patch

The patches are missing descriptions and signed-off-by.

Have these patches been sent upstream? Were they accepted? While minimal, these are really feature patches and in a security critical package.

Signature · 1 line
Bye, Peter Korsgaard