From patchwork Fri Dec 4 09:26:03 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ankur Tyagi X-Patchwork-Id: 107279 X-Patchwork-Delegate: ankur.tyagi85@gmail.com Received: from mail-pj1-f51.google.com (mail-pj1-f51.google.com [209.85.216.51]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.4225.1796376387113677207 for ; Fri, 04 Dec 2026 01:26:27 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20260707 header.b=ZXMRxrUF; spf=pass (domain: gmail.com, ip: 209.85.216.51, mailfrom: ankur.tyagi85@gmail.com) Received: by mail-pj1-f51.google.com with SMTP id 98e67ed59e1d1-3b413997581so517952a91.2 for ; Fri, 04 Dec 2026 01:26:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796376386; x=1796981186; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=c3NaSFwo7mL8dsoR8bcut0YblmGNkczOtKJ1AYI/7bI=; b=ZXMRxrUF2JdLvEEtCVk3EU3fbjHFm0jQgTLYlZavGOY0pG1JZ3p+EtyxDq/gYA2k7c o+x9SePlmzFmhYHhUMhpw+LOeSIeowW7GrLCywW+6j3AGUU/sQa3yUe9vtM9BaXK2h0o j44hq16fljZ12E4mAcDSwblXxfd0stLw0By7o2U5zZfSIB3p8yZMQ2dunbxF4BSiqxE9 pxXGx9vkzdZ2qdehQyak//ieqAOPL9HFlm5Uc8wj7qmVPoG4DtGhv1gi6WPpgMJ8RfR9 dyPYATSaY2ZRFvK9z8etEbAl4IfC07TIwcpwP+AAAagxCvMsYtuacbM65iS01C1QLVrS jqLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796376386; x=1796981186; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=c3NaSFwo7mL8dsoR8bcut0YblmGNkczOtKJ1AYI/7bI=; b=kKi4lX6cNCfyC0L6pV+o/aAIzlOMXDEqAj0muJEv9c2QuQG+LNKH5QVkg3vR3fcjct ict4LwgwAMPg91pubmDKNV1XhPoUlRVDqVhAOU4UvJ3fL9mV/LyHMGwz/7SIfccnRyT4 kTvxplEpwABLbfoUff9DJ5KJ2H2bZG/dZhj3ETJMclIQKAK579aqHTgX24ARSHAUvEUu aoT/BHa4oGMsHbDHODsYrF+OzE2dbfJasBGngBqN69WmkGjIFrVDji0BQjYZdpGGM+DM CYfBcci52KyNfLfsaCeWBDGxMJ/AIzLkwbT6qUelvbFfb9ZPFgcF9gotNOENFD5N5M5H p7nQ== X-Gm-Message-State: APuU4Z/fO68QYk2abn/PXRFmGJzagZwQkrGXglSm77XDFYZjVcqsqsDK HXCfptNev/jOAE/kwHgKI9mHMIxj48DTN0ve3f++j281uFOqIxnD/tymydM7a92T X-Gm-Gg: AZFdTZdL58yGWYHt7cbjwsZA2xsXhQKXqP5UatTZaVJMNPl0Ap7iI6sn8arQ7nc1VuF zvYcsRJdEdn9D9Q0TOzvbN6cbweJ+B1w+5XzeE57BnExtI9esWVBl7BrLuM7cQYGNO4Mnw799i/ 29dWOwCtJ+qJglD39K4/XXfuGhf+xZc1BMnlpA5jGGZouEA+2lsKCzncJspERqXoKZpzDtGYosE 7h7JjidyseB56UNBo7S4KRaqKqzhG7HUZv75BSERUGhbpir6V1+ZVGrweK6GD0ixHEwPWLuSC4d FwaIss02FDVHuPCUZ8zn99zjkUvXlPHPw6p2cAqbXz3+5n9x2jQjfVtoFaBVN7ypDSIGKDoDRGF 0ZjbS8V9r7B2t37ctjTCmSRioqt67/s0EyO29iYocbxXLvUjieCzl/Nb9bt08l7pWwpXhbrvvU+ SjfTif17OcwsXqzlj2HFN2dH+BnEEsfowmS0LiU2E2Gq2AZKxbf+nGH2XG0y0ho6tHxaGN4HEmc EF+lh11HgPaWARqhUZ/dBX1krthIuBtgQf2i4FtC7EgkMbJvXMJxvP/kSPKJwZ8X/p9ylkP3wex nEhs9vWpRZqYSc78/GGSXTAU/nX1RHXVH/T4b1pQS+YZa3g1wxW6ck6I8QqlkPBmdu7RIMfb7u+ LVnv26gHmdw2ck8LNR6O4AgRLkNkSxegC38DTHoiDV7g= X-Received: by 2002:a17:90b:2743:b0:3b3:a74d:f848 with SMTP id 98e67ed59e1d1-3b5e0623fe0mr950125a91.15.1796376386202; Fri, 04 Dec 2026 01:26:26 -0800 (PST) Return-Path: Received: from NVAPF55DW0D-IPD.. ([147.161.219.8]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3b5c7d65b94sm8472029a91.12.2026.12.04.01.26.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Dec 2026 01:26:25 -0800 (PST) From: ankur.tyagi85@gmail.com To: openembedded-devel@lists.openembedded.org Cc: Ankur Tyagi Subject: [oe][meta-oe][blacksail][PATCH 4/10] gammu: patch CVE-2026-138160 Date: Fri, 4 Dec 2026 22:26:03 +1300 Message-ID: <20261204092609.2479561-4-ankur.tyagi85@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20261204092609.2479561-1-ankur.tyagi85@gmail.com> References: <20261204092609.2479561-1-ankur.tyagi85@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by lin-tor-korg-lkml-alma10-1 with HTTPS for ; Fri, 04 Dec 2026 09:26:33 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-devel/message/134020 From: Ankur Tyagi Details: https://nvd.nist.gov/vuln/detail/cve-2026-138160 Signed-off-by: Ankur Tyagi --- .../gammu/gammu/CVE-2026-138160_1.patch | 52 +++++++++ .../gammu/gammu/CVE-2026-138160_2.patch | 107 ++++++++++++++++++ .../gammu/gammu_1.42.0.bb | 2 + 3 files changed, 161 insertions(+) create mode 100644 meta-oe/recipes-connectivity/gammu/gammu/CVE-2026-138160_1.patch create mode 100644 meta-oe/recipes-connectivity/gammu/gammu/CVE-2026-138160_2.patch diff --git a/meta-oe/recipes-connectivity/gammu/gammu/CVE-2026-138160_1.patch b/meta-oe/recipes-connectivity/gammu/gammu/CVE-2026-138160_1.patch new file mode 100644 index 0000000000..e34517ca78 --- /dev/null +++ b/meta-oe/recipes-connectivity/gammu/gammu/CVE-2026-138160_1.patch @@ -0,0 +1,52 @@ +From cf50057e24f2a5aaff6c18e81c27ed8426df1be4 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= +Date: Fri, 6 Nov 2026 10:21:53 +0100 +Subject: [PATCH] Bound text backup decoding before copying fields + +CVE: CVE-2026-138160 +Upstream-Status: Backport [https://github.com/gammu/gammu/commit/8063e55b23b575ee0dc645ce6e94d8bdade0c0cf] + +Dropped test changes during backport + +Signed-off-by: Ankur Tyagi +--- + libgammu/service/backup/backtext.c | 18 +++++++++++++++++- + 1 file changed, 17 insertions(+), 1 deletion(-) + +diff --git a/libgammu/service/backup/backtext.c b/libgammu/service/backup/backtext.c +index c6096749c..46ac756b4 100644 +--- a/libgammu/service/backup/backtext.c ++++ b/libgammu/service/backup/backtext.c +@@ -238,6 +238,11 @@ static gboolean ReadBackupTextLen(INI_Section *file_info, const char *section, c + EncodeUnicode(paramname,myname,strlen(myname)); + readvalue = INI_GetValue(file_info, section, paramname, UseUnicode); + if (readvalue!=NULL) { ++ /* Decoding cannot increase the number of characters. */ ++ if (UnicodeLength(readvalue + 2) >= sizeof(decodedvalue) / 2) { ++ myvalue[0] = myvalue[1] = 0; ++ return FALSE; ++ } + DecodeUnicodeSpecialChars(decodedvalue, readvalue+2); + if ((UnicodeLength(decodedvalue) + 1) * 2 >= maxlen) { + decodedvalue[maxlen - 1] = 0; +@@ -273,8 +278,19 @@ static gboolean ReadBackupTextLen(INI_Section *file_info, const char *section, c + strcpy(paramname,myname); + readvalue = ReadCFGText(file_info, section, paramname, UseUnicode); + if (readvalue!=NULL) { ++ size_t decoded_length; ++ if (strlen(readvalue + 1) >= sizeof(decodedvalue)) { ++ myvalue[0] = myvalue[1] = 0; ++ return FALSE; ++ } + DecodeSpecialChars(decodedvalue, readvalue + 1); +- EncodeUnicode(myvalue, decodedvalue, strlen(decodedvalue) - 1); ++ decoded_length = strlen(decodedvalue); ++ /* The decoded string includes a closing quote. */ ++ if (decoded_length == 0 || decoded_length - 1 >= maxlen / 2) { ++ myvalue[0] = myvalue[1] = 0; ++ return FALSE; ++ } ++ EncodeUnicode(myvalue, decodedvalue, decoded_length - 1); + } else { + myvalue[0]=0; + myvalue[1]=0; diff --git a/meta-oe/recipes-connectivity/gammu/gammu/CVE-2026-138160_2.patch b/meta-oe/recipes-connectivity/gammu/gammu/CVE-2026-138160_2.patch new file mode 100644 index 0000000000..b0695cb7ba --- /dev/null +++ b/meta-oe/recipes-connectivity/gammu/gammu/CVE-2026-138160_2.patch @@ -0,0 +1,107 @@ +From 99104c8b758c9a130612ba3664298579a3d791ad Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= +Date: Fri, 6 Nov 2026 10:21:53 +0100 +Subject: [PATCH] Bound text backup decoding before copying fields + +CVE: CVE-2026-138160 +Upstream-Status: Backport [https://github.com/gammu/gammu/commit/f224198cc316b590ac0c853aa98cfbcf491a16fe] + +Dropped test changes during backport + +Signed-off-by: Ankur Tyagi +--- + libgammu/service/backup/backtext.c | 56 +++++++++++++++++------------- + 1 file changed, 32 insertions(+), 24 deletions(-) + +diff --git a/libgammu/service/backup/backtext.c b/libgammu/service/backup/backtext.c +index 46ac756b4..e05735343 100644 +--- a/libgammu/service/backup/backtext.c ++++ b/libgammu/service/backup/backtext.c +@@ -231,28 +231,27 @@ static GSM_Error SaveBackupBase64(FILE *file, char *myname, unsigned char *data, + + static gboolean ReadBackupTextLen(INI_Section *file_info, const char *section, const char *myname, char *myvalue, const size_t maxlen, const gboolean UseUnicode) + { +- unsigned char paramname[10000],*readvalue, decodedvalue[10000]; ++ unsigned char paramname[10000], *readvalue, *decodedvalue = NULL, *converted = NULL; ++ size_t source_length, decoded_length, converted_length; + gboolean ret = TRUE; + + if (UseUnicode) { + EncodeUnicode(paramname,myname,strlen(myname)); + readvalue = INI_GetValue(file_info, section, paramname, UseUnicode); + if (readvalue!=NULL) { +- /* Decoding cannot increase the number of characters. */ +- if (UnicodeLength(readvalue + 2) >= sizeof(decodedvalue) / 2) { +- myvalue[0] = myvalue[1] = 0; +- return FALSE; +- } ++ source_length = UnicodeLength(readvalue + 2); ++ if (source_length > ((size_t)-1) / 2 - 1) goto invalid_text; ++ decodedvalue = malloc((source_length + 1) * 2); ++ if (decodedvalue == NULL) goto invalid_text; + DecodeUnicodeSpecialChars(decodedvalue, readvalue+2); +- if ((UnicodeLength(decodedvalue) + 1) * 2 >= maxlen) { +- decodedvalue[maxlen - 1] = 0; +- decodedvalue[maxlen - 2] = 0; +- dbgprintf(NULL, "String too long!\n"); +- ret = FALSE; +- } ++ decoded_length = UnicodeLength(decodedvalue); ++ /* The decoded string still includes the closing quote. */ ++ if (decoded_length == 0 || decoded_length > maxlen / 2) goto invalid_text; ++ decodedvalue[(decoded_length - 1) * 2] = 0; ++ decodedvalue[(decoded_length - 1) * 2 + 1] = 0; + CopyUnicodeString(myvalue, decodedvalue); +- myvalue[UnicodeLength(myvalue)*2-2]=0; +- myvalue[UnicodeLength(myvalue)*2-1]=0; ++ free(decodedvalue); ++ decodedvalue = NULL; + + dbgprintf(NULL, "Cfg read: %s\n",DecodeUnicodeString(readvalue)); + } else { +@@ -278,19 +277,23 @@ static gboolean ReadBackupTextLen(INI_Section *file_info, const char *section, c + strcpy(paramname,myname); + readvalue = ReadCFGText(file_info, section, paramname, UseUnicode); + if (readvalue!=NULL) { +- size_t decoded_length; +- if (strlen(readvalue + 1) >= sizeof(decodedvalue)) { +- myvalue[0] = myvalue[1] = 0; +- return FALSE; +- } ++ source_length = strlen(readvalue + 1); ++ if (source_length == (size_t)-1) goto invalid_text; ++ decodedvalue = malloc(source_length + 1); ++ if (decodedvalue == NULL) goto invalid_text; + DecodeSpecialChars(decodedvalue, readvalue + 1); + decoded_length = strlen(decodedvalue); + /* The decoded string includes a closing quote. */ +- if (decoded_length == 0 || decoded_length - 1 >= maxlen / 2) { +- myvalue[0] = myvalue[1] = 0; +- return FALSE; +- } +- EncodeUnicode(myvalue, decodedvalue, decoded_length - 1); ++ if (decoded_length == 0 || decoded_length > ((size_t)-1) / 2 - 1) goto invalid_text; ++ converted = malloc((decoded_length + 1) * 2); ++ if (converted == NULL) goto invalid_text; ++ EncodeUnicode(converted, decodedvalue, decoded_length - 1); ++ converted_length = UnicodeLength(converted); ++ if (converted_length >= maxlen / 2) goto invalid_text; ++ memcpy(myvalue, converted, (converted_length + 1) * 2); ++ free(decodedvalue); ++ free(converted); ++ decodedvalue = converted = NULL; + } else { + myvalue[0]=0; + myvalue[1]=0; +@@ -299,6 +302,11 @@ static gboolean ReadBackupTextLen(INI_Section *file_info, const char *section, c + } + } + return ret; ++invalid_text: ++ free(decodedvalue); ++ free(converted); ++ myvalue[0] = myvalue[1] = 0; ++ return FALSE; + } + + static GSM_Error SaveVCalDateTime(FILE *file, GSM_DateTime *dt, gboolean UseUnicode) diff --git a/meta-oe/recipes-connectivity/gammu/gammu_1.42.0.bb b/meta-oe/recipes-connectivity/gammu/gammu_1.42.0.bb index 353ee37f46..e8d926b996 100644 --- a/meta-oe/recipes-connectivity/gammu/gammu_1.42.0.bb +++ b/meta-oe/recipes-connectivity/gammu/gammu_1.42.0.bb @@ -8,6 +8,8 @@ SRC_URI = "https://dl.cihar.com/${BPN}/releases/${BP}.tar.xz \ file://gammurc \ file://gammu-smsdrc \ file://0001-allow-build-with-cmake-4.patch \ + file://CVE-2026-138160_1.patch \ + file://CVE-2026-138160_2.patch \ " SRC_URI[sha256sum] = "d8f152314d7e4d3d643610d742845e0a016ce97c234ad4b1151574e1b09651ee"