io_uring: only allow submit from owning task
authorJens Axboe <axboe@kernel.dk>
Fri, 17 Jan 2020 02:00:24 +0000 (19:00 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 23 Jan 2020 07:22:32 +0000 (08:22 +0100)
commitaf2e7c923dabca32f1224b178198817536318c71
tree99184f514c771ee88505dca403e4c2ed822f68c9
parent7e7f29200f2d73d3f15fd5718706f2b73a5c420d
io_uring: only allow submit from owning task

commit 44d282796f81eb1debc1d7cb53245b4cb3214cb5 upstream.

If the credentials or the mm doesn't match, don't allow the task to
submit anything on behalf of this ring. The task that owns the ring can
pass the file descriptor to another task, but we don't want to allow
that task to submit an SQE that then assumes the ring mm and creds if
it needs to go async.

Cc: stable@vger.kernel.org
Suggested-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/io_uring.c