Re: [PATCH 1/2] io_uring: Fix io_uring mmap() by using architecture-provided get_unmapped_area()

From: Jiri Slaby
Date: Mon Jul 24 2023 - 03:39:17 EST


On 21. 07. 23, 17:24, Helge Deller wrote:
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.

Signed-off-by: Helge Deller <deller@xxxxxx>
Cc: Jens Axboe <axboe@xxxxxxxxx>
Reported-by: matoro <matoro_mailinglist_kernel@xxxxxxxxx>
Fixes: d808459b2e31 ("io_uring: Adjust mapping wrt architecture aliasing requirements")

Tested-by: Jiri Slaby <jirislaby@xxxxxxxxxx>

thanks,
--
js
suse labs