Openembedded Devel Discussions
 help / color / mirror / Atom feed
* [meta-oe][PATCH 1/4] yasm: add alternative CVE_PRODUCT
@ 2025-11-15 12:38 Gyorgy Sarvari
  2025-11-15 12:38 ` [meta-oe][PATCH 2/4] yasm: patch CVE-2023-59579 Gyorgy Sarvari
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Gyorgy Sarvari @ 2025-11-15 12:38 UTC (permalink / raw)
  To: openembedded-devel

There are multiple vendors for yasm:

$ sqlite3 ./nvdcve_2-2.db "select distinct vendor, product from products where product = 'yasm';"
tortall|yasm
yasm_project|yasm

Both products refer to the same application

Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
---
 meta-oe/recipes-devtools/yasm/yasm_git.bb | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/meta-oe/recipes-devtools/yasm/yasm_git.bb b/meta-oe/recipes-devtools/yasm/yasm_git.bb
index 68895a1697..abaeef4db3 100644
--- a/meta-oe/recipes-devtools/yasm/yasm_git.bb
+++ b/meta-oe/recipes-devtools/yasm/yasm_git.bb
@@ -33,3 +33,5 @@ do_configure:prepend() {
 CVE_STATUS_GROUPS += "CVE_STATUS_HASH_UPDATE"
 CVE_STATUS_HASH_UPDATE = "CVE-2021-33454 CVE-2023-31975 CVE-2023-37732"
 CVE_STATUS_HASH_UPDATE[status] = "fixed-version: patched in current git hash"
+
+CVE_PRODUCT += "tortall:yasm yasm_project:yasm"


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [meta-oe][PATCH 2/4] yasm: patch CVE-2023-59579
  2025-11-15 12:38 [meta-oe][PATCH 1/4] yasm: add alternative CVE_PRODUCT Gyorgy Sarvari
@ 2025-11-15 12:38 ` Gyorgy Sarvari
  2025-11-15 12:38 ` [meta-oe][PATCH 3/4] yasm: patch CVE-2021-33464 Gyorgy Sarvari
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Gyorgy Sarvari @ 2025-11-15 12:38 UTC (permalink / raw)
  To: openembedded-devel

Details: https://nvd.nist.gov/vuln/detail/CVE-2023-29579

The patch was taken from Debian:
https://sources.debian.org/patches/yasm/1.3.0-8/1000-x86-dir-cpu-CVE-2023-29579.patch/

Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
---
 .../yasm/yasm/CVE-2023-59579.patch            | 39 +++++++++++++++++++
 meta-oe/recipes-devtools/yasm/yasm_git.bb     |  3 +-
 2 files changed, 41 insertions(+), 1 deletion(-)
 create mode 100644 meta-oe/recipes-devtools/yasm/yasm/CVE-2023-59579.patch

diff --git a/meta-oe/recipes-devtools/yasm/yasm/CVE-2023-59579.patch b/meta-oe/recipes-devtools/yasm/yasm/CVE-2023-59579.patch
new file mode 100644
index 0000000000..564b27f5e5
--- /dev/null
+++ b/meta-oe/recipes-devtools/yasm/yasm/CVE-2023-59579.patch
@@ -0,0 +1,39 @@
+From 81c1b7b0a28f052eaadddcb010944bf67e6ae257 Mon Sep 17 00:00:00 2001
+From: Gyorgy Sarvari <skandigraun@gmail.com>
+Date: Sat, 15 Nov 2025 13:24:21 +0100
+Subject: [PATCH] Make sure CPU feature parsing use large enough string buffer.
+  Fixes CVE-2023-29579.
+
+Author: Petter Reinholdtsen <pere@debian.org>
+Bug: https://github.com/yasm/yasm/issues/214
+Bug-Debian: https://bugs.debian.org/1035951
+Forwarded:  https://github.com/yasm/yasm/issues/214
+Last-Update: 2025-04-30
+
+This patch is taken from Debian:
+https://sources.debian.org/patches/yasm/1.3.0-8/1000-x86-dir-cpu-CVE-2023-29579.patch/
+
+CVE: CVE-2023-59579
+Upstream-Status: Submitted [https://github.com/yasm/yasm/issues/214]
+
+Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
+---
+ modules/arch/x86/x86arch.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/modules/arch/x86/x86arch.c b/modules/arch/x86/x86arch.c
+index bac11774..58327958 100644
+--- a/modules/arch/x86/x86arch.c
++++ b/modules/arch/x86/x86arch.c
+@@ -165,8 +165,9 @@ x86_dir_cpu(yasm_object *object, yasm_valparamhead *valparams,
+                 yasm_error_set(YASM_ERROR_SYNTAX,
+                                N_("invalid argument to [%s]"), "CPU");
+             else {
+-                char strcpu[16];
+-                sprintf(strcpu, "%lu", yasm_intnum_get_uint(intcpu));
++                char strcpu[21]; /* 21 = ceil(log10(LONG_MAX)+1) */
++                assert(8*sizeof(unsigned long) <= 64);
++                snprintf(strcpu, sizeof(strcpu), "%lu", yasm_intnum_get_uint(intcpu));
+                 yasm_x86__parse_cpu(arch_x86, strcpu, strlen(strcpu));
+             }
+         } else
diff --git a/meta-oe/recipes-devtools/yasm/yasm_git.bb b/meta-oe/recipes-devtools/yasm/yasm_git.bb
index abaeef4db3..f4f84a21f7 100644
--- a/meta-oe/recipes-devtools/yasm/yasm_git.bb
+++ b/meta-oe/recipes-devtools/yasm/yasm_git.bb
@@ -14,7 +14,8 @@ SRC_URI = "git://github.com/yasm/yasm.git;branch=master;protocol=https \
            file://0001-yasm-Set-build-date-to-SOURCE_DATE_EPOCH.patch \
            file://0002-yasm-Use-BUILD_DATE-for-reproducibility.patch \
            file://0001-bitvect-fix-build-with-gcc-15.patch \
-"
+           file://CVE-2023-59579.patch \
+           "
 
 
 inherit autotools gettext python3native


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [meta-oe][PATCH 3/4] yasm: patch CVE-2021-33464
  2025-11-15 12:38 [meta-oe][PATCH 1/4] yasm: add alternative CVE_PRODUCT Gyorgy Sarvari
  2025-11-15 12:38 ` [meta-oe][PATCH 2/4] yasm: patch CVE-2023-59579 Gyorgy Sarvari
@ 2025-11-15 12:38 ` Gyorgy Sarvari
  2025-11-15 12:38 ` [meta-oe][PATCH 4/4] yasm: patch CVE-2021-33456 Gyorgy Sarvari
       [not found] ` <18782E73673BFCC1.1143620@lists.openembedded.org>
  3 siblings, 0 replies; 5+ messages in thread
From: Gyorgy Sarvari @ 2025-11-15 12:38 UTC (permalink / raw)
  To: openembedded-devel

Details: https://nvd.nist.gov/vuln/detail/CVE-2021-33464

The patch was taken from Debian:
https://sources.debian.org/patches/yasm/1.3.0-8/1010-nasm-pp-no-env-CVE-2021-33464.patch/

Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
---
 .../yasm/yasm/CVE-2021-33464.patch            | 34 +++++++++++++++++++
 meta-oe/recipes-devtools/yasm/yasm_git.bb     |  1 +
 2 files changed, 35 insertions(+)
 create mode 100644 meta-oe/recipes-devtools/yasm/yasm/CVE-2021-33464.patch

diff --git a/meta-oe/recipes-devtools/yasm/yasm/CVE-2021-33464.patch b/meta-oe/recipes-devtools/yasm/yasm/CVE-2021-33464.patch
new file mode 100644
index 0000000000..ebae250ff9
--- /dev/null
+++ b/meta-oe/recipes-devtools/yasm/yasm/CVE-2021-33464.patch
@@ -0,0 +1,34 @@
+From 3c3f968d48d768c1e355199d4067d99cb72abc26 Mon Sep 17 00:00:00 2001
+From: Gyorgy Sarvari <skandigraun@gmail.com>
+Date: Sat, 15 Nov 2025 13:30:12 +0100
+Subject: [PATCH] Handle file descriptors with nonexisting env names better. 
+ Avoid writing past allocated memory.
+
+This fixes CVE-2021-33464.
+Author: Petter Reinholdtsen <pere@debian.org>
+Bug: https://github.com/yasm/yasm/issues/164
+Bug-Debian: https://bugs.debian.org/1016353
+Forwarded: https://github.com/yasm/yasm/issues/164
+Last-Update: 2025-04-30
+
+CVE: CVE-2021-33464
+Upstream-Status: Submitted [https://github.com/yasm/yasm/issues/164]
+
+Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
+---
+ modules/preprocs/nasm/nasm-pp.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/modules/preprocs/nasm/nasm-pp.c b/modules/preprocs/nasm/nasm-pp.c
+index 512f02c3..f9f92dd1 100644
+--- a/modules/preprocs/nasm/nasm-pp.c
++++ b/modules/preprocs/nasm/nasm-pp.c
+@@ -1815,7 +1815,7 @@ inc_fopen(char *file, char **newname)
+             error(ERR_WARNING, "environment variable `%s' does not exist",
+                   p1+1);
+             *p2 = '%';
+-            p1 = p2+1;
++            pb = p1 = p2+1;
+             continue;
+         }
+         /* need to expand */
diff --git a/meta-oe/recipes-devtools/yasm/yasm_git.bb b/meta-oe/recipes-devtools/yasm/yasm_git.bb
index f4f84a21f7..98ccb42050 100644
--- a/meta-oe/recipes-devtools/yasm/yasm_git.bb
+++ b/meta-oe/recipes-devtools/yasm/yasm_git.bb
@@ -15,6 +15,7 @@ SRC_URI = "git://github.com/yasm/yasm.git;branch=master;protocol=https \
            file://0002-yasm-Use-BUILD_DATE-for-reproducibility.patch \
            file://0001-bitvect-fix-build-with-gcc-15.patch \
            file://CVE-2023-59579.patch \
+           file://CVE-2021-33464.patch \
            "
 
 


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [meta-oe][PATCH 4/4] yasm: patch CVE-2021-33456
  2025-11-15 12:38 [meta-oe][PATCH 1/4] yasm: add alternative CVE_PRODUCT Gyorgy Sarvari
  2025-11-15 12:38 ` [meta-oe][PATCH 2/4] yasm: patch CVE-2023-59579 Gyorgy Sarvari
  2025-11-15 12:38 ` [meta-oe][PATCH 3/4] yasm: patch CVE-2021-33464 Gyorgy Sarvari
@ 2025-11-15 12:38 ` Gyorgy Sarvari
       [not found] ` <18782E73673BFCC1.1143620@lists.openembedded.org>
  3 siblings, 0 replies; 5+ messages in thread
From: Gyorgy Sarvari @ 2025-11-15 12:38 UTC (permalink / raw)
  To: openembedded-devel

Details: https://nvd.nist.gov/vuln/detail/CVE-2021-33465

The patch was taken from Debian:
https://sources.debian.org/patches/yasm/1.3.0-8/1020-hash-null-CVE-2021-33456.patch/

Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
---
 .../yasm/yasm/CVE-2021-33456.patch            | 35 +++++++++++++++++++
 meta-oe/recipes-devtools/yasm/yasm_git.bb     |  1 +
 2 files changed, 36 insertions(+)
 create mode 100644 meta-oe/recipes-devtools/yasm/yasm/CVE-2021-33456.patch

diff --git a/meta-oe/recipes-devtools/yasm/yasm/CVE-2021-33456.patch b/meta-oe/recipes-devtools/yasm/yasm/CVE-2021-33456.patch
new file mode 100644
index 0000000000..2340d8ed75
--- /dev/null
+++ b/meta-oe/recipes-devtools/yasm/yasm/CVE-2021-33456.patch
@@ -0,0 +1,35 @@
+From 1126140b8f5ece18c58640725f0e4c08e5ec97b0 Mon Sep 17 00:00:00 2001
+From: Gyorgy Sarvari <skandigraun@gmail.com>
+Date: Sat, 15 Nov 2025 13:34:15 +0100
+Subject: [PATCH] A potential null pointer difference is that the return value
+ of the hash may be null. This fixes CVE-2021-33456.
+
+From: lixuebing <lixuebing@cqsoftware.com.cn>
+Date: Mon, 25 Aug 2025 13:51:28 +0800
+Subject: Fix null-pointer-dereference in hash
+Bug: https://github.com/yasm/yasm/issues/175
+Origin: https://github.com/yasm/yasm/pull/290
+
+CVE: CVE-2021-33456
+Upstream-Status: Submitted [https://github.com/yasm/yasm/pull/290]
+
+Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
+---
+ modules/preprocs/nasm/nasm-pp.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/modules/preprocs/nasm/nasm-pp.c b/modules/preprocs/nasm/nasm-pp.c
+index f9f92dd1..473d98c1 100644
+--- a/modules/preprocs/nasm/nasm-pp.c
++++ b/modules/preprocs/nasm/nasm-pp.c
+@@ -1102,6 +1102,10 @@ hash(char *s)
+ {
+     unsigned int h = 0;
+     unsigned int i = 0;
++    /* Check if the input string is NULL to avoid null pointer dereference */
++    if (s == NULL) {
++        return 0;
++    }
+     /*
+      * Powers of three, mod 31.
+      */
diff --git a/meta-oe/recipes-devtools/yasm/yasm_git.bb b/meta-oe/recipes-devtools/yasm/yasm_git.bb
index 98ccb42050..d5fa003957 100644
--- a/meta-oe/recipes-devtools/yasm/yasm_git.bb
+++ b/meta-oe/recipes-devtools/yasm/yasm_git.bb
@@ -16,6 +16,7 @@ SRC_URI = "git://github.com/yasm/yasm.git;branch=master;protocol=https \
            file://0001-bitvect-fix-build-with-gcc-15.patch \
            file://CVE-2023-59579.patch \
            file://CVE-2021-33464.patch \
+           file://CVE-2021-33456.patch \
            "
 
 


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [oe] [meta-oe][PATCH 2/4] yasm: patch CVE-2023-59579
       [not found] ` <18782E73673BFCC1.1143620@lists.openembedded.org>
@ 2025-11-15 18:11   ` Gyorgy Sarvari
  0 siblings, 0 replies; 5+ messages in thread
From: Gyorgy Sarvari @ 2025-11-15 18:11 UTC (permalink / raw)
  To: openembedded-devel

Please ignore this -  made a typo in the CVE id at multiple places - it
is 29579, not 59579. Will send a new version.

On 11/15/25 13:38, Gyorgy Sarvari via lists.openembedded.org wrote:
> Details: https://nvd.nist.gov/vuln/detail/CVE-2023-29579
>
> The patch was taken from Debian:
> https://sources.debian.org/patches/yasm/1.3.0-8/1000-x86-dir-cpu-CVE-2023-29579.patch/
>
> Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
> ---
>  .../yasm/yasm/CVE-2023-59579.patch            | 39 +++++++++++++++++++
>  meta-oe/recipes-devtools/yasm/yasm_git.bb     |  3 +-
>  2 files changed, 41 insertions(+), 1 deletion(-)
>  create mode 100644 meta-oe/recipes-devtools/yasm/yasm/CVE-2023-59579.patch
>
> diff --git a/meta-oe/recipes-devtools/yasm/yasm/CVE-2023-59579.patch b/meta-oe/recipes-devtools/yasm/yasm/CVE-2023-59579.patch
> new file mode 100644
> index 0000000000..564b27f5e5
> --- /dev/null
> +++ b/meta-oe/recipes-devtools/yasm/yasm/CVE-2023-59579.patch
> @@ -0,0 +1,39 @@
> +From 81c1b7b0a28f052eaadddcb010944bf67e6ae257 Mon Sep 17 00:00:00 2001
> +From: Gyorgy Sarvari <skandigraun@gmail.com>
> +Date: Sat, 15 Nov 2025 13:24:21 +0100
> +Subject: [PATCH] Make sure CPU feature parsing use large enough string buffer.
> +  Fixes CVE-2023-29579.
> +
> +Author: Petter Reinholdtsen <pere@debian.org>
> +Bug: https://github.com/yasm/yasm/issues/214
> +Bug-Debian: https://bugs.debian.org/1035951
> +Forwarded:  https://github.com/yasm/yasm/issues/214
> +Last-Update: 2025-04-30
> +
> +This patch is taken from Debian:
> +https://sources.debian.org/patches/yasm/1.3.0-8/1000-x86-dir-cpu-CVE-2023-29579.patch/
> +
> +CVE: CVE-2023-59579
> +Upstream-Status: Submitted [https://github.com/yasm/yasm/issues/214]
> +
> +Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
> +---
> + modules/arch/x86/x86arch.c | 5 +++--
> + 1 file changed, 3 insertions(+), 2 deletions(-)
> +
> +diff --git a/modules/arch/x86/x86arch.c b/modules/arch/x86/x86arch.c
> +index bac11774..58327958 100644
> +--- a/modules/arch/x86/x86arch.c
> ++++ b/modules/arch/x86/x86arch.c
> +@@ -165,8 +165,9 @@ x86_dir_cpu(yasm_object *object, yasm_valparamhead *valparams,
> +                 yasm_error_set(YASM_ERROR_SYNTAX,
> +                                N_("invalid argument to [%s]"), "CPU");
> +             else {
> +-                char strcpu[16];
> +-                sprintf(strcpu, "%lu", yasm_intnum_get_uint(intcpu));
> ++                char strcpu[21]; /* 21 = ceil(log10(LONG_MAX)+1) */
> ++                assert(8*sizeof(unsigned long) <= 64);
> ++                snprintf(strcpu, sizeof(strcpu), "%lu", yasm_intnum_get_uint(intcpu));
> +                 yasm_x86__parse_cpu(arch_x86, strcpu, strlen(strcpu));
> +             }
> +         } else
> diff --git a/meta-oe/recipes-devtools/yasm/yasm_git.bb b/meta-oe/recipes-devtools/yasm/yasm_git.bb
> index abaeef4db3..f4f84a21f7 100644
> --- a/meta-oe/recipes-devtools/yasm/yasm_git.bb
> +++ b/meta-oe/recipes-devtools/yasm/yasm_git.bb
> @@ -14,7 +14,8 @@ SRC_URI = "git://github.com/yasm/yasm.git;branch=master;protocol=https \
>             file://0001-yasm-Set-build-date-to-SOURCE_DATE_EPOCH.patch \
>             file://0002-yasm-Use-BUILD_DATE-for-reproducibility.patch \
>             file://0001-bitvect-fix-build-with-gcc-15.patch \
> -"
> +           file://CVE-2023-59579.patch \
> +           "
>  
>  
>  inherit autotools gettext python3native
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#121723): https://lists.openembedded.org/g/openembedded-devel/message/121723
> Mute This Topic: https://lists.openembedded.org/mt/116306636/6084445
> Group Owner: openembedded-devel+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [skandigraun@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-11-15 18:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-15 12:38 [meta-oe][PATCH 1/4] yasm: add alternative CVE_PRODUCT Gyorgy Sarvari
2025-11-15 12:38 ` [meta-oe][PATCH 2/4] yasm: patch CVE-2023-59579 Gyorgy Sarvari
2025-11-15 12:38 ` [meta-oe][PATCH 3/4] yasm: patch CVE-2021-33464 Gyorgy Sarvari
2025-11-15 12:38 ` [meta-oe][PATCH 4/4] yasm: patch CVE-2021-33456 Gyorgy Sarvari
     [not found] ` <18782E73673BFCC1.1143620@lists.openembedded.org>
2025-11-15 18:11   ` [oe] [meta-oe][PATCH 2/4] yasm: patch CVE-2023-59579 Gyorgy Sarvari

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox