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

conf: fix NULL-pointer dereference in CoredumpLoadConfig #2997

Closed
wants to merge 1 commit into from
Closed

conf: fix NULL-pointer dereference in CoredumpLoadConfig #2997

wants to merge 1 commit into from

Conversation

whotwagner
Copy link

An empty value for coredump.max-dump in the config-file leads to a segfault because of a NULL-pointer dereference in CoredumpLoadConfig().

Link to redmine ticket: https://redmine.openinfosecfoundation.org/issues/2276

Describe changes:

  • This change validates dump_size_config. if it is NULL CoredumpLoadConfig will return with an error and a proper error-message.

PRScript output (if applicable):

An empty value for coredump.max-dump in the config-file leads to a segfault because of a NULL-pointer dereference in CoredumpLoadConfig().

Here is a configuration example:

coredump.max-dump: []

This lets suricata crash with a segfault:

ASAN-output:
==9412==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7f22e851aa28 bp 0x7ffd90006fc0 sp 0x7ffd90006740 T0)
    0 0x7f22e851aa27 in strcasecmp (/usr/lib/x86_64-linux-gnu/libasan.so.3+0x51a27)
    1 0x5608a7ec0108 in CoredumpLoadConfig /root/suricata-1/src/util-coredump-config.c:52
    2 0x5608a7e8bb22 in PostConfLoadedSetup /root/suricata-1/src/suricata.c:2752
    3 0x5608a7e8c577 in main /root/suricata-1/src/suricata.c:2892
    4 0x7f22e4c622b0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202b0)
    5 0x5608a7a30c59 in _start (/usr/local/bin/suricata+0xc4c59)

Bug #2276
@whotwagner whotwagner requested a review from a team as a code owner November 19, 2017 14:34
@victorjulien victorjulien mentioned this pull request Nov 20, 2017
@victorjulien
Copy link
Member

Merged in #3001, thanks!

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