Bug 2134591

Summary: kernel: Double-free in split_2MB_gtt_entry
Product: [Other] Security Response Reporter: Rohit Keshri <rkeshri>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED DUPLICATE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: acaringi, adscvr, airlied, alciregi, bhu, brdeoliv, bskeggs, chwhite, crwood, ddepaula, debarbos, dvlasenk, ezulian, hdegoede, hkrzesin, hpa, jarod, jarodwilson, jburrell, jfaracco, jferlan, jforbes, jglisse, jlelli, joe.lawrence, jonathan, josef, jshortt, jstancek, jwboyer, jwyatt, kcarcia, kernel-maint, kernel-mgr, lgoncalv, linville, lleshchi, lzampier, masami256, mchehab, ndegraef, nmurray, ptalbert, qzhao, rvrbovsk, scweaver, steved, tyberry, vkumar, walters, williams
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-04-04 16:08:54 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: 2132857, 2134596, 2134597, 2134598, 2134599, 2138001, 2138003, 2138005    
Bug Blocks: 2133476    

Description Rohit Keshri 2022-10-13 17:14:04 UTC
There is a double-free security bug in split_2MB_gtt_entry.

Here is a calling chain : ppgtt_populate_spt->ppgtt_populate_shadow_entry->split_2MB_gtt_entry. If intel_gvt_dma_map_guest_page failed, it will call  ppgtt_invalidate_spt, which will finally call ppgtt_free_spt and kfree(spt). But the caller does not notice that, and it will call ppgtt_free_spt again in the error path.

Reference:

https://bugzilla.redhat.com/show_bug.cgi?id=2132857

Comment 2 Rohit Keshri 2022-10-13 17:32:17 UTC
Created kernel tracking bugs for this issue:

Affects: fedora-all [bug 2134596]

Comment 10 Rohit Keshri 2023-04-04 16:08:54 UTC

*** This bug has been marked as a duplicate of bug 2137979 ***