diff mbox series

[kirkstone] binutils: Fix CVE-2025-5245

Message ID 20250605061344.2792436-1-Deepesh.Varatharajan@windriver.com
State Changes Requested
Delegated to: Steve Sakoman
Headers show
Series [kirkstone] binutils: Fix CVE-2025-5245 | expand

Commit Message

Deepesh Varatharajan June 5, 2025, 6:13 a.m. UTC
From: Deepesh Varatharajan <Deepesh.Varatharajan@windriver.com>

PR32829, SEGV on objdump function debug_type_samep
u.kenum is always non-NULL, see debug_make_enum_type.

Backport a patch from upstream to fix CVE-2025-5245
Upstream-Status: Backport [https://sourceware.org/git/?p=binutils-gdb.git;a=patch;h=6c3458a8b7ee7d39f070c7b2350851cb2110c65a]

Signed-off-by: Deepesh Varatharajan <Deepesh.Varatharajan@windriver.com>
---
 .../binutils/binutils-2.38.inc                |  1 +
 .../binutils/0041-CVE-2025-4245.patch         | 38 +++++++++++++++++++
 2 files changed, 39 insertions(+)
 create mode 100644 meta/recipes-devtools/binutils/binutils/0041-CVE-2025-4245.patch

Comments

Steve Sakoman June 6, 2025, 5:30 p.m. UTC | #1
On Wed, Jun 4, 2025 at 11:13 PM Varatharajan, Deepesh via
lists.openembedded.org
<deepesh.varatharajan=windriver.com@lists.openembedded.org> wrote:
>
> From: Deepesh Varatharajan <Deepesh.Varatharajan@windriver.com>
>
> PR32829, SEGV on objdump function debug_type_samep
> u.kenum is always non-NULL, see debug_make_enum_type.
>
> Backport a patch from upstream to fix CVE-2025-5245
> Upstream-Status: Backport [https://sourceware.org/git/?p=binutils-gdb.git;a=patch;h=6c3458a8b7ee7d39f070c7b2350851cb2110c65a]
>
> Signed-off-by: Deepesh Varatharajan <Deepesh.Varatharajan@windriver.com>
> ---
>  .../binutils/binutils-2.38.inc                |  1 +
>  .../binutils/0041-CVE-2025-4245.patch         | 38 +++++++++++++++++++

A typo in the patch filename -- should be 5245, not 4245!

Also, please send V2 as a patch series along with your patch for CVE-2025-5244.

Thanks!

Steve

>  2 files changed, 39 insertions(+)
>  create mode 100644 meta/recipes-devtools/binutils/binutils/0041-CVE-2025-4245.patch
>
> diff --git a/meta/recipes-devtools/binutils/binutils-2.38.inc b/meta/recipes-devtools/binutils/binutils-2.38.inc
> index 01fd03d2f4..d89d3eef19 100644
> --- a/meta/recipes-devtools/binutils/binutils-2.38.inc
> +++ b/meta/recipes-devtools/binutils/binutils-2.38.inc
> @@ -75,5 +75,6 @@ SRC_URI = "\
>       file://0038-CVE-2025-0840.patch \
>       file://0039-CVE-2025-1178.patch \
>       file://0040-CVE-2025-1180.patch \
> +     file://0041-CVE-2025-4245.patch \
>  "
>  S  = "${WORKDIR}/git"
> diff --git a/meta/recipes-devtools/binutils/binutils/0041-CVE-2025-4245.patch b/meta/recipes-devtools/binutils/binutils/0041-CVE-2025-4245.patch
> new file mode 100644
> index 0000000000..2de6abbe93
> --- /dev/null
> +++ b/meta/recipes-devtools/binutils/binutils/0041-CVE-2025-4245.patch
> @@ -0,0 +1,38 @@
> +From: Alan Modra <amodra@gmail.com>
> +Date: Tue, 1 Apr 2025 22:36:54 +1030
> +
> +PR32829, SEGV on objdump function debug_type_samep
> +u.kenum is always non-NULL, see debug_make_enum_type.
> +
> +Upstream-Status: Backport [https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=6c3458a8b7ee7d39f070c7b2350851cb2110c65a]
> +CVE: CVE-2025-5245
> +
> +Signed-off-by: Deepesh Varatharajan <Deepesh.Varatharajan@windriver.com>
> +
> +diff --git a/binutils/debug.c b/binutils/debug.c
> +index dcc8ccde..465b18e7 100644
> +--- a/binutils/debug.c
> ++++ b/binutils/debug.c
> +@@ -2554,9 +2554,6 @@ debug_write_type (struct debug_handle *info,
> +     case DEBUG_KIND_UNION_CLASS:
> +       return debug_write_class_type (info, fns, fhandle, type, tag);
> +     case DEBUG_KIND_ENUM:
> +-      if (type->u.kenum == NULL)
> +-      return (*fns->enum_type) (fhandle, tag, (const char **) NULL,
> +-                                (bfd_signed_vma *) NULL);
> +       return (*fns->enum_type) (fhandle, tag, type->u.kenum->names,
> +                               type->u.kenum->values);
> +     case DEBUG_KIND_POINTER:
> +@@ -3098,9 +3095,9 @@ debug_type_samep (struct debug_handle *info, struct debug_type_s *t1,
> +       break;
> +
> +     case DEBUG_KIND_ENUM:
> +-      if (t1->u.kenum == NULL)
> +-      ret = t2->u.kenum == NULL;
> +-      else if (t2->u.kenum == NULL)
> ++      if (t1->u.kenum->names == NULL)
> ++      ret = t2->u.kenum->names == NULL;
> ++      else if (t2->u.kenum->names == NULL)
> +       ret = false;
> +       else
> +       {
> --
> 2.49.0
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#217987): https://lists.openembedded.org/g/openembedded-core/message/217987
> Mute This Topic: https://lists.openembedded.org/mt/113481072/3620601
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [steve@sakoman.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
Deepesh Varatharajan June 9, 2025, 4:20 a.m. UTC | #2
On 06-06-2025 23:00, Steve Sakoman wrote:
> CAUTION: This email comes from a non Wind River email account!
> Do not click links or open attachments unless you recognize the sender and know the content is safe.
>
> On Wed, Jun 4, 2025 at 11:13 PM Varatharajan, Deepesh via
> lists.openembedded.org
> <deepesh.varatharajan=windriver.com@lists.openembedded.org> wrote:
>> From: Deepesh Varatharajan <Deepesh.Varatharajan@windriver.com>
>>
>> PR32829, SEGV on objdump function debug_type_samep
>> u.kenum is always non-NULL, see debug_make_enum_type.
>>
>> Backport a patch from upstream to fix CVE-2025-5245
>> Upstream-Status: Backport [https://sourceware.org/git/?p=binutils-gdb.git;a=patch;h=6c3458a8b7ee7d39f070c7b2350851cb2110c65a]
>>
>> Signed-off-by: Deepesh Varatharajan <Deepesh.Varatharajan@windriver.com>
>> ---
>>   .../binutils/binutils-2.38.inc                |  1 +
>>   .../binutils/0041-CVE-2025-4245.patch         | 38 +++++++++++++++++++
> A typo in the patch filename -- should be 5245, not 4245!
>
> Also, please send V2 as a patch series along with your patch for CVE-2025-5244.
>
> Thanks!
>
> Steve
Sure Steve,

V2 incoming.

Regards,
Deepesh.
>>   2 files changed, 39 insertions(+)
>>   create mode 100644 meta/recipes-devtools/binutils/binutils/0041-CVE-2025-4245.patch
>>
>> diff --git a/meta/recipes-devtools/binutils/binutils-2.38.inc b/meta/recipes-devtools/binutils/binutils-2.38.inc
>> index 01fd03d2f4..d89d3eef19 100644
>> --- a/meta/recipes-devtools/binutils/binutils-2.38.inc
>> +++ b/meta/recipes-devtools/binutils/binutils-2.38.inc
>> @@ -75,5 +75,6 @@ SRC_URI = "\
>>        file://0038-CVE-2025-0840.patch \
>>        file://0039-CVE-2025-1178.patch \
>>        file://0040-CVE-2025-1180.patch \
>> +     file://0041-CVE-2025-4245.patch \
>>   "
>>   S  = "${WORKDIR}/git"
>> diff --git a/meta/recipes-devtools/binutils/binutils/0041-CVE-2025-4245.patch b/meta/recipes-devtools/binutils/binutils/0041-CVE-2025-4245.patch
>> new file mode 100644
>> index 0000000000..2de6abbe93
>> --- /dev/null
>> +++ b/meta/recipes-devtools/binutils/binutils/0041-CVE-2025-4245.patch
>> @@ -0,0 +1,38 @@
>> +From: Alan Modra <amodra@gmail.com>
>> +Date: Tue, 1 Apr 2025 22:36:54 +1030
>> +
>> +PR32829, SEGV on objdump function debug_type_samep
>> +u.kenum is always non-NULL, see debug_make_enum_type.
>> +
>> +Upstream-Status: Backport [https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=6c3458a8b7ee7d39f070c7b2350851cb2110c65a]
>> +CVE: CVE-2025-5245
>> +
>> +Signed-off-by: Deepesh Varatharajan <Deepesh.Varatharajan@windriver.com>
>> +
>> +diff --git a/binutils/debug.c b/binutils/debug.c
>> +index dcc8ccde..465b18e7 100644
>> +--- a/binutils/debug.c
>> ++++ b/binutils/debug.c
>> +@@ -2554,9 +2554,6 @@ debug_write_type (struct debug_handle *info,
>> +     case DEBUG_KIND_UNION_CLASS:
>> +       return debug_write_class_type (info, fns, fhandle, type, tag);
>> +     case DEBUG_KIND_ENUM:
>> +-      if (type->u.kenum == NULL)
>> +-      return (*fns->enum_type) (fhandle, tag, (const char **) NULL,
>> +-                                (bfd_signed_vma *) NULL);
>> +       return (*fns->enum_type) (fhandle, tag, type->u.kenum->names,
>> +                               type->u.kenum->values);
>> +     case DEBUG_KIND_POINTER:
>> +@@ -3098,9 +3095,9 @@ debug_type_samep (struct debug_handle *info, struct debug_type_s *t1,
>> +       break;
>> +
>> +     case DEBUG_KIND_ENUM:
>> +-      if (t1->u.kenum == NULL)
>> +-      ret = t2->u.kenum == NULL;
>> +-      else if (t2->u.kenum == NULL)
>> ++      if (t1->u.kenum->names == NULL)
>> ++      ret = t2->u.kenum->names == NULL;
>> ++      else if (t2->u.kenum->names == NULL)
>> +       ret = false;
>> +       else
>> +       {
>> --
>> 2.49.0
>>
>>
>> -=-=-=-=-=-=-=-=-=-=-=-
>> Links: You receive all messages sent to this group.
>> View/Reply Online (#217987): https://lists.openembedded.org/g/openembedded-core/message/217987
>> Mute This Topic: https://lists.openembedded.org/mt/113481072/3620601
>> Group Owner: openembedded-core+owner@lists.openembedded.org
>> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [steve@sakoman.com]
>> -=-=-=-=-=-=-=-=-=-=-=-
>>
diff mbox series

Patch

diff --git a/meta/recipes-devtools/binutils/binutils-2.38.inc b/meta/recipes-devtools/binutils/binutils-2.38.inc
index 01fd03d2f4..d89d3eef19 100644
--- a/meta/recipes-devtools/binutils/binutils-2.38.inc
+++ b/meta/recipes-devtools/binutils/binutils-2.38.inc
@@ -75,5 +75,6 @@  SRC_URI = "\
      file://0038-CVE-2025-0840.patch \
      file://0039-CVE-2025-1178.patch \
      file://0040-CVE-2025-1180.patch \
+     file://0041-CVE-2025-4245.patch \
 "
 S  = "${WORKDIR}/git"
diff --git a/meta/recipes-devtools/binutils/binutils/0041-CVE-2025-4245.patch b/meta/recipes-devtools/binutils/binutils/0041-CVE-2025-4245.patch
new file mode 100644
index 0000000000..2de6abbe93
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils/0041-CVE-2025-4245.patch
@@ -0,0 +1,38 @@ 
+From: Alan Modra <amodra@gmail.com>
+Date: Tue, 1 Apr 2025 22:36:54 +1030
+
+PR32829, SEGV on objdump function debug_type_samep
+u.kenum is always non-NULL, see debug_make_enum_type.
+
+Upstream-Status: Backport [https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=6c3458a8b7ee7d39f070c7b2350851cb2110c65a]
+CVE: CVE-2025-5245
+
+Signed-off-by: Deepesh Varatharajan <Deepesh.Varatharajan@windriver.com>
+
+diff --git a/binutils/debug.c b/binutils/debug.c
+index dcc8ccde..465b18e7 100644
+--- a/binutils/debug.c
++++ b/binutils/debug.c
+@@ -2554,9 +2554,6 @@ debug_write_type (struct debug_handle *info,
+     case DEBUG_KIND_UNION_CLASS:
+       return debug_write_class_type (info, fns, fhandle, type, tag);
+     case DEBUG_KIND_ENUM:
+-      if (type->u.kenum == NULL)
+-	return (*fns->enum_type) (fhandle, tag, (const char **) NULL,
+-				  (bfd_signed_vma *) NULL);
+       return (*fns->enum_type) (fhandle, tag, type->u.kenum->names,
+ 				type->u.kenum->values);
+     case DEBUG_KIND_POINTER:
+@@ -3098,9 +3095,9 @@ debug_type_samep (struct debug_handle *info, struct debug_type_s *t1,
+       break;
+ 
+     case DEBUG_KIND_ENUM:
+-      if (t1->u.kenum == NULL)
+-	ret = t2->u.kenum == NULL;
+-      else if (t2->u.kenum == NULL)
++      if (t1->u.kenum->names == NULL)
++	ret = t2->u.kenum->names == NULL;
++      else if (t2->u.kenum->names == NULL)
+ 	ret = false;
+       else
+ 	{