Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] busybox: add upstream patch for CVE-2021-28831
@ 2021-04-02 21:15 daniel-eys
  2021-04-03  3:56 ` [PR PATCH] [Merged]: " ericonr
  0 siblings, 1 reply; 2+ messages in thread
From: daniel-eys @ 2021-04-02 21:15 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1585 bytes --]

There is a new pull request by daniel-eys against master on the void-packages repository

https://github.com/daniel-eys/void-packages busybox
https://github.com/void-linux/void-packages/pull/29956

busybox: add upstream patch for CVE-2021-28831
<!-- Mark items with [x] where applicable -->

#### General
- [ ] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements)

#### Have the results of the proposed changes been tested?
- [x] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [ ] I generally don't use the affected packages but briefly tested this PR

<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
<!--
#### Does it build and run successfully?
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [ ] I built this PR locally for my native architecture, (ARCH-LIBC)
- [ ] I built this PR locally for these architectures (if supported. mark crossbuilds):
  - [ ] aarch64-musl
  - [ ] armv7l
  - [ ] armv6l-musl
-->

A patch file from https://github.com/void-linux/void-packages/pull/29956.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-busybox-29956.patch --]
[-- Type: text/x-diff, Size: 3666 bytes --]

From 5755701926cecc70a228ea4e21de4cebfac0d44c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Daniel=20Ey=C3=9Fer?= <daniel.eysser@gmail.com>
Date: Fri, 2 Apr 2021 22:56:19 +0200
Subject: [PATCH] busybox: add upstream patch for CVE-2021-28831

---
 ...ss_gunzip-Fix-DoS-if-gzip-is-corrupt.patch | 57 +++++++++++++++++++
 srcpkgs/busybox/template                      |  4 +-
 2 files changed, 59 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/busybox/patches/decompress_gunzip-Fix-DoS-if-gzip-is-corrupt.patch

diff --git a/srcpkgs/busybox/patches/decompress_gunzip-Fix-DoS-if-gzip-is-corrupt.patch b/srcpkgs/busybox/patches/decompress_gunzip-Fix-DoS-if-gzip-is-corrupt.patch
new file mode 100644
index 000000000000..fe973506737d
--- /dev/null
+++ b/srcpkgs/busybox/patches/decompress_gunzip-Fix-DoS-if-gzip-is-corrupt.patch
@@ -0,0 +1,57 @@
+From dbd3b883a891f076911d752f56f7a906d5650a17 Mon Sep 17 00:00:00 2001
+From: Samuel Sapalski <samuel.sapalski@nokia.com>
+Date: Wed, 3 Mar 2021 16:31:22 +0100
+Subject: [PATCH] decompress_gunzip: Fix DoS if gzip is corrupt
+
+On certain corrupt gzip files, huft_build will set the error bit on
+the result pointer. If afterwards abort_unzip is called huft_free
+might run into a segmentation fault or an invalid pointer to
+free(p).
+
+In order to mitigate this, we check in huft_free if the error bit
+is set and clear it before the linked list is freed.
+
+Signed-off-by: Samuel Sapalski <samuel.sapalski@nokia.com>
+Signed-off-by: Peter Kaestle <peter.kaestle@nokia.com>
+Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
+---
+ archival/libarchive/decompress_gunzip.c | 12 ++++++++++--
+ 1 file changed, 10 insertions(+), 2 deletions(-)
+
+diff --git archival/libarchive/decompress_gunzip.c archival/libarchive/decompress_gunzip.c
+index 03049cc9b..e0520190a 100644
+--- archival/libarchive/decompress_gunzip.c
++++ archival/libarchive/decompress_gunzip.c
+@@ -220,10 +220,20 @@ static const uint8_t border[] ALIGN1 = {
+  * each table.
+  * t: table to free
+  */
++#define BAD_HUFT(p) ((uintptr_t)(p) & 1)
++#define ERR_RET     ((huft_t*)(uintptr_t)1)
+ static void huft_free(huft_t *p)
+ {
+ 	huft_t *q;
+ 
++	/*
++	 * If 'p' has the error bit set we have to clear it, otherwise we might run
++	 * into a segmentation fault or an invalid pointer to free(p)
++	 */
++	if (BAD_HUFT(p)) {
++		p = (huft_t*)((uintptr_t)(p) ^ (uintptr_t)(ERR_RET));
++	}
++
+ 	/* Go through linked list, freeing from the malloced (t[-1]) address. */
+ 	while (p) {
+ 		q = (--p)->v.t;
+@@ -289,8 +299,6 @@ static unsigned fill_bitbuffer(STATE_PARAM unsigned bitbuffer, unsigned *current
+  * or a valid pointer to a Huffman table, ORed with 0x1 if incompete table
+  * is given: "fixed inflate" decoder feeds us such data.
+  */
+-#define BAD_HUFT(p) ((uintptr_t)(p) & 1)
+-#define ERR_RET     ((huft_t*)(uintptr_t)1)
+ static huft_t* huft_build(const unsigned *b, const unsigned n,
+ 			const unsigned s, const struct cp_ext *cp_ext,
+ 			unsigned *m)
+-- 
+2.31.1
+
diff --git a/srcpkgs/busybox/template b/srcpkgs/busybox/template
index de8a606f02df..1d24e7ea1108 100644
--- a/srcpkgs/busybox/template
+++ b/srcpkgs/busybox/template
@@ -1,13 +1,13 @@
 # Template file for 'busybox'
 pkgname=busybox
 version=1.32.1
-revision=1
+revision=2
 hostmakedepends="perl"
 checkdepends="tar which zip"
 short_desc="Swiss Army Knife of Embedded Linux"
 maintainer="Cameron Nemo <cnemo@tutanota.com>"
 license="GPL-2.0-only"
-homepage="http://www.busybox.net"
+homepage="https://www.busybox.net"
 distfiles="${homepage}/downloads/busybox-${version}.tar.bz2"
 checksum=9d57c4bd33974140fd4111260468af22856f12f5b5ef7c70c8d9b75c712a0dee
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PR PATCH] [Merged]: busybox: add upstream patch for CVE-2021-28831
  2021-04-02 21:15 [PR PATCH] busybox: add upstream patch for CVE-2021-28831 daniel-eys
@ 2021-04-03  3:56 ` ericonr
  0 siblings, 0 replies; 2+ messages in thread
From: ericonr @ 2021-04-03  3:56 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1428 bytes --]

There's a merged pull request on the void-packages repository

busybox: add upstream patch for CVE-2021-28831
https://github.com/void-linux/void-packages/pull/29956

Description:
<!-- Mark items with [x] where applicable -->

#### General
- [ ] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements)

#### Have the results of the proposed changes been tested?
- [x] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [ ] I generally don't use the affected packages but briefly tested this PR

<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
<!--
#### Does it build and run successfully?
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [ ] I built this PR locally for my native architecture, (ARCH-LIBC)
- [ ] I built this PR locally for these architectures (if supported. mark crossbuilds):
  - [ ] aarch64-musl
  - [ ] armv7l
  - [ ] armv6l-musl
-->

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-04-03  3:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-02 21:15 [PR PATCH] busybox: add upstream patch for CVE-2021-28831 daniel-eys
2021-04-03  3:56 ` [PR PATCH] [Merged]: " ericonr

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).