Skip to content
Commit c420644c authored by Haren Myneni's avatar Haren Myneni Committed by Michael Ellerman
Browse files

powerpc: Use mm_context vas_windows counter to issue CP_ABORT



set_thread_uses_vas() sets used_vas flag for a process that opened VAS
window and issue CP_ABORT during context switch for only that process.
In multi-thread application, windows can be shared. For example Thread
A can open a window and Thread B can run COPY/PASTE instructions to
send NX request which may cause corruption or snooping or a covert
channel Also once this flag is set, continue to run CP_ABORT even the
VAS window is closed.

So define vas-windows counter in process mm_context, increment this
counter for each window open and decrement it for window close. If
vas-windows is set, issue CP_ABORT during context switch. It means
clear the foreign real address mapping only if the process / thread
uses COPY/PASTE. Then disable it for that process if windows are not
open.

Moved set_thread_uses_vas() code to vas_tx_win_open() as this
functionality is needed only for userspace open windows. We are adding
VAS userspace support along with this fix. So no need to include this
fix in stable releases.

Fixes: 9d2a4d71 ("powerpc: Define set_thread_uses_vas()")
Signed-off-by: default avatarHaren Myneni <haren@linux.ibm.com>
Reported-by: default avatarNicholas Piggin <npiggin@gmail.com>
Suggested-by: default avatarMilton Miller <miltonm@us.ibm.com>
Suggested-by: default avatarNicholas Piggin <npiggin@gmail.com>
Reviewed-by: default avatarNicholas Piggin <npiggin@gmail.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/1587017291.2275.1077.camel@hbabu-laptop
parent 1d955f98
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment