Commit d08f805
committed
upstream: Move clearing TLS session from prepare phase to destroy phase
This is because lifecycle of TLS is not synchronized with the current
implementation.
Somewhere, we observed:
Our observation “TLS is freed too early in the upstream prepare-destroy phase
→ UAF risk” case is existing in the current code base.
So, even with Keepalive enabled, our Fluent Bit code base shows multiple conditions where
the TLS session is freed during the “prepare destroy” step,
which can race with async I/O and cause a use-after-free in ssl_write_internal.
Moving TLS freeing to the final destroy_conn() phase mitigates this.
Signed-off-by: Hiroshi Hatake <[email protected]>1 parent ba96208 commit d08f805
1 file changed
+9
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
515 | 515 | | |
516 | 516 | | |
517 | 517 | | |
518 | | - | |
519 | | - | |
520 | | - | |
521 | | - | |
522 | | - | |
523 | | - | |
524 | | - | |
525 | 518 | | |
526 | 519 | | |
527 | 520 | | |
| |||
572 | 565 | | |
573 | 566 | | |
574 | 567 | | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
575 | 577 | | |
576 | 578 | | |
577 | 579 | | |
| |||
0 commit comments