Skip to content

[autobackport: sssd-2-12] KCM: fix TGT renewal use-after-free and stabilize test - #9018

Open
sssd-bot wants to merge 3 commits into
SSSD:sssd-2-12from
sssd-bot:SSSD-sssd-backport-pr9005-to-sssd-2-12
Open

[autobackport: sssd-2-12] KCM: fix TGT renewal use-after-free and stabilize test#9018
sssd-bot wants to merge 3 commits into
SSSD:sssd-2-12from
sssd-bot:SSSD-sssd-backport-pr9005-to-sssd-2-12

Conversation

@sssd-bot

Copy link
Copy Markdown
Contributor

This is an automatic backport of PR#9005 KCM: fix TGT renewal use-after-free and stabilize test to branch sssd-2-12, created by @danlavu.

Please make sure this backport is correct.

Note

The commits were cherry-picked without conflicts.

You can push changes to this pull request

git remote add sssd-bot git@github.com:sssd-bot/sssd.git
git fetch sssd-bot refs/heads/SSSD-sssd-backport-pr9005-to-sssd-2-12
git checkout SSSD-sssd-backport-pr9005-to-sssd-2-12
git push sssd-bot SSSD-sssd-backport-pr9005-to-sssd-2-12 --force

Original commits
2373a46 - KCM: fix use-after-free of ccache name during TGT renewal
854dcda - KCM: free auth_data on TGT renewal setup failure
3efe248 - tests: widen KCM TGT renewal poll window

Backported commits

  • d152e2f - KCM: fix use-after-free of ccache name during TGT renewal
  • aee2bab - KCM: free auth_data on TGT renewal setup failure
  • 060bcf1 - tests: widen KCM TGT renewal poll window

Original Pull Request Body

  • Fix use-after-free where auth_data->ccname pointed at a short-lived tmp_ctx ccache name freed before the tevent renewal callback (caused flaky renewals against bogus names like KCM:p).
  • Free auth_data on strdup / tevent_create_immediate failure paths.
  • Widen the system test ticket lifetime/poll window now that renewal uses the correct ccache.

Replaces the exploratory work in #8857.

Co-authored-by: Cursor cursoragent@cursor.com
Model used: Cursor Sonnet 5

Dan Lavu added 3 commits July 28, 2026 16:38
auth_data->ccname pointed at cc->name on a short-lived tmp_ctx that is
freed before the tevent immediate renewal callback runs. Copy the name
onto auth_data so krb5_child renews the correct KCM ccache.

Co-authored-by: Cursor <cursoragent@cursor.com>
Model used: Cursor Sonnet 5

Reviewed-by: Alexey Tikhonov <atikhono@redhat.com>
Reviewed-by: Justin Stephenson <jstephen@redhat.com>
(cherry picked from commit 2373a46)
Avoid leaking the partially initialized auth_data when strdup or
tevent_create_immediate fails in kcm_creds_check_times().

Co-authored-by: Cursor <cursoragent@cursor.com>
Model used: Cursor Sonnet 5

Reviewed-by: Alexey Tikhonov <atikhono@redhat.com>
Reviewed-by: Justin Stephenson <jstephen@redhat.com>
(cherry picked from commit 854dcda)
Use a 10s lifetime and 30s renewable life so renew_till stays past
endtime, and poll for half-life plus slack after the UAF fix.

Co-authored-by: Cursor <cursoragent@cursor.com>
Model used: Cursor Sonnet 5

Reviewed-by: Alexey Tikhonov <atikhono@redhat.com>
Reviewed-by: Justin Stephenson <jstephen@redhat.com>
(cherry picked from commit 3efe248)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-backport This should go to target branch only.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants