]> git.baikalelectronics.ru Git - kernel.git/commit
io_uring: don't assume mm is constant across submits
authorJens Axboe <axboe@kernel.dk>
Tue, 29 Dec 2020 17:50:46 +0000 (10:50 -0700)
committerJens Axboe <axboe@kernel.dk>
Tue, 29 Dec 2020 18:00:36 +0000 (11:00 -0700)
commitb2e88d462645f1d0ccfa06b5b8530b1de4b9dee2
tree2f5da76650d3d77b40923c6b632d23b8e15a4837
parent703b4aaeda226c411ae7e592fdcf61efe00c01a0
io_uring: don't assume mm is constant across submits

If we COW the identity, we assume that ->mm never changes. But this
isn't true of multiple processes end up sharing the ring. Hence treat
id->mm like like any other process compontent when it comes to the
identity mapping. This is pretty trivial, just moving the existing grab
into io_grab_identity(), and including a check for the match.

Cc: stable@vger.kernel.org # 5.10
Fixes: 36c10655ef75 ("io_uring: COW io_identity on mismatch")
Reported-by: Christian Brauner <christian.brauner@ubuntu.com>:
Tested-by: Christian Brauner <christian.brauner@ubuntu.com>:
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c