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 smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1A4BBC982DA for ; Sun, 20 Sep 2026 17:22:30 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id E4E1F40F81; Sun, 20 Sep 2026 17:22:29 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id Dxuh1CzMcP7k; Sun, 20 Sep 2026 17:22:29 +0000 (UTC) ARC-Filter: OpenARC Filter v1.3.0 smtp4.osuosl.org E25DE40F86 Authentication-Results: smtp4.osuosl.org; arc=fail smtp.remote-ip=140.211.166.142 ARC-Seal: i=2; d=osuosl.org; s=arc; a=rsa-sha256; cv=fail; t=1789924949; b=VSWmPrZDnW5ZBsktBlFlzbXGNr4sI3a+zYBFscAKa4/hpr21ZDZkjflhJC6l5AsdkohQ rLZpheN/kPVwXeCO7SITs5e0tGVZE6aBIRGCHyb/qu6S9eqr2wpJU7zzY7iM4slxYCYBy 6Sef778TsYXB8ks3H1qEqRXnV8UmLHRPcdmM0aGo5301anH2gjo0BTS7gz6o2syvlBLcb mrc7OyFIEfVdacH6MHDECCgOnQfD8uhHWm22TI9FhbndaE2fgwqWDHCU8jOz1faGb5z/k Vfr37rIJvBdlmxII4H6rKn23pox6HfT+PAWARGPwUVcvd1rhUhPuEyPeFWUNmz3JxxA== ARC-Message-Signature: i=2; d=osuosl.org; s=arc; a=rsa-sha256; c=relaxed/relaxed; t=1789924949; h=X-Comment:DKIM-Signature:X-Original-To:Delivered-To:Received: Received:X-Virus-Scanned:X-Spam-Flag:X-Spam-Score:X-Spam-Level: X-Spam-Status:Received:ARC-Filter:Received-SPF:Received: DKIM-Signature:X-KAS-Sym:Received:Received:From:To:Date:Message-ID: X-Mailer:In-Reply-To:References:MIME-Version:X-Spamd-Bar:Subject: X-BeenThere:X-Mailman-Version:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:Cc:Content-Type: Content-Transfer-Encoding:Errors-To:Sender; bh=K38UEPTcjs+JlrSehlorOrOxRp9FvTYe2IN4WgIup0U=; b=eNfVciGc4E8vlMPkvfYhdOs9CogNryj0Uq3dhmi2u54rf6t1NYA5fx971g1V5iNTq31Q RdZyrDnSKJG2Lc5dFgUoKMrnKputy62jkerS416ImA9eH6E0RW//kPltycx7jtTAAUtv9 6qe9cv/HMyyIaSq8W12X2ghZk5EvvqkOemCgbALJYyNQbM59o/vTit/fJXOsaD0LdDdjb FCQwGLUH3c+UQpm3U6hsgD8SE0zgIjDPzB2NtbtFnsS106n8yLQ9nf1zGRCB+4eC8OSfm JX4VVp5tYNgUkI/V0oeM1h32H5H9cN1CAefjB9w6pRe2YhuzEbAv/6L0YbcOsHLcNnA== ARC-Authentication-Results: i=2; smtp4.osuosl.org; arc=fail smtp.remote-ip=140.211.166.142 X-Comment: SPF check N/A for local connections - client-ip=140.211.166.142; helo=lists1.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=buildroot.org; s=default; t=1789924949; bh=K38UEPTcjs+JlrSehlorOrOxRp9FvTYe2IN4WgIup0U=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=hZP2xsft8fjzovg4OtfrjZuKwt4iNV7rU1gzH3isbxt/XBZUeSm9atPNOyvSJtjYg kliYQzALly9s2LlAmuassW7BPqNOagpG11zh5PEEYXsxAIDx2kbW4z9+vHtl/GV7Rj DGVvnMbdaJ/VHMrQNrcGStIhMOhZqyomkdRTqoCv9Eij/UaRM8nSt58gTGjKPu8MR+ lKGPh26iopmvKzLRj71TE620I0kh4gHumWk/A6G2IFV1ihoKpmUqY4p5ROFJkNa47P 66SWJh1BImMtCRdWXkJssQpxGE3iLBhXsngAujG0/CGi6UfF3SpxNW8g2IR/r1DUk3 cWtjlqEXluyUw== Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp4.osuosl.org (Postfix) with ESMTP id E25DE40F86; Sun, 20 Sep 2026 17:22:28 +0000 (UTC) Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists1.osuosl.org (Postfix) with ESMTP id 979DA25B for ; Sun, 20 Sep 2026 17:22:27 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 7DDBC60600 for ; Sun, 20 Sep 2026 17:22:27 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id rRZH59XXl3e0 for ; Sun, 20 Sep 2026 17:22:26 +0000 (UTC) ARC-Filter: OpenARC Filter v1.3.0 smtp3.osuosl.org 73736605F1 Authentication-Results: smtp3.osuosl.org; arc=none smtp.remote-ip=85.13.140.57 ARC-Seal: i=1; d=osuosl.org; s=arc; a=rsa-sha256; cv=none; t=1789924946; b=GrQyK6K7iVUrmMlrttDwkQ8BYRolVspRKag9/xi6ZXx+3DERSkedR+GgA3Zw24zIGZd7 ehXAzejrncrVILjboNg+eORdQT+Z/BgmRPeG0hqa0A8gtud1G2hSu8sDaTSSUhI++KTjY lZ+/DYjRTrJ0f00Gi0XVn3o5qBC+f6G3J5Qsd62xjQkY+hqeBoHd7SahFIepnKRMbnmjS 2T3vGOGePSSG6Fc/9QXzsqZADySt2t0IV/ZTWYhG3Cu6QcAfXw5ChfJhX0BprpRwwFueW INrovmqnY1EZfL3k+UQ3QsW6kjvBwqfMeWjL+dp9JRVq/OEObzWtXEadvi5scE55Yfg== ARC-Message-Signature: i=1; d=osuosl.org; s=arc; a=rsa-sha256; c=relaxed/relaxed; t=1789924946; h=Received-SPF:DKIM-Signature:X-KAS-Sym:Received:Received:From:To:Cc: Subject:Date:Message-ID:X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding:X-Spam-Score:X-Spamd-Bar; bh=5K82jIiPOAAxOVMXOUMEDuHnm5P3+HqOjNR0zVeDofk=; b=hcwv7ac2SqzVj5824IrWuwkPpcXneBDGmTLWdKn/sf7+5LTQ2na7t/QJ2TujpGl/4jx4 63720R822eYWcsUzCOAdci4nFBKN+AWC9wDeVG6kCWH4V+33nhYc2YFL9IhlbX+NgA9YZ NUld41F5Us1hZ1dB+DkE4+H6zsop/X1cFw/AV1U9KVatSJXRXcnD86/BFEUs2fH0k9Nbk LbWM5bkphPE2umGTfCmOvzMwwvSi4aqJNbH6xWxJSWdK4B1Iq+M1DlQMbkeIXidlFfIIx KpPsKeTlg14sGdODNuFcVlSZd+D7xZAsqLz2QOSwG+8cVDzAGJGlDDe1i2gWPGsD36w== ARC-Authentication-Results: i=1; smtp3.osuosl.org; dmarc=pass header.from=kuhls.net; dkim=pass header.d=kuhls.net header.i=@kuhls.net header.a=rsa-sha256 header.s=kas202605290044 header.b=jkZDLnzO; arc=none smtp.remote-ip=85.13.140.57 Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=85.13.140.57; helo=dd20012.kasserver.com; envelope-from=bernd@kuhls.net; receiver= Authentication-Results: smtp3.osuosl.org; dmarc=pass (p=none dis=none) header.from=kuhls.net Authentication-Results: smtp3.osuosl.org; dkim=pass (2048-bit key) header.d=kuhls.net header.i=@kuhls.net header.a=rsa-sha256 header.s=kas202605290044 header.b=jkZDLnzO Received: from dd20012.kasserver.com (dd20012.kasserver.com [85.13.140.57]) by smtp3.osuosl.org (Postfix) with ESMTPS id 73736605F1 for ; Sun, 20 Sep 2026 17:22:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kuhls.net; s=kas202605290044; t=1789924169; bh=5K82jIiPOAAxOVMXOUMEDuHnm5P3+HqOjNR0zVeDofk=; h=From:To:Cc:Subject:Date:In-Reply-To:From; b=jkZDLnzOiCZe9LjRggAPw5SwSkHzD8PSZytBk/qxbgnFQqO2yEzjSjgh0bMAffFxh dX70EL3gO020Bocw+TS5+LfRRUa9f3DzW/AsABknLCeLogZb3OzWE8DLuchhw9FAQd /MdxME2wuqHAJHSRQuHFcj69sIdGlSJJnjXL230zD1Ewmm2S+GZ/uuTPTAbxIh4WcN yt4Obh4YxmD+GC+lKyvkjDtZ1VUY2y1TPINJbamRAOgVC1/wbQFbZFxu6GzgNC9s/G LVZvvaqfVVYnfRrUIfEX6fc0F3I6uU8SUX6HgCCcJz4YMliqwJtfK6ENbdiWdgQtHX c1QZOcK3n9Snw== X-KAS-Sym: v3:f51bdf72230551df:lHdkWXAlOH3mFYa7MPhN/Q5mZRaSllnUONUXNce4VNqCbu40d29sJoTMWL/UgPpKmiu+oFAK+SGKiz0pvNPHzzdK8865J0NZZhjD1YGG6aDHJWSqGt9pmYaVeClFza2NY+i+npE0hJgg/gHxSjO6xcwlUb6QQuNPO0hdPziIw4dhYYf4DJSWrRRzANCMomoD/RZTgi346Zz0eW33G9Vcp3B7DR+EaybhZMrqLCjEqGCkGFXPOjSjpT0/ayWciGjXWUz3QuiXUZXlIr+lNW1V5S5HyBJCR/w6EnvHAsYJhPTQhQAx4gJVctdz4XTCaIimRq6ACwja3Rp9OR6uCM1UuQ==:X/m0ia5DB/eiWOgh4yh+vvx8ic0izdhAESRjtOwefGarAi/IQkVNEiYO6a3pbOplutpDrsAN321CEt/JboF5CLA3YxyaEwrVjerC8gITsuu2dbrAHkmghJ/+IFzh3dcwv1XuKVHV7X3/g+YelePUlk7Huq4wNnFd6m8LYo/2Hq6JtwycrGkXqI+Z+KVkjCSfuYPcFzL98zEVgCTYFzWHQpDRdc3GF4iPRXzQ+/UqPySyP64U7qkJOi0AH8ciELYirJSMDRxMjDKMu5tnvK++p+Uv2VkQVcXg1LBDBiJRogZOORlA73umrnjpWmvQUdRyaVKbnW0T1576AZEDVA+Z3aeVid88IPslkcOI9XDKypL4DH/I63T0Zj8REVpZFYiChYQ58OIqoSBvmTRfC59jFKC/nZu2qclC6BFJ35wc/mHxRuNr2jFXTLXv6ROnZG/LXIuocXi+Y9qKL7QWACzfnCBsRo+Zmc7evWtMgz/I7aopAxPXrohmKKLm8rDpaq+sWZ2Dew16/W9ICyCL519HUhACxz/IdSZZuClwX6IZKKPMKmChvBODFmUUv2U+G52E+LtrE/0ilAePlVBPMUZ9WGPtNMxf36F/DSzwDR1wka5ydX uTODtqquIM8KCeLodHhHQuy3519Grp1oVihgXtdoSnh0NUqHszAVRM5xxbqKbaY0S4SjQkY4A= Received: from fli4l.lan.fli4l (p54a1b276.dip0.t-ipconnect.de [84.161.178.118]) by dd20012.kasserver.com (Postfix) with ESMTPSA id 08F58A4C48A9; Sun, 20 Sep 2026 19:09:29 +0200 (CEST) Received: from bruckner.lan.fli4l ([192.168.1.1]:57728) by fli4l.lan.fli4l with esmtp (Exim 4.100.1) (envelope-from ) id 1x8L1f-000000000o7-2mm5; Sun, 20 Sep 2026 17:08:27 +0000 From: Bernd Kuhls To: buildroot@buildroot.org Date: Sun, 20 Sep 2026 19:08:03 +0200 Message-ID: <20260920170815.240247-57-bernd@kuhls.net> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260920170815.240247-1-bernd@kuhls.net> References: <20260920170815.240247-1-bernd@kuhls.net> MIME-Version: 1.0 X-Spamd-Bar: - Subject: [Buildroot] [PATCH v5 56/67] package/softhsm2: Fix build with OpenSSL 4.0.0 X-BeenThere: buildroot@buildroot.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Zoltan Gyarmati , Marcin Bis , Robert Rose , Yair Ben Avraham , Angelo Compagnucci , Thomas Petazzoni , =?UTF-8?q?C=C3=A9dric=20Ch=C3=A9pied?= , Heiko Thiery , Philipp Richter , Titouan Christophe , Fabrice Fontaine , Joris Lijssens , Thomas Devoogdt , Romain Naour , Roy Kollen Svendsen , Brandon Maier , Francois Perrad , =?UTF-8?q?No=C3=A9=20Rubinstein?= , Norbert Lange , Jesse Van Gavere , Luca Ceresoli , David GOUARIN , Andrey Yurovsky , =?UTF-8?q?Andr=C3=A9=20Zwing?= , Daniel Price , Christian Hitz , Gregory Dymarek , Stefan Ott , Baxiche Su , Philippe Reynes , Sen Hastings , Fabrice Fontaine , James Hilliard , Giulio Benetti , Karoly Kasza , Martin Bark Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" Signed-off-by: Bernd Kuhls --- ...mory-leak-in-OSSL-byteString2oid-863.patch | 49 ++++++++++ ...in-EdDSA-PrintableString-handling-85.patch | 98 +++++++++++++++++++ 2 files changed, 147 insertions(+) create mode 100644 package/softhsm2/0001-Fix-the-memory-leak-in-OSSL-byteString2oid-863.patch create mode 100644 package/softhsm2/0002-Fix-memory-leak-in-EdDSA-PrintableString-handling-85.patch diff --git a/package/softhsm2/0001-Fix-the-memory-leak-in-OSSL-byteString2oid-863.patch b/package/softhsm2/0001-Fix-the-memory-leak-in-OSSL-byteString2oid-863.patch new file mode 100644 index 0000000000..2defeda775 --- /dev/null +++ b/package/softhsm2/0001-Fix-the-memory-leak-in-OSSL-byteString2oid-863.patch @@ -0,0 +1,49 @@ +From 1b72640ceccaa8fdd775f224c26a53fdaf189da6 Mon Sep 17 00:00:00 2001 +From: Shawn C +Date: Sat, 25 Apr 2026 20:05:34 +0800 +Subject: [PATCH] Fix the memory leak in OSSL::byteString2oid (#863) + +The function `OSSL::byteString2oid` in `SoftHSM2` (OpenSSL backend) +leaks memory when decoding PKCS#11 attribute values as ASN.1 objects +or strings. It calls `d2i_ASN1_OBJECT` and `d2i_ASN1_PRINTABLESTRING` +which allocate new OpenSSL objects, but these objects are never +freed after their NIDs are extracted. + +Signed-off-by: Shawn C + +Upstream: https://github.com/softhsm/SoftHSMv2/commit/57e10cbbe75069be92c7e9720c180a05833481fc + +Signed-off-by: Bernd Kuhls +--- + src/lib/crypto/OSSLUtil.cpp | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/src/lib/crypto/OSSLUtil.cpp b/src/lib/crypto/OSSLUtil.cpp +index 794f80e..d238eca 100644 +--- a/src/lib/crypto/OSSLUtil.cpp ++++ b/src/lib/crypto/OSSLUtil.cpp +@@ -177,8 +177,10 @@ int OSSL::byteString2oid(const ByteString& byteString) + { + return NID_undef; + } +- +- return OBJ_obj2nid(oid); ++ ++ int nid = OBJ_obj2nid(oid); ++ ASN1_OBJECT_free(oid); ++ return nid; + } + else if (pclass == V_ASN1_UNIVERSAL && tag == V_ASN1_PRINTABLESTRING) + { +@@ -204,6 +206,8 @@ int OSSL::byteString2oid(const ByteString& byteString) + { + return EVP_PKEY_X448; + } ++ ++ ASN1_STRING_free(curve_name); + } + + return NID_undef; +-- +2.47.3 + diff --git a/package/softhsm2/0002-Fix-memory-leak-in-EdDSA-PrintableString-handling-85.patch b/package/softhsm2/0002-Fix-memory-leak-in-EdDSA-PrintableString-handling-85.patch new file mode 100644 index 0000000000..f6b9000b13 --- /dev/null +++ b/package/softhsm2/0002-Fix-memory-leak-in-EdDSA-PrintableString-handling-85.patch @@ -0,0 +1,98 @@ +From c7e930156054e901e27149117494d53e9945f734 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ma=C5=82gorzata=20Olsz=C3=B3wka?= + +Date: Sun, 3 May 2026 13:00:07 +0200 +Subject: [PATCH] Fix memory leak in EdDSA PrintableString handling (#858) + +Upstream: https://github.com/softhsm/SoftHSMv2/commit/d23ea09d318c03c033420d065f1c64b019cc94ed + +Signed-off-by: Bernd Kuhls +--- + src/lib/crypto/OSSLUtil.cpp | 37 +++++++++++++++++++++++++------------ + 1 file changed, 25 insertions(+), 12 deletions(-) + +diff --git a/src/lib/crypto/OSSLUtil.cpp b/src/lib/crypto/OSSLUtil.cpp +index d238eca..7763799 100644 +--- a/src/lib/crypto/OSSLUtil.cpp ++++ b/src/lib/crypto/OSSLUtil.cpp +@@ -160,12 +160,14 @@ ByteString OSSL::oid2ByteString(int nid) + // Convert a ByteString to an OpenSSL EVP_PKEY id + int OSSL::byteString2oid(const ByteString& byteString) + { +- ASN1_OBJECT *oid = NULL; +- ASN1_PRINTABLESTRING *curve_name = NULL; ++ ASN1_OBJECT *oid; ++ ASN1_PRINTABLESTRING *curve_name; + const unsigned char *p = byteString.const_byte_str(); + const unsigned char *pp = p; ++ const unsigned char *data; + long length; +- int tag, pclass; ++ int tag, pclass, data_len; ++ int nid = NID_undef; + + ASN1_get_object(&pp, &length, &tag, &pclass, byteString.size()); + if (pclass == V_ASN1_UNIVERSAL && tag == V_ASN1_OBJECT) +@@ -177,39 +179,50 @@ int OSSL::byteString2oid(const ByteString& byteString) + { + return NID_undef; + } +- +- int nid = OBJ_obj2nid(oid); ++ ++ nid = OBJ_obj2nid(oid); + ASN1_OBJECT_free(oid); +- return nid; + } + else if (pclass == V_ASN1_UNIVERSAL && tag == V_ASN1_PRINTABLESTRING) + { + /* The final PKCS#11 3.0 expects curve name encoded as PrintableString */ + curve_name = d2i_ASN1_PRINTABLESTRING(NULL, &p, byteString.size()); + +- if (strcmp((char *)curve_name->data, "edwards25519") == 0) ++ if (curve_name == NULL) ++ { ++ return NID_undef; ++ } ++ ++ data = ASN1_STRING_get0_data(curve_name); ++ data_len = ASN1_STRING_length(curve_name); ++ ++ if (data_len == 12 && memcmp(data, "edwards25519", data_len) == 0) + { ++ ASN1_PRINTABLESTRING_free(curve_name); + return EVP_PKEY_ED25519; + } + +- if (strcmp((char *)curve_name->data, "curve25519") == 0) ++ if (data_len == 10 && memcmp(data, "curve25519", 10) == 0) + { ++ ASN1_PRINTABLESTRING_free(curve_name); + return EVP_PKEY_X25519; + } + +- if (strcmp((char *)curve_name->data, "edwards448") == 0) ++ if (data_len == 10 && memcmp(data, "edwards448", 10) == 0) + { ++ ASN1_PRINTABLESTRING_free(curve_name); + return EVP_PKEY_ED448; + } + +- if (strcmp((char *)curve_name->data, "curve448") == 0) ++ if (data_len == 8 && memcmp(data, "curve448", 8) == 0) + { ++ ASN1_PRINTABLESTRING_free(curve_name); + return EVP_PKEY_X448; + } + +- ASN1_STRING_free(curve_name); ++ ASN1_PRINTABLESTRING_free(curve_name); + } + +- return NID_undef; ++ return nid; + } + #endif +-- +2.47.3 + -- 2.47.3 _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot