From 5fc9a11f4c8b485721976a69fea812544410ee77 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Sep 29 2020 06:56:21 +0000 Subject: import rsyslog-8.24.0-55.el7 --- diff --git a/SOURCES/rsyslog-8.24.0-rhbz1763746-file-id.patch b/SOURCES/rsyslog-8.24.0-rhbz1763746-file-id.patch index 2238bfc..484d7e7 100644 --- a/SOURCES/rsyslog-8.24.0-rhbz1763746-file-id.patch +++ b/SOURCES/rsyslog-8.24.0-rhbz1763746-file-id.patch @@ -97,7 +97,7 @@ index 4bc6078bda..14f4f1f495 100644 + if(fd < 0) { + if (is_file) { LogMsg(errno, RS_RET_ERR, LOG_WARNING, "imfile: error accessing file '%s'", name); + } else { DBGPRINTF("imfile: error accessing file '%s'", name); } -+ FINALIZE; ++ ABORT_FINALIZE(RS_RET_NO_FILE_ACCESS); + } DBGPRINTF("add new active object '%s' in '%s'\n", name, edge->path); CHKmalloc(act = calloc(sizeof(act_obj_t), 1)); diff --git a/SOURCES/rsyslog-8.24.0-rhbz1778841-serialize-crash-race.patch b/SOURCES/rsyslog-8.24.0-rhbz1778841-serialize-crash-race.patch new file mode 100644 index 0000000..b917c03 --- /dev/null +++ b/SOURCES/rsyslog-8.24.0-rhbz1778841-serialize-crash-race.patch @@ -0,0 +1,33 @@ +From: Jiri Vymazal +Date: Wed, 18 Dec 2019 09:48:15 +0100 +Subject: [PATCH] Fix race condition related to libfastjson when using DA queue + +Rsyslogd aborts when writing to disk queue from multiple workers simultaneously. +It is assumed that libfastjson is not thread-safe. +Resolve libfastjson race condition when writing to disk queue. + +see also https://github.com/rsyslog/rsyslog/issues/4099 +--- + runtime/msg.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/runtime/msg.c b/runtime/msg.c +index b5c17cfdd4..f9da40005f 100644 +--- a/runtime/msg.c ++++ b/runtime/msg.c +@@ -1211,11 +1211,15 @@ static rsRetVal MsgSerialize(smsg_t *pThis, strm_t *pStrm) + psz = pThis->pszStrucData; + CHKiRet(obj.SerializeProp(pStrm, UCHAR_CONSTANT("pszStrucData"), PROPTYPE_PSZ, (void*) psz)); + if(pThis->json != NULL) { ++ MsgLock(pThis); + psz = (uchar*) json_object_get_string(pThis->json); ++ MsgUnlock(pThis); + CHKiRet(obj.SerializeProp(pStrm, UCHAR_CONSTANT("json"), PROPTYPE_PSZ, (void*) psz)); + } + if(pThis->localvars != NULL) { ++ MsgLock(pThis); + psz = (uchar*) json_object_get_string(pThis->localvars); ++ MsgUnlock(pThis); + CHKiRet(obj.SerializeProp(pStrm, UCHAR_CONSTANT("localvars"), PROPTYPE_PSZ, (void*) psz)); + } + diff --git a/SOURCES/rsyslog-8.24.0-rhbz1806493-imfile-file_id.patch b/SOURCES/rsyslog-8.24.0-rhbz1806493-imfile-file_id.patch new file mode 100644 index 0000000..b972d02 --- /dev/null +++ b/SOURCES/rsyslog-8.24.0-rhbz1806493-imfile-file_id.patch @@ -0,0 +1,37 @@ +From 0c69ec76d8cac47bcfa78abae86229ad63c92b0b Mon Sep 17 00:00:00 2001 +From: Jiri Vymazal +Date: Tue, 21 Jan 2020 13:58:14 +0100 +Subject: [PATCH] Fixed saving of old file_id for statefiles + +Previously we saved old file_id unconditionally, which led to not +deleting old statefiles if files changes without rsyslog running. +Now it should work correctly. +--- + plugins/imfile/imfile.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/plugins/imfile/imfile.c b/plugins/imfile/imfile.c +index 908bb5901c..5ad44f6c59 100644 +--- a/plugins/imfile/imfile.c ++++ b/plugins/imfile/imfile.c +@@ -1258,8 +1258,8 @@ get_file_id_hash(const char *data, size_t lendata, + */ + static void getFileID(act_obj_t *const act) + { +- /* save the old id for cleaning purposes */ +- strncpy(act->file_id_prev, (const char*)act->file_id, FILE_ID_HASH_SIZE); ++ char tmp_id[FILE_ID_HASH_SIZE]; ++ strncpy(tmp_id, (const char*)act->file_id, FILE_ID_HASH_SIZE); + act->file_id[0] = '\0'; + assert(act->fd >= 0); /* fd must have been opened at act_obj_t creation! */ + char filedata[FILE_ID_SIZE]; +@@ -1270,6 +1270,9 @@ getFileID(act_obj_t *const act) + } else { + DBGPRINTF("getFileID partial or error read, ret %d\n", r); + } ++ if (strncmp(tmp_id, act->file_id, FILE_ID_HASH_SIZE)) {/* save the old id for cleaning purposes */ ++ strncpy(act->file_id_prev, tmp_id, FILE_ID_HASH_SIZE); ++ } + DBGPRINTF("getFileID for '%s', file_id_hash '%s'\n", act->name, act->file_id); + } + diff --git a/SPECS/rsyslog.spec b/SPECS/rsyslog.spec index efa6efd..28aaa22 100644 --- a/SPECS/rsyslog.spec +++ b/SPECS/rsyslog.spec @@ -14,7 +14,7 @@ Summary: Enhanced system logging and kernel message trapping daemon Name: rsyslog Version: 8.24.0 -Release: 52%{?dist}.2 +Release: 55%{?dist} License: (GPLv3+ and ASL 2.0) Group: System Environment/Daemons URL: http://www.rsyslog.com/ @@ -128,6 +128,9 @@ Patch64: rsyslog-8.24.0-rhbz1768323-pmcisco-CVE.patch Patch65: rsyslog-8.24.0-rhbz1763746-file-id.patch Patch66: rsyslog-8.24.0-rhbz1600171-omelastic-ES6.patch +Patch67: rsyslog-8.24.0-rhbz1806493-imfile-file_id.patch +Patch68: rsyslog-8.24.0-rhbz1778841-serialize-crash-race.patch + %package crypto Summary: Encryption support Group: System Environment/Daemons @@ -447,6 +450,9 @@ mv build doc %patch65 -p1 -b .file-id %patch66 -p1 -b .omelastic-ES6 +%patch67 -p1 -b .file-id_2 +%patch68 -p1 -b .serialize_race + autoreconf %build @@ -705,10 +711,22 @@ done %{_libdir}/rsyslog/mmkubernetes.so %changelog -* Mon May 18 2020 Jiri Vymazal - 8.24.0-52.2 -RHEL 7.8.z ERRATUM +* Tue Jun 09 2020 Jiri Vymazal - 8.24.0-55 +RHEL 7.9 ERRATUM +- edited imfile file-id patch to not segfault on selinux block + resolves: rhbz#1843992 + +* Wed May 13 2020 Jiri Vymazal - 8.24.0-54 +RHEL 7.9 ERRATUM - edited cert chains patch to not cause memory leaks - resolves: rhbz#1836172 + resolves: rhbz#1832087 + +* Thu Mar 26 2020 Jiri Vymazal - 8.24.0-53 +RHEL 7.9 ERRATUM +- one more fix for file ID patch to extend to offline behavior + resolves: rhbz#1806493 +- added patch resoving race in serialization resulting in crash + resolves: rhbz#1778841 * Wed Nov 27 2019 Jiri Vymazal - 8.24.0-52 RHEL 7.8 ERRATUM