[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#807612: jessie-pu: package rsyslog/8.4.2-1+deb8u2



Am 10.12.2015 um 22:26 schrieb Michael Biebl:
> I'd like to make a stable upload for rsyslog in jessie to fix a bug in
> the imfile module. If more then one file is monitored, rsyslog segfaults
> when using the inotify backend (which is used by default).
> 
> This issue has been fixed upstream and the fixed version is in
> sid/stretch for quite a while.
> 
> In http://bugs.debian.org/770998 I was asked if I can pull this fix for
> stable.
> 
> I cherry-picked the upstream commit and I could confirm that this fixes
> the segfault.
> Complete debdiff is attached.

I'd like to include another fix which prevents segfaults when using
dynafiles. This issue has been raised today in #807908.

That commit has been cherry-picked from upstream and already has seen
wider testing as it's part of 8.12.0 which is in unstable/testing.

Updated (v2) debdiff attached.

Please let me know if you are ok with those changes and if I can proceed
with the upload.


Regards,
Michael



-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?
diff --git a/debian/changelog b/debian/changelog
index 0b01623..4f9c938 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,12 @@
+rsyslog (8.4.2-1+deb8u2) jessie; urgency=medium
+
+  * Fix crash in imfile module when using inotify mode.
+    Patch cherry-picked from upstream Git. (Closes: #770998)
+  * Prevent a segfault in dynafile creation.
+    Patch cherry-picked from upstream Git. (Closes: #807908)
+
+ -- Michael Biebl <biebl@debian.org>  Mon, 14 Dec 2015 13:34:01 +0100
+
 rsyslog (8.4.2-1+deb8u1) jessie; urgency=medium
 
   * Disable transactions in ompgsql as they were not working properly.
diff --git a/debian/patches/0003-bugfix-imfile-segfault-on-startup-in-inotify-mode.patch b/debian/patches/0003-bugfix-imfile-segfault-on-startup-in-inotify-mode.patch
new file mode 100644
index 0000000..baae04b
--- /dev/null
+++ b/debian/patches/0003-bugfix-imfile-segfault-on-startup-in-inotify-mode.patch
@@ -0,0 +1,24 @@
+From: Rainer Gerhards <rgerhards@adiscon.com>
+Date: Thu, 9 Oct 2014 08:22:39 +0200
+Subject: bugfix imfile: segfault on startup in "inotify" mode
+
+A segfault happened when more than one file was monitored.
+
+(cherry-picked from commit 8bf43525fe1bf08fd542ad054c987ccf7c97616c)
+---
+ plugins/imfile/imfile.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/plugins/imfile/imfile.c b/plugins/imfile/imfile.c
+index d37cb03..1dde52f 100644
+--- a/plugins/imfile/imfile.c
++++ b/plugins/imfile/imfile.c
+@@ -1093,7 +1093,7 @@ dirsAddFile(int i)
+ 
+ 	if(dir->currMaxFiles == dir->allocMaxFiles) {
+ 		newMax = 2 * allocMaxFiles;
+-		newFileTab = realloc(dirs, newMax * sizeof(dirInfoFiles_t));
++		newFileTab = realloc(dirs->files, newMax * sizeof(dirInfoFiles_t));
+ 		if(newFileTab == NULL) {
+ 			errmsg.LogError(0, RS_RET_OUT_OF_MEMORY,
+ 					"cannot alloc memory to map directory '%s' file relationship "
diff --git a/debian/patches/0004-Prevent-a-segfault-in-dynafile-creation.patch b/debian/patches/0004-Prevent-a-segfault-in-dynafile-creation.patch
new file mode 100644
index 0000000..2c3efba
--- /dev/null
+++ b/debian/patches/0004-Prevent-a-segfault-in-dynafile-creation.patch
@@ -0,0 +1,26 @@
+From: Tomas Heinrich <theinric@redhat.com>
+Date: Fri, 17 Jul 2015 21:00:23 +0200
+Subject: Prevent a segfault in dynafile creation
+
+A failure during the dynafile creation (in prepareFile(), most of the
+time) led to a misaddressing and a segfault.
+
+(cherry-picked from commit 008f0097b610742595034cdab381749dbc00f93)
+---
+ tools/omfile.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/tools/omfile.c b/tools/omfile.c
+index 39c0173..29089cb 100644
+--- a/tools/omfile.c
++++ b/tools/omfile.c
+@@ -779,7 +779,8 @@ prepareDynFile(instanceData *__restrict__ const pData, const uchar *__restrict__
+ 	DBGPRINTF("Added new entry %d for file cache, file '%s'.\n", iFirstFree, newFileName);
+ 
+ finalize_it:
+-	pCache[pData->iCurrElt]->nInactive = 0;
++	if(iRet == RS_RET_OK)
++		pCache[pData->iCurrElt]->nInactive = 0;
+ 	RETiRet;
+ }
+ 
diff --git a/debian/patches/series b/debian/patches/series
index 8351e07..0be5e5a 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,4 @@
 0001-Don-t-create-a-database.patch
 0002-bugfix-ompgsql-transaction-were-improperly-handled.patch
+0003-bugfix-imfile-segfault-on-startup-in-inotify-mode.patch
+0004-Prevent-a-segfault-in-dynafile-creation.patch

Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: