network(), syslog(): Fixed a potential crash for TLS destinations during reload#418
network(), syslog(): Fixed a potential crash for TLS destinations during reload#418MrAnno merged 14 commits intoaxoflow:mainfrom
network(), syslog(): Fixed a potential crash for TLS destinations during reload#418Conversation
Signed-off-by: Tamás Kosztyu <[email protected]>
fe77161 to
876423b
Compare
Signed-off-by: Tamás Kosztyu <[email protected]>
876423b to
d6e22e8
Compare
Signed-off-by: Tamás Kosztyu <[email protected]>
d6e22e8 to
223da2c
Compare
Signed-off-by: Tamás Kosztyu <[email protected]>
223da2c to
0dea14b
Compare
mitzkia
left a comment
There was a problem hiding this comment.
Thanks a lot for the Light feature update and a new testcase.
I have added some review notes.
...t/functional_tests/destination_drivers/network_destination/test_tls_verifier_reload_crash.py
Outdated
Show resolved
Hide resolved
...t/functional_tests/destination_drivers/network_destination/test_tls_verifier_reload_crash.py
Outdated
Show resolved
Hide resolved
Signed-off-by: Tamás Kosztyu <[email protected]>
0dea14b to
24567d0
Compare
Signed-off-by: Tamás Kosztyu <[email protected]>
24567d0 to
4f3d2fb
Compare
Signed-off-by: Tamás Kosztyu <[email protected]>
4f3d2fb to
fec4647
Compare
Signed-off-by: Tamás Kosztyu <[email protected]>
fec4647 to
0f831f4
Compare
Signed-off-by: László Várady <[email protected]>
Signed-off-by: Tamás Kosztyu <[email protected]> Signed-off-by: László Várady <[email protected]>
Signed-off-by: László Várady <[email protected]>
Signed-off-by: Tamás Kosztyu <[email protected]>
Signed-off-by: Tamás Kosztyu <[email protected]>
Signed-off-by: Tamás Kosztyu <[email protected]> Signed-off-by: László Várady <[email protected]>
Signed-off-by: Tamás Kosztyu <[email protected]>
Signed-off-by: László Várady <[email protected]> Signed-off-by: Tamás Kosztyu <[email protected]>
It is possible to keep TLS connections alive during reload. In that case the LogWriter instance is persisted in cfg persist. This LogWriter's signal slot connector wasn't updated based on the new configuration, which could cause a crash. The signal slot connector is updated, so the newly configured verifier is used, instead of the old one. Signed-off-by: Tamás Kosztyu <[email protected]>
Signed-off-by: Tamás Kosztyu <[email protected]>
Signed-off-by: László Várady <[email protected]>
Signed-off-by: László Várady <[email protected]>
0f831f4 to
23b3c5b
Compare
Signed-off-by: László Várady <[email protected]>
Signed-off-by: László Várady <[email protected]>
23b3c5b to
4648b61
Compare
|
The |
| TLSSession * | ||
| log_tansport_tls_get_session(LogTransport *s) | ||
| { | ||
| g_assert(s->name == TLS_TRANSPORT_NAME); |
There was a problem hiding this comment.
nitpick: I don't think C compilers will always ensure that the pointer value of a literal string expression is always the same. I would have used the address of one of the private methods instead.
There was a problem hiding this comment.
We wanted something that will less likely change if we happen to inherit from the TLS clss.
Using the address of a globally declared const gchar *a = "static" and const gchar a[] = "static" should be safe and consistent in C99.
There was a problem hiding this comment.
Due to the forced merge requirements, I have to "resolve" this comment to merge the PR.
Though I still don't agree with such routine, I'm clicking on "resolve".
bazsi
left a comment
There was a problem hiding this comment.
I only have one nitpick but this can go in without fixing that.
mitzkia
left a comment
There was a problem hiding this comment.
Thanks for the Light part of the update, it is approved from my side.
Fixes syslog-ng/syslog-ng#5018
It is possible to keep TLS connections alive during reload.
In that case the LogWriter instance is persisted in cfg persist.
This LogWriter's signal slot connector wasn't updated based on the new configuration, which could cause a crash.
The signal slot connector is updated, so the newly configured verifier is used, instead of the old one.
Note that the fix in syslog-ng/syslog-ng#5087 has a security issue, as in that PR, the connector's lifetime is extended, but the verifier plugins are deregistered during reload, which silently disables all TLS verifiers without the user knowing.