Bug 1721962 (CVE-2019-12819)

Summary: CVE-2019-12819 kernel: use-after-free in function __mdiobus_register() in drivers/net/phy/mdio_bus.c
Product: [Other] Security Response Reporter: Dhananjay Arunesh <darunesh>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact: Fendy Tjahjadi <ftjahjad>
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: acaringi, airlied, bhu, blc, brdeoliv, bskeggs, dhoward, dvlasenk, dvolkov, esammons, fhrbata, hdegoede, hkrzesin, iboverma, ichavero, itamar, jarodwilson, jeremy, jforbes, jglisse, jkacur, john.j5live, jonathan, josef, jross, jstancek, jwboyer, kernel-maint, kernel-mgr, kzhang, lgoncalv, linville, matt, mchehab, mcressma, mjg59, mlangsdo, nmurray, rt-maint, rvrbovsk, rvr, steved, williams, wmealing
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
A use-after-free flaw was found in the Linux kernel's MDIO section of the network management subsystem. An attacker who is able to hot-plug a network device can trigger the __mdiobus_register() function in drivers/net/phy/mdio_bus.c, which can cause a use-after-free condition causing a memory corruption and kernel panic or privilege escalation.
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-11-04 02:21:25 UTC Type: ---
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: 1721969, 1723284, 1723285, 1723286, 1772010    
Bug Blocks: 1721977    

Description Dhananjay Arunesh 2019-06-19 10:20:25 UTC
An issue was discovered in the Linux kernels implementation of Management Data Input/Output (MDIO) or SMI system.

An attacker who is able to hot-plug a network device can trigger the function
__mdiobus_register() in drivers/net/phy/mdio_bus.c which calls put_device(), which will trigger a fixed_mdio_bus_init use-after-free. This will cause a denial of service.

While this function is also run during system boot with onboard networking hardware, exploiting the use-after-free during this narrow timeframe makes the exploit a non-trivial exercise.


Reference:

https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=6ff7b060535e87c2ae14dd8548512abfdda528fb

https://en.wikipedia.org/wiki/Management_Data_Input/Output

Comment 1 Dhananjay Arunesh 2019-06-19 10:27:56 UTC
Created kernel tracking bugs for this issue:

Affects: fedora-all [bug 1721969]

Comment 2 Justin M. Forbes 2019-06-19 13:06:22 UTC
This issue was fixed for Fedora with the 4.20.17 stable update

Comment 5 Wade Mealing 2019-06-24 07:47:25 UTC
This flaw is rated as moderate as the MDIO loading code
will likely only be run in early boot, it would be a difficult flaw to exploit and would require
the attacker to be able to run code at this time to groom the memory into place.  I find it unlikely
that this would be exploited on stationary servers, but it may be more of a problem when you can hotplug
devices..

Comment 9 Product Security DevOps Team 2020-11-04 02:21:25 UTC
This bug is now closed. Further updates for individual products will be reflected on the CVE page(s):

https://access.redhat.com/security/cve/cve-2019-12819