Skip to content

Commit ecea7b4

Browse files
committed
Merge branch 'main' into 2.0
2 parents cadba3d + 15b043a commit ecea7b4

17 files changed

Lines changed: 435 additions & 36 deletions

File tree

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
diff --git a/binutils/dwarf.c b/binutils/dwarf.c
2+
index 79bd2eeed42..409fd895688 100644
3+
--- a/binutils/dwarf.c
4+
+++ b/binutils/dwarf.c
5+
@@ -9782,7 +9782,12 @@ display_debug_names (struct dwarf_section *section, void *file)
6+
printf (_("Out of %lu items there are %zu bucket clashes"
7+
" (longest of %zu entries).\n"),
8+
(unsigned long) name_count, hash_clash_count, longest_clash);
9+
- assert (name_count == buckets_filled + hash_clash_count);
10+
+
11+
+ if (name_count != buckets_filled + hash_clash_count)
12+
+ warn (_("The name_count (%lu) is not the same as the used bucket_count (%lu) + the hash clash count (%lu)"),
13+
+ (unsigned long) name_count,
14+
+ (unsigned long) buckets_filled,
15+
+ (unsigned long) hash_clash_count);
16+
17+
struct abbrev_lookup_entry
18+
{
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
diff --git a/binutils/objdump.c b/binutils/objdump.c
2+
index a7b8303b992..1e2e83959bf 100644
3+
--- a/binutils/objdump.c
4+
+++ b/binutils/objdump.c
5+
@@ -3630,7 +3630,9 @@ load_specific_debug_section (enum dwarf_section_display_enum debug,
6+
section->size = bfd_section_size (sec);
7+
/* PR 24360: On 32-bit hosts sizeof (size_t) < sizeof (bfd_size_type). */
8+
alloced = amt = section->size + 1;
9+
- if (alloced != amt || alloced == 0)
10+
+ if (alloced != amt
11+
+ || alloced == 0
12+
+ || (bfd_get_size (abfd) != 0 && alloced >= bfd_get_size (abfd)))
13+
{
14+
section->start = NULL;
15+
free_debug_section (debug);

SPECS/binutils/CVE-2023-1972.patch

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
diff --git a/bfd/elf.c b/bfd/elf.c
2+
index eddc6304e1c..05bb9c99d5f 100644
3+
--- a/bfd/elf.c
4+
+++ b/bfd/elf.c
5+
@@ -8925,6 +8925,9 @@ _bfd_elf_slurp_version_tables (bfd *abfd, bool default_imported_symver)
6+
bfd_set_error (bfd_error_file_too_big);
7+
goto error_return_verdef;
8+
}
9+
+
10+
+ if (amt == 0)
11+
+ goto error_return_verdef;
12+
elf_tdata (abfd)->verdef = (Elf_Internal_Verdef *) bfd_zalloc (abfd, amt);
13+
if (elf_tdata (abfd)->verdef == NULL)
14+
goto error_return_verdef;
15+
@@ -9028,6 +9031,8 @@ _bfd_elf_slurp_version_tables (bfd *abfd, bool default_imported_symver)
16+
bfd_set_error (bfd_error_file_too_big);
17+
goto error_return;
18+
}
19+
+ if (amt == 0)
20+
+ goto error_return;
21+
elf_tdata (abfd)->verdef = (Elf_Internal_Verdef *) bfd_zalloc (abfd, amt);
22+
if (elf_tdata (abfd)->verdef == NULL)
23+
goto error_return;

SPECS/binutils/binutils.spec

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
Summary: Contains a linker, an assembler, and other tools
2222
Name: binutils
2323
Version: 2.37
24-
Release: 9%{?dist}
24+
Release: 10%{?dist}
2525
License: GPLv2+
2626
Vendor: Microsoft Corporation
2727
Distribution: Mariner
@@ -42,6 +42,9 @@ Patch7: CVE-2022-47007.patch
4242
Patch8: CVE-2022-47008.patch
4343
Patch9: CVE-2022-47010.patch
4444
Patch10: CVE-2022-47011.patch
45+
Patch11: CVE-2022-48063.patch
46+
Patch12: CVE-2023-1972.patch
47+
Patch13: CVE-2022-35205.patch
4548
Provides: bundled(libiberty)
4649

4750
# Moving macro before the "SourceX" tags breaks PR checks parsing the specs.
@@ -298,6 +301,9 @@ find %{buildroot} -type f -name "*.la" -delete -print
298301
%do_files aarch64-linux-gnu %{build_aarch64}
299302

300303
%changelog
304+
* Thu Nov 14 2024 Thien Trung Vuong <tvuong@microsoft.com> - 2.37-10
305+
- Added patch to fix CVE-2023-1972, CVE-2022-48063, CVE-2022-35205
306+
301307
* Mon Nov 04 2024 Nicolas Guibourge <nicolasg@microsoft.com> - 2.37-9
302308
- Address CVE-2022-47007, CVE-2022-47008, CVE-2022-47010, CVE-2022-47011.
303309

SPECS/unzip/CVE-2022-0529.patch

Lines changed: 183 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,183 @@
1+
From 246a2f17066dff57d4a5253de258374a7e99154a Mon Sep 17 00:00:00 2001
2+
From: kavyasree <kkaitepalli@microsoft.com>
3+
Date: Mon, 25 Nov 2024 10:50:21 +0530
4+
Subject: [PATCH] Fix CVE-2022-0529 and CVE-2022-0530
5+
Reference: https://git.launchpad.net/ubuntu/+source/unzip/commit/?h=applied/ubuntu/devel&id=d5d5037f4ca1b40578015085b77ae322d1406f56
6+
---
7+
fileio.c | 34 +++++++++++++++++++++++++---------
8+
process.c | 55 +++++++++++++++++++++++++++++++++++++++++++------------
9+
2 files changed, 68 insertions(+), 21 deletions(-)
10+
11+
diff --git a/fileio.c b/fileio.c
12+
index eb2a115..285f7fe 100644
13+
--- a/fileio.c
14+
+++ b/fileio.c
15+
@@ -171,8 +171,10 @@ static ZCONST char Far ReadError[] = "error: zipfile read error\n";
16+
static ZCONST char Far FilenameTooLongTrunc[] =
17+
"warning: filename too long--truncating.\n";
18+
#ifdef UNICODE_SUPPORT
19+
+ static ZCONST char Far UFilenameCorrupt[] =
20+
+ "error: Unicode filename corrupt.\n";
21+
static ZCONST char Far UFilenameTooLongTrunc[] =
22+
- "warning: Converted unicode filename too long--truncating.\n";
23+
+ "warning: Converted Unicode filename too long--truncating.\n";
24+
#endif
25+
static ZCONST char Far ExtraFieldTooLong[] =
26+
"warning: extra field too long (%d). Ignoring...\n";
27+
@@ -2355,16 +2357,30 @@ int do_string(__G__ length, option) /* return PK-type error code */
28+
/* convert UTF-8 to local character set */
29+
fn = utf8_to_local_string(G.unipath_filename,
30+
G.unicode_escape_all);
31+
- /* make sure filename is short enough */
32+
- if (strlen(fn) >= FILNAMSIZ) {
33+
- fn[FILNAMSIZ - 1] = '\0';
34+
+
35+
+ /* 2022-07-22 SMS, et al. CVE-2022-0530
36+
+ * Detect conversion failure, emit message.
37+
+ * Continue with unconverted name.
38+
+ */
39+
+ if (fn == NULL)
40+
+ {
41+
Info(slide, 0x401, ((char *)slide,
42+
- LoadFarString(UFilenameTooLongTrunc)));
43+
- error = PK_WARN;
44+
+ LoadFarString(UFilenameCorrupt)));
45+
+ error = PK_ERR;
46+
+ }
47+
+ else
48+
+ {
49+
+ /* make sure filename is short enough */
50+
+ if (strlen(fn) >= FILNAMSIZ) {
51+
+ fn[FILNAMSIZ - 1] = '\0';
52+
+ Info(slide, 0x401, ((char *)slide,
53+
+ LoadFarString(UFilenameTooLongTrunc)));
54+
+ error = PK_WARN;
55+
+ }
56+
+ /* replace filename with converted UTF-8 */
57+
+ strcpy(G.filename, fn);
58+
+ free(fn);
59+
}
60+
- /* replace filename with converted UTF-8 */
61+
- strcpy(G.filename, fn);
62+
- free(fn);
63+
}
64+
# endif /* UNICODE_WCHAR */
65+
if (G.unipath_filename != G.filename_full)
66+
diff --git a/process.c b/process.c
67+
index 4e06a35..09d54f7 100644
68+
--- a/process.c
69+
+++ b/process.c
70+
@@ -222,6 +222,8 @@ static ZCONST char Far ZipfileCommTrunc1[] =
71+
"\nwarning: Unicode Path version > 1\n";
72+
static ZCONST char Far UnicodeMismatchError[] =
73+
"\nwarning: Unicode Path checksum invalid\n";
74+
+ static ZCONST char Far UFilenameTooLongTrunc[] =
75+
+ "warning: filename too long (P1) -- truncating.\n";
76+
#endif
77+
78+
79+
@@ -1902,7 +1904,7 @@ int getZip64Data(__G__ ef_buf, ef_len)
80+
Sets both local header and central header fields. Not terribly clever,
81+
but it means that this procedure is only called in one place.
82+
83+
- 2014-12-05 SMS.
84+
+ 2014-12-05 SMS. (oCERT.org report.) CVE-2014-8141.
85+
Added checks to ensure that enough data are available before calling
86+
makeint64() or makelong(). Replaced various sizeof() values with
87+
simple ("4" or "8") constants. (The Zip64 structures do not depend
88+
@@ -1937,8 +1939,7 @@ int getZip64Data(__G__ ef_buf, ef_len)
89+
90+
if (eb_id == EF_PKSZ64)
91+
{
92+
- int offset = EB_HEADSIZE;
93+
-
94+
+ unsigned offset = EB_HEADSIZE;
95+
if ((G.crec.ucsize == Z64FLGL) || (G.lrec.ucsize == Z64FLGL))
96+
{
97+
if (offset+ 8 > ef_len)
98+
@@ -2036,7 +2037,7 @@ int getUnicodeData(__G__ ef_buf, ef_len)
99+
}
100+
if (eb_id == EF_UNIPATH) {
101+
102+
- int offset = EB_HEADSIZE;
103+
+ unsigned offset = EB_HEADSIZE;
104+
ush ULen = eb_len - 5;
105+
ulg chksum = CRCVAL_INITIAL;
106+
107+
@@ -2492,16 +2493,17 @@ char *wide_to_local_string(wide_string, escape_all)
108+
int state_dependent;
109+
int wsize = 0;
110+
int max_bytes = MB_CUR_MAX;
111+
- char buf[9];
112+
+ char buf[ MB_CUR_MAX+ 1]; /* ("+1" not really needed?) */
113+
char *buffer = NULL;
114+
char *local_string = NULL;
115+
+ size_t buffer_size; /* CVE-2022-0529 */
116+
117+
for (wsize = 0; wide_string[wsize]; wsize++) ;
118+
119+
if (max_bytes < MAX_ESCAPE_BYTES)
120+
max_bytes = MAX_ESCAPE_BYTES;
121+
-
122+
- if ((buffer = (char *)malloc(wsize * max_bytes + 1)) == NULL) {
123+
+ buffer_size = wsize * max_bytes + 1; /* Reused below. */
124+
+ if ((buffer = (char *)malloc( buffer_size)) == NULL) {
125+
return NULL;
126+
}
127+
128+
@@ -2539,8 +2541,28 @@ char *wide_to_local_string(wide_string, escape_all)
129+
} else {
130+
/* no MB for this wide */
131+
/* use escape for wide character */
132+
- char *escape_string = wide_to_escape_string(wide_string[i]);
133+
- strcat(buffer, escape_string);
134+
+ size_t buffer_len;
135+
+ size_t escape_string_len;
136+
+ char *escape_string;
137+
+ int err_msg = 0;
138+
+
139+
+ escape_string = wide_to_escape_string(wide_string[i]);
140+
+ buffer_len = strlen( buffer);
141+
+ escape_string_len = strlen( escape_string);
142+
+
143+
+ /* Append escape string, as space allows. */
144+
+ /* 2022-07-18 SMS, et al. CVE-2022-0529 */
145+
+ if (escape_string_len > buffer_size- buffer_len- 1)
146+
+ {
147+
+ escape_string_len = buffer_size- buffer_len- 1;
148+
+ if (err_msg == 0)
149+
+ {
150+
+ err_msg = 1;
151+
+ Info(slide, 0x401, ((char *)slide,
152+
+ LoadFarString( UFilenameTooLongTrunc)));
153+
+ }
154+
+ }
155+
+ strncat( buffer, escape_string, escape_string_len);
156+
free(escape_string);
157+
}
158+
}
159+
@@ -2592,9 +2614,18 @@ char *utf8_to_local_string(utf8_string, escape_all)
160+
ZCONST char *utf8_string;
161+
int escape_all;
162+
{
163+
- zwchar *wide = utf8_to_wide_string(utf8_string);
164+
- char *loc = wide_to_local_string(wide, escape_all);
165+
- free(wide);
166+
+ zwchar *wide;
167+
+ char *loc = NULL;
168+
+
169+
+ wide = utf8_to_wide_string( utf8_string);
170+
+
171+
+ /* 2022-07-25 SMS, et al. CVE-2022-0530 */
172+
+ if (wide != NULL)
173+
+ {
174+
+ loc = wide_to_local_string( wide, escape_all);
175+
+ free( wide);
176+
+ }
177+
+
178+
return loc;
179+
}
180+
181+
--
182+
2.34.1
183+

SPECS/unzip/unzip.spec

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Summary: Unzip-6.0
22
Name: unzip
33
Version: 6.0
4-
Release: 20%{?dist}
4+
Release: 21%{?dist}
55
License: BSD
66
Vendor: Microsoft Corporation
77
Distribution: Mariner
@@ -23,6 +23,7 @@ Patch11: unzip-zipbomb-part3.patch
2323
Patch12: unzip-zipbomb-manpage.patch
2424
Patch13: CVE-2015-7697.patch
2525
Patch14: CVE-2018-1000035.patch
26+
Patch15: CVE-2022-0529.patch
2627

2728
%description
2829
The UnZip package contains ZIP extraction utilities. These are useful
@@ -57,6 +58,9 @@ ln -sf unzip %{buildroot}%{_bindir}/zipinfo
5758
%{_bindir}/*
5859

5960
%changelog
61+
* Mon Nov 25 2024 Kavya Sree Kaitepalli <kkaitepalli@microsoft.com> - 6.0.21
62+
- Fix CVE-2022-0529 and CVE-2022-0530
63+
6064
* Thu Oct 06 2022 Olivia Crain <oliviacrain@microsoft.com> - 6.0-20
6165
- Compile with large file support, zip64 support
6266
- Remove i*86 configuration- Mariner doesn't build for those architectures

toolkit/docs/building/prerequisites-mariner.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ sudo tdnf -y install \
3030
rpm \
3131
rpm-build \
3232
sudo \
33+
systemd \
3334
tar \
3435
wget \
3536
xfsprogs

toolkit/docs/building/prerequisites-ubuntu.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ sudo apt -y install \
2222
parted \
2323
pigz \
2424
openssl \
25+
systemd \
2526
qemu-utils \
2627
rpm \
2728
tar \

toolkit/resources/manifests/package/pkggen_core_aarch64.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ zlib-devel-1.2.13-2.cm2.aarch64.rpm
1212
file-5.40-3.cm2.aarch64.rpm
1313
file-devel-5.40-3.cm2.aarch64.rpm
1414
file-libs-5.40-3.cm2.aarch64.rpm
15-
binutils-2.37-9.cm2.aarch64.rpm
16-
binutils-devel-2.37-9.cm2.aarch64.rpm
15+
binutils-2.37-10.cm2.aarch64.rpm
16+
binutils-devel-2.37-10.cm2.aarch64.rpm
1717
gmp-6.2.1-4.cm2.aarch64.rpm
1818
gmp-devel-6.2.1-4.cm2.aarch64.rpm
1919
mpfr-4.1.0-2.cm2.aarch64.rpm
@@ -236,7 +236,7 @@ ca-certificates-tools-2.0.0-18.cm2.noarch.rpm
236236
ca-certificates-base-2.0.0-18.cm2.noarch.rpm
237237
ca-certificates-2.0.0-18.cm2.noarch.rpm
238238
dwz-0.14-2.cm2.aarch64.rpm
239-
unzip-6.0-20.cm2.aarch64.rpm
239+
unzip-6.0-21.cm2.aarch64.rpm
240240
python3-3.9.19-7.cm2.aarch64.rpm
241241
python3-devel-3.9.19-7.cm2.aarch64.rpm
242242
python3-libs-3.9.19-7.cm2.aarch64.rpm

toolkit/resources/manifests/package/pkggen_core_x86_64.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ zlib-devel-1.2.13-2.cm2.x86_64.rpm
1212
file-5.40-3.cm2.x86_64.rpm
1313
file-devel-5.40-3.cm2.x86_64.rpm
1414
file-libs-5.40-3.cm2.x86_64.rpm
15-
binutils-2.37-9.cm2.x86_64.rpm
16-
binutils-devel-2.37-9.cm2.x86_64.rpm
15+
binutils-2.37-10.cm2.x86_64.rpm
16+
binutils-devel-2.37-10.cm2.x86_64.rpm
1717
gmp-6.2.1-4.cm2.x86_64.rpm
1818
gmp-devel-6.2.1-4.cm2.x86_64.rpm
1919
mpfr-4.1.0-2.cm2.x86_64.rpm
@@ -236,7 +236,7 @@ ca-certificates-tools-2.0.0-18.cm2.noarch.rpm
236236
ca-certificates-base-2.0.0-18.cm2.noarch.rpm
237237
ca-certificates-2.0.0-18.cm2.noarch.rpm
238238
dwz-0.14-2.cm2.x86_64.rpm
239-
unzip-6.0-20.cm2.x86_64.rpm
239+
unzip-6.0-21.cm2.x86_64.rpm
240240
python3-3.9.19-7.cm2.x86_64.rpm
241241
python3-devel-3.9.19-7.cm2.x86_64.rpm
242242
python3-libs-3.9.19-7.cm2.x86_64.rpm

0 commit comments

Comments
 (0)