Skip to content

Commit d9e36f8

Browse files
realsdxsameluchjslobodzian
committed
Fix CVE-2025-0840 for binutils (#12254)
Co-authored-by: Sam Meluch <[email protected]> Co-authored-by: jslobodzian <[email protected]>
1 parent aac65c4 commit d9e36f8

File tree

6 files changed

+66
-13
lines changed

6 files changed

+66
-13
lines changed

SPECS/binutils/CVE-2025-0840.patch

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
From e692412cf74604829a21a7a23857a772d2197788 Mon Sep 17 00:00:00 2001
2+
From: Sudipta Pandit <[email protected]>
3+
Date: Fri, 7 Feb 2025 01:57:06 +0530
4+
Subject: [PATCH] Backport fix for CVE-2025-0840
5+
6+
Reference: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=baac6c221e9d69335bf41366a1c7d87d8ab2f893
7+
8+
---
9+
binutils/objdump.c | 10 ++++++----
10+
1 file changed, 6 insertions(+), 4 deletions(-)
11+
12+
diff --git a/binutils/objdump.c b/binutils/objdump.c
13+
index a35982ea..2efbf4b0 100644
14+
--- a/binutils/objdump.c
15+
+++ b/binutils/objdump.c
16+
@@ -116,7 +116,8 @@ static bool disassemble_all; /* -D */
17+
static int disassemble_zeroes; /* --disassemble-zeroes */
18+
static bool formats_info; /* -i */
19+
int wide_output; /* -w */
20+
-static int insn_width; /* --insn-width */
21+
+#define MAX_INSN_WIDTH 49
22+
+static unsigned long insn_width; /* --insn-width */
23+
static bfd_vma start_address = (bfd_vma) -1; /* --start-address */
24+
static bfd_vma stop_address = (bfd_vma) -1; /* --stop-address */
25+
static int dump_debugging; /* --debugging */
26+
@@ -3315,7 +3316,7 @@ disassemble_bytes (struct disassemble_info *inf,
27+
}
28+
else
29+
{
30+
- char buf[50];
31+
+ char buf[MAX_INSN_WIDTH + 1];
32+
unsigned int bpc = 0;
33+
unsigned int pb = 0;
34+
35+
@@ -5976,8 +5977,9 @@ main (int argc, char **argv)
36+
break;
37+
case OPTION_INSN_WIDTH:
38+
insn_width = strtoul (optarg, NULL, 0);
39+
- if (insn_width <= 0)
40+
- fatal (_("error: instruction width must be positive"));
41+
+ if (insn_width - 1 >= MAX_INSN_WIDTH)
42+
+ fatal (_("error: instruction width must be in the range 1 to "
43+
+ XSTRING (MAX_INSN_WIDTH)));
44+
break;
45+
case OPTION_INLINES:
46+
unwind_inlines = true;
47+
--
48+
2.34.1
49+

SPECS/binutils/binutils.spec

Lines changed: 5 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.41
24-
Release: 3%{?dist}
24+
Release: 4%{?dist}
2525
License: GPLv2+
2626
Vendor: Microsoft Corporation
2727
Distribution: Azure Linux
@@ -36,6 +36,7 @@ Patch2: CVE-2025-1176.patch
3636
Patch3: CVE-2025-1178.patch
3737
Patch4: CVE-2025-1181.patch
3838
Patch5: CVE-2025-1182.patch
39+
Patch6: CVE-2025-0840.patch
3940
Provides: bundled(libiberty)
4041

4142
# Moving macro before the "SourceX" tags breaks PR checks parsing the specs.
@@ -325,6 +326,9 @@ find %{buildroot} -type f -name "*.la" -delete -print
325326
%do_files aarch64-linux-gnu %{build_aarch64}
326327

327328
%changelog
329+
* Sun Feb 23 2025 Sudipta Pandit <[email protected]> - 2.41-4
330+
- Fix CVE-2025-0840 by backporting upstream patch
331+
328332
* Mon Feb 17 2025 Sindhu Karri <[email protected]> - 2.41-3
329333
- Fix CVE-2025-1176, CVE-2025-1178, CVE-2025-1181, CVE-2025-1182
330334

toolkit/resources/manifests/package/pkggen_core_aarch64.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ zlib-devel-1.3.1-1.azl3.aarch64.rpm
1313
file-5.45-1.azl3.aarch64.rpm
1414
file-devel-5.45-1.azl3.aarch64.rpm
1515
file-libs-5.45-1.azl3.aarch64.rpm
16-
binutils-2.41-3.azl3.aarch64.rpm
17-
binutils-devel-2.41-3.azl3.aarch64.rpm
16+
binutils-2.41-4.azl3.aarch64.rpm
17+
binutils-devel-2.41-4.azl3.aarch64.rpm
1818
gmp-6.3.0-1.azl3.aarch64.rpm
1919
gmp-devel-6.3.0-1.azl3.aarch64.rpm
2020
mpfr-4.2.1-1.azl3.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
@@ -13,8 +13,8 @@ zlib-devel-1.3.1-1.azl3.x86_64.rpm
1313
file-5.45-1.azl3.x86_64.rpm
1414
file-devel-5.45-1.azl3.x86_64.rpm
1515
file-libs-5.45-1.azl3.x86_64.rpm
16-
binutils-2.41-3.azl3.x86_64.rpm
17-
binutils-devel-2.41-3.azl3.x86_64.rpm
16+
binutils-2.41-4.azl3.x86_64.rpm
17+
binutils-devel-2.41-4.azl3.x86_64.rpm
1818
gmp-6.3.0-1.azl3.x86_64.rpm
1919
gmp-devel-6.3.0-1.azl3.x86_64.rpm
2020
mpfr-4.2.1-1.azl3.x86_64.rpm

toolkit/resources/manifests/package/toolchain_aarch64.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ bash-5.2.15-3.azl3.aarch64.rpm
2828
bash-debuginfo-5.2.15-3.azl3.aarch64.rpm
2929
bash-devel-5.2.15-3.azl3.aarch64.rpm
3030
bash-lang-5.2.15-3.azl3.aarch64.rpm
31-
binutils-2.41-3.azl3.aarch64.rpm
32-
binutils-debuginfo-2.41-3.azl3.aarch64.rpm
33-
binutils-devel-2.41-3.azl3.aarch64.rpm
31+
binutils-2.41-4.azl3.aarch64.rpm
32+
binutils-debuginfo-2.41-4.azl3.aarch64.rpm
33+
binutils-devel-2.41-4.azl3.aarch64.rpm
3434
bison-3.8.2-1.azl3.aarch64.rpm
3535
bison-debuginfo-3.8.2-1.azl3.aarch64.rpm
3636
bzip2-1.0.8-1.azl3.aarch64.rpm

toolkit/resources/manifests/package/toolchain_x86_64.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ bash-5.2.15-3.azl3.x86_64.rpm
3030
bash-debuginfo-5.2.15-3.azl3.x86_64.rpm
3131
bash-devel-5.2.15-3.azl3.x86_64.rpm
3232
bash-lang-5.2.15-3.azl3.x86_64.rpm
33-
binutils-2.41-3.azl3.x86_64.rpm
34-
binutils-aarch64-linux-gnu-2.41-3.azl3.x86_64.rpm
35-
binutils-debuginfo-2.41-3.azl3.x86_64.rpm
36-
binutils-devel-2.41-3.azl3.x86_64.rpm
33+
binutils-2.41-4.azl3.x86_64.rpm
34+
binutils-aarch64-linux-gnu-2.41-4.azl3.x86_64.rpm
35+
binutils-debuginfo-2.41-4.azl3.x86_64.rpm
36+
binutils-devel-2.41-4.azl3.x86_64.rpm
3737
bison-3.8.2-1.azl3.x86_64.rpm
3838
bison-debuginfo-3.8.2-1.azl3.x86_64.rpm
3939
bzip2-1.0.8-1.azl3.x86_64.rpm
@@ -68,7 +68,7 @@ cracklib-lang-2.9.11-1.azl3.x86_64.rpm
6868
createrepo_c-1.0.3-1.azl3.x86_64.rpm
6969
createrepo_c-debuginfo-1.0.3-1.azl3.x86_64.rpm
7070
createrepo_c-devel-1.0.3-1.azl3.x86_64.rpm
71-
cross-binutils-common-2.41-3.azl3.noarch.rpm
71+
cross-binutils-common-2.41-4.azl3.noarch.rpm
7272
cross-gcc-common-13.2.0-7.azl3.noarch.rpm
7373
curl-8.11.1-1.azl3.x86_64.rpm
7474
curl-debuginfo-8.11.1-1.azl3.x86_64.rpm

0 commit comments

Comments
 (0)