Commit 05ec018
KVM: arm64: Fix page leak in user_mem_abort()
commit 5f9466b upstream.
The user_mem_abort() function acquires a page reference via
__kvm_faultin_pfn() early in its execution. However, the subsequent
checks for mismatched attributes between stage 1 and stage 2 mappings
would return an error code directly, bypassing the corresponding page
release.
Fix this by storing the error and releasing the unused page before
returning the error.
Fixes: 6d674e2 ("KVM: arm/arm64: Properly handle faulting of device mappings")
Fixes: 2a8dfab ("KVM: arm64: Block cacheable PFNMAP mapping")
Signed-off-by: Fuad Tabba <[email protected]>
Reviewed-by: Oliver Upton <[email protected]>
Signed-off-by: Marc Zyngier <[email protected]>
Cc: [email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>1 parent 4f7af3d commit 05ec018
1 file changed
+7
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1673 | 1673 | | |
1674 | 1674 | | |
1675 | 1675 | | |
1676 | | - | |
| 1676 | + | |
1677 | 1677 | | |
1678 | 1678 | | |
1679 | 1679 | | |
| |||
1696 | 1696 | | |
1697 | 1697 | | |
1698 | 1698 | | |
1699 | | - | |
| 1699 | + | |
| 1700 | + | |
| 1701 | + | |
| 1702 | + | |
| 1703 | + | |
| 1704 | + | |
1700 | 1705 | | |
1701 | 1706 | | |
1702 | 1707 | | |
| |||
0 commit comments