RT RT/krbdev.mit.edu: Ticket #6972 memory leak in version 1.9.1 Signed in as guest.
[Logout]

[Home] [Search] [Configuration]

[Display] [History] [Basics] [Dates] [People] [Links] [Jumbo]

 
 

 The Basics  
Id
6972
Status
resolved
Worked
0 min
Priority
0/0
Queue
krb5
 

 Keyword Selections  
Component
Tags
Version_reported
Version_Fixed
  • 1.9.2
Target_Version
  • 1.9.2
 

 Relationships  
Depends on:
Depended on by:
Parents:
Children:

Refers to:
Referred to by:
 
 Dates  
Created: Fri Oct 7 17:26:02 2011
Starts: Not set
Started: Fri Oct 7 18:17:07 2011
Last Contact: Tue Oct 18 17:07:31 2011
Due: Not set
Updated: Wed Dec 16 18:02:57 2015 by tlyu
 

 People  
Owner
 ghudson
Requestors
 greg.mcclement@sap.com
Cc
 
AdminCc
 
 

 More about "McClement, Greg"  
Comments about this user:
No comment entered about this user
This user's 25 highest priority tickets:
 

History   Display mode: [Brief headers] [Full headers]
      Fri Oct  7 17:26:02 2011  greg.mcclement@sap.com - Ticket created    
     
From: "McClement, Greg" <greg.mcclement@sap.com>
To: "krb5-bugs@mit.edu" <krb5-bugs@mit.edu>
Date: Fri, 7 Oct 2011 23:24:14 +0200
Subject: memory leak in version 1.9.1

 

     
Memory leak in version 1.9.1. See comments prefixed with "GJM:"

krb5-1.9.1/src/lib/gssapi/krb5/init_sec_context.c#2

#ifdef CFX_EXERCISE
#include "../../krb5/krb/auth_con.h"
#endif
static krb5_error_code KRB5_CALLCONV
make_gss_checksum (krb5_context context, krb5_auth_context auth_context,
                   void *cksum_data, krb5_data **out)
{
    krb5_error_code code;
    krb5_int32 con_flags;
    unsigned char *ptr;
    struct gss_checksum_data *data = cksum_data;

...

        /*
         * RFC 4121 4.1.1 specifies forwarded credentials must be encrypted in
         * the session key, but krb5_fwd_tgt_creds will use the send subkey if
         * it's set in the auth context.  Suppress the send subkey
         * temporarily.
         */
GJM: This refcount on the key is one. This line increases it to two .
        krb5_auth_con_getsendsubkey_k(context, auth_context, &send_subkey);
GJM: This decrements the refcount back to one.
        krb5_auth_con_setsendsubkey_k(context, auth_context, NULL);

        code = krb5_fwd_tgt_creds(context, auth_context, 0,
                                  data->cred->name->princ, data->ctx->there->princ,
                                  data->cred->ccache, 1,
                                  &credmsg);

        /* Turn KRB5_AUTH_CONTEXT_DO_TIME back on and reset the send subkey. */
        krb5_auth_con_setflags(context, auth_context, con_flags);
GJM: This increases the ref count back to two.
        krb5_auth_con_setsendsubkey_k(context, auth_context, send_subkey);
GJM: This is the line that need to be added to fix the leak. This line to puts the
refcount back to one since send_subkey is on the stack and goes out of scope the only
reference left is in the context so the refcount should be one not two
         krb5_k_free_key(context, send_subkey);
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ADD THIS LINE  TO FIX THE LEAK


Thanks
Greg




Download (untitled) 1.8k
     
 
Download (untitled) 4.1k
      Fri Oct  7 18:17:07 2011  ghudson - Given to ghudson    
      Fri Oct  7 18:17:07 2011  ghudson - Target_Version 1.9.2 added    
      Fri Oct  7 18:17:07 2011  ghudson - Status changed from new to review    
      Fri Oct  7 18:17:07 2011  ghudson - Tags pullup added    
      Fri Oct  7 18:17:07 2011  ghudson - Correspondence added    
     
From: ghudson@mit.edu
Subject: SVN Commit


Fix a memory leak in make_gss_checksum.

From greg.mcclement@sap.com.

https://github.com/krb5/krb5/commit/a642f23fe7988a13625e97067d52b92f8ddf9544
Commit By: ghudson
Revision: 25323
Changed Files:
U   trunk/src/lib/gssapi/krb5/init_sec_context.c


Download (untitled) 248b
      Tue Oct 18 17:07:31 2011  tlyu - Status changed from review to resolved    
      Tue Oct 18 17:07:31 2011  tlyu - Version_Fixed 1.9.2 added    
      Tue Oct 18 17:07:31 2011  tlyu - Correspondence added    
     
From: tlyu@mit.edu
Subject: SVN Commit


pull up r25323 from trunk

 ------------------------------------------------------------------------
 r25323 | ghudson | 2011-10-07 18:17:06 -0400 (Fri, 07 Oct 2011) | 8 lines

 ticket: 6972
 target_version: 1.9.2
 tags: pullup

 Fix a memory leak in make_gss_checksum.

 From greg.mcclement@sap.com.

https://github.com/krb5/krb5/commit/7cb42ee751f251797ce0ad809e1eb48483c8e7b7
Commit By: tlyu
Revision: 25383
Changed Files:
U   branches/krb5-1-9/src/lib/gssapi/krb5/init_sec_context.c


Download (untitled) 488b
      Wed Dec 16 18:02:57 2015  tlyu - Keyword pullup deleted