mirror of
https://github.com/AsahiLinux/m1n1
synced 2024-11-22 14:43:08 +00:00
m1n1.trace.agx: Add exploit mitigation
Signed-off-by: Asahi Lina <lina@asahilina.net>
This commit is contained in:
parent
6d3e594903
commit
7ad099a5b6
1 changed files with 10 additions and 0 deletions
|
@ -612,9 +612,19 @@ class AGXTracer(ASCTracer):
|
|||
stream.meta_fn = lambda a, b: self.meta_gpuvm(context, a, b)
|
||||
return stream
|
||||
|
||||
def mitigate_exploits(self):
|
||||
def hook(addr, val, width):
|
||||
return 0 # Begone, GPU kernel mode in user contexts
|
||||
|
||||
for i in range(1, 64):
|
||||
addr = self.gpu_region + i * 16 + 8
|
||||
self.hv.add_tracer(irange(addr, 8), "UATMitigation", TraceMode.HOOK, None, hook)
|
||||
|
||||
def start(self):
|
||||
super().start()
|
||||
|
||||
#self.mitigate_exploits()
|
||||
|
||||
self.clear_ttbr_tracers()
|
||||
self.clear_uatmap_tracers()
|
||||
self.add_ttbr_tracers()
|
||||
|
|
Loading…
Reference in a new issue