Patch review
cover Patch review
Please review this set of changes for kirkstone and have comments back by end of day Thursday, August 28
Passed a-full on autobuilder:
https://autobuilder.yoctoproject.org/valkyrie/#/builders/29/builds/2267
The following changes since commit e401a16d8e26d25cec95fcea98d6530036cffca1:
libubootenv: backport patch to fix unknown type name 'size_t' (2025-08-19 10:14:55 -0700)
are available in the Git repository at:
https://git.openembedded.org/openembedded-core-contrib stable/kirkstone-nut
https://git.openembedded.org/openembedded-core-contrib/log/?h=stable/kirkstone-nut
Hitendra Prajapati (1):
gstreamer1.0-plugins-base: fix CVE-2025-47807
Jiaying Song (1):
openssl: fix CVE-2023-50781
Peter Marko (4):
qemu: ignore CVE-2024-7730
glib-2.0: patch CVE-2025-7039
dpkg: patch CVE-2025-6297
libarchive: patch regression of patch for CVE-2025-5918
Vijay Anusuri (3):
xserver-xorg: Fix for CVE-2025-49178
xserver-xorg: Fix for CVE-2025-49179
xserver-xorg: Fix for CVE-2025-49180
.../openssl/openssl/CVE-2023-50781-1.patch | 618 ++++++++++++++++++
.../openssl/openssl/CVE-2023-50781-2.patch | 358 ++++++++++
.../openssl/openssl/CVE-2023-50781-3.patch | 41 ++
.../openssl/openssl/CVE-2023-50781-4.patch | 441 +++++++++++++
.../openssl/openssl/CVE-2023-50781-5.patch | 284 ++++++++
.../openssl/openssl/CVE-2023-50781-6.patch | 57 ++
.../openssl/openssl_3.0.17.bb | 8 +-
.../glib-2.0/glib-2.0/CVE-2025-7039-01.patch | 40 ++
.../glib-2.0/glib-2.0/CVE-2025-7039-02.patch | 43 ++
meta/recipes-core/glib-2.0/glib-2.0_2.72.3.bb | 2 +
.../dpkg/dpkg/CVE-2025-6297.patch | 125 ++++
meta/recipes-devtools/dpkg/dpkg_1.21.4.bb | 1 +
meta/recipes-devtools/qemu/qemu.inc | 3 +
...2025-5918.patch => CVE-2025-5918-01.patch} | 0
.../libarchive/CVE-2025-5918-02.patch | 51 ++
.../libarchive/libarchive_3.6.2.bb | 3 +-
.../xserver-xorg/CVE-2025-49178.patch | 49 ++
.../xserver-xorg/CVE-2025-49179.patch | 67 ++
.../xserver-xorg/CVE-2025-49180-1.patch | 44 ++
.../xserver-xorg/CVE-2025-49180-2.patch | 52 ++
.../xorg-xserver/xserver-xorg_21.1.8.bb | 4 +
.../CVE-2025-47807.patch | 49 ++
.../gstreamer1.0-plugins-base_1.20.7.bb | 1 +
23 files changed, 2339 insertions(+), 2 deletions(-)
create mode 100644 meta/recipes-connectivity/openssl/openssl/CVE-2023-50781-1.patch
create mode 100644 meta/recipes-connectivity/openssl/openssl/CVE-2023-50781-2.patch
create mode 100644 meta/recipes-connectivity/openssl/openssl/CVE-2023-50781-3.patch
create mode 100644 meta/recipes-connectivity/openssl/openssl/CVE-2023-50781-4.patch
create mode 100644 meta/recipes-connectivity/openssl/openssl/CVE-2023-50781-5.patch
create mode 100644 meta/recipes-connectivity/openssl/openssl/CVE-2023-50781-6.patch
create mode 100644 meta/recipes-core/glib-2.0/glib-2.0/CVE-2025-7039-01.patch
create mode 100644 meta/recipes-core/glib-2.0/glib-2.0/CVE-2025-7039-02.patch
create mode 100644 meta/recipes-devtools/dpkg/dpkg/CVE-2025-6297.patch
rename meta/recipes-extended/libarchive/libarchive/{CVE-2025-5918.patch => CVE-2025-5918-01.patch} (100%)
create mode 100644 meta/recipes-extended/libarchive/libarchive/CVE-2025-5918-02.patch
create mode 100644 meta/recipes-graphics/xorg-xserver/xserver-xorg/CVE-2025-49178.patch
create mode 100644 meta/recipes-graphics/xorg-xserver/xserver-xorg/CVE-2025-49179.patch
create mode 100644 meta/recipes-graphics/xorg-xserver/xserver-xorg/CVE-2025-49180-1.patch
create mode 100644 meta/recipes-graphics/xorg-xserver/xserver-xorg/CVE-2025-49180-2.patch
create mode 100644 meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/CVE-2025-47807.patchSignature · 1 line
2.43.0
PATCH 1/9 openssl: fix CVE-2023-50781
From: Jiaying Song <[email protected]>
A flaw was found in m2crypto. This issue may allow a remote attacker to decrypt captured messages in TLS servers that use RSA key exchanges, which may lead to exposure of confidential or sensitive data.
The CVE-2023-50781 in M2Crypto is addressed by modifying OpenSSL because M2Crypto relies on OpenSSL for its cryptographic operations.The issue stems from OpenSSL’s RSA PKCS#1 v1.5 padding verification being vulnerable to Bleichenbacher-type attacks.To mitigate this, OpenSSL introduced an implicit rejection mechanism in the RSA PKCS#1 v1.5 padding.Therefore, resolving the vulnerability requires changes within OpenSSL itself to ensure M2Crypto’s security.
References:
https://nvd.nist.gov/vuln/detail/CVE-2023-50781
https://github.com/openssl/openssl/pull/13817/commits
https://todo.sr.ht/~mcepl/m2crypto/342?__goaway_challenge=meta-refresh&__goaway_id=45a03d6accb7b343867110db1f7fb334
--- .../openssl/openssl/CVE-2023-50781-1.patch | 618 ++++++++++++++++++ .../openssl/openssl/CVE-2023-50781-2.patch | 358 ++++++++++ .../openssl/openssl/CVE-2023-50781-3.patch | 41 ++ .../openssl/openssl/CVE-2023-50781-4.patch | 441 +++++++++++++ .../openssl/openssl/CVE-2023-50781-5.patch | 284 ++++++++ .../openssl/openssl/CVE-2023-50781-6.patch | 57 ++ .../openssl/openssl_3.0.17.bb | 8 +- 7 files changed, 1806 insertions(+), 1 deletion(-) create mode 100644 meta/recipes-connectivity/openssl/openssl/CVE-2023-50781-1.patch create mode 100644 meta/recipes-connectivity/openssl/openssl/CVE-2023-50781-2.patch create mode 100644 meta/recipes-connectivity/openssl/openssl/CVE-2023-50781-3.patch create mode 100644 meta/recipes-connectivity/openssl/openssl/CVE-2023-50781-4.patch create mode 100644 meta/recipes-connectivity/openssl/openssl/CVE-2023-50781-5.patch create mode 100644 meta/recipes-connectivity/openssl/openssl/CVE-2023-50781-6.patch
meta/recipes-connectivity/openssl/openssl/CVE-2023-50781-1.patch new file +618 -0
@@ -0,0 +1,618 @@ +From 24734088e1034392de981151dfe57e3a379ada18 Mon Sep 17 00:00:00 2001 +From: Hubert Kario <[email protected]> +Date: Tue, 15 Mar 2022 13:58:08 +0100 +Subject: [PATCH 1/3] rsa: add implicit rejection in PKCS#1 v1.5 + +The RSA decryption as implemented before required very careful handling +of both the exit code returned by OpenSSL and the potentially returned +ciphertext. Looking at the recent security vulnerabilities +(CVE-2020-25659 and CVE-2020-25657) it is unlikely that most users of +OpenSSL do it correctly. + +Given that correct code requires side channel secure programming in +application code, we can classify the existing RSA decryption methods +as CWE-676, which in turn likely causes CWE-208 and CWE-385 in +application code. + +To prevent that, we can use a technique called "implicit rejection". +For that we generate a random message to be returned in case the +padding check fails. We generate the message based on static secret +data (the private exponent) and the provided ciphertext (so that the +attacker cannot determine that the returned value is randomly generated +instead of result of decryption and de-padding). We return it in case +any part of padding check fails. + +The upshot of this approach is that then not only is the length of the +returned message useless as the Bleichenbacher oracle, so are the +actual bytes of the returned message. So application code doesn't have +to perform any operations on the returned message in side-channel free +way to remain secure against Bleichenbacher attacks. + +Note: this patch implements a specific algorithm, shared with Mozilla +NSS, so that the attacker cannot use one library as an oracle against the +other in heterogeneous environments. + +CVE: CVE-2023-50781 + +Upstream-Status: Backport +[https://github.com/openssl/openssl/commit/7fc67e0a33102aa47bbaa56533eeecb98c0450f7] + +Reviewed-by: Dmitry Belyavskiy <[email protected]> +Reviewed-by: Tim Hudson <[email protected]> +Reviewed-by: Tomas Mraz <[email protected]> +(Merged from https://github.com/openssl/openssl/pull/13817) + +Signed-off-by: Jiaying Song <[email protected]> +--- + crypto/rsa/rsa_ossl.c | 95 +++++++- + crypto/rsa/rsa_pk1.c | 252 ++++++++++++++++++++++ + doc/man1/openssl-pkeyutl.pod.in | 5 + + doc/man1/openssl-rsautl.pod.in | 5 + + doc/man3/EVP_PKEY_CTX_ctrl.pod | 7 + + doc/man3/EVP_PKEY_decrypt.pod | 12 ++ + doc/man3/RSA_padding_add_PKCS1_type_1.pod | 7 +- + doc/man3/RSA_public_encrypt.pod | 11 +- + include/crypto/rsa.h | 4 + + 9 files changed, 393 insertions(+), 5 deletions(-) + +diff --git a/crypto/rsa/rsa_ossl.c b/crypto/rsa/rsa_ossl.c +index 0fc642e777..330302ae55 100644 +--- a/crypto/rsa/rsa_ossl.c ++++ b/crypto/rsa/rsa_ossl.c +@@ -17,6 +17,9 @@ + #include "crypto/bn.h" + #include "rsa_local.h" + #include "internal/constant_time.h" ++#include <openssl/evp.h> ++#include <openssl/sha.h> ++#include <openssl/hmac.h> + + static int rsa_ossl_public_encrypt(int flen, const unsigned char *from, + unsigned char *to, RSA *rsa, int padding); +@@ -377,8 +380,13 @@ static int rsa_ossl_private_decrypt(int flen, const unsigned char *from, + BIGNUM *f, *ret; + int j, num = 0, r = -1; + unsigned char *buf = NULL; ++ unsigned char d_hash[SHA256_DIGEST_LENGTH] = {0}; ++ HMAC_CTX *hmac = NULL; ++ unsigned int md_len = SHA256_DIGEST_LENGTH; ++ unsigned char kdk[SHA256_DIGEST_LENGTH] = {0}; + BN_CTX *ctx = NULL; + int local_blinding = 0; ++ EVP_MD *md = NULL; + /* + * Used only if the blinding structure is shared. A non-NULL unblind + * instructs rsa_blinding_convert() and rsa_blinding_invert() to store +@@ -408,6 +416,11 @@ static int rsa_ossl_private_decrypt(int flen, const unsigned char *from, + goto err; + } + ++ if (flen < 1) { ++ ERR_raise(ERR_LIB_RSA, RSA_R_DATA_TOO_SMALL); ++ goto err; ++ } ++ + /* make data into a big number */ + if (BN_bin2bn(from, (int)flen, f) == NULL) + goto err; +@@ -472,13 +485,91 @@ static int rsa_ossl_private_decrypt(int flen, const unsigned char *from, + if (!rsa_blinding_invert(blinding, ret, unblind, ctx)) + goto err; + ++ /* ++ * derive the Key Derivation Key from private exponent and public ++ * ciphertext ++ */ ++ if (!(rsa->flags & RSA_FLAG_EXT_PKEY)) { ++ /* ++ * because we use d as a handle to rsa->d we need to keep it local and ++ * free before any further use of rsa->d ++ */ ++ BIGNUM *d = BN_new(); ++ if (d == NULL) { ++ ERR_raise(ERR_LIB_RSA, ERR_R_MALLOC_FAILURE); ++ goto err; ++ } ++ if (rsa->d == NULL) { ++ ERR_raise(ERR_LIB_RSA, RSA_R_MISSING_PRIVATE_KEY); ++ BN_free(d); ++ goto err; ++ } ++ BN_with_flags(d, rsa->d, BN_FLG_CONSTTIME); ++ if (BN_bn2binpad(d, buf, num) < 0) { ++ ERR_raise(ERR_LIB_RSA, ERR_R_INTERNAL_ERROR); ++ BN_free(d); ++ goto err; ++ } ++ BN_free(d); ++ ++ /* ++ * we use hardcoded hash so that migrating between versions that use ++ * different hash doesn't provide a Bleichenbacher oracle: ++ * if the attacker can see that different versions return different ++ * messages for the same ciphertext, they'll know that the message is ++ * syntethically generated, which means that the padding check failed ++ */ ++ md = EVP_MD_fetch(rsa->libctx, "sha256", NULL); ++ if (md == NULL) { ++ ERR_raise(ERR_LIB_RSA, ERR_R_INTERNAL_ERROR); ++ goto err; ++ } ++ ++ if (EVP_Digest(buf, num, d_hash, NULL, md, NULL) <= 0) { ++ ERR_raise(ERR_LIB_RSA, ERR_R_INTERNAL_ERROR); ++ goto err; ++ } ++ ++ hmac = HMAC_CTX_new(); ++ if (hmac == NULL) { ++ ERR_raise(ERR_LIB_RSA, ERR_R_MALLOC_FAILURE); ++ goto err; ++ } ++ ++ if (HMAC_Init_ex(hmac, d_hash, sizeof(d_hash), md, NULL) <= 0) { ++ ERR_raise(ERR_LIB_RSA, ERR_R_INTERNAL_ERROR); ++ goto err; ++ } ++ ++ if (flen < num) { ++ memset(buf, 0, num - flen); ++ if (HMAC_Update(hmac, buf, num - flen) <= 0) { ++ ERR_raise(ERR_LIB_RSA, ERR_R_INTERNAL_ERROR); ++ goto err; ++ } ++ } ++ if (HMAC_Update(hmac, from, flen) <= 0) { ++ ERR_raise(ERR_LIB_RSA, ERR_R_INTERNAL_ERROR); ++ goto err; ++ } ++ ++ md_len = SHA256_DIGEST_LENGTH; ++ if (HMAC_Final(hmac, kdk, &md_len) <= 0) { ++ ERR_raise(ERR_LIB_RSA, ERR_R_INTERNAL_ERROR); ++ goto err; ++ } ++ } ++ + j = BN_bn2binpad(ret, buf, num); + if (j < 0) + goto err; + + switch (padding) { + case RSA_PKCS1_PADDING: +- r = RSA_padding_check_PKCS1_type_2(to, num, buf, j, num); ++ if (rsa->flags & RSA_FLAG_EXT_PKEY) ++ r = RSA_padding_check_PKCS1_type_2(to, num, buf, j, num); ++ else ++ r = ossl_rsa_padding_check_PKCS1_type_2(rsa->libctx, to, num, buf, j, num, kdk); + break; + case RSA_PKCS1_OAEP_PADDING: + r = RSA_padding_check_PKCS1_OAEP(to, num, buf, j, num, NULL, 0); +@@ -501,6 +592,8 @@ static int rsa_ossl_private_decrypt(int flen, const unsigned char *from, + #endif + + err: ++ HMAC_CTX_free(hmac); ++ EVP_MD_free(md); + BN_CTX_end(ctx); + BN_CTX_free(ctx); + OPENSSL_clear_free(buf, num); +diff --git a/crypto/rsa/rsa_pk1.c b/crypto/rsa/rsa_pk1.c +index 51507fc030..5cd2b26879 100644 +--- a/crypto/rsa/rsa_pk1.c ++++ b/crypto/rsa/rsa_pk1.c +@@ -21,10 +21,14 @@ + #include <openssl/rand.h> + /* Just for the SSL_MAX_MASTER_KEY_LENGTH value */ + #include <openssl/prov_ssl.h> ++#include <openssl/evp.h> ++#include <openssl/sha.h> ++#include <openssl/hmac.h> + #include "internal/cryptlib.h" + #include "crypto/rsa.h" + #include "rsa_local.h" + ++ + int RSA_padding_add_PKCS1_type_1(unsigned char *to, int tlen, + const unsigned char *from, int flen) + { +@@ -273,6 +277,254 @@ int RSA_padding_check_PKCS1_type_2(unsigned char *to, int tlen, + return constant_time_select_int(good, mlen, -1); + } + ++ ++static int ossl_rsa_prf(OSSL_LIB_CTX *ctx, ++ unsigned char *to, int tlen, ++ const char *label, int llen, ++ const unsigned char *kdk, ++ uint16_t bitlen) ++{ ++ int pos; ++ int ret = -1; ++ uint16_t iter = 0; ++ unsigned char be_iter[sizeof(iter)]; ++ unsigned char be_bitlen[sizeof(bitlen)]; ++ HMAC_CTX *hmac = NULL; ++ EVP_MD *md = NULL; ++ unsigned char hmac_out[SHA256_DIGEST_LENGTH]; ++ unsigned int md_len; ++ ++ if (tlen * 8 != bitlen) { ++ ERR_raise(ERR_LIB_RSA, ERR_R_INTERNAL_ERROR); ++ return ret; ++ } ++ ++ be_bitlen[0] = (bitlen >> 8) & 0xff; ++ be_bitlen[1] = bitlen & 0xff; ++ ++ hmac = HMAC_CTX_new(); ++ if (hmac == NULL) { ++ ERR_raise(ERR_LIB_RSA, ERR_R_INTERNAL_ERROR); ++ goto err; ++ } ++ ++ /* ++ * we use hardcoded hash so that migrating between versions that use ++ * different hash doesn't provide a Bleichenbacher oracle: ++ * if the attacker can see that different versions return different ++ * messages for the same ciphertext, they'll know that the message is ++ * syntethically generated, which means that the padding check failed ++ */ ++ md = EVP_MD_fetch(ctx, "sha256", NULL); ++ if (md == NULL) { ++ ERR_raise(ERR_LIB_RSA, ERR_R_INTERNAL_ERROR); ++ goto err; ++ } ++ ++ if (HMAC_Init_ex(hmac, kdk, SHA256_DIGEST_LENGTH, md, NULL) <= 0) { ++ ERR_raise(ERR_LIB_RSA, ERR_R_INTERNAL_ERROR); ++ goto err; ++ } ++ ++ for (pos = 0; pos < tlen; pos += SHA256_DIGEST_LENGTH, iter++) { ++ if (HMAC_Init_ex(hmac, NULL, 0, NULL, NULL) <= 0) { ++ ERR_raise(ERR_LIB_RSA, ERR_R_INTERNAL_ERROR); ++ goto err; ++ } ++ ++ be_iter[0] = (iter >> 8) & 0xff; ++ be_iter[1] = iter & 0xff; ++ ++ if (HMAC_Update(hmac, be_iter, sizeof(be_iter)) <= 0) { ++ ERR_raise(ERR_LIB_RSA, ERR_R_INTERNAL_ERROR); ++ goto err; ++ } ++ if (HMAC_Update(hmac, (unsigned char *)label, llen) <= 0) { ++ ERR_raise(ERR_LIB_RSA, ERR_R_INTERNAL_ERROR); ++ goto err; ++ } ++ if (HMAC_Update(hmac, be_bitlen, sizeof(be_bitlen)) <= 0) { ++ ERR_raise(ERR_LIB_RSA, ERR_R_INTERNAL_ERROR); ++ goto err; ++ } ++ ++ /* ++ * HMAC_Final requires the output buffer to fit the whole MAC ++ * value, so we need to use the intermediate buffer for the last ++ * unaligned block ++ */ ++ md_len = SHA256_DIGEST_LENGTH; ++ if (pos + SHA256_DIGEST_LENGTH > tlen) { ++ if (HMAC_Final(hmac, hmac_out, &md_len) <= 0) { ++ ERR_raise(ERR_LIB_RSA, ERR_R_INTERNAL_ERROR); ++ goto err; ++ } ++ memcpy(to + pos, hmac_out, tlen - pos); ++ } else { ++ if (HMAC_Final(hmac, to + pos, &md_len) <= 0) { ++ ERR_raise(ERR_LIB_RSA, ERR_R_INTERNAL_ERROR); ++ goto err; ++ } ++ } ++ } ++ ++ ret = 0; ++ ++err: ++ HMAC_CTX_free(hmac); ++ EVP_MD_free(md); ++ return ret; ++} ++ ++/* ++ * ossl_rsa_padding_check_PKCS1_type_2() checks and removes the PKCS#1 type 2 ++ * padding from a decrypted RSA message. Unlike the ++ * RSA_padding_check_PKCS1_type_2() it will not return an error in case it ++ * detects a padding error, rather it will return a deterministically generated ++ * random message. In other words it will perform an implicit rejection ++ * of an invalid padding. This means that the returned value does not indicate ++ * if the padding of the encrypted message was correct or not, making ++ * side channel attacks like the ones described by Bleichenbacher impossible ++ * without access to the full decrypted value and a brute-force search of ++ * remaining padding bytes ++ */ ++int ossl_rsa_padding_check_PKCS1_type_2(OSSL_LIB_CTX *ctx, ++ unsigned char *to, int tlen, ++ const unsigned char *from, int flen, ++ int num, unsigned char *kdk) ++{ ++/* ++ * We need to generate a random length for the synthethic message, to avoid ++ * bias towards zero and avoid non-constant timeness of DIV, we prepare ++ * 128 values to check if they are not too large for the used key size, ++ * and use 0 in case none of them are small enough, as 2^-128 is a good enough ++ * safety margin ++ */ ++#define MAX_LEN_GEN_TRIES 128 ++ unsigned char *synthetic = NULL; ++ int synthethic_length; ++ uint16_t len_candidate; ++ unsigned char candidate_lengths[MAX_LEN_GEN_TRIES * sizeof(len_candidate)]; ++ uint16_t len_mask; ++ uint16_t max_sep_offset; ++ int synth_msg_index = 0; ++ int ret = -1; ++ int i, j; ++ unsigned int good, found_zero_byte; ++ int zero_index = 0, msg_index; ++ ++ /* ++ * If these checks fail then either the message in publicly invalid, or ++ * we've been called incorrectly. We can fail immediately. ++ * Since this code is called only internally by openssl, those are just ++ * sanity checks ++ */ ++ if (num != flen || tlen <= 0 || flen <= 0) { ++ ERR_raise(ERR_LIB_RSA, ERR_R_INTERNAL_ERROR); ++ return -1; ++ } ++ ++ /* Generate a random message to return in case the padding checks fail */ ++ synthetic = OPENSSL_malloc(flen); ++ if (synthetic == NULL) { ++ ERR_raise(ERR_LIB_RSA, ERR_R_MALLOC_FAILURE); ++ return -1; ++ } ++ ++ if (ossl_rsa_prf(ctx, synthetic, flen, "message", 7, kdk, flen * 8) < 0) ++ goto err; ++ ++ /* decide how long the random message should be */ ++ if (ossl_rsa_prf(ctx, candidate_lengths, sizeof(candidate_lengths), ++ "length", 6, kdk, ++ MAX_LEN_GEN_TRIES * sizeof(len_candidate) * 8) < 0) ++ goto err; ++ ++ /* ++ * max message size is the size of the modulus size less 2 bytes for ++ * version and padding type and a minimum of 8 bytes padding ++ */ ++ len_mask = max_sep_offset = flen - 2 - 8; ++ /* ++ * we want a mask so lets propagate the high bit to all positions less ++ * significant than it ++ */ ++ len_mask |= len_mask >> 1; ++ len_mask |= len_mask >> 2; ++ len_mask |= len_mask >> 4; ++ len_mask |= len_mask >> 8; ++ ++ synthethic_length = 0; ++ for (i = 0; i < MAX_LEN_GEN_TRIES * (int)sizeof(len_candidate); ++ i += sizeof(len_candidate)) { ++ len_candidate = (candidate_lengths[i] << 8) | candidate_lengths[i + 1]; ++ len_candidate &= len_mask; ++ ++ synthethic_length = constant_time_select_int( ++ constant_time_lt(len_candidate, max_sep_offset), ++ len_candidate, synthethic_length); ++ } ++ ++ synth_msg_index = flen - synthethic_length; ++ ++ /* we have alternative message ready, check the real one */ ++ good = constant_time_is_zero(from[0]); ++ good &= constant_time_eq(from[1], 2); ++ ++ /* then look for the padding|message separator (the first zero byte) */ ++ found_zero_byte = 0; ++ for (i = 2; i < flen; i++) { ++ unsigned int equals0 = constant_time_is_zero(from[i]); ++ zero_index = constant_time_select_int(~found_zero_byte & equals0, ++ i, zero_index); ++ found_zero_byte |= equals0; ++ } ++ ++ /* ++ * padding must be at least 8 bytes long, and it starts two bytes into ++ * |from|. If we never found a 0-byte, then |zero_index| is 0 and the check ++ * also fails. ++ */ ++ good &= constant_time_ge(zero_index, 2 + 8); ++ ++ /* ++ * Skip the zero byte. This is incorrect if we never found a zero-byte ++ * but in this case we also do not copy the message out. ++ */ ++ msg_index = zero_index + 1; ++ ++ /* ++ * old code returned an error in case the decrypted message wouldn't fit ++ * into the |to|, since that would leak information, return the synthethic ++ * message instead ++ */ ++ good &= constant_time_ge(tlen, num - msg_index); ++ ++ msg_index = constant_time_select_int(good, msg_index, synth_msg_index); ++ ++ /* ++ * since at this point the |msg_index| does not provide the signal ++ * indicating if the padding check failed or not, we don't have to worry ++ * about leaking the length of returned message, we still need to ensure ++ * that we read contents of both buffers so that cache accesses don't leak ++ * the value of |good| ++ */ ++ for (i = msg_index, j = 0; i < flen && j < tlen; i++, j++) ++ to[j] = constant_time_select_8(good, from[i], synthetic[i]); ++ ret = j; ++ ++err: ++ /* ++ * the only time ret < 0 is when the ciphertext is publicly invalid ++ * or we were called with invalid parameters, so we don't have to perform ++ * a side-channel secure raising of the error ++ */ ++ if (ret < 0) ++ ERR_raise(ERR_LIB_RSA, ERR_R_INTERNAL_ERROR); ++ OPENSSL_free(synthetic); ++ return ret; ++} ++ + /* + * ossl_rsa_padding_check_PKCS1_type_2_TLS() checks and removes the PKCS1 type 2 + * padding from a decrypted RSA message in a TLS signature. The result is stored +diff --git a/doc/man1/openssl-pkeyutl.pod.in b/doc/man1/openssl-pkeyutl.pod.in +index 2f6ef0021d..015265a74d 100644 +--- a/doc/man1/openssl-pkeyutl.pod.in ++++ b/doc/man1/openssl-pkeyutl.pod.in +@@ -273,6 +273,11 @@ signed or verified directly instead of using a B<DigestInfo> structure. If a + digest is set, then the B<DigestInfo> structure is used and its length + must correspond to the digest type. + ++Note, for B<pkcs1> padding, as a protection against Bleichenbacher attack, ++the decryption will not fail in case of padding check failures. Use B<none> ++and manual inspection of the decrypted message to verify if the decrypted ++value has correct PKCS#1 v1.5 padding. ++ + For B<oaep> mode only encryption and decryption is supported. + + For B<x931> if the digest type is set it is used to format the block data +diff --git a/doc/man1/openssl-rsautl.pod.in b/doc/man1/openssl-rsautl.pod.in +index 0a32fd965b..4c462abc8c 100644 +--- a/doc/man1/openssl-rsautl.pod.in ++++ b/doc/man1/openssl-rsautl.pod.in +@@ -105,6 +105,11 @@ The padding to use: PKCS#1 v1.5 (the default), PKCS#1 OAEP, + ANSI X9.31, or no padding, respectively. + For signatures, only B<-pkcs> and B<-raw> can be used. + ++Note: because of protection against Bleichenbacher attacks, decryption ++using PKCS#1 v1.5 mode will not return errors in case padding check failed. ++Use B<-raw> and inspect the returned value manually to check if the ++padding is correct. ++ + =item B<-hexdump> + + Hex dump the output data. +diff --git a/doc/man3/EVP_PKEY_CTX_ctrl.pod b/doc/man3/EVP_PKEY_CTX_ctrl.pod +index 3075eaafd6..e788f38809 100644 +--- a/doc/man3/EVP_PKEY_CTX_ctrl.pod ++++ b/doc/man3/EVP_PKEY_CTX_ctrl.pod +@@ -386,6 +386,13 @@ this behaviour should be tolerated then + OSSL_ASYM_CIPHER_PARAM_TLS_NEGOTIATED_VERSION should be set to the actual + negotiated protocol version. Otherwise it should be left unset. + ++Similarly to the B<RSA_PKCS1_WITH_TLS_PADDING> above, since OpenSSL version ++3.1.0, the use of B<RSA_PKCS1_PADDING> will return a randomly generated message ++instead of padding errors in case padding checks fail. Applications that ++want to remain secure while using earlier versions of OpenSSL, still need to ++handle both the error code from the RSA decryption operation and the ++returned message in a side channel secure manner. ++ + =head2 DSA parameters + + EVP_PKEY_CTX_set_dsa_paramgen_bits() sets the number of bits used for DSA +diff --git a/doc/man3/EVP_PKEY_decrypt.pod b/doc/man3/EVP_PKEY_decrypt.pod +index b6f9bad5f1..898535a7a2 100644 +--- a/doc/man3/EVP_PKEY_decrypt.pod ++++ b/doc/man3/EVP_PKEY_decrypt.pod +@@ -51,6 +51,18 @@ return 1 for success and 0 or a negative value for failure. In particular a + return value of -2 indicates the operation is not supported by the public key + algorithm. + ++=head1 WARNINGS ++ ++In OpenSSL versions before 3.1.0, when used in PKCS#1 v1.5 padding, ++both the return value from the EVP_PKEY_decrypt() and the B<outlen> provided ++information useful in mounting a Bleichenbacher attack against the ++used private key. They had to processed in a side-channel free way. ++ ++Since version 3.1.0, the EVP_PKEY_decrypt() method when used with PKCS#1 ++v1.5 padding doesn't return an error in case it detects an error in padding, ++instead it returns a pseudo-randomly generated message, removing the need ++of side-channel secure code from applications using OpenSSL. ++ + =head1 EXAMPLES + + Decrypt data using OAEP (for RSA keys): +diff --git a/doc/man3/RSA_padding_add_PKCS1_type_1.pod b/doc/man3/RSA_padding_add_PKCS1_type_1.pod +index 9f7025c497..36ae18563f 100644 +--- a/doc/man3/RSA_padding_add_PKCS1_type_1.pod ++++ b/doc/man3/RSA_padding_add_PKCS1_type_1.pod +@@ -121,8 +121,8 @@ L<ERR_get_error(3)>. + + =head1 WARNINGS + +-The result of RSA_padding_check_PKCS1_type_2() is a very sensitive +-information which can potentially be used to mount a Bleichenbacher ++The result of RSA_padding_check_PKCS1_type_2() is exactly the ++information which is used to mount a classical Bleichenbacher + padding oracle attack. This is an inherent weakness in the PKCS #1 + v1.5 padding design. Prefer PKCS1_OAEP padding. If that is not + possible, the result of RSA_padding_check_PKCS1_type_2() should be +@@ -137,6 +137,9 @@ as this would create a small timing side channel which could be + used to mount a Bleichenbacher attack against any padding mode + including PKCS1_OAEP. + ++You should prefer the use of EVP PKEY APIs for PKCS#1 v1.5 decryption ++as they implement the necessary workarounds internally. ++ + =head1 SEE ALSO + + L<RSA_public_encrypt(3)>, +diff --git a/doc/man3/RSA_public_encrypt.pod b/doc/man3/RSA_public_encrypt.pod +index 1d38073aea..bd3f835ac6 100644 +--- a/doc/man3/RSA_public_encrypt.pod ++++ b/doc/man3/RSA_public_encrypt.pod +@@ -52,8 +52,8 @@ Encrypting user data directly with RSA is insecure. + + =back + +-B<flen> must not be more than RSA_size(B<rsa>) - 11 for the PKCS #1 v1.5 +-based padding modes, not more than RSA_size(B<rsa>) - 42 for ++When encrypting B<flen> must not be more than RSA_size(B<rsa>) - 11 for the ++PKCS #1 v1.5 based padding modes, not more than RSA_size(B<rsa>) - 42 for + RSA_PKCS1_OAEP_PADDING and exactly RSA_size(B<rsa>) for RSA_NO_PADDING. + When a padding mode other than RSA_NO_PADDING is in use, then + RSA_public_encrypt() will include some random bytes into the ciphertext +@@ -92,6 +92,13 @@ which can potentially be used to mount a Bleichenbacher padding oracle + attack. This is an inherent weakness in the PKCS #1 v1.5 padding + design. Prefer RSA_PKCS1_OAEP_PADDING. + ++In OpenSSL before version 3.1.0, both the return value and the length of ++returned value could be used to mount the Bleichenbacher attack. ++Since version 3.1.0, OpenSSL does not return an error in case of padding ++checks failed. Instead it generates a random message based on used private ++key and provided ciphertext so that application code doesn't have to implement ++a side-channel secure error handling. ++ + =head1 CONFORMING TO + + SSL, PKCS #1 v2.0 +diff --git a/include/crypto/rsa.h b/include/crypto/rsa.h +index 949873d0ee..f267e5d9d1 100644 +--- a/include/crypto/rsa.h ++++ b/include/crypto/rsa.h +@@ -83,6 +83,10 @@ int ossl_rsa_param_decode(RSA *rsa, const X509_ALGOR *alg); + RSA *ossl_rsa_key_from_pkcs8(const PKCS8_PRIV_KEY_INFO *p8inf, + OSSL_LIB_CTX *libctx, const char *propq); + ++int ossl_rsa_padding_check_PKCS1_type_2(OSSL_LIB_CTX *ctx, ++ unsigned char *to, int tlen, ++ const unsigned char *from, int flen, ++ int num, unsigned char *kdk); + int ossl_rsa_padding_check_PKCS1_type_2_TLS(OSSL_LIB_CTX *ctx, unsigned char *to, + size_t tlen, + const unsigned char *from, +-- +2.34.1 +
meta/recipes-connectivity/openssl/openssl/CVE-2023-50781-2.patch new file +358 -0
358 lines not on this page · raw message
meta/recipes-connectivity/openssl/openssl/CVE-2023-50781-3.patch new file +41 -0
41 lines not on this page · raw message
meta/recipes-connectivity/openssl/openssl/CVE-2023-50781-4.patch new file +441 -0
441 lines not on this page · raw message
meta/recipes-connectivity/openssl/openssl/CVE-2023-50781-5.patch new file +284 -0
284 lines not on this page · raw message
meta/recipes-connectivity/openssl/openssl/CVE-2023-50781-6.patch new file +57 -0
57 lines not on this page · raw message
meta/recipes-connectivity/openssl/openssl_3.0.17.bb +7 -1
@@ -13,7 +13,13 @@ SRC_URI = "https://github.com/openssl/openssl/releases/download/openssl-${PV}/op file://afalg.patch \ file://0001-Configure-do-not-tweak-mips-cflags.patch \ file://CVE-2024-41996.patch \ - " + file://CVE-2023-50781-1.patch \ + file://CVE-2023-50781-2.patch \ + file://CVE-2023-50781-3.patch \ + file://CVE-2023-50781-4.patch \ + file://CVE-2023-50781-5.patch \ + file://CVE-2023-50781-6.patch \ + " SRC_URI:append:class-nativesdk = " \ file://environment.d-openssl.sh \
Signature · 1 line
2.43.0
PATCH 2/9 xserver-xorg: Fix for CVE-2025-49178
In reply to Steve SakomanFrom: Vijay Anusuri <[email protected]>
Upstream-Status: Backport from https://gitlab.freedesktop.org/xorg/xserver/-/commit/d55c54cecb5e83eaa2d56bed5cc4461f9ba318c2
--- .../xserver-xorg/CVE-2025-49178.patch | 49 +++++++++++++++++++ .../xorg-xserver/xserver-xorg_21.1.8.bb | 1 + 2 files changed, 50 insertions(+) create mode 100644 meta/recipes-graphics/xorg-xserver/xserver-xorg/CVE-2025-49178.patch
meta/recipes-graphics/xorg-xserver/xserver-xorg/CVE-2025-49178.patch new file +49 -0
@@ -0,0 +1,49 @@ +From d55c54cecb5e83eaa2d56bed5cc4461f9ba318c2 Mon Sep 17 00:00:00 2001 +From: Olivier Fourdan <[email protected]> +Date: Mon, 28 Apr 2025 10:46:03 +0200 +Subject: [PATCH] os: Account for bytes to ignore when sharing input buffer + +When reading requests from the clients, the input buffer might be shared +and used between different clients. + +If a given client sends a full request with non-zero bytes to ignore, +the bytes to ignore may still be non-zero even though the request is +full, in which case the buffer could be shared with another client who's +request will not be processed because of those bytes to ignore, leading +to a possible hang of the other client request. + +To avoid the issue, make sure we have zero bytes to ignore left in the +input request when sharing the input buffer with another client. + +CVE-2025-49178 + +This issue was discovered by Nils Emmerich <[email protected]> and +reported by Julian Suleder via ERNW Vulnerability Disclosure. + +Signed-off-by: Olivier Fourdan <[email protected]> +Reviewed-by: Peter Hutterer <[email protected]> +Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2024> + +Upstream-Status: Backport [https://gitlab.freedesktop.org/xorg/xserver/-/commit/d55c54cecb5e83eaa2d56bed5cc4461f9ba318c2] +CVE: CVE-2025-49178 +Signed-off-by: Vijay Anusuri <[email protected]> +--- + os/io.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/os/io.c b/os/io.c +index 3e39c10e6f..e7b76b9cea 100644 +--- a/os/io.c ++++ b/os/io.c +@@ -441,7 +441,7 @@ ReadRequestFromClient(ClientPtr client) + */ + + gotnow -= needed; +- if (!gotnow) ++ if (!gotnow && !oci->ignoreBytes) + AvailableInput = oc; + if (move_header) { + if (client->req_len < bytes_to_int32(sizeof(xBigReq) - sizeof(xReq))) { +-- +GitLab +
meta/recipes-graphics/xorg-xserver/xserver-xorg_21.1.8.bb +1 -0
@@ -40,6 +40,7 @@ SRC_URI += "file://0001-xf86pciBus.c-use-Intel-ddx-only-for-pre-gen4-hardwar.pat file://CVE-2025-49176-1.patch \ file://CVE-2025-49176-2.patch \ file://CVE-2025-49177.patch \ + file://CVE-2025-49178.patch \ " SRC_URI[sha256sum] = "38aadb735650c8024ee25211c190bf8aad844c5f59632761ab1ef4c4d5aeb152"
Signature · 1 line
2.43.0
PATCH 3/9 xserver-xorg: Fix for CVE-2025-49179
In reply to Steve SakomanFrom: Vijay Anusuri <[email protected]>
import patch from debian to fix
CVE-2025-49179
Upstream-Status: Backport [import from debian xorg-server_21.1.7-3+deb12u10.diff.gz
Upstream commit https://gitlab.freedesktop.org/xorg/xserver/-/commit/2bde9ca49a8fd9a1e6697d5e7ef837870d66f5d4]
--- .../xserver-xorg/CVE-2025-49179.patch | 67 +++++++++++++++++++ .../xorg-xserver/xserver-xorg_21.1.8.bb | 1 + 2 files changed, 68 insertions(+) create mode 100644 meta/recipes-graphics/xorg-xserver/xserver-xorg/CVE-2025-49179.patch
meta/recipes-graphics/xorg-xserver/xserver-xorg/CVE-2025-49179.patch new file +67 -0
@@ -0,0 +1,67 @@ +From 2bde9ca49a8fd9a1e6697d5e7ef837870d66f5d4 Mon Sep 17 00:00:00 2001 +From: Olivier Fourdan <[email protected]> +Date: Mon, 28 Apr 2025 11:47:15 +0200 +Subject: [PATCH] record: Check for overflow in + RecordSanityCheckRegisterClients() + +The RecordSanityCheckRegisterClients() checks for the request length, +but does not check for integer overflow. + +A client might send a very large value for either the number of clients +or the number of protocol ranges that will cause an integer overflow in +the request length computation, defeating the check for request length. + +To avoid the issue, explicitly check the number of clients against the +limit of clients (which is much lower than an maximum integer value) and +the number of protocol ranges (multiplied by the record length) do not +exceed the maximum integer value. + +This way, we ensure that the final computation for the request length +will not overflow the maximum integer limit. + +CVE-2025-49179 + +This issue was discovered by Nils Emmerich <[email protected]> and +reported by Julian Suleder via ERNW Vulnerability Disclosure. + +Signed-off-by: Olivier Fourdan <[email protected]> +Reviewed-by: Peter Hutterer <[email protected]> +Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2024> + +Upstream-Status: Backport [import from debian xorg-server_21.1.7-3+deb12u10.diff.gz +Upstream commit https://gitlab.freedesktop.org/xorg/xserver/-/commit/2bde9ca49a8fd9a1e6697d5e7ef837870d66f5d4] +CVE: CVE-2025-49179 +Signed-off-by: Vijay Anusuri <[email protected]> +--- + record/record.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/record/record.c b/record/record.c +index e123867..d57be5b 100644 +--- a/record/record.c ++++ b/record/record.c +@@ -45,6 +45,7 @@ and Jim Haggerty of Metheus. + #include "inputstr.h" + #include "eventconvert.h" + #include "scrnintstr.h" ++#include "opaque.h" + + #include <stdio.h> + #include <assert.h> +@@ -1298,6 +1299,13 @@ RecordSanityCheckRegisterClients(RecordContextPtr pContext, ClientPtr client, + int i; + XID recordingClient; + ++ /* LimitClients is 2048 at max, way less that MAXINT */ ++ if (stuff->nClients > LimitClients) ++ return BadValue; ++ ++ if (stuff->nRanges > (MAXINT - 4 * stuff->nClients) / SIZEOF(xRecordRange)) ++ return BadValue; ++ + if (((client->req_len << 2) - SIZEOF(xRecordRegisterClientsReq)) != + 4 * stuff->nClients + SIZEOF(xRecordRange) * stuff->nRanges) + return BadLength; +-- +2.25.1 +
meta/recipes-graphics/xorg-xserver/xserver-xorg_21.1.8.bb +1 -0
@@ -41,6 +41,7 @@ SRC_URI += "file://0001-xf86pciBus.c-use-Intel-ddx-only-for-pre-gen4-hardwar.pat file://CVE-2025-49176-2.patch \ file://CVE-2025-49177.patch \ file://CVE-2025-49178.patch \ + file://CVE-2025-49179.patch \ " SRC_URI[sha256sum] = "38aadb735650c8024ee25211c190bf8aad844c5f59632761ab1ef4c4d5aeb152"
Signature · 1 line
2.43.0
PATCH 4/9 xserver-xorg: Fix for CVE-2025-49180
In reply to Steve SakomanFrom: Vijay Anusuri <[email protected]>
Upstream-Status: Backport from
https://gitlab.freedesktop.org/xorg/xserver/-/commit/3c3a4b767b16174d3213055947ea7f4f88e10ec6
& https://gitlab.freedesktop.org/xorg/xserver/-/commit/0235121c6a7a6eb247e2addb3b41ed6ef566853d
--- .../xserver-xorg/CVE-2025-49180-1.patch | 44 ++++++++++++++++ .../xserver-xorg/CVE-2025-49180-2.patch | 52 +++++++++++++++++++ .../xorg-xserver/xserver-xorg_21.1.8.bb | 2 + 3 files changed, 98 insertions(+) create mode 100644 meta/recipes-graphics/xorg-xserver/xserver-xorg/CVE-2025-49180-1.patch create mode 100644 meta/recipes-graphics/xorg-xserver/xserver-xorg/CVE-2025-49180-2.patch
meta/recipes-graphics/xorg-xserver/xserver-xorg/CVE-2025-49180-1.patch new file +44 -0
@@ -0,0 +1,44 @@ +From 3c3a4b767b16174d3213055947ea7f4f88e10ec6 Mon Sep 17 00:00:00 2001 +From: Olivier Fourdan <[email protected]> +Date: Tue, 20 May 2025 15:18:19 +0200 +Subject: [PATCH] randr: Check for overflow in RRChangeProviderProperty() + +A client might send a request causing an integer overflow when computing +the total size to allocate in RRChangeProviderProperty(). + +To avoid the issue, check that total length in bytes won't exceed the +maximum integer value. + +CVE-2025-49180 + +This issue was discovered by Nils Emmerich <[email protected]> and +reported by Julian Suleder via ERNW Vulnerability Disclosure. + +Signed-off-by: Olivier Fourdan <[email protected]> +Reviewed-by: Peter Hutterer <[email protected]> +Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2024> + +Upstream-Status: Backport [https://gitlab.freedesktop.org/xorg/xserver/-/commit/3c3a4b767b16174d3213055947ea7f4f88e10ec6] +CVE: CVE-2025-49180 +Signed-off-by: Vijay Anusuri <[email protected]> +--- + randr/rrproviderproperty.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/randr/rrproviderproperty.c b/randr/rrproviderproperty.c +index 69f66ed278..0c3dcd1bc5 100644 +--- a/randr/rrproviderproperty.c ++++ b/randr/rrproviderproperty.c +@@ -182,7 +182,8 @@ RRChangeProviderProperty(RRProviderPtr provider, Atom property, Atom type, + + if (mode == PropModeReplace || len > 0) { + void *new_data = NULL, *old_data = NULL; +- ++ if (total_len > MAXINT / size_in_bytes) ++ return BadValue; + total_size = total_len * size_in_bytes; + new_value.data = (void *) malloc(total_size); + if (!new_value.data && total_size) { +-- +GitLab +
meta/recipes-graphics/xorg-xserver/xserver-xorg/CVE-2025-49180-2.patch new file +52 -0
52 lines not on this page · raw message
meta/recipes-graphics/xorg-xserver/xserver-xorg_21.1.8.bb +2 -0
@@ -42,6 +42,8 @@ SRC_URI += "file://0001-xf86pciBus.c-use-Intel-ddx-only-for-pre-gen4-hardwar.pat file://CVE-2025-49177.patch \ file://CVE-2025-49178.patch \ file://CVE-2025-49179.patch \ + file://CVE-2025-49180-1.patch \ + file://CVE-2025-49180-2.patch \ " SRC_URI[sha256sum] = "38aadb735650c8024ee25211c190bf8aad844c5f59632761ab1ef4c4d5aeb152"
Signature · 1 line
2.43.0
PATCH 5/9 gstreamer1.0-plugins-base: fix CVE-2025-47807
In reply to Steve SakomanFrom: Hitendra Prajapati <[email protected]>
Upstream-Status: Backport from https://gitlab.freedesktop.org/gstreamer/gstreamer/-/commit/9e2238adc1cad1fba5aad23bc8c2a6c2a65794d2
--- .../CVE-2025-47807.patch | 49 +++++++++++++++++++ .../gstreamer1.0-plugins-base_1.20.7.bb | 1 + 2 files changed, 50 insertions(+) create mode 100644 meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/CVE-2025-47807.patch
meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/CVE-2025-47807.patch new file +49 -0
@@ -0,0 +1,49 @@ +From 9e2238adc1cad1fba5aad23bc8c2a6c2a65794d2 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= <[email protected]> +Date: Thu, 8 May 2025 09:14:15 +0300 +Subject: [PATCH] subparse: Check for valid UTF-8 before cleaning up lines and + check for regex replace errors + +Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/4418 +Fixes CVE-2025-47807 + +Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9132> + +CVE: CVE-2025-47807 +Upstream-Status: Backport [https://gitlab.freedesktop.org/gstreamer/gstreamer/-/commit/9e2238adc1cad1fba5aad23bc8c2a6c2a65794d2] +Signed-off-by: Hitendra Prajapati <[email protected]> +--- + gst/subparse/gstsubparse.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/gst/subparse/gstsubparse.c b/gst/subparse/gstsubparse.c +index 81a7f65..5e8769c 100644 +--- a/gst/subparse/gstsubparse.c ++++ b/gst/subparse/gstsubparse.c +@@ -666,6 +666,12 @@ subrip_unescape_formatting (gchar * txt, gconstpointer allowed_tags_ptr, + res = g_regex_replace (tag_regex, txt, strlen (txt), 0, + replace_pattern, 0, NULL); + ++ /* Replacing can fail. Return an empty string in that case. */ ++ if (!res) { ++ strcpy (txt, ""); ++ return; ++ } ++ + /* res will always be shorter than the input or identical, so this + * copy is OK */ + strcpy (txt, res); +@@ -1046,6 +1052,10 @@ parse_subrip (ParserState * state, const gchar * line) + g_string_append_c (state->buf, '\n'); + g_string_append (state->buf, line); + if (strlen (line) == 0) { ++ if (!g_utf8_validate (state->buf->str, state->buf->len, NULL)) { ++ g_string_truncate (state->buf, 0); ++ return NULL; ++ } + ret = g_markup_escape_text (state->buf->str, state->buf->len); + g_string_truncate (state->buf, 0); + state->state = 0; +-- +2.50.1 +
meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_1.20.7.bb +1 -0
@@ -22,6 +22,7 @@ SRC_URI = "https://gstreamer.freedesktop.org/src/gst-plugins-base/gst-plugins-ba file://CVE-2024-47835.patch \ file://CVE-2025-47806.patch \ file://CVE-2025-47808.patch \ + file://CVE-2025-47807.patch \ " SRC_URI[sha256sum] = "fde6696a91875095d82c1012b5777c28ba926047ffce08508e12c1d2c66f0057"
Signature · 1 line
2.43.0
PATCH 6/9 qemu: ignore CVE-2024-7730
In reply to Steve SakomanFrom: Peter Marko <[email protected]>
This CVE is for virtio-snd which was introduced in 8.2.0. Therefore ignore this CVE for version 6.2.0.
--- meta/recipes-devtools/qemu/qemu.inc | 3 +++ 1 file changed, 3 insertions(+)
meta/recipes-devtools/qemu/qemu.inc +3 -0
@@ -164,6 +164,9 @@ CVE_CHECK_IGNORE += "CVE-2022-36648" # disputed: not an issue as per https://bugzilla.redhat.com/show_bug.cgi?id=2223985 CVE_CHECK_IGNORE += "CVE-2023-1386" +# virtio-snd was implemented in 8.2.0, so version 6.2.0 is not yet affected +CVE_CHECK_IGNORE += "CVE-2024-7730" + COMPATIBLE_HOST:mipsarchn32 = "null" COMPATIBLE_HOST:mipsarchn64 = "null" COMPATIBLE_HOST:riscv32 = "null"
Signature · 1 line
2.43.0
PATCH 7/9 glib-2.0: patch CVE-2025-7039
In reply to Steve SakomanFrom: Peter Marko <[email protected]>
Pick commit per [1].
Also pick commit which changed the same code before to apply it cleanly.
[1] https://security-tracker.debian.org/tracker/CVE-2025-7039
--- .../glib-2.0/glib-2.0/CVE-2025-7039-01.patch | 40 +++++++++++++++++ .../glib-2.0/glib-2.0/CVE-2025-7039-02.patch | 43 +++++++++++++++++++ meta/recipes-core/glib-2.0/glib-2.0_2.72.3.bb | 2 + 3 files changed, 85 insertions(+) create mode 100644 meta/recipes-core/glib-2.0/glib-2.0/CVE-2025-7039-01.patch create mode 100644 meta/recipes-core/glib-2.0/glib-2.0/CVE-2025-7039-02.patch
meta/recipes-core/glib-2.0/glib-2.0/CVE-2025-7039-01.patch new file +40 -0
@@ -0,0 +1,40 @@ +From 285db475ecaa4d2cc39ce326b4c63aacb87ca6ad Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin <[email protected]> +Date: Tue, 22 Aug 2023 19:57:48 +0200 +Subject: [PATCH] glib/gfileutils.c: use 64 bits for value in get_tmp_file() + +On 32 bit systems 'long' value will overflow in 2038 and become negative. +As it is used to index into letters array, and % operation preserves signs, +data corruption will then occur. + +Signed-off-by: Alexander Kanavin <[email protected]> + +CVE: CVE-2025-7039 +Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/glib/-/commit/285db475ecaa4d2cc39ce326b4c63aacb87ca6ad] +Signed-off-by: Peter Marko <[email protected]> +--- + glib/gfileutils.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/glib/gfileutils.c b/glib/gfileutils.c +index 9646c696e..bd3cc179a 100644 +--- a/glib/gfileutils.c ++++ b/glib/gfileutils.c +@@ -1475,7 +1475,7 @@ get_tmp_file (gchar *tmpl, + static const char letters[] = + "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; + static const int NLETTERS = sizeof (letters) - 1; +- glong value; ++ gint64 value; + gint64 now_us; + static int counter = 0; + +@@ -1496,7 +1496,7 @@ get_tmp_file (gchar *tmpl, + + for (count = 0; count < 100; value += 7777, ++count) + { +- glong v = value; ++ gint64 v = value; + + /* Fill in the random bits. */ + XXXXXX[0] = letters[v % NLETTERS];
meta/recipes-core/glib-2.0/glib-2.0/CVE-2025-7039-02.patch new file +43 -0
43 lines not on this page · raw message
meta/recipes-core/glib-2.0/glib-2.0_2.72.3.bb +2 -0
@@ -62,6 +62,8 @@ SRC_URI = "${GNOME_MIRROR}/glib/${SHRT_VER}/glib-${PV}.tar.xz \ file://CVE-2025-3360-06.patch \ file://CVE-2025-4373-01.patch \ file://CVE-2025-4373-02.patch \ + file://CVE-2025-7039-01.patch \ + file://CVE-2025-7039-02.patch \ " SRC_URI:append:class-native = " file://relocate-modules.patch"
Signature · 1 line
2.43.0
PATCH 8/9 dpkg: patch CVE-2025-6297
In reply to Steve SakomanFrom: Peter Marko <[email protected]>
Pick commit per [1] from 1.22.x branch.
[1] https://nvd.nist.gov/vuln/detail/CVE-2025-6297
--- .../dpkg/dpkg/CVE-2025-6297.patch | 125 ++++++++++++++++++ meta/recipes-devtools/dpkg/dpkg_1.21.4.bb | 1 + 2 files changed, 126 insertions(+) create mode 100644 meta/recipes-devtools/dpkg/dpkg/CVE-2025-6297.patch
meta/recipes-devtools/dpkg/dpkg/CVE-2025-6297.patch new file +125 -0
@@ -0,0 +1,125 @@ +From 98c623c8d6814ae46a3b30ca22e584c77d47d86b Mon Sep 17 00:00:00 2001 +From: Guillem Jover <[email protected]> +Date: Sat, 7 Jun 2025 14:17:07 +0200 +Subject: [PATCH] dpkg-deb: Fix cleanup for control member with restricted + directories +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +When extracting a control member into a temporary directory, which is +documented as being a safe operation even on untrusted data, the code +in charge of the temporary directory cleanup does not sanitize the +directory permissions, which is then unable to perform the «rm -rf» +when running as a non-root user, leaving temporary files behind. + +Given automated and repeated execution of dpkg-deb commands on +adversarial .deb packages or with well compressible files, placed +inside a directory with permissions not allowing removal by a non-root +user, this can end up with a DoS scenario due to causing disk quota +exhaustion or disk full conditions. + +This is considered a minor issue, given the required conditions to +trigger a problem with it, but an issue non the less given the +documented security guarantees of the command. This has been an +issue since the initial commit introducing dpkg-deb in C. + +We use an existing string for the error message to avoid new strings +needing translation for stable branches, which make the error message +less descriptive than what would be ideal. This will be improved in +git HEAD. + +Reported-by: zhutyra on HackerOne +Fixes: CVE-2025-6297 +Stable-Candidate: 1.20.x 1.21.x 1.22.x +(cherry picked from commit ed6bbd445dd8800308c67236ba35d08004c98e82) +(cherry picked from commit 02ad0532bd490cbc95b344f670e622a38eecfbf6) +(cherry picked from commit d8a76551e22abe76eefd7fef5c7f51f4118eb40e) + +CVE: CVE-2025-6297 +Upstream-Status: Backport [https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=98c623c8d6814ae46a3b30ca22e584c77d47d86b] +Signed-off-by: Peter Marko <[email protected]> +--- + src/at/deb-content.at | 32 ++++++++++++++++++++++++++++++++ + src/deb/info.c | 20 ++++++++++++++++++++ + 2 files changed, 52 insertions(+) + +diff --git a/src/at/deb-content.at b/src/at/deb-content.at +index a192c9493..d48eed72b 100644 +--- a/src/at/deb-content.at ++++ b/src/at/deb-content.at +@@ -127,3 +127,35 @@ newline' + ]) + + AT_CLEANUP ++ ++AT_SETUP([dpkg-deb .deb extraction cleanup]) ++AT_KEYWORDS([dpkg-deb deb extraction]) ++ ++DPKG_GEN_CONTROL([pkg-ctrl-dir-perms]) ++AT_CHECK([ ++dpkg-deb --root-owner-group -Znone -b pkg-ctrl-dir-perms ++DPKG_AR_EXTRACT([pkg-ctrl-dir-perms.deb]) ++dpkg-deb -R pkg-ctrl-dir-perms.deb pkg-ctrl-dir-perms-bad ++mkdir -p pkg-ctrl-dir-perms-bad/DEBIAN/rx-subdir/inner ++touch pkg-ctrl-dir-perms-bad/DEBIAN/rx-subdir/inner/file ++chmod 0555 pkg-ctrl-dir-perms-bad/DEBIAN ++chmod 0555 pkg-ctrl-dir-perms-bad/DEBIAN/rx-subdir ++chmod 0555 pkg-ctrl-dir-perms-bad/DEBIAN/rx-subdir/inner ++$TAR cf control.tar --format=gnu --sort=name --mtime @0 --clamp-mtime --owner root:0 --group root:0 -C pkg-ctrl-dir-perms-bad/DEBIAN . ++DPKG_AR_GEN([pkg-ctrl-dir-perms.deb], [debian-binary control.tar data.tar]) ++], [0], [dpkg-deb: building package 'pkg-ctrl-dir-perms' in 'pkg-ctrl-dir-perms.deb'. ++]) ++AT_CHECK([ ++dpkg-deb --ctrl-tarfile pkg-ctrl-dir-perms.deb | $TAR tvf - ++], [0], [dr-xr-xr-x root/root 0 1970-01-01 00:00 ./ ++-rw-r--r-- root/root 176 1970-01-01 00:00 ./control ++dr-xr-xr-x root/root 0 1970-01-01 00:00 ./rx-subdir/ ++dr-xr-xr-x root/root 0 1970-01-01 00:00 ./rx-subdir/inner/ ++-rw-r--r-- root/root 0 1970-01-01 00:00 ./rx-subdir/inner/file ++]) ++# Check that we can cleanup the temporarily extracted control.tar member. ++AT_CHECK([ ++dpkg-deb -I pkg-ctrl-dir-perms.deb ++], [0], [ignore]) ++ ++AT_CLEANUP +diff --git a/src/deb/info.c b/src/deb/info.c +index f3d57e2ce..396ea4d14 100644 +--- a/src/deb/info.c ++++ b/src/deb/info.c +@@ -45,14 +45,34 @@ + #include <dpkg/pkg-format.h> + #include <dpkg/buffer.h> + #include <dpkg/path.h> ++#include <dpkg/treewalk.h> + #include <dpkg/options.h> + + #include "dpkg-deb.h" + ++static int ++cu_info_treewalk_fixup_dir(struct treenode *node) ++{ ++ const char *nodename; ++ ++ if (!S_ISDIR(treenode_get_mode(node))) ++ return 0; ++ ++ nodename = treenode_get_pathname(node); ++ if (chmod(nodename, 0755) < 0) ++ ohshite(_("error setting permissions of '%.255s'"), nodename); ++ ++ return 0; ++} ++ + static void cu_info_prepare(int argc, void **argv) { + char *dir; ++ struct treewalk_funcs cu_info_treewalk_funcs = { ++ .visit = cu_info_treewalk_fixup_dir, ++ }; + + dir = argv[0]; ++ treewalk(dir, TREEWALK_NONE, &cu_info_treewalk_funcs); + path_remove_tree(dir); + free(dir); + }
meta/recipes-devtools/dpkg/dpkg_1.21.4.bb +1 -0
@@ -15,6 +15,7 @@ SRC_URI = "git://salsa.debian.org/dpkg-team/dpkg.git;protocol=https;branch=main file://pager.patch \ file://0001-Add-support-for-riscv32-CPU.patch \ file://0001-Dpkg-Source-Archive-Prevent-directory-traversal-for-.patch \ + file://CVE-2025-6297.patch \ " SRC_URI:append:class-native = " file://0001-build.c-ignore-return-of-1-from-tar-cf.patch"
Signature · 1 line
2.43.0
PATCH 9/9 libarchive: patch regression of patch for CVE-2025-5918
In reply to Steve SakomanFrom: Peter Marko <[email protected]>
Picked commit per [1].
[1] https://security-tracker.debian.org/tracker/CVE-2025-5918
---
...2025-5918.patch => CVE-2025-5918-01.patch} | 0
.../libarchive/CVE-2025-5918-02.patch | 51 +++++++++++++++++++
.../libarchive/libarchive_3.6.2.bb | 3 +-
3 files changed, 53 insertions(+), 1 deletion(-)
rename meta/recipes-extended/libarchive/libarchive/{CVE-2025-5918.patch => CVE-2025-5918-01.patch} (100%)
create mode 100644 meta/recipes-extended/libarchive/libarchive/CVE-2025-5918-02.patchmeta/recipes-extended/libarchive/libarchive/CVE-2025-5918-01.patch renamed from meta/recipes-extended/libarchive/libarchive/CVE-2025-5918.patch +0 -0
meta/recipes-extended/libarchive/libarchive/CVE-2025-5918-02.patch new file +51 -0
51 lines not on this page · raw message
meta/recipes-extended/libarchive/libarchive_3.6.2.bb +2 -1
@@ -41,7 +41,8 @@ SRC_URI = "http://libarchive.org/downloads/libarchive-${PV}.tar.gz \ file://CVE-2025-5917.patch \ file://0001-FILE-seeking-support-2539.patch \ file://0001-Improve-lseek-handling-2564.patch \ - file://CVE-2025-5918.patch \ + file://CVE-2025-5918-01.patch \ + file://CVE-2025-5918-02.patch \ " UPSTREAM_CHECK_URI = "http://libarchive.org/"
Signature · 1 line
2.43.0