Skip Menu |
 

From: "Casper, Corene" <C.Casper@Dell.com>
To: "krb5-bugs@mit.edu" <krb5-bugs@mit.edu>
Subject: memory leak via krb5_rc_none_close
Date: Wed, 13 Feb 2019 23:37:39 +0000
Download (untitled) / with headers
text/plain 1.4KiB

Originator:     Corene Casper

Organization:   Dell EMC

Confidential:   no

Synopsis:       memory leak via krb5_rc_none_close

Severity:       non-critical

Priority:       low

Category:       krb5-libs

Class:          sw-bug

Release:        1.14

Environment:

        system:  Isilon OneFS v8.1.0  (freebsd-11.0 based)

        machine: amd64

Description:

        When using the krb5_rc_none_ops cache type, a k5_mutex_t structure

        is being leaked on every close.  We've run into the case where our

        application has been up for long enough that it finally ran

        the system out of memory due to this leak.

How-To-Repeat:

        Configure your system so it uses "none" rc cache type and then

        exercise that code path repeatedly and observe process slowly

        grow in size.

        (In our case, this was in our SMB server code.  With Kerberos

        configured, each SESSION_SETUP user authentication resulted

        in a leak of one k5_mutex_t).

Fix:    one-line patch to krb5_rc_none_close, to add the k5_mutex_destroy()

        call:

*** isilon/fsp/krb5/src/lib/krb5/rcache/rc_none.c       2019-02-13 15:22:42.251051611 -0800

--- /tmp/NDbjMy_rc_none.c       2019-02-13 15:23:46.331514547 -0800

***************

*** 50,56 ****

  static krb5_error_code KRB5_CALLCONV

  krb5_rc_none_close(krb5_context ctx, krb5_rcache rc)

  {

-     k5_mutex_destroy(&rc->lock);

      free (rc);

      return 0;

  }

--- 50,55 ----

From: ghudson@mit.edu
Subject: git commit

Fix memory leak in 'none' replay cache type

Commit 0f06098e2ab419d02e89a1ca6bc9f2828f6bdb1e fixed part of a memory
leak in the 'none' replay cache type by freeing the outer container,
but we also need to free the mutex.

[ghudson@mit.edu: wrote commit message]

https://github.com/krb5/krb5/commit/af2a3115cb8feb5174151b4b40223ae45aa9db17
Author: Corene Casper <C.Casper@Dell.com>
Committer: Greg Hudson <ghudson@mit.edu>
Commit: af2a3115cb8feb5174151b4b40223ae45aa9db17
Branch: master
src/lib/krb5/rcache/rc_none.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
From: ghudson@mit.edu
Subject: git commit

Fix memory leak in 'none' replay cache type

Commit 0f06098e2ab419d02e89a1ca6bc9f2828f6bdb1e fixed part of a memory
leak in the 'none' replay cache type by freeing the outer container,
but we also need to free the mutex.

[ghudson@mit.edu: wrote commit message]

(cherry picked from commit af2a3115cb8feb5174151b4b40223ae45aa9db17)

https://github.com/krb5/krb5/commit/7ef6c40e007a3857ac484fbb14fbad6f5f86d9e9
Author: Corene Casper <C.Casper@Dell.com>
Committer: Greg Hudson <ghudson@mit.edu>
Commit: 7ef6c40e007a3857ac484fbb14fbad6f5f86d9e9
Branch: krb5-1.16
src/lib/krb5/rcache/rc_none.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
From: ghudson@mit.edu
Subject: git commit

Fix memory leak in 'none' replay cache type

Commit 0f06098e2ab419d02e89a1ca6bc9f2828f6bdb1e fixed part of a memory
leak in the 'none' replay cache type by freeing the outer container,
but we also need to free the mutex.

[ghudson@mit.edu: wrote commit message]

(cherry picked from commit af2a3115cb8feb5174151b4b40223ae45aa9db17)

https://github.com/krb5/krb5/commit/3d8dd08ebbb26d15bdf6cc740f5c46268e913a6f
Author: Corene Casper <C.Casper@Dell.com>
Committer: Greg Hudson <ghudson@mit.edu>
Commit: 3d8dd08ebbb26d15bdf6cc740f5c46268e913a6f
Branch: krb5-1.17
src/lib/krb5/rcache/rc_none.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)