Skip to contentSkip to conversation

rsyslog: fix CVE-2019-17040

PATCH New Trevor Gamblin 1 participant 1 message Oct 11, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rsyslog: fix CVE-2019-17040

From: Trevor Gamblin <[email protected]>

Backport CVE-2019-17040 fix to zeus.

---
 .../rsyslog/0001-Out-of-bounds-issue.patch    | 31 +++++++++++++++++++
 .../rsyslog/rsyslog_8.1908.0.bb               |  1 +
 2 files changed, 32 insertions(+)
 create mode 100644 meta-oe/recipes-extended/rsyslog/rsyslog/0001-Out-of-bounds-issue.patch
meta-oe/recipes-extended/rsyslog/rsyslog/0001-Out-of-bounds-issue.patch new file +31 -0
new file mode 100644
index 000000000..b494ca687
@@ -0,0 +1,31 @@
+From b0894088b680666035a3418326e13bc99d4fed49 Mon Sep 17 00:00:00 2001
+From: Philippe Duveau <[email protected]>
+Date: Tue, 24 Sep 2019 20:45:25 +0200
+Subject: [PATCH] Out of bounds issue
+
+Add a new sanity check after determining the level len.
+---
+ contrib/pmdb2diag/pmdb2diag.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+Upstream-Status: Backport [https://github.com/rsyslog/rsyslog/commit/b0894088b6]
+CVE: CVE-2019-17040
+Signed-off-by: Trevor Gamblin <[email protected]>
+diff --git a/contrib/pmdb2diag/pmdb2diag.c b/contrib/pmdb2diag/pmdb2diag.c
+index 2b5916301..5810eb4df 100644
+--- a/contrib/pmdb2diag/pmdb2diag.c
++++ b/contrib/pmdb2diag/pmdb2diag.c
+@@ -134,6 +134,10 @@ CODESTARTparse2
+ 		ABORT_FINALIZE(0);
+ 	}
+ 
++	/* let recheck with the real level len */
++	if(pMsg->iLenRawMsg - (int)pMsg->offAfterPRI < pInst->levelpos+lvl_len)
++		ABORT_FINALIZE(RS_RET_COULD_NOT_PARSE);
++
+ 	DBGPRINTF("db2parse Level %d\n", pMsg->iSeverity);
+ 
+ 	end = (char*)pMsg->pszRawMsg + pMsg->iLenRawMsg ;
+-- 
+2.17.1
+
meta-oe/recipes-extended/rsyslog/rsyslog_8.1908.0.bb +1 -0
index bbb4b119a..bd0dbc1a2 100644
@@ -23,6 +23,7 @@ SRC_URI = "http://www.rsyslog.com/download/files/download/rsyslog/${BPN}-${PV}.t
            file://rsyslog.logrotate \
            file://use-pkgconfig-to-check-libgcrypt.patch \
            file://run-ptest \
+           file://0001-Out-of-bounds-issue.patch \
 "
 
 SRC_URI_append_libc-musl = " \
Signature · 1 line
2.18.1