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

http input layer: parser realloc fixes (#9970) #9971

Merged
merged 7 commits into from
Feb 20, 2025
Merged

Conversation

edsiper
Copy link
Member

@edsiper edsiper commented Feb 20, 2025

backport of #9970


Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.

niedbalski and others added 7 commits February 20, 2025 13:48
When buffer reallocation occurs in HTTP/1.1 connections, parsed header
references become invalid since they point to locations in the old buffer.
This causes memory corruption and crashes when later accessing those headers.

Add splunk_conn_realloc_and_reparse() function that:
- Performs buffer reallocation
- Resets parser state
- Reinitializes HTTP session and request

This ensures no dangling pointers exist after reallocation, preventing
crashes at the cost of reparsing. A proper fix using offsets instead of
pointers will be implemented in mk_http_parser in a future change.

Fixes #9964

Signed-off-by: Jorge Niedbalski <jnr@metaklass.org>
Signed-off-by: Eduardo Silva <eduardo@chronosphere.io>
Signed-off-by: Eduardo Silva <eduardo@chronosphere.io>
Signed-off-by: Eduardo Silva <eduardo@chronosphere.io>
Signed-off-by: Eduardo Silva <eduardo@chronosphere.io>
Signed-off-by: Eduardo Silva <eduardo@chronosphere.io>
…trics

Signed-off-by: Eduardo Silva <eduardo@chronosphere.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants