[LTP] [PATCH] userfaultfd03.c: Require kernel 6.1

Petr Vorel
2026-03-26T12:52:47Z

Required kernel functionality was added in kernel 6.1 (not 6.11)
2d5de004e009 ("userfaultfd: add /dev/userfaultfd for fine grained access control")

Because it's a new kernel functionality which has not been backported to
enterprise kernels we can simplify check with just .min_kver.

Fixes: b63ab54aee ("userfaultfd: Do not use min_kver as gate for test")
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
Hi all,

@Li I suppose RHEL kernel haven't backport this.

Kind regards,
Petr

testcases/kernel/syscalls/userfaultfd/userfaultfd03.c | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/testcases/kernel/syscalls/userfaultfd/userfaultfd03.c b/testcases/kernel/syscalls/userfaultfd/userfaultfd03.c
index b65f39ecab..dd4354be6f 100644
--- a/testcases/kernel/syscalls/userfaultfd/userfaultfd03.c
+++ b/testcases/kernel/syscalls/userfaultfd/userfaultfd03.c
@@ -24,15 +24,6 @@ static char *page;
static void *copy_page;
static int uffd;

-static void setup(void)
-{
- if (access("/dev/userfaultfd", F_OK) != 0) {
- int res = (tst_kvercmp(6, 1, 0) < 0) ? TCONF : TBROK;
-
- tst_brk(res, "/dev/userfaultfd not found");
- }
-}
-
static int open_userfaultfd(int flags)
{
int fd, fd2;
@@ -127,8 +118,8 @@ static void run(void)

static struct tst_test test = {
.needs_root = 1,
- .setup = setup,
.test_all = run,
+ .min_kver = "6.1",
.needs_kconfigs = (const char *[]) {
"CONFIG_USERFAULTFD=y",
NULL
--
2.53.0