Commit 5f9466b
KVM: arm64: Fix page leak in user_mem_abort()
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]1 parent 6515c61 commit 5f9466b
1 file changed
+7
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1670 | 1670 | | |
1671 | 1671 | | |
1672 | 1672 | | |
1673 | | - | |
| 1673 | + | |
1674 | 1674 | | |
1675 | 1675 | | |
1676 | 1676 | | |
| |||
1693 | 1693 | | |
1694 | 1694 | | |
1695 | 1695 | | |
1696 | | - | |
| 1696 | + | |
| 1697 | + | |
| 1698 | + | |
| 1699 | + | |
| 1700 | + | |
| 1701 | + | |
1697 | 1702 | | |
1698 | 1703 | | |
1699 | 1704 | | |
| |||
0 commit comments