diff --git a/meta/recipes-devtools/binutils/binutils-2.34.inc b/meta/recipes-devtools/binutils/binutils-2.34.inc index ff0d467132..713e428a3e 100644 --- a/meta/recipes-devtools/binutils/binutils-2.34.inc +++ b/meta/recipes-devtools/binutils/binutils-2.34.inc @@ -24,7 +24,7 @@ BRANCH ?= "binutils-2_34-branch" UPSTREAM_CHECK_GITTAGREGEX = "binutils-(?P\d+_(\d_?)*)" -SRCREV ?= "d4b50999b3b287b5f984ade2f8734aa8c9359440" +SRCREV ?= "c4e78c0868a22971680217a41fdb73516a26813d" BINUTILS_GIT_URI ?= "git://sourceware.org/git/binutils-gdb.git;branch=${BRANCH};protocol=git" SRC_URI = "\ ${BINUTILS_GIT_URI} \ diff --git a/meta/recipes-devtools/binutils/binutils/CVE-2020-16593.patch b/meta/recipes-devtools/binutils/binutils/CVE-2020-16593.patch index cbe4a50507..c7c7829261 100644 --- a/meta/recipes-devtools/binutils/binutils/CVE-2020-16593.patch +++ b/meta/recipes-devtools/binutils/binutils/CVE-2020-16593.patch @@ -199,6 +199,6 @@ Index: git/bfd/ChangeLog + * dwarf2.c (scan_unit_for_symbols): Wrap overlong lines. Don't + strdup(0). + - 2020-02-19 H.J. Lu + 2021-05-03 Alan Modra - PR binutils/25355 + PR 27755 diff --git a/meta/recipes-devtools/binutils/binutils/CVE-2021-3549.patch b/meta/recipes-devtools/binutils/binutils/CVE-2021-3549.patch index 4391db340a..5f56dd7696 100644 --- a/meta/recipes-devtools/binutils/binutils/CVE-2021-3549.patch +++ b/meta/recipes-devtools/binutils/binutils/CVE-2021-3549.patch @@ -7,31 +7,49 @@ Adds missing sanity checks for avr device info note, to avoid potential buffer overflows. Uses bfd_malloc_and_get_section for sanity checking section size. - PR 27290 - PR 27293 - PR 27295 - * od-elf32_avr.c (elf32_avr_get_note_section_contents): Formatting. - Use bfd_malloc_and_get_section. - (elf32_avr_get_note_desc): Formatting. Return descsz. Sanity - check namesz. Return NULL if descsz is too small. Ensure - string table is terminated. - (elf32_avr_get_device_info): Formatting. Add note_size param. - Sanity check note. - (elf32_avr_dump_mem_usage): Adjust to suit. + PR 27290 + PR 27293 + PR 27295 + * od-elf32_avr.c (elf32_avr_get_note_section_contents): Formatting. + Use bfd_malloc_and_get_section. + (elf32_avr_get_note_desc): Formatting. Return descsz. Sanity + check namesz. Return NULL if descsz is too small. Ensure + string table is terminated. + (elf32_avr_get_device_info): Formatting. Add note_size param. + Sanity check note. + (elf32_avr_dump_mem_usage): Adjust to suit. Upstream-Status: Backport CVE: CVE-2021-3549 Signed-of-by: Armin Kuster --- - binutils/ChangeLog | 14 +++++++++ - binutils/od-elf32_avr.c | 66 ++++++++++++++++++++++++++--------------- - 2 files changed, 56 insertions(+), 24 deletions(-) - -Index: git/binutils/od-elf32_avr.c -=================================================================== ---- git.orig/binutils/od-elf32_avr.c -+++ git/binutils/od-elf32_avr.c +diff --git a/binutils/ChangeLog b/binutils/ChangeLog +index 1e9a96c9bb6..02e5019204e 100644 +--- a/binutils/ChangeLog ++++ b/binutils/ChangeLog +@@ -1,3 +1,17 @@ ++2021-02-11 Alan Modra ++ ++ PR 27290 ++ PR 27293 ++ PR 27295 ++ * od-elf32_avr.c (elf32_avr_get_note_section_contents): Formatting. ++ Use bfd_malloc_and_get_section. ++ (elf32_avr_get_note_desc): Formatting. Return descsz. Sanity ++ check namesz. Return NULL if descsz is too small. Ensure ++ string table is terminated. ++ (elf32_avr_get_device_info): Formatting. Add note_size param. ++ Sanity check note. ++ (elf32_avr_dump_mem_usage): Adjust to suit. ++ + 2020-03-25 H.J. Lu + + * ar.c (main): Update bfd_plugin_set_program_name call. +diff --git a/binutils/od-elf32_avr.c b/binutils/od-elf32_avr.c +index 5ec99957fe9..1d32bce918e 100644 +--- a/binutils/od-elf32_avr.c ++++ b/binutils/od-elf32_avr.c @@ -77,23 +77,29 @@ elf32_avr_filter (bfd *abfd) return bfd_get_flavour (abfd) == bfd_target_elf_flavour; } @@ -70,7 +88,7 @@ Index: git/binutils/od-elf32_avr.c { Elf_External_Note *xnp = (Elf_External_Note *) contents; Elf_Internal_Note in; -@@ -107,42 +113,54 @@ static char* elf32_avr_get_note_desc (bf +@@ -107,42 +113,54 @@ static char* elf32_avr_get_note_desc (bfd *abfd, char *contents, if (in.namesz > contents - in.namedata + size) return NULL; @@ -163,25 +181,3 @@ Index: git/binutils/od-elf32_avr.c } elf32_avr_get_memory_usage (abfd, &text_usage, &data_usage, -Index: git/binutils/ChangeLog -=================================================================== ---- git.orig/binutils/ChangeLog -+++ git/binutils/ChangeLog -@@ -1,3 +1,17 @@ -+2021-02-11 Alan Modra -+ -+ PR 27290 -+ PR 27293 -+ PR 27295 -+ * od-elf32_avr.c (elf32_avr_get_note_section_contents): Formatting. -+ Use bfd_malloc_and_get_section. -+ (elf32_avr_get_note_desc): Formatting. Return descsz. Sanity -+ check namesz. Return NULL if descsz is too small. Ensure -+ string table is terminated. -+ (elf32_avr_get_device_info): Formatting. Add note_size param. -+ Sanity check note. -+ (elf32_avr_dump_mem_usage): Adjust to suit. -+ - 2020-02-01 Nick Clifton - - * configure: Regenerate.