Skip to contentSkip to conversation

connman: Backports for security fixes

PATCH New Khem Raj 1 participant 1 message Aug 14, 2022

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH v2 4/8 connman: Backports for security fixes

Fixes
CVE: CVE-2022-32292, CVE-2022-32293

---
v2: Fix the order of patch apply

 .../connman/connman/CVE-2022-32292.patch      |  37 ++++
 .../connman/connman/CVE-2022-32293_p1.patch   | 141 ++++++++++++++
 .../connman/connman/CVE-2022-32293_p2.patch   | 174 ++++++++++++++++++
 .../connman/connman_1.41.bb                   |   3 +
 4 files changed, 355 insertions(+)
 create mode 100644 meta/recipes-connectivity/connman/connman/CVE-2022-32292.patch
 create mode 100644 meta/recipes-connectivity/connman/connman/CVE-2022-32293_p1.patch
 create mode 100644 meta/recipes-connectivity/connman/connman/CVE-2022-32293_p2.patch
meta/recipes-connectivity/connman/connman/CVE-2022-32292.patch new file +37 -0
new file mode 100644
index 00000000000..182c5ca29c2
@@ -0,0 +1,37 @@
+From d1a5ede5d255bde8ef707f8441b997563b9312bd Mon Sep 17 00:00:00 2001
+From: Nathan Crandall <[email protected]>
+Date: Tue, 12 Jul 2022 08:56:34 +0200
+Subject: gweb: Fix OOB write in received_data()
+
+There is a mismatch of handling binary vs. C-string data with memchr
+and strlen, resulting in pos, count, and bytes_read to become out of
+sync and result in a heap overflow.  Instead, do not treat the buffer
+as an ASCII C-string. We calculate the count based on the return value
+of memchr, instead of strlen.
+
+Fixes: CVE-2022-32292
+
+CVE: CVE-2022-32292
+
+Upstream-Status: Backport [https://git.kernel.org/pub/scm/network/connman/connman.git/commit/?id=d1a5ede5d255bde8ef707f8441b997563b9312bd]
+Signed-off-by: Khem Raj <[email protected]>
+---
+ gweb/gweb.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/gweb/gweb.c b/gweb/gweb.c
+index 12fcb1d8..13c6c5f2 100644
+--- a/gweb/gweb.c
++++ b/gweb/gweb.c
+@@ -918,7 +918,7 @@ static gboolean received_data(GIOChannel *channel, GIOCondition cond,
+ 		}
+ 
+ 		*pos = '\0';
+-		count = strlen((char *) ptr);
++		count = pos - ptr;
+ 		if (count > 0 && ptr[count - 1] == '\r') {
+ 			ptr[--count] = '\0';
+ 			bytes_read--;
+-- 
+cgit 
+
meta/recipes-connectivity/connman/connman/CVE-2022-32293_p1.patch new file +141 -0

141 lines not on this page · raw message

meta/recipes-connectivity/connman/connman/CVE-2022-32293_p2.patch new file +174 -0

174 lines not on this page · raw message

meta/recipes-connectivity/connman/connman_1.41.bb +3 -0
index 736b78eaebb..79542b2175d 100644
@@ -5,6 +5,9 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/network/${BPN}/${BP}.tar.xz \
            file://0001-connman.service-stop-systemd-resolved-when-we-use-co.patch \
            file://connman \
            file://no-version-scripts.patch \
+           file://CVE-2022-32293_p1.patch \
+           file://CVE-2022-32293_p2.patch \
+           file://CVE-2022-32292.patch \
            "
 
 SRC_URI:append:libc-musl = " file://0002-resolve-musl-does-not-implement-res_ninit.patch"
Signature · 1 line
2.37.2