Bug 911167

Summary: tkey-gssapi-credential option in /etc/named.conf creates a memory leak
Product: Red Hat Enterprise Linux 6 Reporter: Petr Spacek <pspacek>
Component: bindAssignee: Tomáš Hozza <thozza>
Status: CLOSED CURRENTRELEASE QA Contact: qe-baseos-daemons
Severity: high Docs Contact:
Priority: urgent    
Version: 6.4CC: azelinka, jkurik, mkolaja, nc, ovasik, pspacek
Target Milestone: rcKeywords: Patch, ZStream
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
* Due to a missing gss_release_name() call, the BIND DNS server leaked memory when the "tkey-gssapi-credential" option was used in the BIND configuration. This update properly frees all memory in case the "tkey-gssapi-credential" is used, and BIND no longer leaks memory when GSSAPI credentials are used internally by the server for authentication.
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-11-14 10:39:58 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 996955    
Attachments:
Description Flags
Proposed patch none

Description Petr Spacek 2013-02-14 14:25:00 UTC
Description of problem:
Valgrind reports memory leak if "tkey-gssapi-credential" is used in /etc/named.conf.

Version-Release number of selected component (if applicable):
bind-9.8.2-0.17.rc1.el6.x86_64

How reproducible:
100 %

Steps to Reproduce:
1. Configure tkey-gssapi-credential (e.g. default IPA install with integrated DNS)

2. Run named under valgrind
E.g.:
$ export KRB5_KTNAME=/etc/named.keytab
$ valgrind --leak-check=full named -g -u named

3. Let named to start and then terminate it with CTRL+C or rndc stop


Actual results:
==10844== 63 (16 direct, 47 indirect) bytes in 1 blocks are definitely lost in loss record 14 of 15
==10844==    at 0x4C2677B: calloc (vg_replace_malloc.c:593)
==10844==    by 0x580F2FB: generic_gss_copy_oid_set (gssapi_alloc.h:43)
==10844==    by 0x58129D3: gss_acquire_cred (g_acquire_cred.c:195)
==10844==    by 0x518619D: dst_gssapi_acquirecred (gssapictx.c:306)
==10844==    by 0x155DC2: ns_tkeyctx_fromconfig (tkeyconf.c:114)
==10844==    by 0x14FA18: load_configuration (server.c:4963)
==10844==    by 0x150BB4: run_server (server.c:5381)
==10844==    by 0x60172F7: run (task.c:1012)
==10844==    by 0x6650850: start_thread (pthread_create.c:301)
==10844==    by 0x713A90C: clone (clone.S:115)
==10844== 
==10844== 94 (40 direct, 54 indirect) bytes in 1 blocks are definitely lost in loss record 15 of 15
==10844==    at 0x4C279EE: malloc (vg_replace_malloc.c:270)
==10844==    by 0x5817244: gss_import_name (g_imp_name.c:110)
==10844==    by 0x5186132: dst_gssapi_acquirecred (gssapictx.c:279)
==10844==    by 0x155DC2: ns_tkeyctx_fromconfig (tkeyconf.c:114)
==10844==    by 0x14FA18: load_configuration (server.c:4963)
==10844==    by 0x150BB4: run_server (server.c:5381)
==10844==    by 0x60172F7: run (task.c:1012)
==10844==    by 0x6650850: start_thread (pthread_create.c:301)
==10844==    by 0x713A90C: clone (clone.S:115)



Expected results:
No leaks are present :-)


Additional info:
(I guess!) gss_release_name() call is missing somewhere.

http://www.unix.com/man-page/all/3gss/gss_import_name/

Comment 2 RHEL Program Management 2013-02-20 06:50:03 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.

Comment 5 Tomáš Hozza 2013-05-24 15:24:31 UTC
Created attachment 752729 [details]
Proposed patch