lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <99739a23-9843-4c96-a614-ce2d48431a5c@arm.com>
Date: Fri, 28 Feb 2025 22:55:00 +0530
From: Dev Jain <dev.jain@....com>
To: Brendan Jackman <jackmanb@...gle.com>,
 Lorenzo Stoakes <lorenzo.stoakes@...cle.com>,
 Andrew Morton <akpm@...ux-foundation.org>, Shuah Khan <shuah@...nel.org>
Cc: linux-mm@...ck.org, linux-kselftest@...r.kernel.org,
 linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 03/10] selftests/mm: Skip uffd-wp-mremap if userfaultfd
 not available



On 28/02/25 10:24 pm, Brendan Jackman wrote:
> It's obvious that this should fail in that case, but still, save the
> reader the effort of figuring out that they've run into this by just
> SKIPping
> 
> Signed-off-by: Brendan Jackman <jackmanb@...gle.com>
> ---
>   tools/testing/selftests/mm/uffd-wp-mremap.c | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/mm/uffd-wp-mremap.c b/tools/testing/selftests/mm/uffd-wp-mremap.c
> index 2c4f984bd73caa17e12b9f4a5bb71e7fdf5d8554..c2ba7d46c7b4581a3c32a6b6acd148e3e89c2172 100644
> --- a/tools/testing/selftests/mm/uffd-wp-mremap.c
> +++ b/tools/testing/selftests/mm/uffd-wp-mremap.c
> @@ -182,7 +182,10 @@ static void test_one_folio(size_t size, bool private, bool swapout, bool hugetlb
>   
>   	/* Register range for uffd-wp. */
>   	if (userfaultfd_open(&features)) {
> -		ksft_test_result_fail("userfaultfd_open() failed\n");
> +		if (errno == ENOENT)
> +			ksft_test_result_skip("userfaultfd not available\n");
> +		else
> +			ksft_test_result_fail("userfaultfd_open() failed\n");
>   		goto out;
>   	}
>   	if (uffd_register(uffd, mem, size, false, true, false)) {
> 

I think you are correct, just want to confirm whether "uffd not 
available" if and only if "errno == ENOENT" is true. That is,
is it possible that errno can be something else and uffd is still not 
available, or errno can be ENOENT even if uffd is available.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ