Bug 1832860 (CVE-2020-12656) - CVE-2020-12656 kernel: gss_mech_free in net/sunrpc/auth_gss/gss_mech_switch.c in the rpcsec_gss_krb5 implementation lacks certain domain_release calls, leading to a memory leak.
Summary: CVE-2020-12656 kernel: gss_mech_free in net/sunrpc/auth_gss/gss_mech_switch.c...
Keywords:
Status: CLOSED WONTFIX
Alias: CVE-2020-12656
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
URL:
Whiteboard:
Depends On: 1832862 1837211 1837212 1837213 1837214 1837215
Blocks: 1832884
TreeView+ depends on / blocked
 
Reported: 2020-05-07 12:14 UTC by Michael Kaplan
Modified: 2023-12-15 17:51 UTC (History)
48 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
A flaw was found in the implementation of the Linux kernel’s GSS mechanism registration functionality. During this period, memory allocation was not freed when the module was unloaded, leading to a memory leak. This flaw allows an attacker with the ability to repeat loads and unloads, to cause the system to run out of free memory and crash eventually.
Clone Of:
Environment:
Last Closed: 2020-05-26 12:28:42 UTC
Embargoed:


Attachments (Terms of Use)

Description Michael Kaplan 2020-05-07 12:14:09 UTC
A flaw was found in the implementation of the Linux kernels GSS mechanism registration functionality.  A memory allocation during this period would not be freed when the module was unloaded.

A local attacker with the ability to unload and reload the "rpcsec_gss_krb5" kernel module (a privileged operation) is able to leak kernel memory that is unable to be reclaimed.

Over time this can cause a denial of service, crashing the system or possibly having other unknown side effects.

A non root (or CAP_SYS_ADMIN) user is unable to trigger this flaw as loading and unloading of kernel modules requires advanced permissions.

Comment 1 Michael Kaplan 2020-05-07 12:14:51 UTC
Created kernel tracking bugs for this issue:

Affects: fedora-all [bug 1832862]

Comment 2 Michael Kaplan 2020-05-07 12:15:32 UTC
Upstream Issue:

https://bugzilla.kernel.org/show_bug.cgi?id=206651

Comment 6 Wade Mealing 2020-05-19 05:52:05 UTC
Mitigation:

There is no mitigation to this flaw other than to prevent the loading of the affected kernel module. 

A user with permission to load a kernel module would also likely have permission to overcome any blacklisting on the system.

Comment 9 J. Bruce Fields 2020-05-21 20:49:28 UTC
I'm having trouble reaching cve.mitre.org, but this sounds like the same flaw addressed by these patches posted today by Neil Brown:
https://lore.kernel.org/r/159003086409.24897.4659128962844846611.stgit@noble

I agree that the memory leak sounds like a mild issue.

However, he also points out: "The rpcsec_gss_krb5 module registers 2 flavours but does not unregister them, so if you load, unload, reload the module, it will happily continue to use the old registration which now has pointers to the memory were the module was originally loaded."

I'm trying to sort out whether that's an issue.

Comment 10 J. Bruce Fields 2020-05-21 21:12:35 UTC
Looks like after unloading and reloading the rpcsec_gss_krb5 module, we can end up with an auth_domain in the auth_domain table with ->name still an address from the previous module (one of the strings assigned to .name fields in gss_kerberos_pfs[].)

So in auth_domain_lookup() and auth_domain_find(), the accesses of hp->name in strcmp(hp->name, name) will be reading from those old addresses.

I think that's all.

That still doesn't sound too serious to me--am I missing anything?

Comment 11 Petr Matousek 2020-05-26 12:28:52 UTC
Statement:

This issue is rated as having Low impact because of the preconditions needed to trigger the issue (privileges requried to mount/unmount a module). The issue is also being disputed with MITRE (https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-12656) as being a non-issue because of the privileges required.

Comment 12 Justin M. Forbes 2020-10-08 18:58:03 UTC
This was fixed for Fedora with the 5.7.13 stable kernel updates.


Note You need to log in before you can comment on or make changes to this bug.