io_uring: check for valid register opcode earlier
authorJens Axboe <axboe@kernel.dk>
Fri, 23 Dec 2022 13:37:08 +0000 (06:37 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Jan 2023 11:02:41 +0000 (12:02 +0100)
commit8b2de52126612b6d99f637292fc3aaceb42efc8a
treef1349eaf043a5f59fee7e116823a85cb5444e14d
parent9c152189a7e85dac1f759d6ba95f877af91ccf8c
io_uring: check for valid register opcode earlier

[ Upstream commit 343190841a1f22b96996d9f8cfab902a4d1bfd0e ]

We only check the register opcode value inside the restricted ring
section, move it into the main io_uring_register() function instead
and check it up front.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
io_uring/io_uring.c