summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/platform/ring0/kernel.go
diff options
context:
space:
mode:
authorAdin Scannell <ascannell@google.com>2020-06-05 17:24:12 -0700
committergVisor bot <gvisor-bot@google.com>2020-06-05 17:25:28 -0700
commit527d08f6afdea1e142c76b8abb2266525a98c2ea (patch)
tree9bdd320cc5479192a46f0ad44ab00ec83a8b00b1 /pkg/sentry/platform/ring0/kernel.go
parent8d8dce418f7e4053f80b035ff257743b431859d9 (diff)
Add +checkescape annotations to kvm/ring0.
This analysis also catches a potential bug, which is a split on mapPhysical. This would have led to potential guest-exit during Mapping (although this would have been handled by the now-unecessary retryInGuest loop). PiperOrigin-RevId: 315025106
Diffstat (limited to 'pkg/sentry/platform/ring0/kernel.go')
-rw-r--r--pkg/sentry/platform/ring0/kernel.go24
1 files changed, 20 insertions, 4 deletions
diff --git a/pkg/sentry/platform/ring0/kernel.go b/pkg/sentry/platform/ring0/kernel.go
index 900c0bba7..021693791 100644
--- a/pkg/sentry/platform/ring0/kernel.go
+++ b/pkg/sentry/platform/ring0/kernel.go
@@ -31,23 +31,39 @@ type defaultHooks struct{}
// KernelSyscall implements Hooks.KernelSyscall.
//
+// +checkescape:all
+//
//go:nosplit
-func (defaultHooks) KernelSyscall() { Halt() }
+func (defaultHooks) KernelSyscall() {
+ Halt()
+}
// KernelException implements Hooks.KernelException.
//
+// +checkescape:all
+//
//go:nosplit
-func (defaultHooks) KernelException(Vector) { Halt() }
+func (defaultHooks) KernelException(Vector) {
+ Halt()
+}
// kernelSyscall is a trampoline.
//
+// +checkescape:hard,stack
+//
//go:nosplit
-func kernelSyscall(c *CPU) { c.hooks.KernelSyscall() }
+func kernelSyscall(c *CPU) {
+ c.hooks.KernelSyscall()
+}
// kernelException is a trampoline.
//
+// +checkescape:hard,stack
+//
//go:nosplit
-func kernelException(c *CPU, vector Vector) { c.hooks.KernelException(vector) }
+func kernelException(c *CPU, vector Vector) {
+ c.hooks.KernelException(vector)
+}
// Init initializes a new CPU.
//