summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2012-08-01 10:14:37 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2012-08-01 10:14:37 +0200
commit4d01df57c2f378ceda3bcc400a9df5e50a0c007b (patch)
tree777c3c2827d7468f31594cc0d5fdff965e22463d
parent617a7aaa1dc4569e6c151a14889bffe808f984c5 (diff)
downloadrsyslog-4d01df57c2f378ceda3bcc400a9df5e50a0c007b.zip
rsyslog-4d01df57c2f378ceda3bcc400a9df5e50a0c007b.tar.gz
rsyslog-4d01df57c2f378ceda3bcc400a9df5e50a0c007b.tar.xz
bugfix: potential abort if output plugin logged message during shutdown
note that none of the rsyslog-provided plugins does this Thanks to bodik and Rohit Prasad for alerting us on this bug and analyzing it. fixes: http://bugzilla.adiscon.com/show_bug.cgi?id=347
-rw-r--r--ChangeLog13
-rw-r--r--tools/syslogd.c22
2 files changed, 28 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index a081893..eb8230d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -8,10 +8,15 @@ Version 5.8.13 [V5-stable] 2012-06-??
- bugfix: randomized IP option header in omudpspoof caused problems
closes: http://bugzilla.adiscon.com/show_bug.cgi?id=327
Thanks to Rick Brown for helping to test out the patch.
-- bugfix: DA queue fixed handling of bad queue files. If old queue files
- existed, they were not truncated when being reused. this could lead to
- extra data being read from them and in consequence data format errors,
- which could cause trouble to the queue handler.
+- bugfix: DA queue fixed handling of bad queue files
+ If old queue files existed, they were not truncated when being reused.
+ This could lead to extra data being read from them and in consequence
+ data format errors, which could cause trouble to the queue handler.
+- bugfix: potential abort if output plugin logged message during shutdown
+ note that none of the rsyslog-provided plugins does this
+ Thanks to bodik and Rohit Prasad for alerting us on this bug and
+ analyzing it.
+ fixes: http://bugzilla.adiscon.com/show_bug.cgi?id=347
---------------------------------------------------------------------------
Version 5.8.12 [V5-stable] 2012-06-06
- add small delay (50ms) after sending shutdown message
diff --git a/tools/syslogd.c b/tools/syslogd.c
index cbbb66b..8fc1d1e 100644
--- a/tools/syslogd.c
+++ b/tools/syslogd.c
@@ -725,11 +725,19 @@ submitMsg(msg_t *pMsg)
ISOBJ_TYPE_assert(pMsg, msg);
pRuleset = MsgGetRuleset(pMsg);
-
pQueue = (pRuleset == NULL) ? pMsgQueue : ruleset.GetRulesetQueue(pRuleset);
+
+ /* if a plugin logs a message during shutdown, the queue may no longer exist */
+ if(pQueue == NULL) {
+ DBGPRINTF("submitMsg() could not submit message - "
+ "queue does (no longer?) exist - ignored\n");
+ FINALIZE;
+ }
+
MsgPrepareEnqueue(pMsg);
qqueueEnqObj(pQueue, pMsg->flowCtlType, (void*) pMsg);
+finalize_it:
RETiRet;
}
@@ -750,12 +758,20 @@ multiSubmitMsg(multi_submit_t *pMultiSub)
if(pMultiSub->nElem == 0)
FINALIZE;
+ pRuleset = MsgGetRuleset(pMultiSub->ppMsgs[0]);
+ pQueue = (pRuleset == NULL) ? pMsgQueue : ruleset.GetRulesetQueue(pRuleset);
+
+ /* if a plugin logs a message during shutdown, the queue may no longer exist */
+ if(pQueue == NULL) {
+ DBGPRINTF("multiSubmitMsg() could not submit message - "
+ "queue does (no longer?) exist - ignored\n");
+ FINALIZE;
+ }
+
for(i = 0 ; i < pMultiSub->nElem ; ++i) {
MsgPrepareEnqueue(pMultiSub->ppMsgs[i]);
}
- pRuleset = MsgGetRuleset(pMultiSub->ppMsgs[0]);
- pQueue = (pRuleset == NULL) ? pMsgQueue : ruleset.GetRulesetQueue(pRuleset);
iRet = pQueue->MultiEnq(pQueue, pMultiSub);
pMultiSub->nElem = 0;