Skip to content

Commit

Permalink
SUNRPC: Obscure Kerberos session key
Browse files Browse the repository at this point in the history
ctx->Ksess is never used after import has completed. Obscure it
immediately so it cannot be re-used or copied.

Tested-by: Scott Mayhew <smayhew@redhat.com>
Reviewed-by: Simo Sorce <simo@redhat.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
  • Loading branch information
Chuck Lever committed Feb 20, 2023
1 parent 7f675ca commit 01c4e32
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions net/sunrpc/auth_gss/gss_krb5_mech.c
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,7 @@ gss_import_sec_context_kerberos(const void *p, size_t len,
ret = gss_import_v1_context(p, end, ctx);
else
ret = gss_import_v2_context(p, end, ctx, gfp_mask);
memzero_explicit(&ctx->Ksess, sizeof(ctx->Ksess));
if (ret) {
kfree(ctx);
return ret;
Expand Down

0 comments on commit 01c4e32

Please sign in to comment.