Backport patch for CVE-2022-38533

This commit is contained in:
Sandro Mani 2022-10-30 12:42:28 +01:00
parent 7286330d02
commit 23caca7ba6
2 changed files with 26 additions and 1 deletions

19
CVE-2022-38533.patch Normal file
View File

@ -0,0 +1,19 @@
diff -rupN --no-dereference binutils-2.39/bfd/coffcode.h binutils-2.39-new/bfd/coffcode.h
--- binutils-2.39/bfd/coffcode.h 2022-07-08 11:46:47.000000000 +0200
+++ binutils-2.39-new/bfd/coffcode.h 2022-10-30 12:41:41.408023817 +0100
@@ -4284,10 +4284,13 @@ coff_set_section_contents (bfd * abfd,
rec = (bfd_byte *) location;
recend = rec + count;
- while (rec < recend)
+ while (recend - rec >= 4)
{
+ size_t len = bfd_get_32 (abfd, rec);
+ if (len == 0 || len > (size_t) (recend - rec) / 4)
+ break;
+ rec += len * 4;
++section->lma;
- rec += bfd_get_32 (abfd, rec) * 4;
}
BFD_ASSERT (rec == recend);

View File

@ -3,7 +3,7 @@
Name: mingw-binutils
Version: 2.39
Release: 1%{?dist}
Release: 2%{?dist}
Summary: Cross-compiled version of binutils for Win32 and Win64 environments
License: GPLv2+ and LGPLv2+ and GPLv3+ and LGPLv3+
@ -129,6 +129,9 @@ Patch19: binutils-package-metadata.patch
# Lifetime: Fixed in 2.40
Patch20: binutils-gas-dwarf-skip-empty-functions.patch
# Backport patch for CVE-2022-38533
Patch21: CVE-2022-38533.patch
BuildRequires: make
BuildRequires: gcc
@ -461,6 +464,9 @@ rm -rf %{buildroot}%{_mandir}/man1/*
%changelog
* Sun Oct 30 2022 Sandro Mani <manisandro@gmail.com> - 2.39-2
- Backport patch for CVE-2022-38533
* Tue Aug 16 2022 Sandro Mani <manisandro@gmail.com> - 2.39-1
- Update to 2.39