Skip to contentSkip to conversation

package/binutils: bump 2.35.x series to 2.35.2

PATCH New Thomas Petazzoni 3 participants 13 messages Jan 31, 2021 – Feb 4, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/5 package/binutils: bump 2.35.x series to 2.35.2

Release notes:

https://sourceware.org/pipermail/binutils/2021-January/115150.html

---
 package/binutils/{2.35.1 => 2.35.2}/0001-sh-conf.patch        | 0
 .../{2.35.1 => 2.35.2}/0002-poison-system-directories.patch   | 0
 package/binutils/Config.in.host                               | 4 ++--
 package/binutils/binutils.hash                                | 2 +-
 4 files changed, 3 insertions(+), 3 deletions(-)
 rename package/binutils/{2.35.1 => 2.35.2}/0001-sh-conf.patch (100%)
 rename package/binutils/{2.35.1 => 2.35.2}/0002-poison-system-directories.patch (100%)
package/binutils/2.35.2/0001-sh-conf.patch renamed from package/binutils/2.35.1/0001-sh-conf.patch +0 -0
similarity index 100%
rename from package/binutils/2.35.1/0001-sh-conf.patch
rename to package/binutils/2.35.2/0001-sh-conf.patch
package/binutils/2.35.2/0002-poison-system-directories.patch renamed from package/binutils/2.35.1/0002-poison-system-directories.patch +0 -0
similarity index 100%
rename from package/binutils/2.35.1/0002-poison-system-directories.patch
rename to package/binutils/2.35.2/0002-poison-system-directories.patch
package/binutils/Config.in.host +2 -2
index 89c6894a1f..49daf3b70a 100644
@@ -32,7 +32,7 @@ config BR2_BINUTILS_VERSION_2_34_X
 	depends on !BR2_BINFMT_FLAT
 
 config BR2_BINUTILS_VERSION_2_35_X
-	bool "binutils 2.35.1"
+	bool "binutils 2.35.2"
 	depends on !BR2_csky
 	# https://github.com/uclinux-dev/elf2flt/pull/16
 	# https://github.com/uclinux-dev/elf2flt/issues/12
@@ -55,7 +55,7 @@ config BR2_BINUTILS_VERSION
 	default "2.32"		if BR2_BINUTILS_VERSION_2_32_X
 	default "2.33.1"	if BR2_BINUTILS_VERSION_2_33_X
 	default "2.34"		if BR2_BINUTILS_VERSION_2_34_X
-	default "2.35.1"	if BR2_BINUTILS_VERSION_2_35_X
+	default "2.35.2"	if BR2_BINUTILS_VERSION_2_35_X
 
 config BR2_BINUTILS_ENABLE_LTO
 	bool
package/binutils/binutils.hash +1 -1
index ce5b0cdca8..ff91e802cc 100644
@@ -2,7 +2,7 @@
 sha512  d326408f12a03d9a61a9de56584c2af12f81c2e50d2d7e835d51565df8314df01575724afa1e43bd0db45cfc9916b41519b67dfce03232aa4978704492a6994a  binutils-2.32.tar.xz
 sha512  b7a6767c6c7ca6b5cafa7080e6820b7bb3a53b7148348c438d99905defbdf0d30c9744a484ee01c9441a8153901808513366b15ba9533e20c9673c262ade36ac  binutils-2.33.1.tar.xz
 sha512  2c7976939dcf5e8c5b7374cccd39bfe803b1bec73c6abfa0eb17c24e1942574c6bdb874c66a092a82adc443182eacd8a5a8001c19a76101f0c7ba40c27de0bbd  binutils-2.34.tar.xz
-sha512  94ff72708403413b70b247f3af4099ebaa882b6659249869f1ed9941a0f1912e313f08357d470f9fd2359e7f5e5b0eb86285e5eaf883fa8187789d6b1bd304eb  binutils-2.35.1.tar.xz
+sha512  9974ede5978d32e0d68fef23da48fa00bd06b0bff7ec45b00ca075c126d6bbe0cf2defc03ecc3f17bc6cc85b64271a13009c4049d7ba17de26e84e3a6e2c0348  binutils-2.35.2.tar.xz
 
 # Locally calculated (fetched from Github)
 sha512  76a8227a19218435319c660e4983ea17985194b7f496f163e97543e7f6fd3e9249241fdc05a16ba512fba96a1d846c1f7b080983404d821d6215f10e7f11e238  binutils-gdb-arc-2020.09-release.tar.gz
Signature · 1 line
2.29.2
#1 lore raw

PATCH 2/5 package/binutils: add support for version 2.36

Release e-mail:

https://sourceware.org/pipermail/binutils/2021-January/115071.html

---
 package/binutils/2.36/0001-sh-conf.patch      |  48 +++
 .../2.36/0002-poison-system-directories.patch | 306 ++++++++++++++++++
 package/binutils/Config.in.host               |   8 +
 package/binutils/binutils.hash                |   1 +
 4 files changed, 363 insertions(+)
 create mode 100644 package/binutils/2.36/0001-sh-conf.patch
 create mode 100644 package/binutils/2.36/0002-poison-system-directories.patch
package/binutils/2.36/0001-sh-conf.patch new file +48 -0
new file mode 100644
index 0000000000..0070e582fa
@@ -0,0 +1,48 @@
+From f88f4c77266b9669b285ab64386cf39e183661bb Mon Sep 17 00:00:00 2001
+From: Romain Naour <[email protected]>
+Date: Fri, 25 Dec 2015 11:38:13 +0100
+Subject: [PATCH] sh-conf
+
+Likewise, binutils has no idea about any of these new targets either, so we
+fix that up too.. now we're able to actually build a real toolchain for
+sh2a_nofpu- and other more ineptly named toolchains (and yes, there are more
+inept targets than that one, really. Go look, I promise).
+
+[Romain: rebase on top of 2.32]
+Signed-off-by: Romain Naour <[email protected]>
+[Thomas: rebase on top of 2.29, in which sh64 support was removed.]
+Signed-off-by: Thomas Petazzoni <[email protected]>
+---
+ configure    | 2 +-
+ configure.ac | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/configure b/configure
+index 68779feb42b..8b4333b2c15 100755
+--- a/configure
++++ b/configure
+@@ -3887,7 +3887,7 @@ case "${target}" in
+   nvptx*-*-*)
+     noconfigdirs="$noconfigdirs target-libssp target-libstdc++-v3 target-libobjc"
+     ;;
+-  sh-*-*)
++  sh*-*-*)
+     case "${target}" in
+       sh*-*-elf)
+          ;;
+diff --git a/configure.ac b/configure.ac
+index d16a2757689..035854759ed 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1177,7 +1177,7 @@ case "${target}" in
+   nvptx*-*-*)
+     noconfigdirs="$noconfigdirs target-libssp target-libstdc++-v3 target-libobjc"
+     ;;
+-  sh-*-*)
++  sh*-*-*)
+     case "${target}" in
+       sh*-*-elf)
+          ;;
+-- 
+2.29.2
+
package/binutils/2.36/0002-poison-system-directories.patch new file +306 -0

306 lines not on this page · raw message

package/binutils/Config.in.host +8 -0
index 49daf3b70a..237aafc136 100644
@@ -38,6 +38,13 @@ config BR2_BINUTILS_VERSION_2_35_X
 	# https://github.com/uclinux-dev/elf2flt/issues/12
 	depends on !BR2_BINFMT_FLAT
 
+config BR2_BINUTILS_VERSION_2_36_X
+	bool "binutils 2.36"
+	depends on !BR2_csky
+	# https://github.com/uclinux-dev/elf2flt/pull/16
+	# https://github.com/uclinux-dev/elf2flt/issues/12
+	depends on !BR2_BINFMT_FLAT
+
 config BR2_BINUTILS_VERSION_ARC
 	bool "binutils arc (2.34.50)"
 	depends on BR2_arc
@@ -56,6 +63,7 @@ config BR2_BINUTILS_VERSION
 	default "2.33.1"	if BR2_BINUTILS_VERSION_2_33_X
 	default "2.34"		if BR2_BINUTILS_VERSION_2_34_X
 	default "2.35.2"	if BR2_BINUTILS_VERSION_2_35_X
+	default "2.36"		if BR2_BINUTILS_VERSION_2_36_X
 
 config BR2_BINUTILS_ENABLE_LTO
 	bool
package/binutils/binutils.hash +1 -0
index ff91e802cc..35e688a21e 100644
@@ -3,6 +3,7 @@ sha512  d326408f12a03d9a61a9de56584c2af12f81c2e50d2d7e835d51565df8314df01575724a
 sha512  b7a6767c6c7ca6b5cafa7080e6820b7bb3a53b7148348c438d99905defbdf0d30c9744a484ee01c9441a8153901808513366b15ba9533e20c9673c262ade36ac  binutils-2.33.1.tar.xz
 sha512  2c7976939dcf5e8c5b7374cccd39bfe803b1bec73c6abfa0eb17c24e1942574c6bdb874c66a092a82adc443182eacd8a5a8001c19a76101f0c7ba40c27de0bbd  binutils-2.34.tar.xz
 sha512  9974ede5978d32e0d68fef23da48fa00bd06b0bff7ec45b00ca075c126d6bbe0cf2defc03ecc3f17bc6cc85b64271a13009c4049d7ba17de26e84e3a6e2c0348  binutils-2.35.2.tar.xz
+sha512  0b89b70d4ad5cfe5bd0011dc7e342ae9de96efdbfc3442a0d6b5f7660e38bbcad36f2c72ba8f074323f02bde022ff1cd723ae99f0ea55cf94ee2dbbc0e4efdb2  binutils-2.36.tar.xz
 
 # Locally calculated (fetched from Github)
 sha512  76a8227a19218435319c660e4983ea17985194b7f496f163e97543e7f6fd3e9249241fdc05a16ba512fba96a1d846c1f7b080983404d821d6215f10e7f11e238  binutils-gdb-arc-2020.09-release.tar.gz
Signature · 1 line
2.29.2
#3 lore raw

PATCH 3/5 package/binutils: switch to 2.35.x as the default version

In reply to Thomas Petazzoni

Now that 2.36 has been released, let's use 2.35.x as the default binutils version.

---
 package/binutils/Config.in.host | 2 +-
 package/binutils/binutils.mk    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
package/binutils/Config.in.host +1 -1
index 237aafc136..d857c485d3 100644
@@ -7,7 +7,7 @@ config BR2_PACKAGE_HOST_BINUTILS_SUPPORTS_CFI
 
 choice
 	prompt "Binutils Version"
-	default BR2_BINUTILS_VERSION_2_34_X if !BR2_arc && !BR2_csky
+	default BR2_BINUTILS_VERSION_2_35_X if !BR2_arc && !BR2_csky
 	default BR2_BINUTILS_VERSION_ARC if BR2_arc
 	default BR2_BINUTILS_VERSION_CSKY if BR2_csky
 	help
package/binutils/binutils.mk +1 -1
index aff7f4ba86..e469febbb4 100644
@@ -11,7 +11,7 @@ ifeq ($(BINUTILS_VERSION),)
 ifeq ($(BR2_arc),y)
 BINUTILS_VERSION = arc-2020.09-release
 else
-BINUTILS_VERSION = 2.34
+BINUTILS_VERSION = 2.35.2
 endif
 endif # BINUTILS_VERSION
 
Signature · 1 line
2.29.2
#4 lore raw

PATCH 3/5 package/binutils: switch to 2.35.x as the default version

Quoted 6 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

Now that 2.36 has been released, let's use 2.35.x as the default binutils version.

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard
#5 lore raw

PATCH 4/5 package/binutils: drop 2.33.x series

In reply to Thomas Petazzoni

Now that 2.36.x has been added, that 2.35.x is the default version, drop support for 2.33.x.

Note that we keep binutils 2.32.x as it is the latest version that works for FLAT binaries (used on noMMU platforms).

---
 Config.in.legacy                              |   7 +
 package/binutils/2.33.1/0001-sh-conf.patch    |  48 --
 .../0002-poison-system-directories.patch      | 306 -------------
 .../0004-bfd-xtensa-fix-PR-ld-25630.patch     |  37 --
 .../2.33.1/0005-xtensa-fix-PR-ld-25861.patch  | 432 ------------------
 ...TENSA_NDIFF-handling-for-PR-ld-25861.patch | 128 ------
 package/binutils/Config.in.host               |   8 -
 package/binutils/binutils.hash                |   1 -
 8 files changed, 7 insertions(+), 960 deletions(-)
 delete mode 100644 package/binutils/2.33.1/0001-sh-conf.patch
 delete mode 100644 package/binutils/2.33.1/0002-poison-system-directories.patch
 delete mode 100644 package/binutils/2.33.1/0004-bfd-xtensa-fix-PR-ld-25630.patch
 delete mode 100644 package/binutils/2.33.1/0005-xtensa-fix-PR-ld-25861.patch
 delete mode 100644 package/binutils/2.33.1/0006-xtensa-fix-XTENSA_NDIFF-handling-for-PR-ld-25861.patch
Config.in.legacy +7 -0
index 2bf39d7175..18f9bc5478 100644
@@ -146,6 +146,13 @@ endif
 
 comment "Legacy options removed in 2021.02"
 
+config BR2_BINUTILS_VERSION_2_33_X
+	bool "binutils 2.33.x has been removed"
+	select BR2_LEGACY
+	help
+	  binutils 2.33.x has been removed, use a newer version.
+
+
 config BR2_PACKAGE_LIBUPNP18
 	bool "libupnp18 package removed"
 	select BR2_LEGACY
package/binutils/2.33.1/0001-sh-conf.patch deleted +0 -48

48 lines not on this page · raw message

package/binutils/2.33.1/0002-poison-system-directories.patch deleted +0 -306

306 lines not on this page · raw message

package/binutils/2.33.1/0004-bfd-xtensa-fix-PR-ld-25630.patch deleted +0 -37
deleted file mode 100644
index f499426b70..0000000000
@@ -1,37 +0,0 @@
-From 85dcca5997cf3822d6456a5c9c59c46b56adfbb8 Mon Sep 17 00:00:00 2001
-From: Max Filippov <[email protected]>
-Date: Wed, 4 Mar 2020 14:54:27 -0800
-Subject: [PATCH] bfd: xtensa: fix PR ld/25630
-
-bfd/
-2020-03-05  Max Filippov  <[email protected]>
-
-	* elf32-xtensa.c (shrink_dynamic_reloc_sections): Shrink dynamic
-	relocation sections for any removed reference to a dynamic symbol.
-
-Signed-off-by: Max Filippov <[email protected]>
----
- bfd/elf32-xtensa.c | 7 +++----
- 1 file changed, 3 insertions(+), 4 deletions(-)
-
-diff --git a/bfd/elf32-xtensa.c b/bfd/elf32-xtensa.c
-index 12ff9f772aaf..65e14d87940c 100644
---- a/bfd/elf32-xtensa.c
-+++ b/bfd/elf32-xtensa.c
-@@ -10148,10 +10148,9 @@ shrink_dynamic_reloc_sections (struct bfd_link_info *info,
- 
-   if ((r_type == R_XTENSA_32 || r_type == R_XTENSA_PLT)
-       && (input_section->flags & SEC_ALLOC) != 0
--      && (dynamic_symbol || bfd_link_pic (info))
--      && (!h || h->root.type != bfd_link_hash_undefweak
--	  || (dynamic_symbol
--	      && (bfd_link_dll (info) || info->export_dynamic))))
-+      && (dynamic_symbol
-+	  || (bfd_link_pic (info)
-+	      && (!h || h->root.type != bfd_link_hash_undefweak))))
-     {
-       asection *srel;
-       bfd_boolean is_plt = FALSE;
--- 
-2.20.1
-
package/binutils/2.33.1/0005-xtensa-fix-PR-ld-25861.patch deleted +0 -432

432 lines not on this page · raw message

package/binutils/2.33.1/0006-xtensa-fix-XTENSA_NDIFF-handling-for-PR-ld-25861.patch deleted +0 -128

128 lines not on this page · raw message

package/binutils/Config.in.host +0 -8
index d857c485d3..8622ebf3f3 100644
@@ -17,13 +17,6 @@ config BR2_BINUTILS_VERSION_2_32_X
 	bool "binutils 2.32"
 	depends on !BR2_csky
 
-config BR2_BINUTILS_VERSION_2_33_X
-	bool "binutils 2.33.1"
-	depends on !BR2_csky
-	# https://github.com/uclinux-dev/elf2flt/pull/16
-	# https://github.com/uclinux-dev/elf2flt/issues/12
-	depends on !BR2_BINFMT_FLAT
-
 config BR2_BINUTILS_VERSION_2_34_X
 	bool "binutils 2.34"
 	depends on !BR2_csky
@@ -60,7 +53,6 @@ config BR2_BINUTILS_VERSION
 	default "arc-2020.09-release"	if BR2_BINUTILS_VERSION_ARC
 	default "c66d8bbcebfddf713b2b436e1b135e6b125a55a5" if BR2_BINUTILS_VERSION_CSKY
 	default "2.32"		if BR2_BINUTILS_VERSION_2_32_X
-	default "2.33.1"	if BR2_BINUTILS_VERSION_2_33_X
 	default "2.34"		if BR2_BINUTILS_VERSION_2_34_X
 	default "2.35.2"	if BR2_BINUTILS_VERSION_2_35_X
 	default "2.36"		if BR2_BINUTILS_VERSION_2_36_X
package/binutils/binutils.hash +0 -1
index 35e688a21e..9d48581712 100644
@@ -1,6 +1,5 @@
 # From ftp://gcc.gnu.org/pub/binutils/releases/sha512.sum
 sha512  d326408f12a03d9a61a9de56584c2af12f81c2e50d2d7e835d51565df8314df01575724afa1e43bd0db45cfc9916b41519b67dfce03232aa4978704492a6994a  binutils-2.32.tar.xz
-sha512  b7a6767c6c7ca6b5cafa7080e6820b7bb3a53b7148348c438d99905defbdf0d30c9744a484ee01c9441a8153901808513366b15ba9533e20c9673c262ade36ac  binutils-2.33.1.tar.xz
 sha512  2c7976939dcf5e8c5b7374cccd39bfe803b1bec73c6abfa0eb17c24e1942574c6bdb874c66a092a82adc443182eacd8a5a8001c19a76101f0c7ba40c27de0bbd  binutils-2.34.tar.xz
 sha512  9974ede5978d32e0d68fef23da48fa00bd06b0bff7ec45b00ca075c126d6bbe0cf2defc03ecc3f17bc6cc85b64271a13009c4049d7ba17de26e84e3a6e2c0348  binutils-2.35.2.tar.xz
 sha512  0b89b70d4ad5cfe5bd0011dc7e342ae9de96efdbfc3442a0d6b5f7660e38bbcad36f2c72ba8f074323f02bde022ff1cd723ae99f0ea55cf94ee2dbbc0e4efdb2  binutils-2.36.tar.xz
Signature · 1 line
2.29.2
#6 lore raw

PATCH 4/5 package/binutils: drop 2.33.x series

Quoted 7 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

Now that 2.36.x has been added, that 2.35.x is the default version, drop support for 2.33.x.

Note that we keep binutils 2.32.x as it is the latest version that works for FLAT binaries (used on noMMU platforms).

:/ Does upstream know about this? Do they not care?

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard
#7 lore raw

PATCH 4/5 package/binutils: drop 2.33.x series

Hello Peter,

Le 01/02/2021 ? 18:28, Peter Korsgaard a ?crit?:

Quoted 9 lines
Quoted 7 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

Now that 2.36.x has been added, that 2.35.x is the default version, drop support for 2.33.x.

Note that we keep binutils 2.32.x as it is the latest version that works for FLAT binaries (used on noMMU platforms).

:/ Does upstream know about this? Do they not care?

It's not really an issue with Binutils but elf2flt tool:

https://github.com/uclinux-dev/elf2flt/issues/12

I just noticed a new PR that is interesting to fix the issue:
https://github.com/uclinux-dev/elf2flt/pull/20

Best regards,
Romain

Quoted 3 lines

Committed, thanks.

#8 lore raw

PATCH 4/5 package/binutils: drop 2.33.x series

Quoted 12 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Romain" == Romain Naour <[email protected]> writes:

Hello Peter,
Le 01/02/2021 ? 18:28, Peter Korsgaard a ?crit?:

Quoted 8 lines
Quoted 7 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

Now that 2.36.x has been added, that 2.35.x is the default version, drop support for 2.33.x.

Note that we keep binutils 2.32.x as it is the latest version that works for FLAT binaries (used on noMMU platforms).

Quoted 8 lines
Quoted 1 line

:/ Does upstream know about this? Do they not care?

It's not really an issue with Binutils but elf2flt tool:

https://github.com/uclinux-dev/elf2flt/issues/12

I just noticed a new PR that is interesting to fix the issue:
https://github.com/uclinux-dev/elf2flt/pull/20

Ok, thanks - Hopefully that indeed fixes the issues.

Signature · 1 line
Bye, Peter Korsgaard
#9 lore raw

PATCH 5/5 package/musl: bump to version 1.2.2

In reply to Thomas Petazzoni

Drop 0003-rewrite-wcsnrtombs-to-fix-buffer-overflow-and-other-.patch as it is a backport of upstream commit 3ab2a4e02682df1382955071919d8aa3c3ec40d4 which is part of the 1.2.2 release.

1.2.2 release notes

major changes:
- child restrictions lifted after fork of multithreaded parent

new features:
- _Fork function (POSIX-future)
- reallocarray function (extension from OpenBSD, now widespread)
- gettid function (kernel tid as supported concept)
- SIGEV_THREAD_ID sigevent API (Linux extension)
- tcgetwinsize and tcsetwinsize functions (POSIX-future)

performance:
- faster software sqrt on archs without native sqrt instruction

compatibility:
- realpath no longer depends on procfs availability & accuracy
- time zone parser now always prefers 64-bit tables if present
- crypt_blowfish now supports $2b$ prefix
- res_query now reports errors via h_errno
- set*id and setrlimit are now safe in vforked/cloned child
- setgroups now applies to all threads
- dlopen debugger notification is improved, should work with lldb
- setrlimit no longer needs __synccall broadcast on linux 2.6.36+
- faccessat with AT_EACCESS no longer needs child process on linux 5.8+

bugs fixed:
- buffer overflow and infinite loop errors in wcsnrtombs (CVE-2020-28928)
- sem_close unmapped still-referenced semaphores
- fork of process with active aio could deadlock or crash paren
- pthread_cond_wait was broken with priority-inheritance mutex
- getgrouplist wrongly failed when nscd reported an empty list
- abort could leak modified SIGABRT disposition to fork or posix_spawn child
- regression with mallocng: malloc_usable_size(0) crashed
- readlink wrongly gave EINVAL on zero length dest buffer
- sqrtl was severely inaccurate (not correctly rounded) on ldquad archs
- assert failure wrongly flushed stdio (possible deadlock)
- MUSL_LOCPATH search was broken with multiple components
- missing newline in herror output
- possible deadlock in pthread_exit with pshared mutex or barrier usage
- pthread_mutexattr_getprotocol didn't read back protocol
- v4l2 ioctl translation for pre-time64 kernels didn't work

arch-specific bugs fixed:
- x86_64 longjmp failed to handle 0 argument reliably
- i386 __set_thread_area fallback for pre-2.6 kernels didn't work
- missing O_LARGEFILE macro value on x86_64, x32, mips64
- unpredictable s390x breakage from failure to preserve call-saved registers

---
 ...bs-to-fix-buffer-overflow-and-other-.patch | 114 ------------------
 package/musl/musl.hash                        |   4 +-
 package/musl/musl.mk                          |   2 +-
 3 files changed, 3 insertions(+), 117 deletions(-)
 delete mode 100644 package/musl/0003-rewrite-wcsnrtombs-to-fix-buffer-overflow-and-other-.patch
package/musl/0003-rewrite-wcsnrtombs-to-fix-buffer-overflow-and-other-.patch deleted +0 -114
deleted file mode 100644
index 2fb29940a9..0000000000
@@ -1,114 +0,0 @@
-From 3ab2a4e02682df1382955071919d8aa3c3ec40d4 Mon Sep 17 00:00:00 2001
-From: Rich Felker <[email protected]>
-Date: Thu, 19 Nov 2020 17:12:43 -0500
-Subject: [PATCH] rewrite wcsnrtombs to fix buffer overflow and other bugs
-
-the original wcsnrtombs implementation, which has been largely
-untouched since 0.5.0, attempted to build input-length-limiting
-conversion on top of wcsrtombs, which only limits output length. as
-best I recall, this choice was made out of a mix of disdain over
-having yet another variant function to implement (added in POSIX 2008;
-not standard C) and preference not to switch things around and
-implement the wcsrtombs in terms of the more general new function,
-probably over namespace issues. the strategy employed was to impose
-output limits that would ensure the input limit wasn't exceeded, then
-finish up the tail character-at-a-time. unfortunately, none of that
-worked correctly.
-
-first, the logic in the wcsrtombs loop was wrong in that it could
-easily get stuck making no forward progress, by imposing an output
-limit too small to convert even one character.
-
-the character-at-a-time loop that followed was even worse. it made no
-effort to ensure that the converted multibyte character would fit in
-the remaining output space, only that there was a nonzero amount of
-output space remaining. it also employed an incorrect interpretation
-of wcrtomb's interface contract for converting the null character,
-thereby failing to act on end of input, and remaining space accounting
-was subject to unsigned wrap-around. together these errors allow
-unbounded overflow of the destination buffer, controlled by input
-length limit and input wchar_t string contents.
-
-given the extent to which this function was broken, it's plausible
-that most applications that would have been rendered exploitable were
-sufficiently broken not to be usable in the first place. however, it's
-also plausible that common (especially ASCII-only) inputs succeeded in
-the wcsrtombs loop, which mostly worked, while leaving the wildly
-erroneous code in the second loop exposed to particular non-ASCII
-inputs.
-
-CVE-2020-28928 has been assigned for this issue.
-
-Signed-off-by: Peter Korsgaard <[email protected]>
----
- src/multibyte/wcsnrtombs.c | 46 ++++++++++++++++----------------------
- 1 file changed, 19 insertions(+), 27 deletions(-)
-
-diff --git a/src/multibyte/wcsnrtombs.c b/src/multibyte/wcsnrtombs.c
-index 676932b5..95e25e70 100644
---- a/src/multibyte/wcsnrtombs.c
-+++ b/src/multibyte/wcsnrtombs.c
-@@ -1,41 +1,33 @@
- #include <wchar.h>
-+#include <limits.h>
-+#include <string.h>
- 
- size_t wcsnrtombs(char *restrict dst, const wchar_t **restrict wcs, size_t wn, size_t n, mbstate_t *restrict st)
- {
--	size_t l, cnt=0, n2;
--	char *s, buf[256];
- 	const wchar_t *ws = *wcs;
--	const wchar_t *tmp_ws;
--
--	if (!dst) s = buf, n = sizeof buf;
--	else s = dst;
--
--	while ( ws && n && ( (n2=wn)>=n || n2>32 ) ) {
--		if (n2>=n) n2=n;
--		tmp_ws = ws;
--		l = wcsrtombs(s, &ws, n2, 0);
--		if (!(l+1)) {
--			cnt = l;
--			n = 0;
-+	size_t cnt = 0;
-+	if (!dst) n=0;
-+	while (ws && wn) {
-+		char tmp[MB_LEN_MAX];
-+		size_t l = wcrtomb(n<MB_LEN_MAX ? tmp : dst, *ws, 0);
-+		if (l==-1) {
-+			cnt = -1;
- 			break;
- 		}
--		if (s != buf) {
--			s += l;
-+		if (dst) {
-+			if (n<MB_LEN_MAX) {
-+				if (l>n) break;
-+				memcpy(dst, tmp, l);
-+			}
-+			dst += l;
- 			n -= l;
- 		}
--		wn = ws ? wn - (ws - tmp_ws) : 0;
--		cnt += l;
--	}
--	if (ws) while (n && wn) {
--		l = wcrtomb(s, *ws, 0);
--		if ((l+1)<=1) {
--			if (!l) ws = 0;
--			else cnt = l;
-+		if (!*ws) {
-+			ws = 0;
- 			break;
- 		}
--		ws++; wn--;
--		/* safe - this loop runs fewer than sizeof(buf) times */
--		s+=l; n-=l;
-+		ws++;
-+		wn--;
- 		cnt += l;
- 	}
- 	if (dst) *wcs = ws;
--- 
-2.20.1
-
package/musl/musl.hash +2 -2
index 39f1057961..4ab18cebd8 100644
@@ -1,4 +1,4 @@
 # Locally calculated after checking pgp signature from
-# https://musl.libc.org/releases/musl-1.2.1.tar.gz.asc
-sha256  68af6e18539f646f9c41a3a2bb25be4a5cfa5a8f65f0bb647fd2bbfdf877e84b  musl-1.2.1.tar.gz
+# https://musl.libc.org/releases/musl-1.2.2.tar.gz.asc
+sha256  9b969322012d796dc23dda27a35866034fa67d8fb67e0e2c45c913c3d43219dd  musl-1.2.2.tar.gz
 sha256  f9bc4423732350eb0b3f7ed7e91d530298476f8fec0c6c427a1c04ade22655af  COPYRIGHT
package/musl/musl.mk +1 -1
index bc4237968d..82b3eeaf52 100644
@@ -4,7 +4,7 @@
 #
 ################################################################################
 
-MUSL_VERSION = 1.2.1
+MUSL_VERSION = 1.2.2
 MUSL_SITE = http://www.musl-libc.org/releases
 MUSL_LICENSE = MIT
 MUSL_LICENSE_FILES = COPYRIGHT
Signature · 1 line
2.29.2
#10 lore raw

PATCH 5/5 package/musl: bump to version 1.2.2

Quoted 50 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

Drop 0003-rewrite-wcsnrtombs-to-fix-buffer-overflow-and-other-.patch as it is a backport of upstream commit 3ab2a4e02682df1382955071919d8aa3c3ec40d4 which is part of the 1.2.2 release.

1.2.2 release notes

major changes:
- child restrictions lifted after fork of multithreaded parent

new features:
- _Fork function (POSIX-future)
- reallocarray function (extension from OpenBSD, now widespread)
- gettid function (kernel tid as supported concept)
- SIGEV_THREAD_ID sigevent API (Linux extension)
- tcgetwinsize and tcsetwinsize functions (POSIX-future)

performance:
- faster software sqrt on archs without native sqrt instruction

compatibility:
- realpath no longer depends on procfs availability & accuracy
- time zone parser now always prefers 64-bit tables if present
- crypt_blowfish now supports $2b$ prefix
- res_query now reports errors via h_errno
- set*id and setrlimit are now safe in vforked/cloned child
- setgroups now applies to all threads
- dlopen debugger notification is improved, should work with lldb
- setrlimit no longer needs __synccall broadcast on linux 2.6.36+
- faccessat with AT_EACCESS no longer needs child process on linux 5.8+

bugs fixed:
- buffer overflow and infinite loop errors in wcsnrtombs (CVE-2020-28928)
- sem_close unmapped still-referenced semaphores
- fork of process with active aio could deadlock or crash paren
- pthread_cond_wait was broken with priority-inheritance mutex
- getgrouplist wrongly failed when nscd reported an empty list
- abort could leak modified SIGABRT disposition to fork or posix_spawn child
- regression with mallocng: malloc_usable_size(0) crashed
- readlink wrongly gave EINVAL on zero length dest buffer
- sqrtl was severely inaccurate (not correctly rounded) on ldquad archs
- assert failure wrongly flushed stdio (possible deadlock)
- MUSL_LOCPATH search was broken with multiple components
- missing newline in herror output
- possible deadlock in pthread_exit with pshared mutex or barrier usage
- pthread_mutexattr_getprotocol didn't read back protocol
- v4l2 ioctl translation for pre-time64 kernels didn't work

Quoted 7 lines

arch-specific bugs fixed:
- x86_64 longjmp failed to handle 0 argument reliably
- i386 __set_thread_area fallback for pre-2.6 kernels didn't work
- missing O_LARGEFILE macro value on x86_64, x32, mips64
- unpredictable s390x breakage from failure to preserve call-saved registers

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard