Bug 12006 - memory leaks in libads and KRB5_PAC
Summary: memory leaks in libads and KRB5_PAC
Status: RESOLVED FIXED
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: Winbind (show other bugs)
Version: 4.4.4
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Karolin Seeger
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-07-03 20:15 UTC by Uri Simchoni
Modified: 2016-08-02 07:19 UTC (History)
4 users (show)

See Also:


Attachments
git-am fix for 4.3.next and 4.4.next (3.14 KB, patch)
2016-07-06 06:20 UTC, Uri Simchoni
asn: review+
uri: review? (rsharpe)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Uri Simchoni 2016-07-03 20:15:12 UTC
Two memory leaks identified in code flows that establish a security context, and hence are being used by winbindd when creating new ldap or SMB connection.

To reproduce, on a member-machine, run:
valgrind net ads testjoin

==19221== 192 bytes in 1 blocks are definitely lost in loss record 110 of 153 
==19221==    at 0x4C28BF6: malloc (vg_replace_malloc.c:299)
==19221==    by 0x746BB70: __talloc_with_prefix (talloc.c:668)
==19221==    by 0x746BD03: __talloc (talloc.c:708)
==19221==    by 0x746C0B7: _talloc_named_const (talloc.c:865)
==19221==    by 0x746ECAB: _talloc_memdup (talloc.c:2286)
==19221==    by 0x6963BA5: data_blob_talloc_named (data_blob.c:54)
==19221==    by 0x6963B38: data_blob_named (data_blob.c:38)
==19221==    by 0x62F96CA: ads_sasl_spnego_bind (sasl.c:713)
==19221==    by 0x62FAA15: ads_sasl_bind (sasl.c:1084)
==19221==    by 0x62EED2F: ads_connect (ldap.c:697)

==19221== 64 (16 direct, 48 indirect) bytes in 1 blocks are definitely lost in loss record 75 of 153
==19221==    at 0x4C28BF6: malloc (vg_replace_malloc.c:299)
==19221==    by 0x88D22A5: gss_create_empty_buffer_set (gss_buffer_set.c:42)
==19221==    by 0x88D2327: gss_add_buffer_set_member (gss_buffer_set.c:68)
==19221==    by 0x88BD840: inquire_sec_context_get_sspi_session_key (inquire_sec_context_by_oid.c:207)
==19221==    by 0x88BE1A5: _gsskrb5_inquire_sec_context_by_oid (inquire_sec_context_by_oid.c:574)
==19221==    by 0x88D39E4: gss_inquire_sec_context_by_oid (gss_inquire_sec_context_by_oid.c:61)
==19221==    by 0x119ECA63: gssapi_get_session_key (gssapi_pac.c:201)
==19221==    by 0xD206D39: gensec_gse_have_feature (gse.c:944)
==19221==    by 0xD447E01: gensec_have_feature (gensec.c:563)
==19221==    by 0xD436843: gensec_spnego_update (spnego.c:1180)
==19221==    by 0xD437205: gensec_spnego_update_wrapper (spnego.c:1474)
==19221==    by 0xD447761: gensec_update_ev (gensec.c:303)
Comment 1 Uri Simchoni 2016-07-06 06:20:34 UTC
Created attachment 12262 [details]
git-am fix for 4.3.next and 4.4.next
Comment 2 Andreas Schneider 2016-07-06 09:46:14 UTC
Comment on attachment 12262 [details]
git-am fix for 4.3.next and 4.4.next

LGTM
Comment 3 Uri Simchoni 2016-07-06 09:59:17 UTC
Assigning to Karolin for inclusion in 4.3.next and 4.4.next.
Comment 4 Karolin Seeger 2016-07-08 07:27:20 UTC
(In reply to Uri Simchoni from comment #3)
Pushed to autobuild-v4-[4|3]-test.
Comment 5 Karolin Seeger 2016-08-02 07:19:48 UTC
(In reply to Karolin Seeger from comment #4)
Pushed to both branches.
Closing out bug report.

Thanks!