mirror of
https://gitlab.com/buildroot.org/buildroot.git
synced 2026-08-09 17:03:35 -09:00
In Buildroot there are multiple way to apply patches on a package [1]
- Adding `.patch` file in the package directory.
- Define `<pkg>_PATCH` variable with the location of the patch tar.gz.
It used to download Debian patches tarball.
- Implement custom patching logic with `PRE`/`POST` patches hooks.
To make the CycloneDX SBOM generation not dependant on downloading the
packages, the two last options have the downside of not appearing on the
generated SBOM.
The unzip package is downloading a tarball from the Debian mirror with
the `<pkg>_PATCH` method [2].
To improve the tracking of the patched vulnerabilities for the unzip
package this commit import the patches previously downloaded with the
`_PATCH` variable in the Buildroot tree.
This allows to add the `CVE:` trailer [3] on the patches that fix
vulnerabilities to better track which patch is fixing the vulnerability.
[1] https://buildroot.org/downloads/manual/manual.html#patch-policy
[2] https://snapshot.debian.org/archive/debian/20250311T215724Z/pool/main/u/unzip/unzip_6.0-29.debian.tar.xz
[3] 1167d0ff3d docs/manual: mention CVE trailer
Signed-off-by: Thomas Perale <thomas.perale@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
57 lines
2.1 KiB
Diff
57 lines
2.1 KiB
Diff
From: "Steven M. Schweda" <sms@antinode.info>
|
|
Subject: Fix CVE-2014-8139: CRC32 verification heap-based overflow
|
|
Bug-Debian: https://bugs.debian.org/773722
|
|
CVE: CVE-2014-8139
|
|
Upstream: https://sources.debian.org/src/unzip/6.0-29/debian/patches/09-cve-2014-8139-crc-overflow.patch
|
|
Signed-off-by: Thomas Perale <thomas.perale@mind.be>
|
|
|
|
--- a/extract.c
|
|
+++ b/extract.c
|
|
@@ -1,5 +1,5 @@
|
|
/*
|
|
- Copyright (c) 1990-2009 Info-ZIP. All rights reserved.
|
|
+ Copyright (c) 1990-2014 Info-ZIP. All rights reserved.
|
|
|
|
See the accompanying file LICENSE, version 2009-Jan-02 or later
|
|
(the contents of which are also included in unzip.h) for terms of use.
|
|
@@ -298,6 +298,8 @@
|
|
#ifndef SFX
|
|
static ZCONST char Far InconsistEFlength[] = "bad extra-field entry:\n \
|
|
EF block length (%u bytes) exceeds remaining EF data (%u bytes)\n";
|
|
+ static ZCONST char Far TooSmallEBlength[] = "bad extra-field entry:\n \
|
|
+ EF block length (%u bytes) invalid (< %d)\n";
|
|
static ZCONST char Far InvalidComprDataEAs[] =
|
|
" invalid compressed data for EAs\n";
|
|
# if (defined(WIN32) && defined(NTSD_EAS))
|
|
@@ -2023,7 +2025,8 @@
|
|
ebID = makeword(ef);
|
|
ebLen = (unsigned)makeword(ef+EB_LEN);
|
|
|
|
- if (ebLen > (ef_len - EB_HEADSIZE)) {
|
|
+ if (ebLen > (ef_len - EB_HEADSIZE))
|
|
+ {
|
|
/* Discovered some extra field inconsistency! */
|
|
if (uO.qflag)
|
|
Info(slide, 1, ((char *)slide, "%-22s ",
|
|
@@ -2158,11 +2161,19 @@
|
|
}
|
|
break;
|
|
case EF_PKVMS:
|
|
- if (makelong(ef+EB_HEADSIZE) !=
|
|
+ if (ebLen < 4)
|
|
+ {
|
|
+ Info(slide, 1,
|
|
+ ((char *)slide, LoadFarString(TooSmallEBlength),
|
|
+ ebLen, 4));
|
|
+ }
|
|
+ else if (makelong(ef+EB_HEADSIZE) !=
|
|
crc32(CRCVAL_INITIAL, ef+(EB_HEADSIZE+4),
|
|
(extent)(ebLen-4)))
|
|
+ {
|
|
Info(slide, 1, ((char *)slide,
|
|
LoadFarString(BadCRC_EAs)));
|
|
+ }
|
|
break;
|
|
case EF_PKW32:
|
|
case EF_PKUNIX:
|