[Bug 259] New: udp destination causes seg fault when BUILD_WITH_SSL is not defined
https://bugzilla.balabit.com/show_bug.cgi?id=259 Summary: udp destination causes seg fault when BUILD_WITH_SSL is not defined Product: syslog-ng Version: 3.5.x Platform: Other OS/Version: Linux Status: NEW Severity: major Priority: unspecified Component: syslog-ng AssignedTo: bazsi@balabit.hu ReportedBy: htsai@skytap.com Type of the Report: bug Estimated Hours: 0.0 We ran into this bug when compiling 3.5.0rc1 on top of customized OpenWrt. BUILD_WITH_SSL is not defined on our platform. When a udp destination is defined, the start of syslog-ng failed with seg fault. After debugging, we found the bug is that, in afinet_dd_new_instance (afinet-dest.c:509), AFSocketDestDriver->construct_transport is initialized with afinet_dd_construct_transport, which is defined as afsocket_dd_construct_transport (line 158). When afsocket_dd_construct_transport is called to construct the transport (afsocket-dest.c:166), it calls AFSocketDestDriver->construct_transport (afsocket-dest.h:66), which is again afsocket_dd_construct_transport. The two functions call each other endlessly until the stack is exhausted, hence the seg fault. The bug still exists in 3.5.1 and may potentially affect other destinations using afinet. We didn't check other syslog-ng versions. The bug can be fixed by the following patch. Please review and apply the patch. --- a/modules/afsocket/afinet-dest.c +++ b/modules/afsocket/afinet-dest.c @@ -155,7 +155,7 @@ afinet_dd_construct_transport(AFSocketDe #else -#define afinet_dd_construct_transport afsocket_dd_construct_transport +#define afinet_dd_construct_transport afsocket_dd_construct_transport_method #endif -- Configure bugmail: https://bugzilla.balabit.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
https://bugzilla.balabit.com/show_bug.cgi?id=259 Balazs Scheidler <bazsi@balabit.hu> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution| |FIXED Status|NEW |RESOLVED --- Comment #1 from Balazs Scheidler <bazsi@balabit.hu> 2013-11-06 08:51:16 --- thanks a lot for the detailed error report and the proposed fix. I have now integrated this patch to 3.5/master: commit f17b3fd3837e0b5c7dad8ac1cb1cd97f212b7301 Author: Balazs Scheidler <bazsi@balabit.hu> Date: Wed Nov 6 08:48:44 2013 +0100 afsocket: fix segmentation fault in the notls build When SSL is disabled, the construct_transport() virtual method was incorrectly initialized, causing an endless recursion during initialization of any AF_INET destination. This in turn causes a stack exhaustion, which in turn causes a segmentation fault. Thanks to Howard for the detailed bug report and proposed fix. Reported-by: Howard Tsai <htsai@skytap.com> Signed-off-by: Balazs Scheidler <bazsi@balabit.hu> -- Configure bugmail: https://bugzilla.balabit.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
participants (1)
-
bugzilla@bugzilla.balabit.com