Commit 8c2e8ac
KVM: arm64: Check for kvm_vma_mte_allowed in the critical section
On page fault, we find about the VMA that backs the page fault
early on, and quickly release the mmap_read_lock. However, using
the VMA pointer after the critical section is pretty dangerous,
as a teardown may happen in the meantime and the VMA be long gone.
Move the sampling of the MTE permission early, and NULL-ify the
VMA pointer after that, just to be on the safe side.
Signed-off-by: Marc Zyngier <[email protected]>
Cc: [email protected]
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Oliver Upton <[email protected]>1 parent e86fc1a commit 8c2e8ac
1 file changed
Lines changed: 6 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1218 | 1218 | | |
1219 | 1219 | | |
1220 | 1220 | | |
1221 | | - | |
| 1221 | + | |
1222 | 1222 | | |
1223 | 1223 | | |
1224 | 1224 | | |
| |||
1309 | 1309 | | |
1310 | 1310 | | |
1311 | 1311 | | |
| 1312 | + | |
| 1313 | + | |
| 1314 | + | |
| 1315 | + | |
1312 | 1316 | | |
1313 | 1317 | | |
1314 | 1318 | | |
| |||
1379 | 1383 | | |
1380 | 1384 | | |
1381 | 1385 | | |
1382 | | - | |
| 1386 | + | |
1383 | 1387 | | |
1384 | 1388 | | |
1385 | 1389 | | |
| |||
0 commit comments