diff --git a/backport-CVE-2022-47011.patch b/backport-CVE-2022-47011.patch new file mode 100644 index 0000000000000000000000000000000000000000..d05f6643cf68b8d2f2b50f49cc994799b82c4b97 --- /dev/null +++ b/backport-CVE-2022-47011.patch @@ -0,0 +1,30 @@ +From d88510a426e0c310ecfe9955837fdbc9fdc6aa51 Mon Sep 17 00:00:00 2001 +From: liningjie +Date: Tue, 15 Aug 2023 02:56:30 +0800 +Subject: [PATCH] PR29261, memory leak in parse_stab_struct_fields + +PR 29261 +* stabs.c (parse_stab_struct_fields): Free "fields" on failure path. +--- + binutils/stabs.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/binutils/stabs.c b/binutils/stabs.c +index 395ed52d..207dc52f 100644 +--- a/binutils/stabs.c ++++ b/binutils/stabs.c +@@ -2368,7 +2368,10 @@ parse_stab_struct_fields (void * dhandle, + + if (! parse_stab_one_struct_field (dhandle, info, pp, p, fields + c, + staticsp, p_end)) +- return FALSE; ++ { ++ free (fields); ++ return FALSE; ++ } + + ++c; + } +-- +2.33.0 + diff --git a/binutils.spec b/binutils.spec index 7cef626e5fb3281ad13fceb26b9dff4e045db564..4df7337aa296989c6c031bfe639a5b4a667633c0 100644 --- a/binutils.spec +++ b/binutils.spec @@ -1,7 +1,7 @@ Summary: Binary utilities Name: binutils Version: 2.34 -Release: 23 +Release: 24 License: GPLv3+ URL: https://sourceware.org/binutils @@ -60,6 +60,7 @@ Patch43: backport-0002-CVE-2021-42574.patch Patch44: Fix-gold-relocation-offset.patch Patch45: Fix-gold-adrp-signed-shift.patch Patch46: CVE-2022-47008.patch +Patch47: backport-CVE-2022-47011.patch Provides: bundled(libiberty) @@ -338,6 +339,9 @@ fi %{_infodir}/bfd*info* %changelog +* Thu Aug 24 2023 liningjie - 2.34-24 +- fix CVE-2022-47011 + * Wed Aug 23 2023 liningjie - 2.34-23 - fix CVE-2022-47008