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

in_http: reassign mk_http_request values on realloc. #8643

Merged
merged 1 commit into from
Apr 11, 2024

Conversation

pwhelan
Copy link
Contributor

@pwhelan pwhelan commented Mar 27, 2024

Summary

Reassign pointers in mk_http_request when the request buffer is reallocated. If this is not done a crash occurs when in_http attempts to check header values or the uri.


Enter [N/A] in the box, if an item is not applicable to your change.

Testing
Before we can approve your change; please submit the following in a comment:

  • Example configuration file for the change
  • Debug log output from testing the change
  • Attached Valgrind output that shows no leaks or memory corruption was found

If this is a change to packaging of containers or native binaries then please confirm it works for all targets.

  • Run local packaging test showing all targets (including any new ones) build.
  • Set ok-package-test label to test for all targets (requires maintainer to do).

Documentation

  • Documentation required for this feature

Backporting

  • Backport to latest stable release.

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.

reassign pointers in mk_http_request when the request
buffer is reallocated.

Signed-off-by: Phillip Whelan <phil@calyptia.com>
@pwhelan
Copy link
Contributor Author

pwhelan commented Mar 29, 2024

Preempted and replaced by #8649.

@pwhelan pwhelan closed this Mar 29, 2024
@pwhelan pwhelan deleted the pwhelan-in_http-realloc-header-fix branch March 29, 2024 17:48
@pwhelan pwhelan restored the pwhelan-in_http-realloc-header-fix branch April 2, 2024 20:45
@pwhelan
Copy link
Contributor Author

pwhelan commented Apr 2, 2024

Reopening this PR to fix the legacy support for in_http, per @leonardo-albertovich.

@edsiper
Copy link
Member

edsiper commented Apr 9, 2024

@pwhelan is it safe to assume this is not longer needed ?

@pwhelan
Copy link
Contributor Author

pwhelan commented Apr 9, 2024

@pwhelan is it safe to assume this is not longer needed ?

it is still required since @leonardo-albertovich's fix only handled the new http2 based code and this fixes the legacy code (used when -i http -p http2=off is set.

@edsiper edsiper added this to the Fluent Bit v3.0.2 milestone Apr 11, 2024
@edsiper edsiper self-assigned this Apr 11, 2024
@pwhelan
Copy link
Contributor Author

pwhelan commented Apr 11, 2024

I just tested with valgrind and it seems to still be good.
valgrind.log

@edsiper edsiper merged commit c97f418 into master Apr 11, 2024
87 of 89 checks passed
@edsiper edsiper deleted the pwhelan-in_http-realloc-header-fix branch April 11, 2024 16:40
@edsiper
Copy link
Member

edsiper commented Apr 11, 2024

thank you !

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