io_uring: Fix io_uring mmap() by using architecture-provided get_unmapped_area()
authorHelge Deller <deller@gmx.de>
Fri, 21 Jul 2023 15:24:31 +0000 (17:24 +0200)
committerJens Axboe <axboe@kernel.dk>
Fri, 21 Jul 2023 15:41:29 +0000 (09:41 -0600)
commit32832a407a7178eec3215fad9b1a3298c14b0d69
treee60669b6217f4be1c48969b7e8757e64e49b6c26
parenta9be202269580ca611c6cebac90eaf1795497800
io_uring: Fix io_uring mmap() by using architecture-provided get_unmapped_area()

The io_uring testcase is broken on IA-64 since commit d808459b2e31
("io_uring: Adjust mapping wrt architecture aliasing requirements").

The reason is, that this commit introduced an own architecture
independend get_unmapped_area() search algorithm which finds on IA-64 a
memory region which is outside of the regular memory region used for
shared userspace mappings and which can't be used on that platform
due to aliasing.

To avoid similar problems on IA-64 and other platforms in the future,
it's better to switch back to the architecture-provided
get_unmapped_area() function and adjust the needed input parameters
before the call. Beside fixing the issue, the function now becomes
easier to understand and maintain.

This patch has been successfully tested with the io_uring testcase on
physical x86-64, ppc64le, IA-64 and PA-RISC machines. On PA-RISC the LTP
mmmap testcases did not report any regressions.

Cc: stable@vger.kernel.org # 6.4
Signed-off-by: Helge Deller <deller@gmx.de>
Reported-by: matoro <matoro_mailinglist_kernel@matoro.tk>
Fixes: d808459b2e31 ("io_uring: Adjust mapping wrt architecture aliasing requirements")
Link: https://lore.kernel.org/r/20230721152432.196382-2-deller@gmx.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
arch/parisc/kernel/sys_parisc.c
io_uring/io_uring.c