On Mon, Jan 28, 2019 at 10:35 PM Jens Axboe <axboe@xxxxxxxxx> wrote: > The submission queue (SQ) and completion queue (CQ) rings are shared > between the application and the kernel. This eliminates the need to > copy data back and forth to submit and complete IO. [...] > +static int io_import_iovec(struct io_ring_ctx *ctx, int rw, > + const struct io_uring_sqe *sqe, > + struct iovec **iovec, struct iov_iter *iter) > +{ > + void __user *buf = u64_to_user_ptr(sqe->addr); > + > +#ifdef CONFIG_COMPAT > + if (in_compat_syscall()) > + return compat_import_iovec(rw, buf, sqe->len, UIO_FASTIOV, > + iovec, iter); > +#endif > + > + return import_iovec(rw, buf, sqe->len, UIO_FASTIOV, iovec, iter); > +} This code can run in kthread context, right? I think in_compat_syscall() might not work if this is a kthread launched by a compat task; I don't see anything that propagates the compat flag to the kthread.