fix CVE-2022-47011

(cherry picked from commit b3d48ba6a060eb8cc46b19c35b2e832a35e7e205)
This commit is contained in:
liningjie 2023-08-24 14:37:21 +08:00 committed by openeuler-sync-bot
parent 7d3b646266
commit 098e729555
2 changed files with 34 additions and 1 deletions

View File

@ -0,0 +1,29 @@
From 8a24927bc8dbf6beac2000593b21235c3796dc35 Mon Sep 17 00:00:00 2001
From: Alan Modra <amodra@gmail.com>
Date: Mon, 20 Jun 2022 10:39:13 +0930
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 796ff85b86a..bf3f578cbcc 100644
--- a/binutils/stabs.c
+++ b/binutils/stabs.c
@@ -2367,7 +2367,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.39.3

View File

@ -1,7 +1,7 @@
Summary: Binary utilities
Name: binutils
Version: 2.37
Release: 16
Release: 17
License: GPLv3+
URL: https://sourceware.org/binutils
@ -74,6 +74,7 @@ Patch48: backport-PR28422-build_id-use-after-free.patch
Patch49: backport-PR28540-segmentation-fault-on-NULL-byte_get.patch
Patch50: Fix-gold-relocation-offset-and-adrp-signed-shife.patch
Patch51: CVE-2022-47008.patch
Patch52: backport-CVE-2022-47011.patch
Provides: bundled(libiberty)
@ -397,6 +398,9 @@ fi
%{_infodir}/bfd*info*
%changelog
* Thu Aug 24 2023 liningjie <liningjie@xfusion.com> - 2.37-17
- fix CVE-2022-47011
* Wed Aug 23 2023 liningjie <liningjie@xfusion.com> - 2.37-16
- fix CVE-2022-47008