Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
io_submit(): replace syscall context before returning, hold reference…
… per iocb op The aio code was issuing read and write requests on behalf of the running syscall context without managing the lifetime of the context or replacing the cpu's default syscall context. The following scenario would lead to a crash during the aio test: An aio_complete executes within the saved syscall context but on a different cpu than the one that issued the requests. The originating cpu, still having the same syscall context set as default, then serves a syscall. The low-level syscall entry begins running on the stack of this context, expecting exclusive access to it, and corruption of the stack ensues. The solution presented here uses the active syscall context to encompass all continuations as a result of an io_submit(), despite such operations no longer being associated with a syscall. The default syscall context is replaced by calling check_syscall_context_replace() in io_submit(), and each issued I/O operation holds a reference to the context. The context is finally freed and recycled once the last operation completes.
- Loading branch information