Memory leaks in version 1.6.dfsg.3~beta1-2ubuntu1.1

Bug #475546 reported by Dan Searle
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
krb5 (Ubuntu)
Expired
Low
Unassigned

Bug Description

Binary package hint: libkrb53

Package: libkrb53
Package Version: 1.6.dfsg.3~beta1-2ubuntu1.1
Description: Ubuntu 8.04.2
Release: 8.04

Using the squid_kerb_auth helper with MIT Kerberos using option KRB5RCACHETYPE=none, I get these leak reports from valgrind:

==7095== 136 bytes in 2 blocks are definitely lost in loss record 60 of 71
==7095== at 0x4022AB8: malloc (vg_replace_malloc.c:207)
==7095== by 0x40C2690: krb5_rc_resolve_full (in /usr/lib/libkrb5.so.3.3)
==7095== by 0x40BFAB8: krb5_get_server_rcache (in /usr/lib/libkrb5.so.3.3)
==7095== by 0x40B9B9D: krb5_rd_req (in /usr/lib/libkrb5.so.3.3)
==7095== by 0x403D6A0: (within /usr/lib/libgssapi_krb5.so.2.2)
==7095== by 0x404AF22: (within /usr/lib/libgssapi_krb5.so.2.2)
==7095== by 0x4033EC2: gss_accept_sec_context (in /usr/lib/libgssapi_krb5.so.2.2)
==7095== by 0x4050F17: (within /usr/lib/libgssapi_krb5.so.2.2)
==7095== by 0x4033EC2: gss_accept_sec_context (in /usr/lib/libgssapi_krb5.so.2.2)
==7095== by 0x8049CC8: main (squid_kerb_auth.c:495)
==7095==
==7095==
==7095== 204 bytes in 3 blocks are definitely lost in loss record 64 of 71
==7095== at 0x4022AB8: malloc (vg_replace_malloc.c:207)
==7095== by 0x40C2690: krb5_rc_resolve_full (in /usr/lib/libkrb5.so.3.3)
==7095== by 0x40BFAB8: krb5_get_server_rcache (in /usr/lib/libkrb5.so.3.3)
==7095== by 0x403FC2A: (within /usr/lib/libgssapi_krb5.so.2.2)
==7095== by 0x404B02D: (within /usr/lib/libgssapi_krb5.so.2.2)
==7095== by 0x4034615: gss_add_cred (in /usr/lib/libgssapi_krb5.so.2.2)
==7095== by 0x4034A65: gss_acquire_cred (in /usr/lib/libgssapi_krb5.so.2.2)
==7095== by 0x8049C31: main (squid_kerb_auth.c:489)
==7095==
==7095== LEAK SUMMARY:
==7095== definitely lost: 340 bytes in 5 blocks.
==7095== possibly lost: 0 bytes in 0 blocks.
==7095== still reachable: 29,933 bytes in 146 blocks.
==7095== suppressed: 0 bytes in 0 blocks.

Revision history for this message
Chuck Short (zulcss) wrote :

Thanks I was wondering how I can reproduce this?

Regards
chuck

Changed in krb5 (Ubuntu):
importance: Undecided → Low
status: New → Incomplete
Revision history for this message
Sam Hartman (hartmans) wrote : Re: [Bug 475546] Re: Memory leaks in version 1.6.dfsg.3~beta1-2ubuntu1.1

>>>>> "Chuck" == Chuck Short <email address hidden> writes:

    Chuck> Thanks I was wondering how I can reproduce this? Regards
    Chuck> chuck

Set up openssh-krb5 on a server with a keytab
set GssapiKeyExchange to yes in sshd_config
set gssapiKeyExchange to yes in a client config.

Set the replay cache type to none; I'm not sure what the config
variable is for that but the libapache2-mod-auth-kerb docs should tell
you.
run sshd under valgrind and confirm the leak.

I recommend sshd rather than apache2 because getting negotiate auth
with apache2 running is tricky.

Revision history for this message
Dan Searle (dan-censornet) wrote :

Why is this seen as "low" priotiry, it's causing no end of problems for some of our servers running out of memory, I have to restart the effected daemons twice a day, which is a pretty ugly, I have confirmed the patch I submitted from the <email address hidden> mailing list does work. All you have to do is apply this patch:

--- ./src/lib/krb5/rcache/rc_none.c 2004-08-04 07:58:17.000000000 +0100
+++ ./src/lib/krb5/rcache/rc_none.c 2009-11-09 09:14:43.000000000 +0000
@@ -43,11 +43,17 @@
    return 0;
}
#define krb5_rc_none_recover krb5_rc_none_noargs
-#define krb5_rc_none_destroy krb5_rc_none_noargs
-#define krb5_rc_none_close krb5_rc_none_noargs
#define krb5_rc_none_expunge krb5_rc_none_noargs

static krb5_error_code KRB5_CALLCONV
+krb5_rc_none_close(krb5_context ctx, krb5_rcache rc)
+{
+ free (rc);
+ return 0;
+}
+#define krb5_rc_none_destroy krb5_rc_none_close
+
+static krb5_error_code KRB5_CALLCONV
krb5_rc_none_store(krb5_context ctx, krb5_rcache rc, krb5_donot_replay *r)
{
    return 0;

I tried to make a new libkrb53 package myself, but there are lots of interdependencies which mean I would have to remake lots of other packages. Please apply this patch and update the official Hardy repository ASAP.

Chuck Short (zulcss)
Changed in krb5 (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
Dan Searle (dan-censornet) wrote :

I've found and attempted a fix for more memory leaks in libkrb53, here's a patch (attached) that fixes them for me when patched against the krb5-1.6.4-beta1 relase available from MIT.

I urge you to test this patch (it may have undesirable side effects I'm unaware of) and if it's good then merge it into the Ubuntu release of MIT kerberos.

Reards, Dan...

Revision history for this message
Dan Searle (dan-censornet) wrote :

Still low priproty? I'm having to use custom build libs which override the libkrb53 package, which is not optimal. Any idea when these bug fixes will be merged?

Revision history for this message
Dan Searle (dan-censornet) wrote :

Erm nobody doing anything to get these fixes merged into the upstream? Anything? Anybody? :-/

Revision history for this message
Nigel Babu (nigelbabu) wrote :

Is this still an issue? krb5 version 1.7dfsg~beta3-1ubuntu0.4 uploaded on 07 Jan 2010 seems to have a fix from debian titled "none replay cache memory leak". This should have fixed the problem in karmic and above. Can someone please confirm?

Changed in krb5 (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for krb5 (Ubuntu) because there has been no activity for 60 days.]

Changed in krb5 (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.