Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stack overflow in parse_ip4 resulting in segfault #121

Open
geeknik opened this issue Dec 23, 2020 · 1 comment
Open

Stack overflow in parse_ip4 resulting in segfault #121

geeknik opened this issue Dec 23, 2020 · 1 comment

Comments

@geeknik
Copy link

geeknik commented Dec 23, 2020

Hi, with passivedns built from commit 3f387d, we can trigger a segfault with a stack overflow in the parse_ip4 routine.

$ ./passivedns -r stack_overflow_parse_ip4.pcap

[*] PassiveDNS 1.2.1
[*] By Edward Bjarte Fjellskål <edward.fjellskaal@gmail.com>
[*] Using libpcap version 1.9.1 (with TPACKET_V3)
[*] Using ldns version 1.7.0
[*] Reading from file stack_overflow_parse_ip4.pcap

UndefinedBehaviorSanitizer:DEADLYSIGNAL
==522174==ERROR: UndefinedBehaviorSanitizer: stack-overflow on address 0x7ffd825caf98 (pc 0x000000426bcc bp 0x7ffd825cb0d0 sp 0x7ffd825cafa0 T522174)
    #0 0x426bcc in parse_ip4 (/root/passivedns/src/passivedns+0x426bcc)
    #1 0x426e5c in parse_ip4 (/root/passivedns/src/passivedns+0x426e5c)
    #2 0x426e5c in parse_ip4 (/root/passivedns/src/passivedns+0x426e5c)
    #3 0x426e5c in parse_ip4 (/root/passivedns/src/passivedns+0x426e5c)
    #4 0x426e5c in parse_ip4 (/root/passivedns/src/passivedns+0x426e5c)
    #5 0x426e5c in parse_ip4 (/root/passivedns/src/passivedns+0x426e5c)
    **SNIP**
    #245 0x426e5c in parse_ip4 (/root/passivedns/src/passivedns+0x426e5c)
    #246 0x426e5c in parse_ip4 (/root/passivedns/src/passivedns+0x426e5c)
    #247 0x426e5c in parse_ip4 (/root/passivedns/src/passivedns+0x426e5c)
    #248 0x426e5c in parse_ip4 (/root/passivedns/src/passivedns+0x426e5c)
    #249 0x426e5c in parse_ip4 (/root/passivedns/src/passivedns+0x426e5c)
    #250 0x426e5c in parse_ip4 (/root/passivedns/src/passivedns+0x426e5c)

SUMMARY: UndefinedBehaviorSanitizer: stack-overflow (/root/passivedns/src/passivedns+0x426bcc) in parse_ip4
==522174==ABORTING
@gamelinux
Copy link
Owner

Can you share the pcap?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants