diff options
Diffstat (limited to 'meta-oe/recipes-devtools/yasm')
6 files changed, 223 insertions, 0 deletions
diff --git a/meta-oe/recipes-devtools/yasm/yasm/0001-Do-not-use-AC_HEADER_STDC.patch b/meta-oe/recipes-devtools/yasm/yasm/0001-Do-not-use-AC_HEADER_STDC.patch new file mode 100644 index 0000000000..bda90edb20 --- /dev/null +++ b/meta-oe/recipes-devtools/yasm/yasm/0001-Do-not-use-AC_HEADER_STDC.patch @@ -0,0 +1,39 @@ +From 6b1cbe8b4dcc45103d69bc7337e5eb33d1fd21f3 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Wed, 3 Feb 2021 14:22:51 -0800 +Subject: [PATCH] Do not use AC_HEADER_STDC + +This macro is removed in autotools 2.70+ and it can be expected that C90 +headers are always available [1] + +Upstream-Status: Pending + +[1] https://www.gnu.org/software/autoconf/manual/autoconf-2.70/autoconf.html#index-AC_005fHEADER_005fSTDC + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + configure.ac | 6 ------ + 1 file changed, 6 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 01b61097..2823ecd7 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -101,14 +101,8 @@ AM_WITH_DMALLOC + # + # Checks for header files. + # +-AC_HEADER_STDC + AC_CHECK_HEADERS([strings.h libgen.h unistd.h direct.h sys/stat.h]) + +-# REQUIRE standard C headers +-if test "$ac_cv_header_stdc" != yes; then +- AC_MSG_ERROR([Standard (ANSI/ISO C89) header files are required.]) +-fi +- + # + # Checks for typedefs, structures, and compiler characteristics. + # +-- +2.30.0 + diff --git a/meta-oe/recipes-devtools/yasm/yasm/0001-yasm-Set-build-date-to-SOURCE_DATE_EPOCH.patch b/meta-oe/recipes-devtools/yasm/yasm/0001-yasm-Set-build-date-to-SOURCE_DATE_EPOCH.patch new file mode 100644 index 0000000000..42f5559e3f --- /dev/null +++ b/meta-oe/recipes-devtools/yasm/yasm/0001-yasm-Set-build-date-to-SOURCE_DATE_EPOCH.patch @@ -0,0 +1,37 @@ +From eb164bb201c0f792fa8aa78270c47294065183a3 Mon Sep 17 00:00:00 2001 +From: Oleh Matiusha <omatiush@cisco.com> +Date: Tue, 6 Feb 2024 09:33:11 +0000 +Subject: [PATCH 1/2] yasm: Set build date to SOURCE_DATE_EPOCH + +If SOURCE_DATE_EPOCH is set, use it to generate a reproducible +string for BUILD_DATE. + +Signed-off-by: Oleh Matiusha <omatiush@cisco.com> + +Upstream-Status: Pending +--- + configure.ac | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/configure.ac b/configure.ac +index 2823ecd..eeb51ce 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -103,6 +103,14 @@ AM_WITH_DMALLOC + # + AC_CHECK_HEADERS([strings.h libgen.h unistd.h direct.h sys/stat.h]) + ++# Use reproducible build date and time ++if test "$SOURCE_DATE_EPOCH"; then ++ DATE_FMT="%d %b %Y %H:%M:%S" ++ BUILD_DATE=$(LC_ALL=C date -u -d "@$SOURCE_DATE_EPOCH" "+$DATE_FMT") ++ AC_DEFINE_UNQUOTED([BUILD_DATE], ["$BUILD_DATE"], [Use reproducidle build date]) ++fi ++ ++ + # + # Checks for typedefs, structures, and compiler characteristics. + # +-- +2.33.0 + diff --git a/meta-oe/recipes-devtools/yasm/yasm/0002-yasm-Use-BUILD_DATE-for-reproducibility.patch b/meta-oe/recipes-devtools/yasm/yasm/0002-yasm-Use-BUILD_DATE-for-reproducibility.patch new file mode 100644 index 0000000000..4b9c933d01 --- /dev/null +++ b/meta-oe/recipes-devtools/yasm/yasm/0002-yasm-Use-BUILD_DATE-for-reproducibility.patch @@ -0,0 +1,42 @@ +From 19fffab74a201dc41c3da7e74d86eafa8f68bbc6 Mon Sep 17 00:00:00 2001 +From: Oleh Matiusha <omatiush@cisco.com> +Date: Tue, 6 Feb 2024 09:34:26 +0000 +Subject: [PATCH] yasm: Use BUILD_DATE for reproducibility + +Use reproducible build date instead of compilation time and date. + +Signed-off-by: Oleh Matiusha <omatiush@cisco.com> + + +Upstream-Status: Pending +--- + tools/re2c/parser.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/tools/re2c/parser.c b/tools/re2c/parser.c +index 02d5c66..1c90aee 100644 +--- a/tools/re2c/parser.c ++++ b/tools/re2c/parser.c +@@ -5,6 +5,7 @@ + #include "tools/re2c/globals.h" + #include "tools/re2c/parse.h" + #include "tools/re2c/parser.h" ++#include "config.h" + + int yylex(void); + static RegExp *parse_expr(void); +@@ -233,7 +234,11 @@ void parse(FILE *i, FILE *o){ + peektok = NONE; + + fputs("/* Generated by re2c 0.9.1-C on ", o); ++#ifndef BUILD_DATE + fprintf(o, "%-24s", ctime(&now)); ++#else ++ fprintf(o, "%-24s", BUILD_DATE " "); ++#endif + fputs(" */\n", o); oline+=2; + + in = Scanner_new(i); +-- +2.33.0 + diff --git a/meta-oe/recipes-devtools/yasm/yasm/CVE-2023-31975.patch b/meta-oe/recipes-devtools/yasm/yasm/CVE-2023-31975.patch new file mode 100644 index 0000000000..ae10e99c2f --- /dev/null +++ b/meta-oe/recipes-devtools/yasm/yasm/CVE-2023-31975.patch @@ -0,0 +1,29 @@ +From b2cc5a1693b17ac415df76d0795b15994c106441 Mon Sep 17 00:00:00 2001 +From: Katsuhiko Gondow <gondow@cs.titech.ac.jp> +Date: Tue, 13 Jun 2023 05:00:47 +0900 +Subject: [PATCH] Fix memory leak in bin-objfmt (#231) + +Upstream-Status: Backport [https://github.com/yasm/yasm/commit/b2cc5a1693b17ac415df76d0795b15994c106441] + +CVE: CVE-2023-31975 +--- + modules/objfmts/bin/bin-objfmt.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/modules/objfmts/bin/bin-objfmt.c b/modules/objfmts/bin/bin-objfmt.c +index 18026750..a38c3422 100644 +--- a/modules/objfmts/bin/bin-objfmt.c ++++ b/modules/objfmts/bin/bin-objfmt.c +@@ -1680,6 +1680,10 @@ static void + bin_section_data_destroy(void *data) + { + bin_section_data *bsd = (bin_section_data *)data; ++ if (bsd->align) ++ yasm_xfree(bsd->align); ++ if (bsd->valign) ++ yasm_xfree(bsd->valign); + if (bsd->start) + yasm_expr_destroy(bsd->start); + if (bsd->vstart) +-- +2.40.0 diff --git a/meta-oe/recipes-devtools/yasm/yasm/CVE-2023-37732.patch b/meta-oe/recipes-devtools/yasm/yasm/CVE-2023-37732.patch new file mode 100644 index 0000000000..1ca33f0a92 --- /dev/null +++ b/meta-oe/recipes-devtools/yasm/yasm/CVE-2023-37732.patch @@ -0,0 +1,41 @@ +From 2cd3bb50e256f5ed5f611ac611d25fe673f2cec3 Mon Sep 17 00:00:00 2001 +From: Peter Johnson <johnson.peter@gmail.com> +Date: Fri, 11 Aug 2023 10:49:51 +0000 +Subject: [PATCH] elf.c: Fix NULL deref on bad xsize expression (#234) + +CVE: CVE-2023-37732 + +Upstream-Status: Backport [https://github.com/yasm/yasm/commit/2cd3bb50e256f5ed5f611ac611d25fe673f2cec3] + +Signed-off-by: Soumya <soumya.sambu@windriver.com> +--- + modules/objfmts/elf/elf.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/modules/objfmts/elf/elf.c b/modules/objfmts/elf/elf.c +index 2486bba8..bab4c9ca 100644 +--- a/modules/objfmts/elf/elf.c ++++ b/modules/objfmts/elf/elf.c +@@ -482,15 +482,15 @@ elf_symtab_write_to_file(FILE *f, elf_symtab_head *symtab, + + /* get size (if specified); expr overrides stored integer */ + if (entry->xsize) { +- size_intn = yasm_intnum_copy( +- yasm_expr_get_intnum(&entry->xsize, 1)); +- if (!size_intn) { ++ yasm_intnum *intn = yasm_expr_get_intnum(&entry->xsize, 1); ++ if (!intn) { + yasm_error_set(YASM_ERROR_VALUE, + N_("size specifier not an integer expression")); + yasm_errwarn_propagate(errwarns, entry->xsize->line); +- } ++ } else ++ size_intn = yasm_intnum_copy(intn); + } +- else ++ if (!size_intn) + size_intn = yasm_intnum_create_uint(entry->size); + + /* get EQU value for constants */ +-- +2.40.0 diff --git a/meta-oe/recipes-devtools/yasm/yasm_git.bb b/meta-oe/recipes-devtools/yasm/yasm_git.bb new file mode 100644 index 0000000000..216b777667 --- /dev/null +++ b/meta-oe/recipes-devtools/yasm/yasm_git.bb @@ -0,0 +1,35 @@ +SUMMARY = "x86 (SSE) assembler supporting NASM and GAS-syntaxes" +LICENSE = "MIT" +HOMEPAGE = "http://www.tortall.net/projects/yasm/" + +LIC_FILES_CHKSUM = "file://COPYING;md5=a12d8903508fb6bfd49d8d82c6170dd9" + +DEPENDS += "flex-native bison-native" +PACKAGECONFIG[docs] = ",,xmlto-native," + +PV = "1.3.0+git" +# v1.3.0 +SRCREV = "ba463d3c26c0ece2e797b8d6381b161633b5971a" +SRC_URI = "git://github.com/yasm/yasm.git;branch=master;protocol=https \ + file://0001-Do-not-use-AC_HEADER_STDC.patch \ + file://CVE-2023-31975.patch \ + file://CVE-2023-37732.patch \ + file://0001-yasm-Set-build-date-to-SOURCE_DATE_EPOCH.patch \ + file://0002-yasm-Use-BUILD_DATE-for-reproducibility.patch \ +" + +S = "${WORKDIR}/git" + +inherit autotools gettext python3native + +CACHED_CONFIGUREVARS = "CCLD_FOR_BUILD='${CC_FOR_BUILD}'" + +BBCLASSEXTEND = "native" + +PARALLEL_MAKE = "" + +do_configure:prepend() { + # Don't include $CC (which includes path to sysroot) in generated header. + sed -i -e "s/^echo \"\/\* generated \$ac_cv_stdint_message \*\/\" >>\$ac_stdint$"// ${S}/m4/ax_create_stdint_h.m4 +} + |