summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-extended/rsyslog/rsyslog/0001-pmaixforwardedfrom-bugfix-potential-misadressing.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-oe/recipes-extended/rsyslog/rsyslog/0001-pmaixforwardedfrom-bugfix-potential-misadressing.patch')
-rw-r--r--meta-oe/recipes-extended/rsyslog/rsyslog/0001-pmaixforwardedfrom-bugfix-potential-misadressing.patch43
1 files changed, 43 insertions, 0 deletions
diff --git a/meta-oe/recipes-extended/rsyslog/rsyslog/0001-pmaixforwardedfrom-bugfix-potential-misadressing.patch b/meta-oe/recipes-extended/rsyslog/rsyslog/0001-pmaixforwardedfrom-bugfix-potential-misadressing.patch
new file mode 100644
index 000000000..0b32766a5
--- /dev/null
+++ b/meta-oe/recipes-extended/rsyslog/rsyslog/0001-pmaixforwardedfrom-bugfix-potential-misadressing.patch
@@ -0,0 +1,43 @@
1From 10549ba915556c557b22b3dac7e4cb73ad22d3d8 Mon Sep 17 00:00:00 2001
2From: Rainer Gerhards <rgerhards@adiscon.com>
3Date: Fri, 27 Sep 2019 13:36:02 +0200
4Subject: [PATCH] pmaixforwardedfrom bugfix: potential misadressing
5
6---
7 contrib/pmaixforwardedfrom/pmaixforwardedfrom.c | 9 +++++++++
8 1 file changed, 9 insertions(+)
9
10Upstream-Status: Backport [https://github.com/rsyslog/rsyslog/pull/3884]
11CVE: CVE-2019-17041
12Signed-off-by: Trevor Gamblin <trevor.gamblin@windriver.com>
13
14diff --git a/contrib/pmaixforwardedfrom/pmaixforwardedfrom.c b/contrib/pmaixforwardedfrom/pmaixforwardedfrom.c
15index 37157c7d4..ebf12ebbe 100644
16--- a/contrib/pmaixforwardedfrom/pmaixforwardedfrom.c
17+++ b/contrib/pmaixforwardedfrom/pmaixforwardedfrom.c
18@@ -109,6 +109,10 @@ CODESTARTparse
19 /* bump the message portion up by skipLen(23 or 5) characters to overwrite the "Message forwarded from
20 " or "From " with the hostname */
21 lenMsg -=skipLen;
22+ if(lenMsg < 2) {
23+ dbgprintf("not a AIX message forwarded from message has nothing after header\n");
24+ ABORT_FINALIZE(RS_RET_COULD_NOT_PARSE);
25+ }
26 memmove(p2parse, p2parse + skipLen, lenMsg);
27 *(p2parse + lenMsg) = '\n';
28 *(p2parse + lenMsg + 1) = '\0';
29@@ -120,6 +124,11 @@ really an AIX log, but has a similar preamble */
30 --lenMsg;
31 ++p2parse;
32 }
33+ if (lenMsg < 1) {
34+ dbgprintf("not a AIX message forwarded from message has nothing after colon "
35+ "or no colon at all\n");
36+ ABORT_FINALIZE(RS_RET_COULD_NOT_PARSE);
37+ }
38 if (lenMsg && *p2parse != ':') {
39 DBGPRINTF("not a AIX message forwarded from mangled log but similar enough that the preamble has "
40 "been removed\n");
41--
422.17.1
43