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

kafka: Fixed segfault issue with auditing and mTLS #23245

Merged

Conversation

michael-redpanda
Copy link
Contributor

The connection_context::start method enqueues the connect_context instance into the list of connections. If connection_context::stop is called before the item is inserted, then a segfault will happen.

Fixes: CORE-7245

Backports Required

  • none - not a bug fix
  • none - this is a backport
  • none - issue does not exist in previous branches
  • none - papercut/not impactful enough to backport
  • v24.2.x
  • v24.1.x
  • v23.3.x

Release Notes

Bug Fixes

  • Fixed a segfault that will occur if mTLS is in use and the auditing client is not configured correctly

@michael-redpanda michael-redpanda requested a review from a team September 9, 2024 20:24
@michael-redpanda michael-redpanda self-assigned this Sep 9, 2024
@michael-redpanda michael-redpanda requested review from aanthony-rp, dotnwat and BenPope and removed request for a team September 9, 2024 20:24
The audit log system requires that at the Redpanda cluster is configured
to use SASL/SCRAM authentication.  This is due to permissions applied to
the audit log topic (only permitting the audit log system to produce to
the audit log topic).  When the internal k/client attempts to connect
the the node and it reports "illegal_sasl_state", the audit system flags
that the audit system is misconfigured. This prevents audit messages
from being enqueued into the audit system and in turn ensures that the
unaudited action is not performed (that's important).

Originally, if the next error message seen is not "illegal_sasl_state"
then the flag is unset.  However, after reconnect the client may see
"broker_not_available" and then "illegal_sasl_state".  This commit
changes the behavior to wait for neither "illegal_sasl_state" nor
"broker_not_available" to be seen before unsetting the flag.

Signed-off-by: Michael Boquard <michael@redpanda.com>
The connection_context::start method enqueues the connect_context
instance into the list of connections.  If connection_context::stop is
called before the item is inserted, then a segfault will happen.

Fixes: CORE-7245

Signed-off-by: Michael Boquard <michael@redpanda.com>
Copy link
Member

@dotnwat dotnwat left a comment

Choose a reason for hiding this comment

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

the segfault fix lgtm. i don't understand the other stuff

Copy link
Contributor

@aanthony-rp aanthony-rp left a comment

Choose a reason for hiding this comment

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

fix looks straight forward. Really like the failure-case tests you wrote.

@dotnwat dotnwat merged commit 8c1f396 into redpanda-data:dev Sep 12, 2024
18 checks passed
@vbotbuildovich
Copy link
Collaborator

/backport v24.2.x

@vbotbuildovich
Copy link
Collaborator

/backport v24.1.x

@vbotbuildovich
Copy link
Collaborator

/backport v23.3.x

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.

4 participants