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

network(), syslog(): Fixed a potential crash for TLS destinations during reload #418

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

sodomelle
Copy link
Contributor

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.

sodomelle added a commit to sodomelle/axosyslog that referenced this pull request Dec 16, 2024
Signed-off-by: Tamás Kosztyu <tamas.kosztyu@axoflow.com>
@sodomelle sodomelle force-pushed the tls-destination-crash branch from fe77161 to 876423b Compare December 16, 2024 08:45
sodomelle added a commit to sodomelle/axosyslog that referenced this pull request Dec 16, 2024
Signed-off-by: Tamás Kosztyu <tamas.kosztyu@axoflow.com>
@sodomelle sodomelle force-pushed the tls-destination-crash branch from 876423b to d6e22e8 Compare December 16, 2024 08:47
sodomelle added a commit to sodomelle/axosyslog that referenced this pull request Dec 16, 2024
Signed-off-by: Tamás Kosztyu <tamas.kosztyu@axoflow.com>
@sodomelle sodomelle force-pushed the tls-destination-crash branch from d6e22e8 to 223da2c Compare December 16, 2024 09:00
sodomelle added a commit to sodomelle/axosyslog that referenced this pull request Dec 16, 2024
Signed-off-by: Tamás Kosztyu <tamas.kosztyu@axoflow.com>
@sodomelle sodomelle force-pushed the tls-destination-crash branch from 223da2c to 0dea14b Compare December 16, 2024 09:08
Copy link
Contributor

@mitzkia mitzkia left a comment

Choose a reason for hiding this comment

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

Thanks a lot for the Light feature update and a new testcase.
I have added some review notes.

sodomelle added a commit to sodomelle/axosyslog that referenced this pull request Dec 16, 2024
Signed-off-by: Tamás Kosztyu <tamas.kosztyu@axoflow.com>
@sodomelle sodomelle force-pushed the tls-destination-crash branch from 0dea14b to 24567d0 Compare December 16, 2024 11:24
sodomelle added a commit to sodomelle/axosyslog that referenced this pull request Dec 16, 2024
Signed-off-by: Tamás Kosztyu <tamas.kosztyu@axoflow.com>
@sodomelle sodomelle force-pushed the tls-destination-crash branch from 24567d0 to 4f3d2fb Compare December 16, 2024 15:43
@sodomelle sodomelle requested a review from mitzkia December 16, 2024 15:43
MrAnno and others added 9 commits December 16, 2024 17:12
Signed-off-by: László Várady <laszlo.varady@axoflow.com>
Signed-off-by: Tamás Kosztyu <tamas.kosztyu@axoflow.com>
Signed-off-by: László Várady <laszlo.varady@axoflow.com>
Signed-off-by: Tamás Kosztyu <tamas.kosztyu@axoflow.com>
Signed-off-by: Tamás Kosztyu <tamas.kosztyu@axoflow.com>
Signed-off-by: Tamás Kosztyu <tamas.kosztyu@axoflow.com>
Signed-off-by: Tamás Kosztyu <tamas.kosztyu@axoflow.com>
Signed-off-by: Tamás Kosztyu <tamas.kosztyu@axoflow.com>
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 <tamas.kosztyu@axoflow.com>
Signed-off-by: Tamás Kosztyu <tamas.kosztyu@axoflow.com>
@sodomelle sodomelle force-pushed the tls-destination-crash branch from 4f3d2fb to fec4647 Compare December 16, 2024 16:12
@@ -237,6 +237,14 @@ log_transport_tls_write_method(LogTransport *s, const gpointer buf, gsize buflen
return -1;
}

TLSSession *
Copy link
Member

Choose a reason for hiding this comment

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

We should add the very least add an assertion to check if this is indeed a logtransporttls instance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Syslog-ng Service crashes in g_hash_table_lookup function after syslog-ng-ctl reload
4 participants