Skip to content

KCM: fix use-after-free in kcm_read_options()#8592

Merged
alexey-tikhonov merged 1 commit into
SSSD:masterfrom
alexey-tikhonov:kcm-init
Apr 13, 2026
Merged

KCM: fix use-after-free in kcm_read_options()#8592
alexey-tikhonov merged 1 commit into
SSSD:masterfrom
alexey-tikhonov:kcm-init

Conversation

@alexey-tikhonov

Copy link
Copy Markdown
Member

The renew_intv string was allocated under tmp_ctx but not re-linked to mem_ctx before tmp_ctx was freed.

Assisted-By: Claude Code (Opus 4.6)

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2457467

@alexey-tikhonov alexey-tikhonov added backport-to-sssd-2-9 Trivial A single reviewer is sufficient to review the Pull Request labels Apr 13, 2026

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request updates the kcm_read_options function in src/responder/kcm/kcm_renew.c to use talloc_steal when assigning the renewal interval. This ensures that the memory ownership of renew_intv is correctly transferred to the provided memory context, preventing potential memory management issues. I have no feedback to provide.

@sumit-bose sumit-bose left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hi,

thank you for the fix, ACK.

bye,
Sumit

The `renew_intv` string was allocated under tmp_ctx but not re-linked
to mem_ctx before tmp_ctx was freed.

Assisted-By: Claude Code (Opus 4.6)
Reviewed-by: Sumit Bose <[email protected]>
@sssd-bot

Copy link
Copy Markdown
Contributor

The pull request was accepted by @alexey-tikhonov with the following PR CI status:


🟢 CodeQL (success)
🟢 osh-diff-scan:fedora-rawhide-x86_64:upstream (success)
🟢 rpm-build:centos-stream-10-x86_64:upstream (success)
🟢 rpm-build:fedora-42-x86_64:upstream (success)
🟢 rpm-build:fedora-43-x86_64:upstream (success)
🟢 rpm-build:fedora-44-x86_64:upstream (success)
🟢 rpm-build:fedora-rawhide-x86_64:upstream (success)
🟢 Analyze (target) / cppcheck (success)
🟢 Build / freebsd (success)
🟢 Build / make-distcheck (success)
🟢 ci / intgcheck (centos-10) (success)
🟢 ci / intgcheck (fedora-42) (success)
🟢 ci / intgcheck (fedora-43) (success)
🟢 ci / intgcheck (fedora-44) (success)
🟢 ci / intgcheck (fedora-45) (success)
🟢 ci / prepare (success)
🟢 ci / system (centos-10) (success)
🟢 ci / system (fedora-42) (success)
🟢 ci / system (fedora-43) (success)
🟢 ci / system (fedora-44) (success)
🟢 ci / system (fedora-45) (success)
➖ Coverity scan / coverity (skipped)
🟢 Static code analysis / codeql (success)
🟢 Static code analysis / pre-commit (success)
🟢 Static code analysis / python-system-tests (success)


There are unsuccessful or unfinished checks. Make sure that the failures are not related to this pull request before merging.

@alexey-tikhonov
alexey-tikhonov merged commit 0100b1c into SSSD:master Apr 13, 2026
16 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Accepted backport-to-sssd-2-9 Trivial A single reviewer is sufficient to review the Pull Request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants