[Bro-Dev] [JIRA] (BIT-1298) IP_Hdr pointer do not propagate from udp to child analyzers via DeliverPacket method causing a segfault

Eric Asselin (JIRA) jira at bro-tracker.atlassian.net
Tue Dec 9 14:07:00 PST 2014


    [ https://bro-tracker.atlassian.net/browse/BIT-1298?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=19203#comment-19203 ] 

Eric Asselin edited comment on BIT-1298 at 12/9/14 4:06 PM:
------------------------------------------------------------

I'm writing a protocol analyzer that use UDP as transport layer, so my analyzer extend "Analyzer" class. In the DeliverPacket method of my analyzer, I need to access the IP address and UDP port. When I try to retrieve the IP address from the "IP_Hdr* ip", it trigger a segmentation fault due to an invalid pointer.

Then I use NTP analyzer, due to its use of UDP and its simplicity, to test the retrieval of an IP address from the "IP_Hdr* ip" in DeliverPacket method but I have the same result. Be sure to parse NTP traffic to trigger the analyzer.




was (Author: easselin):
I'm writing a protocol analyzer that use UDP as transport layer, so my analyzer extend "Analyzer" class. In the DeliverPacket method of my analyzer, I need to access the IP address and UDP port. When I try to retrieve the IP address from the "IP_Hdr* ip", it trigger a segmentation fault due to an invalid pointer.

Then I use NTP analyzer, due to its use of UDP and its simplicity, to test the retrieval of an IP address from the "IP_Hdr* ip" in DeliverPacket method but I have the same result.



> IP_Hdr pointer do not propagate from udp to child analyzers via DeliverPacket method causing a segfault
> -------------------------------------------------------------------------------------------------------
>
>                 Key: BIT-1298
>                 URL: https://bro-tracker.atlassian.net/browse/BIT-1298
>             Project: Bro Issue Tracker
>          Issue Type: Problem
>          Components: Bro
>    Affects Versions: 2.3
>         Environment: Debian
>            Reporter: Eric Asselin
>            Priority: High
>              Labels: analyzer
>         Attachments: core.zip
>
>
> From a child analyzer like NTP, the IP_Hdr pointer in the DeliverPacket method is empty and unusable causing a segmentation fault as soon as you try to access it.
> To recreate the bug, just add an "assert(ip)" inside the DeliverPacket method of a UDP child analyzer and the execution will fail (instead of the segmentation fault).



--
This message was sent by Atlassian JIRA
(v6.4-OD-11-014#64007)


More information about the bro-dev mailing list