From patchwork Thu Feb 13 14:26:29 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Sakoman X-Patchwork-Id: 57264 X-Patchwork-Delegate: steve@sakoman.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id DCACFC021A4 for ; Thu, 13 Feb 2025 14:26:41 +0000 (UTC) Received: from mail-pj1-f51.google.com (mail-pj1-f51.google.com [209.85.216.51]) by mx.groups.io with SMTP id smtpd.web10.12200.1739456798686074007 for ; Thu, 13 Feb 2025 06:26:38 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@sakoman-com.20230601.gappssmtp.com header.s=20230601 header.b=VF+kp3Pq; spf=softfail (domain: sakoman.com, ip: 209.85.216.51, mailfrom: steve@sakoman.com) Received: by mail-pj1-f51.google.com with SMTP id 98e67ed59e1d1-2fbfe16cc39so1822559a91.3 for ; Thu, 13 Feb 2025 06:26:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sakoman-com.20230601.gappssmtp.com; s=20230601; t=1739456798; x=1740061598; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=GWXGl0vlB9YNvSl/XoTyYjD3TWkzpDfXhsy+Eqa02do=; b=VF+kp3PqBpYaAYCL+qzi7S6vFUIFHmObIFK4q+oWdhPRw5BVi7G3SjL8IG0i2ILWYx wsFgMb5pmQWlJ607i+TJ+zXEcefA7brG4U44+kmvJymZw5IPFvlNQbgcAV6MVQFW5Acg F3D7ydnaRKNoWKtpKlU9+o5lgo9C176dqmZR1bKjJb12VBJHNiIz19hQi2RobytqCLuM 5Hgm0iJDkRlYOp/cLjuD0G3ziSqhfdX1jDJPMhp8RELy3bkV7V4HL5CE1OIL2K7/v2B7 6KxgRhXrCh3Xb1mUODPQ6qsCY2Xt9pCJ30UhFqBQ34hMC2ATB2nQox7MRo70veuEvopz MNyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739456798; x=1740061598; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GWXGl0vlB9YNvSl/XoTyYjD3TWkzpDfXhsy+Eqa02do=; b=kNmFd3hKkCAQ1CXJ+nclc6avDUcb7f7gDIsjs5trUam/Uedfm3URwPocO6cjwsY9MF f2IDVWMouaZW6bxdo8MS6P61e9Gj9E7mxAfVYWr9WS4V7B6ZBBjWxQmmh2u52marqo5/ N4hA/thqN0UuxdkiPgG2ZU1GRVBOVBvdkesqPJCiwFCN9tuhrpIQAaSYUsp1WIpKiSVm JIGhU1k5A0ZV82YuRyYdYacNVLNVYXqq2IRYJWrb/dUENvLEkX9/rooldZHVNLo19WoP VlNOc5cUPXXfE64jWTyIp5vM4sOmmmds+44OeNj4o1yFeQNmJlFb1HaZu0+/JNoBxlrL 7M6Q== X-Gm-Message-State: AOJu0Yx1NsY77MSOmJMAfvEnJui5QjXid26xuaw8G3vJwqcNBub5TGaJ NQY8I07FMzo72acAztspSzwwUL3iyXtwsCbj+iQjyNvrvF6qPUnUCvQ0H50NacosbI5X5rixEYx 5 X-Gm-Gg: ASbGnctW4kQezkztgoYwzcIaNhN4/X53CjORp3d4BB0ul/Ud9jncQJRbJrIZge2Lk2B tgMzDuSWnj9zKRVC3tSVIDkoNtMuk5ew3WuoQLqLsU75pKNyRyNO31qMwtL/vI/I5afZE4lzMOF 7mKm2WEsOoIIIhxpGousWZbWPXhB3vLj1ZaXAyJIUjth1SetzrFrdI5dZR8wp/EUB1biqzp3oAE j3SZ5vxIVKSTvXvHRZviEL80NZGZUT8Fp29BRIcUFWsJ4fb14kx07ZrDLTWkmVFLe3lMTpy/pSR QP7S X-Google-Smtp-Source: AGHT+IGNoH3oPPliLVWndF6faYdG4wKYPEC93kMmNgV/2sF/qJsHYMN5V3w1E6qEaGanZt8Xh2pdiQ== X-Received: by 2002:a05:6a00:841:b0:730:8a5b:6e61 with SMTP id d2e1a72fcca58-7322c376935mr11164540b3a.2.1739456797687; Thu, 13 Feb 2025 06:26:37 -0800 (PST) Received: from hexa.. ([98.142.47.158]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-732425467b9sm1342377b3a.30.2025.02.13.06.26.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Feb 2025 06:26:37 -0800 (PST) From: Steve Sakoman To: openembedded-core@lists.openembedded.org Subject: [OE-core][kirkstone 1/3] openssl: upgrade 3.0.15 -> 3.0.16 Date: Thu, 13 Feb 2025 06:26:29 -0800 Message-ID: <68c01710e3522af317f8fe09465b56e6aca01615.1739455358.git.steve@sakoman.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 13 Feb 2025 14:26:41 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/211338 From: Peter Marko Release information: https://github.com/openssl/openssl/blob/openssl-3.0/NEWS.md#major-changes-between-openssl-3015-and-openssl-3016-11-feb-2025 All CVEs were already patched, so this upgrade fixes only minor bugs. Remove CVE patches included in the new version. Signed-off-by: Peter Marko Signed-off-by: Steve Sakoman --- .../openssl/openssl/CVE-2024-13176.patch | 125 ----------- .../openssl/openssl/CVE-2024-9143.patch | 202 ------------------ .../{openssl_3.0.15.bb => openssl_3.0.16.bb} | 4 +- 3 files changed, 1 insertion(+), 330 deletions(-) delete mode 100644 meta/recipes-connectivity/openssl/openssl/CVE-2024-13176.patch delete mode 100755 meta/recipes-connectivity/openssl/openssl/CVE-2024-9143.patch rename meta/recipes-connectivity/openssl/{openssl_3.0.15.bb => openssl_3.0.16.bb} (98%) diff --git a/meta/recipes-connectivity/openssl/openssl/CVE-2024-13176.patch b/meta/recipes-connectivity/openssl/openssl/CVE-2024-13176.patch deleted file mode 100644 index 0076003db1..0000000000 --- a/meta/recipes-connectivity/openssl/openssl/CVE-2024-13176.patch +++ /dev/null @@ -1,125 +0,0 @@ -From 07272b05b04836a762b4baa874958af51d513844 Mon Sep 17 00:00:00 2001 -From: Tomas Mraz -Date: Wed, 15 Jan 2025 18:27:02 +0100 -Subject: [PATCH] Fix timing side-channel in ECDSA signature computation - -There is a timing signal of around 300 nanoseconds when the top word of -the inverted ECDSA nonce value is zero. This can happen with significant -probability only for some of the supported elliptic curves. In particular -the NIST P-521 curve is affected. To be able to measure this leak, the -attacker process must either be located in the same physical computer or -must have a very fast network connection with low latency. - -Attacks on ECDSA nonce are also known as Minerva attack. - -Fixes CVE-2024-13176 - -Reviewed-by: Tim Hudson -Reviewed-by: Neil Horman -Reviewed-by: Paul Dale -(Merged from https://github.com/openssl/openssl/pull/26429) - -(cherry picked from commit 63c40a66c5dc287485705d06122d3a6e74a6a203) - -CVE: CVE-2024-13176 -Upstream-Status: Backport [https://github.com/openssl/openssl/commit/07272b05b04836a762b4baa874958af51d513844] -Signed-off-by: Peter Marko ---- - crypto/bn/bn_exp.c | 21 +++++++++++++++------ - crypto/ec/ec_lib.c | 7 ++++--- - include/crypto/bn.h | 3 +++ - 3 files changed, 22 insertions(+), 9 deletions(-) - -diff --git a/crypto/bn/bn_exp.c b/crypto/bn/bn_exp.c -index 598a592ca1397..d84c7de18a6b6 100644 ---- a/crypto/bn/bn_exp.c -+++ b/crypto/bn/bn_exp.c -@@ -606,7 +606,7 @@ static int MOD_EXP_CTIME_COPY_FROM_PREBUF(BIGNUM *b, int top, - * out by Colin Percival, - * http://www.daemonology.net/hyperthreading-considered-harmful/) - */ --int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, -+int bn_mod_exp_mont_fixed_top(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, - const BIGNUM *m, BN_CTX *ctx, - BN_MONT_CTX *in_mont) - { -@@ -623,10 +623,6 @@ int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, - unsigned int t4 = 0; - #endif - -- bn_check_top(a); -- bn_check_top(p); -- bn_check_top(m); -- - if (!BN_is_odd(m)) { - ERR_raise(ERR_LIB_BN, BN_R_CALLED_WITH_EVEN_MODULUS); - return 0; -@@ -1146,7 +1142,7 @@ int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, - goto err; - } else - #endif -- if (!BN_from_montgomery(rr, &tmp, mont, ctx)) -+ if (!bn_from_mont_fixed_top(rr, &tmp, mont, ctx)) - goto err; - ret = 1; - err: -@@ -1160,6 +1156,19 @@ int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, - return ret; - } - -+int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, -+ const BIGNUM *m, BN_CTX *ctx, -+ BN_MONT_CTX *in_mont) -+{ -+ bn_check_top(a); -+ bn_check_top(p); -+ bn_check_top(m); -+ if (!bn_mod_exp_mont_fixed_top(rr, a, p, m, ctx, in_mont)) -+ return 0; -+ bn_correct_top(rr); -+ return 1; -+} -+ - int BN_mod_exp_mont_word(BIGNUM *rr, BN_ULONG a, const BIGNUM *p, - const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont) - { -diff --git a/crypto/ec/ec_lib.c b/crypto/ec/ec_lib.c -index b1696d93bd6dd..1f0bf1ec795fa 100644 ---- a/crypto/ec/ec_lib.c -+++ b/crypto/ec/ec_lib.c -@@ -20,6 +20,7 @@ - #include - #include - #include "crypto/ec.h" -+#include "crypto/bn.h" - #include "internal/nelem.h" - #include "ec_local.h" - -@@ -1262,10 +1263,10 @@ static int ec_field_inverse_mod_ord(const EC_GROUP *group, BIGNUM *r, - if (!BN_sub(e, group->order, e)) - goto err; - /*- -- * Exponent e is public. -- * No need for scatter-gather or BN_FLG_CONSTTIME. -+ * Although the exponent is public we want the result to be -+ * fixed top. - */ -- if (!BN_mod_exp_mont(r, x, e, group->order, ctx, group->mont_data)) -+ if (!bn_mod_exp_mont_fixed_top(r, x, e, group->order, ctx, group->mont_data)) - goto err; - - ret = 1; -diff --git a/include/crypto/bn.h b/include/crypto/bn.h -index c5f328156d3a9..59a629b9f6288 100644 ---- a/include/crypto/bn.h -+++ b/include/crypto/bn.h -@@ -73,6 +73,9 @@ int bn_set_words(BIGNUM *a, const BN_ULONG *words, int num_words); - */ - int bn_mul_mont_fixed_top(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, - BN_MONT_CTX *mont, BN_CTX *ctx); -+int bn_mod_exp_mont_fixed_top(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, -+ const BIGNUM *m, BN_CTX *ctx, -+ BN_MONT_CTX *in_mont); - int bn_to_mont_fixed_top(BIGNUM *r, const BIGNUM *a, BN_MONT_CTX *mont, - BN_CTX *ctx); - int bn_from_mont_fixed_top(BIGNUM *r, const BIGNUM *a, BN_MONT_CTX *mont, diff --git a/meta/recipes-connectivity/openssl/openssl/CVE-2024-9143.patch b/meta/recipes-connectivity/openssl/openssl/CVE-2024-9143.patch deleted file mode 100755 index c72a4193c6..0000000000 --- a/meta/recipes-connectivity/openssl/openssl/CVE-2024-9143.patch +++ /dev/null @@ -1,202 +0,0 @@ -From 72ae83ad214d2eef262461365a1975707f862712 Mon Sep 17 00:00:00 2001 -From: Viktor Dukhovni -Date: Thu, 19 Sep 2024 01:02:40 +1000 -Subject: [PATCH] Harden BN_GF2m_poly2arr against misuse. - -The BN_GF2m_poly2arr() function converts characteristic-2 field -(GF_{2^m}) Galois polynomials from a representation as a BIGNUM bitmask, -to a compact array with just the exponents of the non-zero terms. - -These polynomials are then used in BN_GF2m_mod_arr() to perform modular -reduction. A precondition of calling BN_GF2m_mod_arr() is that the -polynomial must have a non-zero constant term (i.e. the array has `0` as -its final element). - -Internally, callers of BN_GF2m_poly2arr() did not verify that -precondition, and binary EC curve parameters with an invalid polynomial -could lead to out of bounds memory reads and writes in BN_GF2m_mod_arr(). - -The precondition is always true for polynomials that arise from the -standard form of EC parameters for characteristic-two fields (X9.62). -See the "Finite Field Identification" section of: - - https://www.itu.int/ITU-T/formal-language/itu-t/x/x894/2018-cor1/ANSI-X9-62.html - -The OpenSSL GF(2^m) code supports only the trinomial and pentanomial -basis X9.62 forms. - -This commit updates BN_GF2m_poly2arr() to return `0` (failure) when -the constant term is zero (i.e. the input bitmask BIGNUM is not odd). - -Additionally, the return value is made unambiguous when there is not -enough space to also pad the array with a final `-1` sentinel value. -The return value is now always the number of elements (including the -final `-1`) that would be filled when the output array is sufficiently -large. Previously the same count was returned both when the array has -just enough room for the final `-1` and when it had only enough space -for non-sentinel values. - -Finally, BN_GF2m_poly2arr() is updated to reject polynomials whose -degree exceeds `OPENSSL_ECC_MAX_FIELD_BITS`, this guards against -CPU exhausition attacks via excessively large inputs. - -The above issues do not arise in processing X.509 certificates. These -generally have EC keys from "named curves", and RFC5840 (Section 2.1.1) -disallows explicit EC parameters. The TLS code in OpenSSL enforces this -constraint only after the certificate is decoded, but, even if explicit -parameters are specified, they are in X9.62 form, which cannot represent -problem values as noted above. - -Initially reported as oss-fuzz issue 71623. - -A closely related issue was earlier reported in -. - -Severity: Low, CVE-2024-9143 - -Reviewed-by: Matt Caswell -Reviewed-by: Bernd Edlinger -Reviewed-by: Paul Dale -Reviewed-by: Tomas Mraz -(Merged from https://github.com/openssl/openssl/pull/25639) - -(cherry picked from commit 8e008cb8b23ec7dc75c45a66eeed09c815b11cd2) - -CVE: CVE-2024-9143 -Upstream-Status: Backport [https://github.com/openssl/openssl/commit/72ae83ad214d2eef262461365a1975707f862712] -Signed-off-by: Peter Marko ---- - crypto/bn/bn_gf2m.c | 28 +++++++++++++++------- - test/ec_internal_test.c | 51 +++++++++++++++++++++++++++++++++++++++++ - 2 files changed, 71 insertions(+), 8 deletions(-) - -diff --git a/crypto/bn/bn_gf2m.c b/crypto/bn/bn_gf2m.c -index c811ae82d6b15..bcc66613cc14d 100644 ---- a/crypto/bn/bn_gf2m.c -+++ b/crypto/bn/bn_gf2m.c -@@ -15,6 +15,7 @@ - #include "bn_local.h" - - #ifndef OPENSSL_NO_EC2M -+# include - - /* - * Maximum number of iterations before BN_GF2m_mod_solve_quad_arr should -@@ -1140,16 +1141,26 @@ int BN_GF2m_mod_solve_quad(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, - /* - * Convert the bit-string representation of a polynomial ( \sum_{i=0}^n a_i * - * x^i) into an array of integers corresponding to the bits with non-zero -- * coefficient. Array is terminated with -1. Up to max elements of the array -- * will be filled. Return value is total number of array elements that would -- * be filled if array was large enough. -+ * coefficient. The array is intended to be suitable for use with -+ * `BN_GF2m_mod_arr()`, and so the constant term of the polynomial must not be -+ * zero. This translates to a requirement that the input BIGNUM `a` is odd. -+ * -+ * Given sufficient room, the array is terminated with -1. Up to max elements -+ * of the array will be filled. -+ * -+ * The return value is total number of array elements that would be filled if -+ * array was large enough, including the terminating `-1`. It is `0` when `a` -+ * is not odd or the constant term is zero contrary to requirement. -+ * -+ * The return value is also `0` when the leading exponent exceeds -+ * `OPENSSL_ECC_MAX_FIELD_BITS`, this guards against CPU exhaustion attacks, - */ - int BN_GF2m_poly2arr(const BIGNUM *a, int p[], int max) - { - int i, j, k = 0; - BN_ULONG mask; - -- if (BN_is_zero(a)) -+ if (!BN_is_odd(a)) - return 0; - - for (i = a->top - 1; i >= 0; i--) { -@@ -1167,12 +1178,13 @@ int BN_GF2m_poly2arr(const BIGNUM *a, int p[], int max) - } - } - -- if (k < max) { -+ if (k > 0 && p[0] > OPENSSL_ECC_MAX_FIELD_BITS) -+ return 0; -+ -+ if (k < max) - p[k] = -1; -- k++; -- } - -- return k; -+ return k + 1; - } - - /* -diff --git a/test/ec_internal_test.c b/test/ec_internal_test.c -index 8c2cd05631696..02cfd4e9d8858 100644 ---- a/test/ec_internal_test.c -+++ b/test/ec_internal_test.c -@@ -155,6 +155,56 @@ static int field_tests_ecp_mont(void) - } - - #ifndef OPENSSL_NO_EC2M -+/* Test that decoding of invalid GF2m field parameters fails. */ -+static int ec2m_field_sanity(void) -+{ -+ int ret = 0; -+ BN_CTX *ctx = BN_CTX_new(); -+ BIGNUM *p, *a, *b; -+ EC_GROUP *group1 = NULL, *group2 = NULL, *group3 = NULL; -+ -+ TEST_info("Testing GF2m hardening\n"); -+ -+ BN_CTX_start(ctx); -+ p = BN_CTX_get(ctx); -+ a = BN_CTX_get(ctx); -+ if (!TEST_ptr(b = BN_CTX_get(ctx)) -+ || !TEST_true(BN_one(a)) -+ || !TEST_true(BN_one(b))) -+ goto out; -+ -+ /* Even pentanomial value should be rejected */ -+ if (!TEST_true(BN_set_word(p, 0xf2))) -+ goto out; -+ if (!TEST_ptr_null(group1 = EC_GROUP_new_curve_GF2m(p, a, b, ctx))) -+ TEST_error("Zero constant term accepted in GF2m polynomial"); -+ -+ /* Odd hexanomial should also be rejected */ -+ if (!TEST_true(BN_set_word(p, 0xf3))) -+ goto out; -+ if (!TEST_ptr_null(group2 = EC_GROUP_new_curve_GF2m(p, a, b, ctx))) -+ TEST_error("Hexanomial accepted as GF2m polynomial"); -+ -+ /* Excessive polynomial degree should also be rejected */ -+ if (!TEST_true(BN_set_word(p, 0x71)) -+ || !TEST_true(BN_set_bit(p, OPENSSL_ECC_MAX_FIELD_BITS + 1))) -+ goto out; -+ if (!TEST_ptr_null(group3 = EC_GROUP_new_curve_GF2m(p, a, b, ctx))) -+ TEST_error("GF2m polynomial degree > %d accepted", -+ OPENSSL_ECC_MAX_FIELD_BITS); -+ -+ ret = group1 == NULL && group2 == NULL && group3 == NULL; -+ -+ out: -+ EC_GROUP_free(group1); -+ EC_GROUP_free(group2); -+ EC_GROUP_free(group3); -+ BN_CTX_end(ctx); -+ BN_CTX_free(ctx); -+ -+ return ret; -+} -+ - /* test EC_GF2m_simple_method directly */ - static int field_tests_ec2_simple(void) - { -@@ -443,6 +493,7 @@ int setup_tests(void) - ADD_TEST(field_tests_ecp_simple); - ADD_TEST(field_tests_ecp_mont); - #ifndef OPENSSL_NO_EC2M -+ ADD_TEST(ec2m_field_sanity); - ADD_TEST(field_tests_ec2_simple); - #endif - ADD_ALL_TESTS(field_tests_default, crv_len); diff --git a/meta/recipes-connectivity/openssl/openssl_3.0.15.bb b/meta/recipes-connectivity/openssl/openssl_3.0.16.bb similarity index 98% rename from meta/recipes-connectivity/openssl/openssl_3.0.15.bb rename to meta/recipes-connectivity/openssl/openssl_3.0.16.bb index 295f05729f..a9fffd18ba 100644 --- a/meta/recipes-connectivity/openssl/openssl_3.0.15.bb +++ b/meta/recipes-connectivity/openssl/openssl_3.0.16.bb @@ -12,15 +12,13 @@ SRC_URI = "https://github.com/openssl/openssl/releases/download/openssl-${PV}/op file://0001-buildinfo-strip-sysroot-and-debug-prefix-map-from-co.patch \ file://afalg.patch \ file://0001-Configure-do-not-tweak-mips-cflags.patch \ - file://CVE-2024-9143.patch \ - file://CVE-2024-13176.patch \ " SRC_URI:append:class-nativesdk = " \ file://environment.d-openssl.sh \ " -SRC_URI[sha256sum] = "23c666d0edf20f14249b3d8f0368acaee9ab585b09e1de82107c66e1f3ec9533" +SRC_URI[sha256sum] = "57e03c50feab5d31b152af2b764f10379aecd8ee92f16c985983ce4a99f7ef86" inherit lib_package multilib_header multilib_script ptest perlnative MULTILIB_SCRIPTS = "${PN}-bin:${bindir}/c_rehash" From patchwork Thu Feb 13 14:26:30 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Sakoman X-Patchwork-Id: 57266 X-Patchwork-Delegate: steve@sakoman.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id DE175C3DA4A for ; Thu, 13 Feb 2025 14:26:41 +0000 (UTC) Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) by mx.groups.io with SMTP id smtpd.web10.12202.1739456799778955484 for ; Thu, 13 Feb 2025 06:26:39 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@sakoman-com.20230601.gappssmtp.com header.s=20230601 header.b=3HcxIpRL; spf=softfail (domain: sakoman.com, ip: 209.85.214.179, mailfrom: steve@sakoman.com) Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-21f3c119fe6so22275755ad.0 for ; Thu, 13 Feb 2025 06:26:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sakoman-com.20230601.gappssmtp.com; s=20230601; t=1739456799; x=1740061599; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=ljOT/4vMaRXZ0pUg9IGukepS1UmOAlNeuEPW0/qcLA4=; b=3HcxIpRLFczm29VMwUo3n0iQNS7LfS9l5uNj1S+jiZOtw1MwwCYKmt3Ho61qS6vI4H fSVbIUubgWwJDuvM/4r+BwrpYn1irGAcFZQkklJH7PWY2Qj+Cz3eVm/mAdEHLmEHF8od +XEXiEzSwMoyULzbl+vqqCN+AIY5q1m489Rto1OnzE+QapxgDnDp1QWx4kaGMVE/uxsn S97ldpQi+127p2PitkR29sbCyhjj38SPpKce/RqTz3IA6GhtTtIg90rwMIo2Ce7zt3Jr 4RmV4ZQwEsQwon34BEBwrSaeQF6XLEacWiiOeZKvM7gw8DcvTaQ6vw20+yPYC5lXLoGg OZ2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739456799; x=1740061599; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ljOT/4vMaRXZ0pUg9IGukepS1UmOAlNeuEPW0/qcLA4=; b=Ga+u24O1kie+ImsQAA9gFxS9bjuHNX/YcPrjXcGcF0kQiod9u00amGBFjh9ae6gM31 Tl/pzKyGmdkNMYlHD3ib7m/ZpThWpda7yDX/t/MZMjbRdmA1tO//JPRUy5V71WGbd9Cx e4UwYcb0pTIr1ufr3U1KUV0ofsRlVRG81awKV/aATo3UBOGnAt7PDzZjMWRMH6Aig/+X k0a4w/YeJsd8x81qYm+UT7wC2y+O9B5GhKH+NZhexJRXeL4y+60j9jQ61bESjUOLM5O6 A2+BIvQeHGp17xSxzXlug9Ecb3pqPm8praB0lxb+BAE3MfH/4jD23p0/zGO1aK+LyRXk 4+Mg== X-Gm-Message-State: AOJu0YzF/v3ITfcYU7g2oBzT1mK4cKCKB030ecKhhQJ1Peqz62QG/Sda ImF2Es3fGeE2MLPXHbW4CsN3tccQeKe24ZKUKB9t8U8y1ASDQz/uwcDpO2kRjotprwdnUjMFIQa W X-Gm-Gg: ASbGncujXjxNhcnAZ37+oEx3J0/ijHqKeAJFwNQrTkbZjzXowhBlXHwUxv1hTdxhlCr yjk3vfw2dT/1GmTTcfyNq/ivAvICZCtNFB6z5DBqTGqYJv5nxt5GwxQaZP6mvs1fZ0sRCSxGZ1H uTldoeRkCHURP/oM+R+ag2GQ1lNO+0+8lH7v3psNDEJ7vzQKkK8WilwfXu1VaA2EgNa8s9NtRqK mDIzZO2gmi+WVMZbSXBoYsXQGm/uEC6O2iD/PwmtIgOccoyGgUaoVOL6BA2pvWlK2ChuUcMXS3o qGCg X-Google-Smtp-Source: AGHT+IGuSqGWbMppMLcxrKNg1Us6132h6eKlAoNcHHQUvIh4Eh8HN7ObdMGykjOlJ33AiPirzg2t+A== X-Received: by 2002:a05:6a00:b95:b0:730:8a0a:9ef9 with SMTP id d2e1a72fcca58-7322c417953mr12351526b3a.22.1739456799006; Thu, 13 Feb 2025 06:26:39 -0800 (PST) Received: from hexa.. ([98.142.47.158]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-732425467b9sm1342377b3a.30.2025.02.13.06.26.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Feb 2025 06:26:38 -0800 (PST) From: Steve Sakoman To: openembedded-core@lists.openembedded.org Subject: [OE-core][kirkstone 2/3] lib/packagedata.py: Add API to iterate over rprovides Date: Thu, 13 Feb 2025 06:26:30 -0800 Message-ID: <579717212ba2892e32315788ccd65320556d32a3.1739455358.git.steve@sakoman.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 13 Feb 2025 14:26:41 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/211339 From: Joshua Watt Adds an API that makes it easier to iterate over the package data for a all providers of a runtime dependency. (From OE-Core rev: 68bdc219a4a819e83217f5b54c463624af8d3b9e) Signed-off-by: Joshua Watt Signed-off-by: Richard Purdie Signed-off-by: Steve Sakoman --- meta/lib/oe/packagedata.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/meta/lib/oe/packagedata.py b/meta/lib/oe/packagedata.py index 212f048bc6..205800a407 100644 --- a/meta/lib/oe/packagedata.py +++ b/meta/lib/oe/packagedata.py @@ -108,3 +108,18 @@ def recipename(pkg, d): """Return the recipe name for the given binary package name.""" return pkgmap(d).get(pkg) + +def foreach_runtime_provider_pkgdata(d, rdep, include_rdep=False): + pkgdata_dir = d.getVar("PKGDATA_DIR") + possibles = set() + try: + possibles |= set(os.listdir("%s/runtime-rprovides/%s/" % (pkgdata_dir, rdep))) + except OSError: + pass + + if include_rdep: + possibles.add(rdep) + + for p in sorted(list(possibles)): + rdep_data = read_subpkgdata(p, d) + yield p, rdep_data From patchwork Thu Feb 13 14:26:31 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Sakoman X-Patchwork-Id: 57265 X-Patchwork-Delegate: steve@sakoman.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id EC0C3C021A5 for ; Thu, 13 Feb 2025 14:26:41 +0000 (UTC) Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) by mx.groups.io with SMTP id smtpd.web11.12087.1739456801108327516 for ; Thu, 13 Feb 2025 06:26:41 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@sakoman-com.20230601.gappssmtp.com header.s=20230601 header.b=corahBoo; spf=softfail (domain: sakoman.com, ip: 209.85.214.175, mailfrom: steve@sakoman.com) Received: by mail-pl1-f175.google.com with SMTP id d9443c01a7336-220c4159f87so12536145ad.0 for ; Thu, 13 Feb 2025 06:26:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sakoman-com.20230601.gappssmtp.com; s=20230601; t=1739456800; x=1740061600; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=n6UPa5EYmSiz6djPcwLz4pyVwq+uC9v1SMG7coN8Wt4=; b=corahBooAaxbcAYcb4pSI3XfMl60NFYyq98dEVOL1iwf4NQXhfz8yomW+BLEAG4abI F82VtIs+byXzAPUTsw03fnqaPSjaNDXlvXH26EJbCSIypdGClOlYsJLRrCYnIkGnr+82 YLIcb3OhLK8xMuOQhOlMpL3hhSQBS0MNW//UkdZQ6EL9IMcL/3qfbavrW2T4xx9OgHii XSNYDV5F8GvAy0Xjxx+BTrNc7B7uursBqohn6JCuenIGeIN7CjJlfFeaRTLcq4+lEQ1b pNrS3V/Ltska8mnYu4fCcyInAt2Q952p3yxvbLcA8rgd24Y1rbqLYJVSKkLLUP6f7guB GCeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739456800; x=1740061600; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=n6UPa5EYmSiz6djPcwLz4pyVwq+uC9v1SMG7coN8Wt4=; b=uhMVICxi+SuUOOodebAO9DaK40G/enwpDWTJsFeFZ4wG6vjs8THWZcHiJUhlil/bYP 8NiSfgGekXceQe5FyqeKrdME5pdGtdzwyRFMXD4dDfQl4bjvYGKBL51YMYRK711m7N6E yH/HSileuNFemebBW1ksWKzz0RKvZvuTilE2Yg8GKuTxc//DAncEhYOthV0Gg/++jrd8 T7ieEv+qbM2p4xvQl09HiBGnNRQR8Z/VwQg+pNwz8cy/ndpN8ESGa15m2efYit7OYuJN +TWT7xACB7BZbWTl0Ufuzqnqh9pI7QA9gSGslfSVzGKePFOiaLjeJO5MHQ8O3gzz1XwS KHHQ== X-Gm-Message-State: AOJu0YyRrnTrYVQsGIXr+S3HZyD8gynGibH4liH9R8jb5yaZ277ed2Nc EZnZIqUw3fTwAQtoK2eJ+sBf0l+b6k6tx5dapbvaeMTUBw1pwT/bt2FZtMmlCznLATx2pvpUVN8 9 X-Gm-Gg: ASbGncvUMfwlNksFk+i35SqivNpmKwtZc1ZkfMm9raupW9fs3jOi7ShQB/yX7/CXHwJ 9BTi9vj1XYnhMu/hceBCm5AQlr0bVEhL+0dAdb1rdmyQCrAR11lwxat8jVh6n+cbLH9KmpgBMyN XgT6w3mg9RbsHaqY3l4z6dOOxx+PwclJNLH2Gng2/J1i8FmuXISb1Rt3H43Hg3EZT5VWOssZv2O qHISUnYe/d6/xAX6YWfjIYMzY0ZW/7yUKKPeu8BOuLhGf0i6LtPyu/CP5jJNOOSkP0Z9+CUGRXb pc06 X-Google-Smtp-Source: AGHT+IGFjEwJJaB61UAyX062ZKUNMoO6YhIVMF8VQBjnoLHbWifin6Mfzi858dgSISMwNsFeLOA9HA== X-Received: by 2002:a05:6a20:244a:b0:1ee:65eb:73ef with SMTP id adf61e73a8af0-1ee6b2fe357mr5378504637.12.1739456800364; Thu, 13 Feb 2025 06:26:40 -0800 (PST) Received: from hexa.. ([98.142.47.158]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-732425467b9sm1342377b3a.30.2025.02.13.06.26.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Feb 2025 06:26:40 -0800 (PST) From: Steve Sakoman To: openembedded-core@lists.openembedded.org Subject: [OE-core][kirkstone 3/3] classes-global/insane: Look up all runtime providers for file-rdeps Date: Thu, 13 Feb 2025 06:26:31 -0800 Message-ID: <0ff31972b60dda5d8bada2ffb428cc54bb49e8cf.1739455358.git.steve@sakoman.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 13 Feb 2025 14:26:41 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/211340 From: Joshua Watt Uses the new foreach_runtime_provider_pkgdata() API to look up all possible runtime providers of a given dependency when resolving file-rdeps. This allows the check to correctly handle RPROVIDES for non-virtual dependencies (From OE-Core rev: 018fa1b7cb5e6a362ebb45b93e52b0909a782ac9) Signed-off-by: Joshua Watt Signed-off-by: Richard Purdie Signed-off-by: Steve Sakoman --- meta/classes/insane.bbclass | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass index dfda70bad6..f4b4c05e3d 100644 --- a/meta/classes/insane.bbclass +++ b/meta/classes/insane.bbclass @@ -761,13 +761,7 @@ def package_qa_check_rdepends(pkg, pkgdest, skip, taskdeps, packages, d): if rdep_data and 'PN' in rdep_data and rdep_data['PN'] in taskdeps: continue if not rdep_data or not 'PN' in rdep_data: - pkgdata_dir = d.getVar("PKGDATA_DIR") - try: - possibles = os.listdir("%s/runtime-rprovides/%s/" % (pkgdata_dir, rdepend)) - except OSError: - possibles = [] - for p in possibles: - rdep_data = oe.packagedata.read_subpkgdata(p, d) + for _, rdep_data in oe.packagedata.foreach_runtime_provider_pkgdata(d, rdepend): if rdep_data and 'PN' in rdep_data and rdep_data['PN'] in taskdeps: break if rdep_data and 'PN' in rdep_data and rdep_data['PN'] in taskdeps: @@ -811,17 +805,17 @@ def package_qa_check_rdepends(pkg, pkgdest, skip, taskdeps, packages, d): # perl filerdepends.pop(rdep,None) - # For Saving the FILERPROVIDES, RPROVIDES and FILES_INFO - rdep_data = oe.packagedata.read_subpkgdata(rdep, d) - for key in rdep_data: - if key.startswith("FILERPROVIDES:") or key.startswith("RPROVIDES:"): - for subkey in bb.utils.explode_deps(rdep_data[key]): - filerdepends.pop(subkey,None) - # Add the files list to the rprovides - if key.startswith("FILES_INFO:"): - # Use eval() to make it as a dict - for subkey in eval(rdep_data[key]): - filerdepends.pop(subkey,None) + for _, rdep_data in oe.packagedata.foreach_runtime_provider_pkgdata(d, rdep, True): + for key in rdep_data: + if key.startswith("FILERPROVIDES:") or key.startswith("RPROVIDES:"): + for subkey in bb.utils.explode_deps(rdep_data[key]): + filerdepends.pop(subkey,None) + # Add the files list to the rprovides + if key.startswith("FILES_INFO:"): + # Use eval() to make it as a dict + for subkey in eval(rdep_data[key]): + filerdepends.pop(subkey,None) + if not filerdepends: # Break if all the file rdepends are met break