From patchwork Thu Dec 2 12:19:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: akuster808 X-Patchwork-Id: 1306 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 4A47CC433FE for ; Thu, 2 Dec 2021 12:19:14 +0000 (UTC) Received: from mail-pj1-f52.google.com (mail-pj1-f52.google.com [209.85.216.52]) by mx.groups.io with SMTP id smtpd.web10.7247.1638447553303463088 for ; Thu, 02 Dec 2021 04:19:13 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=A5ikEpia; spf=pass (domain: gmail.com, ip: 209.85.216.52, mailfrom: akuster808@gmail.com) Received: by mail-pj1-f52.google.com with SMTP id gb13-20020a17090b060d00b001a674e2c4a8so4493364pjb.4 for ; Thu, 02 Dec 2021 04:19:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=oS0we338D7shjwaZEUpLsYz26G1xVhe57He2ZGsYGlQ=; b=A5ikEpiaA8OaIMogD8+nR5EL2gUpkk+0qpfRX2KhdeozEn/NOo8HA8++rXyZugEz5I As+gTcFPRoOsfr/rp2za7zkyfIl+R6yqLyuWRtaAYJ1mnRTbFCYa0M6q/JGDLQxWQM4Z AM31R67v9yxTzwW+YI0CiwggFat7xnC59Fkqux6sEsK33oHrDQbiNigzBuzw9Sd0diSW sUbumBRP5Cy1ZB6WzQSuK30ZWkpwV5d43KuAeXjUMyC2PlO0TcpmNASS5ZHq0+QMQsnN /MVqFpm2PiEQGqR0G9gs/9F3gKzpdy/799Um7U8HTPuVSTnir5X+uaQsmnAxM+/DxK+x FiRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=oS0we338D7shjwaZEUpLsYz26G1xVhe57He2ZGsYGlQ=; b=48dSvQvEkCZ//W0h9yntJLJVdwPdQ53nhsEJkkYAWRkSC3au+Im60IVTfyJB+LGU9i Ctl+2s4aMbdahIUwIdM64R6xO8CkSk4Ph4HwjnSPDvV9P6XTyZeWg4Axvw8Q19oqqYOF FZU2JaxLPbg3WdX0+ACeOVdQx0nazyccdjEDtesTVPFDQZGCaNFhwotHIQdU+u1KwbP3 XdNTWkcVLrXL8ylpocRa+vhrBbg7drr4dIESy+XgccQHrSjvCSBT9wk32G81wJYsbrQy 2qhQCX18cKRAhI7vAqW0PZHv+nZk7386SXuzNYCIB+Xn0t9Y4PiWaZvwbAWEX2uG4Da9 ngCw== X-Gm-Message-State: AOAM533XibFTeyuzo6jBi+zDossdRCVRT73kN6PMe79ao42OjmVeZs+7 pDVtnGTM+Mgc1q9zGqkW6Pm0j1YhpcQ= X-Google-Smtp-Source: ABdhPJxiNnINy8quK6Zn6pSCsbsaC2sdLx7dbODeVb+sqcQHoPZxKBHN9IFzA1/0frGFFI20ilfrPg== X-Received: by 2002:a17:903:2091:b0:142:8567:e794 with SMTP id d17-20020a170903209100b001428567e794mr15089841plc.50.1638447552398; Thu, 02 Dec 2021 04:19:12 -0800 (PST) Received: from keaua.hsd1.ca.comcast.net ([2601:202:4180:a5c0:9b75:b57e:d1aa:6e39]) by smtp.gmail.com with ESMTPSA id d2sm3396881pfj.42.2021.12.02.04.19.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Dec 2021 04:19:12 -0800 (PST) From: Armin Kuster To: openembedded-devel@lists.openembedded.org Subject: [dunfell 2/5] nss: Fix CVE-2020-12403 Date: Thu, 2 Dec 2021 04:19:02 -0800 Message-Id: X-Mailer: git-send-email 2.25.1 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, 02 Dec 2021 12:19:14 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-devel/message/94180 From: Ranjitsinh Rathod Add patch for CVE-2020-12403 Link: https://github.com/nss-dev/nss/commit/9ff9d3925d31ab265a965ab1d16d76c496ddb5c8 https://github.com/nss-dev/nss/commit/06b2b1c50bd4eaa7f65d858e5e3f44f678cb3c45 Signed-off-by: Ranjitsinh Rathod Signed-off-by: Ranjitsinh Rathod Signed-off-by: Armin Kuster --- .../nss/nss/CVE-2020-12403_1.patch | 65 +++++++++++++++ .../nss/nss/CVE-2020-12403_2.patch | 80 +++++++++++++++++++ meta-oe/recipes-support/nss/nss_3.51.1.bb | 2 + 3 files changed, 147 insertions(+) create mode 100644 meta-oe/recipes-support/nss/nss/CVE-2020-12403_1.patch create mode 100644 meta-oe/recipes-support/nss/nss/CVE-2020-12403_2.patch diff --git a/meta-oe/recipes-support/nss/nss/CVE-2020-12403_1.patch b/meta-oe/recipes-support/nss/nss/CVE-2020-12403_1.patch new file mode 100644 index 0000000000..a229a2d20f --- /dev/null +++ b/meta-oe/recipes-support/nss/nss/CVE-2020-12403_1.patch @@ -0,0 +1,65 @@ +From 9ff9d3925d31ab265a965ab1d16d76c496ddb5c8 Mon Sep 17 00:00:00 2001 +From: Benjamin Beurdouche +Date: Sat, 18 Jul 2020 00:13:38 +0000 +Subject: [PATCH] Bug 1636771 - Fix incorrect call to Chacha20Poly1305 by + PKCS11. r=jcj,kjacobs,rrelyea + +Differential Revision: https://phabricator.services.mozilla.com/D74801 + +--HG-- +extra : moz-landing-system : lando +--- + nss/gtests/pk11_gtest/pk11_chacha20poly1305_unittest.cc | 11 +++++++++-- + nss/lib/freebl/chacha20poly1305.c | 2 +- + 2 files changed, 10 insertions(+), 3 deletions(-) + +CVE: CVE-2020-12403 +Upstream-Status: Backport [https://github.com/nss-dev/nss/commit/9ff9d3925d31ab265a965ab1d16d76c496ddb5c8] +Comment: Refreshed path for whole patchset +Signed-off-by: Ranjitsinh Rathod + +diff --git a/nss/gtests/pk11_gtest/pk11_chacha20poly1305_unittest.cc b/nss/gtests/pk11_gtest/pk11_chacha20poly1305_unittest.cc +index 41f9da71d6..3ea17678d9 100644 +--- a/nss/gtests/pk11_gtest/pk11_chacha20poly1305_unittest.cc ++++ b/nss/gtests/pk11_gtest/pk11_chacha20poly1305_unittest.cc +@@ -45,7 +45,7 @@ class Pkcs11ChaCha20Poly1305Test + SECItem params = {siBuffer, reinterpret_cast(&aead_params), + sizeof(aead_params)}; + +- // Encrypt with bad parameters. ++ // Encrypt with bad parameters (TagLen is too long). + unsigned int encrypted_len = 0; + std::vector encrypted(data_len + aead_params.ulTagLen); + aead_params.ulTagLen = 158072; +@@ -54,9 +54,16 @@ class Pkcs11ChaCha20Poly1305Test + &encrypted_len, encrypted.size(), data, data_len); + EXPECT_EQ(SECFailure, rv); + EXPECT_EQ(0U, encrypted_len); +- aead_params.ulTagLen = 16; ++ ++ // Encrypt with bad parameters (TagLen is too short). ++ aead_params.ulTagLen = 2; ++ rv = PK11_Encrypt(key.get(), kMech, ¶ms, encrypted.data(), ++ &encrypted_len, encrypted.size(), data, data_len); ++ EXPECT_EQ(SECFailure, rv); ++ EXPECT_EQ(0U, encrypted_len); + + // Encrypt. ++ aead_params.ulTagLen = 16; + rv = PK11_Encrypt(key.get(), kMech, ¶ms, encrypted.data(), + &encrypted_len, encrypted.size(), data, data_len); + +diff --git a/nss/lib/freebl/chacha20poly1305.c b/nss/lib/freebl/chacha20poly1305.c +index 970c6436da..5c294a9eaf 100644 +--- a/nss/lib/freebl/chacha20poly1305.c ++++ b/nss/lib/freebl/chacha20poly1305.c +@@ -81,7 +81,7 @@ ChaCha20Poly1305_InitContext(ChaCha20Poly1305Context *ctx, + PORT_SetError(SEC_ERROR_BAD_KEY); + return SECFailure; + } +- if (tagLen == 0 || tagLen > 16) { ++ if (tagLen != 16) { + PORT_SetError(SEC_ERROR_INPUT_LEN); + return SECFailure; + } + diff --git a/meta-oe/recipes-support/nss/nss/CVE-2020-12403_2.patch b/meta-oe/recipes-support/nss/nss/CVE-2020-12403_2.patch new file mode 100644 index 0000000000..7b093d0cda --- /dev/null +++ b/meta-oe/recipes-support/nss/nss/CVE-2020-12403_2.patch @@ -0,0 +1,80 @@ +From 06b2b1c50bd4eaa7f65d858e5e3f44f678cb3c45 Mon Sep 17 00:00:00 2001 +From: Benjamin Beurdouche +Date: Sat, 18 Jul 2020 00:13:14 +0000 +Subject: [PATCH] Bug 1636771 - Disable PKCS11 incremental mode for ChaCha20. + r=kjacobs,rrelyea + +Depends on D74801 + +Differential Revision: https://phabricator.services.mozilla.com/D83994 + +--HG-- +extra : moz-landing-system : lando +--- + nss/gtests/pk11_gtest/pk11_cipherop_unittest.cc | 49 +++++++++++++++++++++ + nss/lib/softoken/pkcs11c.c | 1 + + 2 files changed, 50 insertions(+) + +CVE: CVE-2020-12403 +Upstream-Status: Backport [https://github.com/nss-dev/nss/commit/06b2b1c50bd4eaa7f65d858e5e3f44f678cb3c45] +Comment: Refreshed path for whole patchset and removed change for pkcs11c.c +Signed-off-by: Ranjitsinh Rathod + +diff --git a/nss/gtests/pk11_gtest/pk11_cipherop_unittest.cc b/nss/gtests/pk11_gtest/pk11_cipherop_unittest.cc +index 38982fd885..700750cc90 100644 +--- a/nss/gtests/pk11_gtest/pk11_cipherop_unittest.cc ++++ b/nss/gtests/pk11_gtest/pk11_cipherop_unittest.cc +@@ -77,4 +77,53 @@ TEST(Pkcs11CipherOp, SingleCtxMultipleUnalignedCipherOps) { + NSS_ShutdownContext(globalctx); + } + ++TEST(Pkcs11CipherOp, SingleCtxMultipleUnalignedCipherOpsChaCha20) { ++ PK11SlotInfo* slot; ++ PK11SymKey* key; ++ PK11Context* ctx; ++ ++ NSSInitContext* globalctx = ++ NSS_InitContext("", "", "", "", NULL, ++ NSS_INIT_READONLY | NSS_INIT_NOCERTDB | NSS_INIT_NOMODDB | ++ NSS_INIT_FORCEOPEN | NSS_INIT_NOROOTINIT); ++ ++ const CK_MECHANISM_TYPE cipher = CKM_NSS_CHACHA20_CTR; ++ ++ slot = PK11_GetInternalSlot(); ++ ASSERT_TRUE(slot); ++ ++ // Use arbitrary bytes for the ChaCha20 key and IV ++ uint8_t key_bytes[32]; ++ for (size_t i = 0; i < 32; i++) { ++ key_bytes[i] = i; ++ } ++ SECItem keyItem = {siBuffer, key_bytes, 32}; ++ ++ uint8_t iv_bytes[16]; ++ for (size_t i = 0; i < 16; i++) { ++ key_bytes[i] = i; ++ } ++ SECItem ivItem = {siBuffer, iv_bytes, 16}; ++ ++ SECItem* param = PK11_ParamFromIV(cipher, &ivItem); ++ ++ key = PK11_ImportSymKey(slot, cipher, PK11_OriginUnwrap, CKA_ENCRYPT, ++ &keyItem, NULL); ++ ctx = PK11_CreateContextBySymKey(cipher, CKA_ENCRYPT, key, param); ++ ASSERT_TRUE(key); ++ ASSERT_TRUE(ctx); ++ ++ uint8_t outbuf[128]; ++ // This is supposed to fail for Chacha20. This is because the underlying ++ // PK11_CipherOp operation is calling the C_EncryptUpdate function for ++ // which multi-part is disabled for ChaCha20 in counter mode. ++ ASSERT_EQ(GetBytes(ctx, outbuf, 7), SECFailure); ++ ++ PK11_FreeSymKey(key); ++ PK11_FreeSlot(slot); ++ SECITEM_FreeItem(param, PR_TRUE); ++ PK11_DestroyContext(ctx, PR_TRUE); ++ NSS_ShutdownContext(globalctx); ++} ++ + } // namespace nss_test diff --git a/meta-oe/recipes-support/nss/nss_3.51.1.bb b/meta-oe/recipes-support/nss/nss_3.51.1.bb index ac046ed0fe..14f670c32a 100644 --- a/meta-oe/recipes-support/nss/nss_3.51.1.bb +++ b/meta-oe/recipes-support/nss/nss_3.51.1.bb @@ -37,6 +37,8 @@ SRC_URI = "http://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/${VERSIO file://0001-Bug-1631576-Force-a-fixed-length-for-DSA-exponentiat.patch \ file://CVE-2020-12401.patch \ file://CVE-2020-6829_12400.patch \ + file://CVE-2020-12403_1.patch \ + file://CVE-2020-12403_2.patch \ " SRC_URI[md5sum] = "6acaf1ddff69306ae30a908881c6f233" From patchwork Thu Dec 2 12:19:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: akuster808 X-Patchwork-Id: 1308 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 3EA75C433EF for ; Thu, 2 Dec 2021 12:19:15 +0000 (UTC) Received: from mail-pg1-f175.google.com (mail-pg1-f175.google.com [209.85.215.175]) by mx.groups.io with SMTP id smtpd.web10.7248.1638447553963209147 for ; Thu, 02 Dec 2021 04:19:14 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=BuN1FH7A; spf=pass (domain: gmail.com, ip: 209.85.215.175, mailfrom: akuster808@gmail.com) Received: by mail-pg1-f175.google.com with SMTP id s37so17159589pga.9 for ; Thu, 02 Dec 2021 04:19:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=luKm9E7Mds2quZBEMCzmd4uu85LM3NODkw5rBKXWpbc=; b=BuN1FH7AeV8QgYGvEPry/CRJSLOUrsykqImmya/MUMhU4nYySvrdP7DRiInCE3KP5W hLk++sej2Qq5i7OFxKpmOP54lcyMMdnMDqOG/GAEf68maaydQ74wCT65fwpVgPIWpfdE m+c5FosIFpwXKp9fA0cYHRiKsNwZM6QekBb86TiDkc+0NBLAP92C4LyhLpkiHGbH473k +O4KceCJ6c+0UI/BxHkuJG5ZaEmWxpeayY8N/pbH1VsJPnRlhYPDakKMEwhoEgqkDisy YlCG4DY/HsjGPKB23i8JhJJ4OqZgcDX7SDkU3T+6Zdt4osWrGz0F74Fvl+jwXVk10pdG 9mfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=luKm9E7Mds2quZBEMCzmd4uu85LM3NODkw5rBKXWpbc=; b=2ZlbagKE3A4JsFdSOgE1W/PsB+Mmcisg1LbsNOeahc2xAVuOusTxaGRjnzQrDMxk5v J8PFiqHl3CTYGy1nthLxqkBaq0rcmhd9JCd63Qnka0eVS7GwatXoJjerg4UmPbnaRW5a sLGjeda1FLUgXHsHyCGl0CgC/F6jxo2qPPL7/r8Fn9lc2iyjQRb+gkaBTU9a7wzzc5fk XrbDgNS+1Sog5S/g03xtNmZgLvtNh2+SjJDG8DAESevXvgk/IGk48DSO98alSOwKyiE2 eEubekmKNI7ywjTrIddlKA3bdsEJ0eB0wOBsgpFu1C1mYTG3NWu3zYn4+xpuogxenRtb j24Q== X-Gm-Message-State: AOAM530/P6ByBq+gXBzswElGkHsT2oQXs1ML/fovcYIrk/mTqw6x3hoU 16V5eleLFVvh3uTTFjTrUQMjt+Q6baE= X-Google-Smtp-Source: ABdhPJz4RRgmPnIXFWb4k251Kf33T7B2V9B6363AJbxu3nhKtIe1gvgW69TQG7dwHaD9uD+NlFWaJQ== X-Received: by 2002:a63:2c50:: with SMTP id s77mr9018573pgs.387.1638447553315; Thu, 02 Dec 2021 04:19:13 -0800 (PST) Received: from keaua.hsd1.ca.comcast.net ([2601:202:4180:a5c0:9b75:b57e:d1aa:6e39]) by smtp.gmail.com with ESMTPSA id d2sm3396881pfj.42.2021.12.02.04.19.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Dec 2021 04:19:13 -0800 (PST) From: Armin Kuster To: openembedded-devel@lists.openembedded.org Subject: [dunfell 3/5] lmsensors: do not depend on lmsensors-isatools on non-x86 Date: Thu, 2 Dec 2021 04:19:03 -0800 Message-Id: X-Mailer: git-send-email 2.25.1 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, 02 Dec 2021 12:19:15 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-devel/message/94181 From: lumag lmsensors will build isadump and isaset only on x86 architecture. Depending on this package breaks lmsensors on all non-x86 machines. Fix this by enabling ${PN}-isatools dependency only on x86. Signed-off-by: Dmitry Baryshkov Signed-off-by: Khem Raj Signed-off-by: Martin Jansa Signed-off-by: Armin Kuster --- meta-oe/recipes-bsp/lm_sensors/lmsensors_3.6.0.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta-oe/recipes-bsp/lm_sensors/lmsensors_3.6.0.bb b/meta-oe/recipes-bsp/lm_sensors/lmsensors_3.6.0.bb index a2f0805fe5..37a98a0996 100644 --- a/meta-oe/recipes-bsp/lm_sensors/lmsensors_3.6.0.bb +++ b/meta-oe/recipes-bsp/lm_sensors/lmsensors_3.6.0.bb @@ -95,7 +95,7 @@ RDEPENDS_${PN} += " \ ${PN}-sensorsdetect \ ${PN}-sensorsconfconvert \ ${PN}-pwmconfig \ - ${PN}-isatools \ + ${@bb.utils.contains('MACHINE_FEATURES', 'x86', '${PN}-isatools', '', d)} \ " # libsensors packages From patchwork Thu Dec 2 12:19:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: akuster808 X-Patchwork-Id: 1309 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 345FAC43219 for ; Thu, 2 Dec 2021 12:19:16 +0000 (UTC) Received: from mail-pj1-f54.google.com (mail-pj1-f54.google.com [209.85.216.54]) by mx.groups.io with SMTP id smtpd.web11.7456.1638447555175865397 for ; Thu, 02 Dec 2021 04:19:15 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=QxgILENN; spf=pass (domain: gmail.com, ip: 209.85.216.54, mailfrom: akuster808@gmail.com) Received: by mail-pj1-f54.google.com with SMTP id p18-20020a17090ad31200b001a78bb52876so2290037pju.3 for ; Thu, 02 Dec 2021 04:19:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=KVlYYnsJCNLKmLBLH6s/XBsn6BORAASMhWEqFH4qldc=; b=QxgILENNCvzP6T+vb03BhzSILYBWKlA7oI8QpJYMm03FzeoNqqMTy0xFcrLqF2hSvR K+pSwifcttI04bWWdTUVZkjyw73C9T0yxyebvRkMGpc49krYrrdWvMUJwjXFPgE+o1QN x6xuMnlhYUpt4Kw3CCpf8f3C7sOhIvqikqa6jh77xi/WCa43ESKqQtXtnjT9fJM3oO5+ AqvUrmJ+NuasYt7gKCwdoL7tW3s9WMJa+qEXjG7H9MT1fu6HNx1wMwaB2Ed3qz98DzPY A93xJu8VMjwyarxrQGBWqEJN/nCBB2AJMNdzK7As68Sfwyi3MvSsuyF5cprhkUTXq7OU u+Fg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=KVlYYnsJCNLKmLBLH6s/XBsn6BORAASMhWEqFH4qldc=; b=gu3tloGIvfSQYSez1fbsk48eKCbk9KqSpnvd8KRao+yd3zTZ0eM5Vy4bO3IcMTxV5k Wn0BvlkW01a9EBwi/XAkodQe7mmS7Qck5eGAW1AL3h1d6gUwWpwNLU1lxi2cAzgCFLcm iYDNZCE7W47cwNINhJ3bcyziOYMEacRu+plg8hM6bejuRUURNUv+wNequMrjV3ITgqSb SGnjbOMguaakdEtXgLuXF1wX5DqtbWjxoFwpZe28N4uGndHuDxQfkjODE5D3zU7O0uAB rKbMk+E2yAJzQFl+x/IZbN6P7lVimfZ3aEbrgH9GClKoGAzIL1YnL3u81JNPUPIptoIM j7CA== X-Gm-Message-State: AOAM533cCJzSoBbfwdYyk8c/UUTzxQMSuCGxnzNR72hqCRfmRr/1H9aE NHnw1AqFi8zrDCYYsR3PJd25xehMYVU= X-Google-Smtp-Source: ABdhPJyDiBWBnOzW+/2q6WkcogYAkdWReRBfMAMCiN5raxcK0OODvy9RJiWV9AaqNKteJQWAUuSOPA== X-Received: by 2002:a17:90b:38c5:: with SMTP id nn5mr5541152pjb.220.1638447554335; Thu, 02 Dec 2021 04:19:14 -0800 (PST) Received: from keaua.hsd1.ca.comcast.net ([2601:202:4180:a5c0:9b75:b57e:d1aa:6e39]) by smtp.gmail.com with ESMTPSA id d2sm3396881pfj.42.2021.12.02.04.19.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Dec 2021 04:19:13 -0800 (PST) From: Armin Kuster To: openembedded-devel@lists.openembedded.org Subject: [dunfell 4/5] sdbus-c++: don't fetch googletest during do_configure Date: Thu, 2 Dec 2021 04:19:04 -0800 Message-Id: X-Mailer: git-send-email 2.25.1 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, 02 Dec 2021 12:19:16 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-devel/message/94183 From: Martin Jansa * with PTEST_ENABLED it enables with-tests PACKAGECONFIG which instead of using system googletest gmock, tries to fetch googletest from github and fails because branch was recently renamed from master to main | -- Found PkgConfig: /OE/tmp-glibc/work/qemux86-oe-linux/sdbus-c++/0.8.3-r0/recipe-sysroot-native/usr/bin/pkg-config (found version "0.29.2") | -- Checking for module 'libsystemd>=236' | -- Found libsystemd, version 249 | -- Building with tests | Fetching googletest... | [1/9] Creating directories for 'googletest-populate' | [1/9] Performing download step (git clone) for 'googletest-populate' | Cloning into 'googletest-src'... | fatal: invalid reference: master | CMake Error at googletest-subbuild/googletest-populate-prefix/tmp/googletest-populate-gitclone.cmake:40 (message): | Failed to checkout tag: 'master' | | | FAILED: googletest-populate-prefix/src/googletest-populate-stamp/googletest-populate-download | cd /OE/tmp-glibc/work/qemux86-oe-linux/sdbus-c++/0.8.3-r0/build/_deps && /OE/tmp-glibc/work/qemux86-oe-linux/sdbus-c++/0.8.3-r0/recipe-sysroot-native/usr/bin/cmake -P /OE/tmp-glibc/work/qemux86-oe-linux/sdbus-c++/0.8.3-r0/build/_deps/googletest-subbuild/googletest-populate-prefix/tmp/googletest-populate-gitclone.cmake && /OE/tmp-glibc/work/qemux86-oe-linux/sdbus-c++/0.8.3-r0/recipe-sysroot-native/usr/bin/cmake -E touch /OE/tmp-glibc/work/qemux86-oe-linux/sdbus-c++/0.8.3-r0/build/_deps/googletest-subbuild/googletest-populate-prefix/src/googletest-populate-stamp/googletest-populate-download | ninja: build stopped: subcommand failed. | | CMake Error at /OE/tmp-glibc/work/qemux86-oe-linux/sdbus-c++/0.8.3-r0/recipe-sysroot-native/usr/share/cmake-3.19/Modules/FetchContent.cmake:989 (message): | Build step for googletest failed: 1 | Call Stack (most recent call first): | /OE/tmp-glibc/work/qemux86-oe-linux/sdbus-c++/0.8.3-r0/recipe-sysroot-native/usr/share/cmake-3.19/Modules/FetchContent.cmake:1118:EVAL:2 (__FetchContent_directPopulate) | /OE/tmp-glibc/work/qemux86-oe-linux/sdbus-c++/0.8.3-r0/recipe-sysroot-native/usr/share/cmake-3.19/Modules/FetchContent.cmake:1118 (cmake_language) | tests/CMakeLists.txt:17 (FetchContent_Populate) | | | -- Configuring incomplete, errors occurred! * unfortunately this backported patch fixes the fetching failure, because it uses release-${GOOGLETEST_VERSION} tag instead of now non-existent master branch, but is not enough to prevent fetching from github during do_configure: -- Building with tests -- Could NOT find GTest (missing: GTest_DIR) -- Checking for module 'gmock>=1.10.0' -- No package 'gmock' found Fetching googletest... we also need to add googletest dependency to with-tests PACKAGECONFIG was fixed in meta-oe/master with the upgrade to 1.0.0: https://github.com/openembedded/meta-openembedded/commit/b26b66e5da92718b4e99a57fbfaaef9e751c3cfe#diff-48a847e7323703994fd2ce0fcb731ff860fa955a77cdfe39d71a9cc84a042c06L15 then it's ok and not fetching: -- Building with tests -- Looking for pthread.h -- Looking for pthread.h - found Signed-off-by: Martin Jansa Signed-off-by: Armin Kuster --- ...d-googletest-in-the-system-before-do.patch | 96 +++++++++++++++++++ .../recipes-core/sdbus-c++/sdbus-c++_0.8.1.bb | 9 +- 2 files changed, 102 insertions(+), 3 deletions(-) create mode 100644 meta-oe/recipes-core/sdbus-c++/sdbus-c++-0.8.1/0001-Try-to-first-find-googletest-in-the-system-before-do.patch diff --git a/meta-oe/recipes-core/sdbus-c++/sdbus-c++-0.8.1/0001-Try-to-first-find-googletest-in-the-system-before-do.patch b/meta-oe/recipes-core/sdbus-c++/sdbus-c++-0.8.1/0001-Try-to-first-find-googletest-in-the-system-before-do.patch new file mode 100644 index 0000000000..89cb593e60 --- /dev/null +++ b/meta-oe/recipes-core/sdbus-c++/sdbus-c++-0.8.1/0001-Try-to-first-find-googletest-in-the-system-before-do.patch @@ -0,0 +1,96 @@ +From b073e1c2b9a8138da83300f598b9a56fc9762b4b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stanislav=20Angelovi=C4=8D?= +Date: Mon, 16 Nov 2020 17:05:36 +0100 +Subject: [PATCH] Try to first find googletest in the system before downloading + it (#125) + +Upstream-Status: Backport [d6fdaca] +Signed-off-by: Martin Jansa + +--- + tests/CMakeLists.txt | 62 ++++++++++++++++++++++++++++---------------- + 1 file changed, 40 insertions(+), 22 deletions(-) + +diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt +index 97f7c1a..7ecc327 100644 +--- a/tests/CMakeLists.txt ++++ b/tests/CMakeLists.txt +@@ -2,26 +2,44 @@ + # DOWNLOAD AND BUILD OF GOOGLETEST + #------------------------------- + +-include(FetchContent) +- +-message("Fetching googletest...") +-FetchContent_Declare(googletest +- GIT_REPOSITORY https://github.com/google/googletest.git +- GIT_TAG master +- GIT_SHALLOW 1 +- UPDATE_COMMAND "") +- +-#FetchContent_MakeAvailable(googletest) # Not available in CMake 3.13 :-( Let's do it manually: +-FetchContent_GetProperties(googletest) +-if(NOT googletest_POPULATED) +- FetchContent_Populate(googletest) +- set(gtest_force_shared_crt ON CACHE INTERNAL "" FORCE) +- set(BUILD_GMOCK ON CACHE INTERNAL "" FORCE) +- set(INSTALL_GTEST OFF CACHE INTERNAL "" FORCE) +- set(BUILD_SHARED_LIBS_BAK ${BUILD_SHARED_LIBS}) +- set(BUILD_SHARED_LIBS OFF) +- add_subdirectory(${googletest_SOURCE_DIR} ${googletest_BINARY_DIR}) +- set(BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS_BAK}) ++set(GOOGLETEST_VERSION 1.10.0 CACHE STRING "Version of gmock to use") ++set(GOOGLETEST_GIT_REPO "https://github.com/google/googletest.git" CACHE STRING "A git repo to clone and build googletest from if gmock is not found in the system") ++ ++find_package(GTest ${GOOGLETEST_VERSION} CONFIG) ++if (NOT TARGET GTest::gmock) ++ # Try pkg-config if GTest was not found through CMake config ++ find_package(PkgConfig) ++ if (PkgConfig_FOUND) ++ pkg_check_modules(GMock IMPORTED_TARGET GLOBAL gmock>=${GOOGLETEST_VERSION}) ++ if(TARGET PkgConfig::GMock) ++ add_library(GTest::gmock ALIAS PkgConfig::GMock) ++ endif() ++ endif() ++ # GTest was not found in the system, build it on our own ++ if (NOT TARGET GTest::gmock) ++ include(FetchContent) ++ ++ message("Fetching googletest...") ++ FetchContent_Declare(googletest ++ GIT_REPOSITORY ${GOOGLETEST_GIT_REPO} ++ GIT_TAG release-${GOOGLETEST_VERSION} ++ GIT_SHALLOW 1 ++ UPDATE_COMMAND "") ++ ++ #FetchContent_MakeAvailable(googletest) # Not available in CMake 3.13 :-( Let's do it manually: ++ FetchContent_GetProperties(googletest) ++ if(NOT googletest_POPULATED) ++ FetchContent_Populate(googletest) ++ set(gtest_force_shared_crt ON CACHE INTERNAL "" FORCE) ++ set(BUILD_GMOCK ON CACHE INTERNAL "" FORCE) ++ set(INSTALL_GTEST OFF CACHE INTERNAL "" FORCE) ++ set(BUILD_SHARED_LIBS_BAK ${BUILD_SHARED_LIBS}) ++ set(BUILD_SHARED_LIBS OFF) ++ add_subdirectory(${googletest_SOURCE_DIR} ${googletest_BINARY_DIR}) ++ set(BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS_BAK}) ++ add_library(GTest::gmock ALIAS gmock) ++ endif() ++ endif() + endif() + + #------------------------------- +@@ -87,11 +105,11 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}) + + add_executable(sdbus-c++-unit-tests ${UNITTESTS_SRCS}) + target_compile_definitions(sdbus-c++-unit-tests PRIVATE LIBSYSTEMD_VERSION=${LIBSYSTEMD_VERSION}) +-target_link_libraries(sdbus-c++-unit-tests sdbus-c++-objlib gmock gmock_main) ++target_link_libraries(sdbus-c++-unit-tests sdbus-c++-objlib GTest::gmock) + + add_executable(sdbus-c++-integration-tests ${INTEGRATIONTESTS_SRCS}) + target_compile_definitions(sdbus-c++-integration-tests PRIVATE LIBSYSTEMD_VERSION=${LIBSYSTEMD_VERSION}) +-target_link_libraries(sdbus-c++-integration-tests sdbus-c++ gmock gmock_main) ++target_link_libraries(sdbus-c++-integration-tests sdbus-c++ GTest::gmock) + + # Manual performance and stress tests + option(ENABLE_PERF_TESTS "Build and install manual performance tests (default OFF)" OFF) diff --git a/meta-oe/recipes-core/sdbus-c++/sdbus-c++_0.8.1.bb b/meta-oe/recipes-core/sdbus-c++/sdbus-c++_0.8.1.bb index c4d63fd272..a94fb8deff 100644 --- a/meta-oe/recipes-core/sdbus-c++/sdbus-c++_0.8.1.bb +++ b/meta-oe/recipes-core/sdbus-c++/sdbus-c++_0.8.1.bb @@ -12,13 +12,16 @@ PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'with-exte ${@bb.utils.contains('PTEST_ENABLED', '1', 'with-tests', '', d)}" PACKAGECONFIG[with-builtin-libsystemd] = ",,sdbus-c++-libsystemd,libcap" PACKAGECONFIG[with-external-libsystemd] = ",,systemd,libsystemd" -PACKAGECONFIG[with-tests] = "-DBUILD_TESTS=ON -DTESTS_INSTALL_PATH=${libdir}/${BPN}/tests,-DBUILD_TESTS=OFF" +PACKAGECONFIG[with-tests] = "-DBUILD_TESTS=ON -DTESTS_INSTALL_PATH=${libdir}/${BPN}/tests,-DBUILD_TESTS=OFF,googletest gmock" DEPENDS += "expat" SRCREV = "3a4f343fb924650e7639660efa5f143961162044" -SRC_URI = "git://github.com/Kistler-Group/sdbus-cpp.git;protocol=https;branch=master" -SRC_URI += "file://run-ptest" + +SRC_URI = "git://github.com/Kistler-Group/sdbus-cpp.git;protocol=https;branch=master \ + file://0001-Try-to-first-find-googletest-in-the-system-before-do.patch \ + file://run-ptest \ +" EXTRA_OECMAKE = "-DBUILD_CODE_GEN=ON \ -DBUILD_DOC=ON \ From patchwork Thu Dec 2 12:19:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: akuster808 X-Patchwork-Id: 1310 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 343ADC43217 for ; Thu, 2 Dec 2021 12:19:17 +0000 (UTC) Received: from mail-pj1-f53.google.com (mail-pj1-f53.google.com [209.85.216.53]) by mx.groups.io with SMTP id smtpd.web09.7385.1638447556132575669 for ; Thu, 02 Dec 2021 04:19:16 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=DkOCBg+b; spf=pass (domain: gmail.com, ip: 209.85.216.53, mailfrom: akuster808@gmail.com) Received: by mail-pj1-f53.google.com with SMTP id nn15-20020a17090b38cf00b001ac7dd5d40cso4498881pjb.3 for ; Thu, 02 Dec 2021 04:19:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=fu9sKguq9Fz+PVamKvBprXxYWVRy0hgD9nIp4Dt3Y58=; b=DkOCBg+b9vDAjW5bYCXwzf9MTwW58JiAGYPu4431th3bD0GVefVixSXHOy4BnXBYRM E0qiq4+KEvnCgSqNNEHQ3rWPLMAH9br9q6w0MpvyYhTNX8I8wr+/LE9F6G/AhVgnWNQw cpJYVatrVzOfeDo5CQdnUtqlEVuR9ONEdJPfNksKzJP1bFQTMpkgbulx9RvOl96HOkso bSymTN8kBHhQoeIisto0FSyUkLoQ9W8IWJfvc7CE7s2ZVaBYYIaMQSOTieU9v/roQY7y IHT1pupjY9VcgJLfpJCS8v3jxl44+k0Te8ANlq/iE98JCBPpbwvGXlWlZ+iysSgu+n2R 3OaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=fu9sKguq9Fz+PVamKvBprXxYWVRy0hgD9nIp4Dt3Y58=; b=A22S/ONQSJ8tApojkh2cPfFxF66tyIsJ6cJojNUbpqyujxwrbHZ61atuEoW83gKhNP aXcEYR54Sg+JwL3wte6sVNhpbAQ+aOjSsgds4EzzPvuSsvpdZXgSAIjQndyHPkoU/Yjx Wfqj7Kgaat2A+ObtyPoeCn9NcbeZvGAZKqAkE0KKWHqH9korshGSQBDnir+VR7gavdBp VA0eT/4yIGB56MU8GMRDGI4nQlEH1oULIPfaqkJRs74TUWkEtqerIyCYTv9Z/LL/HWR5 LbMzH7Yvxx7Osq5frrzPR3QrOI90Ovv1xDl2M1YgPMbl5Xn2VonyyDBTWk+LbEtyQmGT gLww== X-Gm-Message-State: AOAM530PigeqV6oFt3749mChqnJRExA6Y/efIrrsZsRtTl2NoeKgBvr2 1a2AVeAGfmHIploj2XeHEqGkLGWFhy4= X-Google-Smtp-Source: ABdhPJx17bh9lWjADllggkV62eho4fabhQgKxbB6QCvfZwV3r3gAiI8PtogNlTZCgUg1HuV+PfpRnA== X-Received: by 2002:a17:90b:4a83:: with SMTP id lp3mr5724256pjb.34.1638447555436; Thu, 02 Dec 2021 04:19:15 -0800 (PST) Received: from keaua.hsd1.ca.comcast.net ([2601:202:4180:a5c0:9b75:b57e:d1aa:6e39]) by smtp.gmail.com with ESMTPSA id d2sm3396881pfj.42.2021.12.02.04.19.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Dec 2021 04:19:15 -0800 (PST) From: Armin Kuster To: openembedded-devel@lists.openembedded.org Subject: [dunfell 5/5] jansson: whitelist CVE-2020-36325 Date: Thu, 2 Dec 2021 04:19:05 -0800 Message-Id: X-Mailer: git-send-email 2.25.1 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, 02 Dec 2021 12:19:17 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-devel/message/94184 From: Marta Rybczynska According to the upstream [1], the bug happens only if the programmer does not follow the API definition. [1] https://github.com/akheron/jansson/issues/548 Signed-off-by: Marta Rybczynska Signed-off-by: Armin Kuster --- meta-oe/recipes-extended/jansson/jansson_2.13.1.bb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/meta-oe/recipes-extended/jansson/jansson_2.13.1.bb b/meta-oe/recipes-extended/jansson/jansson_2.13.1.bb index d6e56ea768..7beea9f1e7 100644 --- a/meta-oe/recipes-extended/jansson/jansson_2.13.1.bb +++ b/meta-oe/recipes-extended/jansson/jansson_2.13.1.bb @@ -11,4 +11,7 @@ SRC_URI[sha256sum] = "f4f377da17b10201a60c1108613e78ee15df6b12016b116b6de42209f4 inherit autotools pkgconfig +# upstream considers it isn't a real bug https://github.com/akheron/jansson/issues/548 +CVE_CHECK_WHITELIST = "CVE-2020-36325 " + BBCLASSEXTEND = "native"