rsyslog with imgssapi segfaults

This is the place for developers to discuss bugs, new features and everything else about code changes.

Google Ads


rsyslog with imgssapi segfaults

Postby jnansi » Wed Oct 03, 2012 7:21 am

Setup the client to send plain text tcp and the server to capture plain text tcp via the gssapi input module.

Client:
*.* @@syslog.domain.com:514

Server:
$ModLoad imgssapi
$InputGSSServerRun 514
$InputGSSServerPermitPlainTCP on
$InputGSSServerServiceName host

The following messages are logged:
~~~~
9405.056460828:7fb7bce8b700: New connect on NSD 0x7fb7c3bfa230.
9405.065733078:7fb7bce8b700: GSS-API Trying to accept TCP session <hexvalue>
9406.066929379:7fb7bce8b700: Called LogError, msg: GSS-API error reading token data
9406.066966754:7fb7bce8b700: MsgSetTAG in: len 9, pszBuf: rsyslogd:
9406.066975958:7fb7bce8b700: MsgSetTAG exit: pMsg->iLenTAG 9, pMsg->TAG.szBuf: rsyslogd:
rsyslogd: GSS-API error reading token data
9406.066995645:7fb7bce8b700: main Q: entry added, size now log 1, phys 1 entries
9406.067034381:7fb7bce8b700: main Q: EnqueueMsg advised worker start
9406.067073394:7fb7bce8b700: Called LogError, msg: TCP session <hexvalue> will be closed, error ignored

9406.067088702:7fb7bce8b700: MsgSetTAG in: len 9, pszBuf: rsyslogd:
9406.067097652:7fb7bce8b700: MsgSetTAG exit: pMsg->iLenTAG 9, pMsg->TAG.szBuf: rsyslogd:
rsyslogd: TCP session <hexvalue> will be closed, error ignored
~~~~

The following also shows up in the logs:
~~~~
Aug 30 01:42:43 syslog rsyslogd: TCP session <hexvalue> will be closed, error ignored
Aug 30 01:42:43 syslog rsyslogd-2163: epoll_ctl failed on fd 75, id 0/<hexvalue>, op 1 with File exists
: File exists [try http://www.rsyslog.com/e/2163 ]
Aug 30 01:42:54 syslog rsyslogd: GSS-API error reading token data
Aug 30 01:42:54 syslog rsyslogd: TCP session <hexvalue> will be closed, error ignored
Aug 30 01:42:54 syslog rsyslogd-2163: epoll_ctl failed on fd 17, id 0/<hexvalue>, op 1 with File exists
: File exists [try http://www.rsyslog.com/e/2163 ]
~~~~

Then rsyslogd will segfault.

The fix is to put the InputGSSServerRun configuration option at the end of the ModLoad imgssapi section:

$ModLoad imgssapi
$InputGSSServerPermitPlainTCP on
$InputGSSServerServiceName host
$InputGSSServerRun 514

The following patch fixes the issue:
--- rsyslog-5.8.10/tcpsrv.c.orig 2012-10-03 15:24:35.563265715 +1000
+++ rsyslog-5.8.10/tcpsrv.c 2012-10-03 15:24:56.110304081 +1000
@@ -695,7 +695,7 @@ Run(tcpsrv_t *pThis)

if(pUsr == pThis->ppLstn) {
DBGPRINTF("New connect on NSD %p.\n", pThis->ppLstn[i]);
- SessAccept(pThis, pThis->ppLstnPort[i], &pNewSess, pThis->ppLstn[i]);
+ CHKiRet(SessAccept(pThis, pThis->ppLstnPort[i], &pNewSess, pThis->ppLstn[i]));
CHKiRet(nspoll.Ctl(pPoll, pNewSess->pStrm, 0, pNewSess, NSDPOLL_IN, NSDPOLL_ADD));
DBGPRINTF("New session created with NSD %p.\n", pNewSess);
} else {
jnansi
New
 
Posts: 1
Joined: Wed Oct 03, 2012 7:11 am

Urgent Question?

  • Pulling out your Hair?
  • Wasting Time and Money?
  • Deadline Approaching?

Google Ads


Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 0 guests

cron