Bug 2952 - GSSAPI doesn't cleanup methoddata (leaks some memory).
Summary: GSSAPI doesn't cleanup methoddata (leaks some memory).
Status: CLOSED FIXED
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: Kerberos support (show other bugs)
Version: 7.9p1
Hardware: All All
: P5 minor
Assignee: Assigned to nobody
URL:
Keywords:
Depends on:
Blocks: V_8_0
  Show dependency treegraph
 
Reported: 2019-01-08 21:35 AEDT by Markus
Modified: 2019-05-03 14:42 AEST (History)
3 users (show)

See Also:


Attachments
patch to fix memory leak and side issues. (4.37 KB, text/plain)
2019-01-08 21:42 AEDT, Markus
no flags Details
Fixed patch for v7.9 after opacket removal (5.72 KB, patch)
2019-02-05 21:33 AEDT, Markus
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Markus 2019-01-08 21:35:23 AEDT
userauth_gssapi allocates a bit of memory for the authctxt->methoddata pointer but doesn't clean up.

Side issue: userauth_gssapi is also using two function-static variables.  One of these leaks.  The other one makes prevents reusability (e.g. porting to OO languages) because there is no way to reset it.  They should be moved to authctxt.
Comment 1 Markus 2019-01-08 21:39:43 AEDT
Another side issue: some gssapi-userauth related functions could be made static and there is a function prototype (input_gssapi_hash) that is no longer used.
Comment 2 Markus 2019-01-08 21:42:39 AEDT
Created attachment 3221 [details]
patch to fix memory leak and side issues.
Comment 3 Markus 2019-02-05 21:32:02 AEDT
The initial patch now breaks after other patches (old packet api) were applied to v7.9.

I'm attaching a new patch.  

It also slightly changes the pubkey_cleanup, adding it to the method table as a cleanup handler, rather than calling it explicitely.
Comment 4 Markus 2019-02-05 21:33:42 AEDT
Created attachment 3234 [details]
Fixed patch for v7.9 after opacket removal


applies again to current v7.9 (portable)
Comment 5 Darren Tucker 2019-02-05 22:39:14 AEDT
Put on list for 8.0
Comment 6 Damien Miller 2019-02-11 20:47:21 AEDT
This has been committed and will be in the 8.0 release - thanks.
Comment 7 Damien Miller 2019-05-03 14:42:35 AEST
Move resolved bugs -> CLOSED after 8.0 release