From kerberos-acl@MIT.EDU Thu Oct 7 09:58:19 1999
Received: from MIT.EDU (SOUTH-STATION-ANNEX.MIT.EDU [18.72.1.2]) by rt-11.MIT.EDU (8.7.5/8.7.3) with SMTP id JAA13165 for <bugs@RT-11.MIT.EDU>; Thu, 7 Oct 1999 09:58:19 -0400
Received: from GRAND-CENTRAL-STATION.MIT.EDU by MIT.EDU with SMTP
id AA06903; Thu, 7 Oct 99 09:58:11 EDT
Received: from melbourne-city-street.MIT.EDU (MELBOURNE-CITY-STREET.MIT.EDU [18.69.0.45])
by grand-central-station.MIT.EDU (8.9.2/8.9.2) with ESMTP id JAA11440
for <krb5-bugs@MIT.EDU>; Thu, 7 Oct 1999 09:58:14 -0400 (EDT)
Received: from rcn-sucks.fsck.com (r95aag006497.sbo-smr.ma.cable.rcn.com [209.6.194.217])
by melbourne-city-street.MIT.EDU (8.9.3/8.9.2) with ESMTP id JAA28001
for <krb5-bugs@mit.edu>; Thu, 7 Oct 1999 09:58:14 -0400 (EDT)
Received: by rcn-sucks.fsck.com (8.8.8/4.7) id JAA19585; Thu, 7 Oct 1999 09:58:12 -0400 (EDT)
Message-Id: <199910071358.JAA19585@rcn-sucks.fsck.com>
Date: Thu, 7 Oct 1999 09:58:12 -0400 (EDT)
From: ghudson@MIT.EDU
Reply-To: ghudson@MIT.EDU
To: krb5-bugs@MIT.EDU
Subject: libkrb4 resource leak
X-Send-Pr-Version: 3.99
System: NetBSD rcn-sucks.fsck.com 1.3.2 NetBSD 1.3.2 (ATHENA) #0: Mon Jun 22 17:32:46 EDT 1998 nathanw@antisnork.mit.edu:/u1/var/build/sys-1.3.2/arch/i386/compile/ATHENA i386
logic towards the end of krb54_get_service_keyblock(). As far as
I can tell, he introduced a resource leak: the krb5_kt_close() of
kt_id only happens in a particular error case, and not in the
success case.
guess.
Index: rd_svc_key.c
===================================================================
RCS file: /cvs/krbdev/krb5/src/lib/krb4/rd_svc_key.c,v
retrieving revision 1.10
diff -c -r1.10 rd_svc_key.c
*** rd_svc_key.c 1999/04/03 19:55:00 1.10
--- rd_svc_key.c 1999/10/07 13:57:34
***************
*** 194,199 ****
--- 194,200 ----
&kt_entry.key, keyblock);
krb5_kt_free_entry(krb5__krb4_context, &kt_entry);
+ krb5_kt_close(krb5__krb4_context, kt_id);
errout:
if (princ)
State-Changed-From-To: open-closed
State-Changed-By: raeburn
State-Changed-When: Thu Oct 7 18:03:23 1999
State-Changed-Why:
Thanks, Greg. I've checked your patch into the trunk and 1.1 branch.
Received: from MIT.EDU (SOUTH-STATION-ANNEX.MIT.EDU [18.72.1.2]) by rt-11.MIT.EDU (8.7.5/8.7.3) with SMTP id JAA13165 for <bugs@RT-11.MIT.EDU>; Thu, 7 Oct 1999 09:58:19 -0400
Received: from GRAND-CENTRAL-STATION.MIT.EDU by MIT.EDU with SMTP
id AA06903; Thu, 7 Oct 99 09:58:11 EDT
Received: from melbourne-city-street.MIT.EDU (MELBOURNE-CITY-STREET.MIT.EDU [18.69.0.45])
by grand-central-station.MIT.EDU (8.9.2/8.9.2) with ESMTP id JAA11440
for <krb5-bugs@MIT.EDU>; Thu, 7 Oct 1999 09:58:14 -0400 (EDT)
Received: from rcn-sucks.fsck.com (r95aag006497.sbo-smr.ma.cable.rcn.com [209.6.194.217])
by melbourne-city-street.MIT.EDU (8.9.3/8.9.2) with ESMTP id JAA28001
for <krb5-bugs@mit.edu>; Thu, 7 Oct 1999 09:58:14 -0400 (EDT)
Received: by rcn-sucks.fsck.com (8.8.8/4.7) id JAA19585; Thu, 7 Oct 1999 09:58:12 -0400 (EDT)
Message-Id: <199910071358.JAA19585@rcn-sucks.fsck.com>
Date: Thu, 7 Oct 1999 09:58:12 -0400 (EDT)
From: ghudson@MIT.EDU
Reply-To: ghudson@MIT.EDU
To: krb5-bugs@MIT.EDU
Subject: libkrb4 resource leak
X-Send-Pr-Version: 3.99
Show quoted text
>Number: 769
>Category: krb5-libs
>Synopsis: rd_svc_key seems to have a resource leak
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: krb5-unassigned
>State: closed
>Class: sw-bug
>Submitter-Id: unknown
>Arrival-Date: Thu Oct 07 09:59:01 EDT 1999
>Last-Modified: Thu Oct 07 18:04:16 EDT 1999
>Originator: Greg Hudson
>Organization:
MIT>Category: krb5-libs
>Synopsis: rd_svc_key seems to have a resource leak
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: krb5-unassigned
>State: closed
>Class: sw-bug
>Submitter-Id: unknown
>Arrival-Date: Thu Oct 07 09:59:01 EDT 1999
>Last-Modified: Thu Oct 07 18:04:16 EDT 1999
>Originator: Greg Hudson
>Organization:
Show quoted text
>Release: 1.0
>Environment:
>Environment:
System: NetBSD rcn-sucks.fsck.com 1.3.2 NetBSD 1.3.2 (ATHENA) #0: Mon Jun 22 17:32:46 EDT 1998 nathanw@antisnork.mit.edu:/u1/var/build/sys-1.3.2/arch/i386/compile/ATHENA i386
Show quoted text
>Description:
When Ted committed revision 1.9 of rd_svc_key.c, he reorganized thelogic towards the end of krb54_get_service_keyblock(). As far as
I can tell, he introduced a resource leak: the krb5_kt_close() of
kt_id only happens in a particular error case, and not in the
success case.
Show quoted text
>How-To-Repeat:
Read a service key lots of times and run out of file descriptors, Iguess.
Show quoted text
>Fix:
I expect this would fix the problem.Index: rd_svc_key.c
===================================================================
RCS file: /cvs/krbdev/krb5/src/lib/krb4/rd_svc_key.c,v
retrieving revision 1.10
diff -c -r1.10 rd_svc_key.c
*** rd_svc_key.c 1999/04/03 19:55:00 1.10
--- rd_svc_key.c 1999/10/07 13:57:34
***************
*** 194,199 ****
--- 194,200 ----
&kt_entry.key, keyblock);
krb5_kt_free_entry(krb5__krb4_context, &kt_entry);
+ krb5_kt_close(krb5__krb4_context, kt_id);
errout:
if (princ)
Show quoted text
>Audit-Trail:
State-Changed-From-To: open-closed
State-Changed-By: raeburn
State-Changed-When: Thu Oct 7 18:03:23 1999
State-Changed-Why:
Thanks, Greg. I've checked your patch into the trunk and 1.1 branch.
Show quoted text
>Unformatted: