diff options
author | Jamie Liu <jamieliu@google.com> | 2020-10-30 13:52:38 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-10-30 13:54:47 -0700 |
commit | 9ad864628dc3f36a24a5eb6a51d7e13471598517 (patch) | |
tree | eb747d6bede6dd733339adb58d04cb41b36023ef /pkg/sentry/fsimpl/ext | |
parent | c94bf137da809551f2ccdaec061576eb98cceb67 (diff) |
Separate kernel.Task.AsCopyContext() into CopyContext() and OwnCopyContext().
kernel.copyContext{t} cannot be used outside of t's task goroutine, for three
reasons:
- t.CopyScratchBuffer() is task-goroutine-local.
- Calling t.MemoryManager() without running on t's task goroutine or locking
t.mu violates t.MemoryManager()'s preconditions.
- kernel.copyContext passes t as context.Context to MM IO methods, which is
illegal outside of t's task goroutine (cf. kernel.Task.Value()).
Fix this by splitting AsCopyContext() into CopyContext() (which takes an
explicit context.Context and is usable outside of the task goroutine) and
OwnCopyContext() (which uses t as context.Context, but is only usable by t's
task goroutine).
PiperOrigin-RevId: 339933809
Diffstat (limited to 'pkg/sentry/fsimpl/ext')
0 files changed, 0 insertions, 0 deletions