Skip to content

Commit 8945822

Browse files
Co-authored-by: CBL-Mariner Servicing Account <[email protected]>
1 parent 6f9f595 commit 8945822

File tree

9 files changed

+171
-13
lines changed

9 files changed

+171
-13
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
From 0ebc886149c22aceaf8ed74267821a59ca9d03eb Mon Sep 17 00:00:00 2001
2+
From: Alan Modra <[email protected]>
3+
Date: Fri, 17 Jun 2022 09:00:41 +0930
4+
Subject: [PATCH] PR29254, memory leak in stab_demangle_v3_arg
5+
6+
PR 29254
7+
* stabs.c (stab_demangle_v3_arg): Free dt on failure path.
8+
---
9+
binutils/stabs.c | 5 ++++-
10+
1 file changed, 4 insertions(+), 1 deletion(-)
11+
12+
diff --git a/binutils/stabs.c b/binutils/stabs.c
13+
index 2b5241637c1..796ff85b86a 100644
14+
--- a/binutils/stabs.c
15+
+++ b/binutils/stabs.c
16+
@@ -5467,7 +5467,10 @@ stab_demangle_v3_arg (void *dhandle, struct stab_handle *info,
17+
dc->u.s_binary.right,
18+
&varargs);
19+
if (pargs == NULL)
20+
- return NULL;
21+
+ {
22+
+ free (dt);
23+
+ return NULL;
24+
+ }
25+
26+
return debug_make_function_type (dhandle, dt, pargs, varargs);
27+
}
28+
--
29+
2.43.5
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
From d6e1d48c83b165c129cb0aa78905f7ca80a1f682 Mon Sep 17 00:00:00 2001
2+
From: Alan Modra <[email protected]>
3+
Date: Fri, 17 Jun 2022 09:13:38 +0930
4+
Subject: [PATCH] PR29255, memory leak in make_tempdir
5+
6+
PR 29255
7+
* bucomm.c (make_tempdir, make_tempname): Free template on all
8+
failure paths.
9+
---
10+
binutils/bucomm.c | 20 +++++++++++---------
11+
1 file changed, 11 insertions(+), 9 deletions(-)
12+
13+
diff --git a/binutils/bucomm.c b/binutils/bucomm.c
14+
index fdc2209df9c..4395cb9f7f5 100644
15+
--- a/binutils/bucomm.c
16+
+++ b/binutils/bucomm.c
17+
@@ -537,8 +537,9 @@ make_tempname (const char *filename, int *ofd)
18+
#else
19+
tmpname = mktemp (tmpname);
20+
if (tmpname == NULL)
21+
- return NULL;
22+
- fd = open (tmpname, O_RDWR | O_CREAT | O_EXCL, 0600);
23+
+ fd = -1;
24+
+ else
25+
+ fd = open (tmpname, O_RDWR | O_CREAT | O_EXCL, 0600);
26+
#endif
27+
if (fd == -1)
28+
{
29+
@@ -556,22 +557,23 @@ char *
30+
make_tempdir (const char *filename)
31+
{
32+
char *tmpname = template_in_dir (filename);
33+
+ char *ret;
34+
35+
#ifdef HAVE_MKDTEMP
36+
- return mkdtemp (tmpname);
37+
+ ret = mkdtemp (tmpname);
38+
#else
39+
- tmpname = mktemp (tmpname);
40+
- if (tmpname == NULL)
41+
- return NULL;
42+
+ ret = mktemp (tmpname);
43+
#if defined (_WIN32) && !defined (__CYGWIN32__)
44+
if (mkdir (tmpname) != 0)
45+
- return NULL;
46+
+ ret = NULL;
47+
#else
48+
if (mkdir (tmpname, 0700) != 0)
49+
- return NULL;
50+
+ ret = NULL;
51+
#endif
52+
- return tmpname;
53+
#endif
54+
+ if (ret == NULL)
55+
+ free (tmpname);
56+
+ return ret;
57+
}
58+
59+
/* Parse a string into a VMA, with a fatal error if it can't be
60+
--
61+
2.43.5
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
From 0d02e70b197c786f26175b9a73f94e01d14abdab Mon Sep 17 00:00:00 2001
2+
From: Alan Modra <[email protected]>
3+
Date: Mon, 20 Jun 2022 10:39:31 +0930
4+
Subject: [PATCH] PR29262, memory leak in pr_function_type
5+
6+
PR 29262
7+
* prdbg.c (pr_function_type): Free "s" on failure path.
8+
---
9+
binutils/prdbg.c | 7 ++-----
10+
1 file changed, 2 insertions(+), 5 deletions(-)
11+
12+
diff --git a/binutils/prdbg.c b/binutils/prdbg.c
13+
index c1e41628d26..bb42a5b6c2d 100644
14+
--- a/binutils/prdbg.c
15+
+++ b/binutils/prdbg.c
16+
@@ -742,12 +742,9 @@ pr_function_type (void *p, int argcount, bool varargs)
17+
18+
strcat (s, ")");
19+
20+
- if (! substitute_type (info, s))
21+
- return false;
22+
-
23+
+ bool ret = substitute_type (info, s);
24+
free (s);
25+
-
26+
- return true;
27+
+ return ret;
28+
}
29+
30+
/* Turn the top type on the stack into a reference to that type. */
31+
--
32+
2.43.5
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
From 8a24927bc8dbf6beac2000593b21235c3796dc35 Mon Sep 17 00:00:00 2001
2+
From: Alan Modra <[email protected]>
3+
Date: Mon, 20 Jun 2022 10:39:13 +0930
4+
Subject: [PATCH] PR29261, memory leak in parse_stab_struct_fields
5+
6+
PR 29261
7+
* stabs.c (parse_stab_struct_fields): Free "fields" on failure path.
8+
---
9+
binutils/stabs.c | 5 ++++-
10+
1 file changed, 4 insertions(+), 1 deletion(-)
11+
12+
diff --git a/binutils/stabs.c b/binutils/stabs.c
13+
index 796ff85b86a..bf3f578cbcc 100644
14+
--- a/binutils/stabs.c
15+
+++ b/binutils/stabs.c
16+
@@ -2367,7 +2367,10 @@ parse_stab_struct_fields (void *dhandle,
17+
18+
if (! parse_stab_one_struct_field (dhandle, info, pp, p, fields + c,
19+
staticsp, p_end))
20+
- return false;
21+
+ {
22+
+ free (fields);
23+
+ return false;
24+
+ }
25+
26+
++c;
27+
}
28+
--
29+
2.43.5

SPECS/binutils/binutils.spec

Lines changed: 8 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: 8%{?dist}
24+
Release: 9%{?dist}
2525
License: GPLv2+
2626
Vendor: Microsoft Corporation
2727
Distribution: Mariner
@@ -38,6 +38,10 @@ Patch4: CVE-2022-38533.patch
3838
Patch5: CVE-2022-4285.patch
3939
# The gold linker doesn't understand the 'module_info.ld' script passed to all linkers and the tests fail to correctly link.
4040
Patch6: disable_gold_test.patch
41+
Patch7: CVE-2022-47007.patch
42+
Patch8: CVE-2022-47008.patch
43+
Patch9: CVE-2022-47010.patch
44+
Patch10: CVE-2022-47011.patch
4145
Provides: bundled(libiberty)
4246

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

296300
%changelog
301+
* Mon Nov 04 2024 Nicolas Guibourge <[email protected]> - 2.37-9
302+
- Address CVE-2022-47007, CVE-2022-47008, CVE-2022-47010, CVE-2022-47011.
303+
297304
* Fri Nov 17 2023 Pawel Winogrodzki <[email protected]> - 2.37-8
298305
- Add the cross-compilation subpackage for aarch64.
299306
- Used Fedora 38 spec (license: MIT) for guidance.

toolkit/resources/manifests/package/pkggen_core_aarch64.txt

Lines changed: 2 additions & 2 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-2.cm2.aarch64.rpm
1313
file-devel-5.40-2.cm2.aarch64.rpm
1414
file-libs-5.40-2.cm2.aarch64.rpm
15-
binutils-2.37-8.cm2.aarch64.rpm
16-
binutils-devel-2.37-8.cm2.aarch64.rpm
15+
binutils-2.37-9.cm2.aarch64.rpm
16+
binutils-devel-2.37-9.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

toolkit/resources/manifests/package/pkggen_core_x86_64.txt

Lines changed: 2 additions & 2 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-2.cm2.x86_64.rpm
1313
file-devel-5.40-2.cm2.x86_64.rpm
1414
file-libs-5.40-2.cm2.x86_64.rpm
15-
binutils-2.37-8.cm2.x86_64.rpm
16-
binutils-devel-2.37-8.cm2.x86_64.rpm
15+
binutils-2.37-9.cm2.x86_64.rpm
16+
binutils-devel-2.37-9.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

toolkit/resources/manifests/package/toolchain_aarch64.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ bash-5.1.8-4.cm2.aarch64.rpm
99
bash-debuginfo-5.1.8-4.cm2.aarch64.rpm
1010
bash-devel-5.1.8-4.cm2.aarch64.rpm
1111
bash-lang-5.1.8-4.cm2.aarch64.rpm
12-
binutils-2.37-8.cm2.aarch64.rpm
13-
binutils-debuginfo-2.37-8.cm2.aarch64.rpm
14-
binutils-devel-2.37-8.cm2.aarch64.rpm
12+
binutils-2.37-9.cm2.aarch64.rpm
13+
binutils-debuginfo-2.37-9.cm2.aarch64.rpm
14+
binutils-devel-2.37-9.cm2.aarch64.rpm
1515
bison-3.7.6-2.cm2.aarch64.rpm
1616
bison-debuginfo-3.7.6-2.cm2.aarch64.rpm
1717
bzip2-1.0.8-1.cm2.aarch64.rpm

toolkit/resources/manifests/package/toolchain_x86_64.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ bash-5.1.8-4.cm2.x86_64.rpm
99
bash-debuginfo-5.1.8-4.cm2.x86_64.rpm
1010
bash-devel-5.1.8-4.cm2.x86_64.rpm
1111
bash-lang-5.1.8-4.cm2.x86_64.rpm
12-
binutils-2.37-8.cm2.x86_64.rpm
13-
binutils-aarch64-linux-gnu-2.37-8.cm2.x86_64.rpm
14-
binutils-debuginfo-2.37-8.cm2.x86_64.rpm
15-
binutils-devel-2.37-8.cm2.x86_64.rpm
12+
binutils-2.37-9.cm2.x86_64.rpm
13+
binutils-aarch64-linux-gnu-2.37-9.cm2.x86_64.rpm
14+
binutils-debuginfo-2.37-9.cm2.x86_64.rpm
15+
binutils-devel-2.37-9.cm2.x86_64.rpm
1616
bison-3.7.6-2.cm2.x86_64.rpm
1717
bison-debuginfo-3.7.6-2.cm2.x86_64.rpm
1818
bzip2-1.0.8-1.cm2.x86_64.rpm
@@ -47,7 +47,7 @@ cracklib-lang-2.9.7-5.cm2.x86_64.rpm
4747
createrepo_c-0.17.5-1.cm2.x86_64.rpm
4848
createrepo_c-debuginfo-0.17.5-1.cm2.x86_64.rpm
4949
createrepo_c-devel-0.17.5-1.cm2.x86_64.rpm
50-
cross-binutils-common-2.37-8.cm2.noarch.rpm
50+
cross-binutils-common-2.37-9.cm2.noarch.rpm
5151
cross-gcc-common-11.2.0-8.cm2.noarch.rpm
5252
curl-8.8.0-3.cm2.x86_64.rpm
5353
curl-debuginfo-8.8.0-3.cm2.x86_64.rpm

0 commit comments

Comments
 (0)