Skip to content

connections: downstream: harden listener and architecture [Backport to 4.2] - #12054

Closed
cosmo0920 wants to merge 2 commits into
4.2from
harden-connections-4.2
Closed

connections: downstream: harden listener and architecture [Backport to 4.2]#12054
cosmo0920 wants to merge 2 commits into
4.2from
harden-connections-4.2

Conversation

@cosmo0920

Copy link
Copy Markdown
Contributor

This PR is only backporting connections and downstream hardening from #11742 due to plugging lack of notification mechanism for a deletion of connections.


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.

edsiper added 2 commits July 6, 2026 13:56
Signed-off-by: Eduardo Silva <eduardo@chronosphere.io>
Signed-off-by: Eduardo Silva <eduardo@chronosphere.io>
@cosmo0920
cosmo0920 requested a review from edsiper as a code owner July 6, 2026 05:01
@cosmo0920 cosmo0920 added this to the v4.2.7 milestone Jul 6, 2026
@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ff95bcad-2485-48aa-9d9c-18aa91944678

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch harden-connections-4.2

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 00eadc57f4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/flb_downstream.c
Comment on lines +212 to +214
if (connection->drop_notification_callback != NULL) {
connection->drop_notification_callback(connection);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Wire the drop callback for downstream owners

This call does not currently notify any owner because the new field is never assigned anywhere in the tree (rg "drop_notification_callback\\s*=" finds no setters). In the HTTP server path, sessions still retain session->connection/connection->user_data when the connection is attached (src/http_server/flb_http_server.c:275-281), and later unconditionally release that pointer during session destroy (src/http_server/flb_http_server.c:512-513); if flb_downstream_conn_timeouts() drops the downstream connection first (src/flb_downstream.c:515-516), the session is left with a stale connection pointer. Please register the callback where downstream sessions are attached, or the added notification mechanism will not prevent the timeout/use-after-free case it is meant to handle.

Useful? React with 👍 / 👎.

@cosmo0920 cosmo0920 changed the title connections: downstream: harden listener and architecture connections: downstream: harden listener and architecture [Backport to 4.2] Jul 6, 2026
@cosmo0920 cosmo0920 closed this Jul 7, 2026
@cosmo0920 cosmo0920 removed this from the v4.2.7 milestone Jul 7, 2026
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