{"id":2222373,"url":"http://patchwork.ozlabs.org/api/1.1/patches/2222373/?format=json","web_url":"http://patchwork.ozlabs.org/project/ltp/patch/20260411092452.211540-1-rbranco@suse.de/","project":{"id":59,"url":"http://patchwork.ozlabs.org/api/1.1/projects/59/?format=json","name":"Linux Test Project development","link_name":"ltp","list_id":"ltp.lists.linux.it","list_email":"ltp@lists.linux.it","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20260411092452.211540-1-rbranco@suse.de>","date":"2026-04-11T09:24:51","name":"userfaultfd: Use two-step handshake to probe features","commit_ref":null,"pull_url":null,"state":"needs-review-ack","archived":false,"hash":"b0bf9cc88eb915dd6c9c37a9ddd0f7bb7d427cb0","submitter":{"id":92484,"url":"http://patchwork.ozlabs.org/api/1.1/people/92484/?format=json","name":"Ricardo Branco","email":"rbranco@suse.de"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/ltp/patch/20260411092452.211540-1-rbranco@suse.de/mbox/","series":[{"id":499542,"url":"http://patchwork.ozlabs.org/api/1.1/series/499542/?format=json","web_url":"http://patchwork.ozlabs.org/project/ltp/list/?series=499542","date":"2026-04-11T09:24:51","name":"userfaultfd: Use two-step handshake to probe features","version":1,"mbox":"http://patchwork.ozlabs.org/series/499542/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2222373/comments/","check":"warning","checks":"http://patchwork.ozlabs.org/api/patches/2222373/checks/","tags":{},"headers":{"Return-Path":"<ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it>","X-Original-To":["incoming@patchwork.ozlabs.org","ltp@lists.linux.it"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","ltp@picard.linux.it"],"Authentication-Results":["legolas.ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256\n header.s=susede2_rsa header.b=Bli+syPS;\n\tdkim=fail reason=\"signature verification failed\" header.d=suse.de\n header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519\n header.b=nD8PmTFA;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key)\n header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa\n header.b=Bli+syPS;\n\tdkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256\n header.s=susede2_ed25519 header.b=nD8PmTFA;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.linux.it\n (client-ip=2001:1418:10:5::2; helo=picard.linux.it;\n envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it;\n receiver=patchwork.ozlabs.org)","smtp-out2.suse.de;\n\tnone"],"Received":["from picard.linux.it (picard.linux.it [IPv6:2001:1418:10:5::2])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4ft7Yh5Sx5z1y2d\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 11 Apr 2026 19:25:09 +1000 (AEST)","from picard.linux.it (localhost [IPv6:::1])\n\tby picard.linux.it (Postfix) with ESMTP id B3FC23E2142\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 11 Apr 2026 11:25:00 +0200 (CEST)","from in-2.smtp.seeweb.it (in-2.smtp.seeweb.it [217.194.8.2])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature ECDSA (secp384r1))\n (No client certificate requested)\n by picard.linux.it (Postfix) with ESMTPS id EC8713E0E67\n for <ltp@lists.linux.it>; Sat, 11 Apr 2026 11:24:57 +0200 (CEST)","from smtp-out2.suse.de (smtp-out2.suse.de\n [IPv6:2a07:de40:b251:101:10:150:64:2])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n (No client certificate requested)\n by in-2.smtp.seeweb.it (Postfix) with ESMTPS id 4968B600A6F\n for <ltp@lists.linux.it>; Sat, 11 Apr 2026 11:24:57 +0200 (CEST)","from imap1.dmz-prg2.suse.org (unknown [10.150.64.97])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest\n SHA256)\n (No client certificate requested)\n by smtp-out2.suse.de (Postfix) with ESMTPS id C71905BCD8;\n Sat, 11 Apr 2026 09:24:55 +0000 (UTC)","from imap1.dmz-prg2.suse.org (localhost [127.0.0.1])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest\n SHA256)\n (No client certificate requested)\n by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id A5D7B4A2B4;\n Sat, 11 Apr 2026 09:24:55 +0000 (UTC)","from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167])\n by imap1.dmz-prg2.suse.org with ESMTPSA id z/zaJmcT2mm+JgAAD6G6ig\n (envelope-from <rbranco@suse.de>); Sat, 11 Apr 2026 09:24:55 +0000"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de;\n s=susede2_rsa;\n t=1775899495;\n h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:\n mime-version:mime-version:\n content-transfer-encoding:content-transfer-encoding;\n bh=5VNFKs+qGsrj4d0YjqpXgq32ih+wFrpTGf94TKctzEA=;\n b=Bli+syPSSpLS72a3WM2sERwezdaau3uY7vNtpKZNLiWjXMqFDSI4XSub8kk1eJ69qbd+hW\n SbmKjqOvNVnm4BpFAAfJAj6eWztqUh88QygxY0sKVYRtc47ymxAKDYC7uz2/pI/Nen6CrO\n yhbMZW+5SfSSXjgCgGk5j7ZSp5hVgQ4=","v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de;\n s=susede2_ed25519; t=1775899495;\n h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:\n mime-version:mime-version:\n content-transfer-encoding:content-transfer-encoding;\n bh=5VNFKs+qGsrj4d0YjqpXgq32ih+wFrpTGf94TKctzEA=;\n b=nD8PmTFAkk5W3StsjJBfZBHeV8IGsvKAxmTC2MCLeEqg8jyuzKm+Ro9uQ1bCze+xbUxTu5\n iIUpu4KUqPAWHsDQ==","v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de;\n s=susede2_rsa;\n t=1775899495;\n h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:\n mime-version:mime-version:\n content-transfer-encoding:content-transfer-encoding;\n bh=5VNFKs+qGsrj4d0YjqpXgq32ih+wFrpTGf94TKctzEA=;\n b=Bli+syPSSpLS72a3WM2sERwezdaau3uY7vNtpKZNLiWjXMqFDSI4XSub8kk1eJ69qbd+hW\n SbmKjqOvNVnm4BpFAAfJAj6eWztqUh88QygxY0sKVYRtc47ymxAKDYC7uz2/pI/Nen6CrO\n yhbMZW+5SfSSXjgCgGk5j7ZSp5hVgQ4=","v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de;\n s=susede2_ed25519; t=1775899495;\n h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:\n mime-version:mime-version:\n content-transfer-encoding:content-transfer-encoding;\n bh=5VNFKs+qGsrj4d0YjqpXgq32ih+wFrpTGf94TKctzEA=;\n b=nD8PmTFAkk5W3StsjJBfZBHeV8IGsvKAxmTC2MCLeEqg8jyuzKm+Ro9uQ1bCze+xbUxTu5\n iIUpu4KUqPAWHsDQ=="],"From":"Ricardo Branco <rbranco@suse.de>","To":"ltp@lists.linux.it","Date":"Sat, 11 Apr 2026 11:24:51 +0200","Message-ID":"<20260411092452.211540-1-rbranco@suse.de>","X-Mailer":"git-send-email 2.53.0","MIME-Version":"1.0","X-Spam-Score":"-2.80","X-Spam-Level":"","X-Spamd-Result":"default: False [-2.80 / 50.00]; BAYES_HAM(-3.00)[100.00%];\n NEURAL_HAM_LONG(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[];\n R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-1.000];\n MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[];\n ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[];\n FROM_HAS_DN(0.00)[]; MIME_TRACE(0.00)[0:+];\n DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:mid,suse.de:email];\n FUZZY_RATELIMITED(0.00)[rspamd.com]; RCPT_COUNT_TWO(0.00)[2];\n RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[];\n DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519];\n TO_DN_SOME(0.00)[]; RCVD_TLS_ALL(0.00)[]","X-Spam-Status":"No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID,\n DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,SPF_HELO_NONE,SPF_PASS\n shortcircuit=no autolearn=disabled version=4.0.1","X-Spam-Checker-Version":"SpamAssassin 4.0.1 (2024-03-25) on in-2.smtp.seeweb.it","X-Virus-Scanned":"clamav-milter 1.0.9 at in-2.smtp.seeweb.it","X-Virus-Status":"Clean","Subject":"[LTP] [PATCH] userfaultfd: Use two-step handshake to probe features","X-BeenThere":"ltp@lists.linux.it","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"Linux Test Project <ltp.lists.linux.it>","List-Unsubscribe":"<https://lists.linux.it/options/ltp>,\n <mailto:ltp-request@lists.linux.it?subject=unsubscribe>","List-Archive":"<http://lists.linux.it/pipermail/ltp/>","List-Post":"<mailto:ltp@lists.linux.it>","List-Help":"<mailto:ltp-request@lists.linux.it?subject=help>","List-Subscribe":"<https://lists.linux.it/listinfo/ltp>,\n <mailto:ltp-request@lists.linux.it?subject=subscribe>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it","Sender":"\"ltp\" <ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it>"},"content":"userfaultfd05 and userfaultfd06 assume that\nUFFD_FEATURE_PAGEFAULT_FLAG_WP and UFFD_FEATURE_POISON are available\nwhen setting up userfaultfd.\n\nOn kernels where either feature is unavailable at runtime,\nUFFDIO_API fails with EINVAL and the tests end up as TBROK instead of\nbeing skipped.\n\nFix this by using the required two-step handshake and skip with TCONF\nif the required feature bit is absent.\n\nAlso remove userfaultfd05's needs_kconfigs check, since runtime\nfeature probing is sufficient here.\n\nLink: https://github.com/linux-test-project/ltp/issues/1289\n\nSigned-off-by: Ricardo Branco <rbranco@suse.de>\n---\n testcases/kernel/syscalls/userfaultfd/userfaultfd05.c | 11 +++++++----\n testcases/kernel/syscalls/userfaultfd/userfaultfd06.c | 10 +++++++---\n 2 files changed, 14 insertions(+), 7 deletions(-)","diff":"diff --git a/testcases/kernel/syscalls/userfaultfd/userfaultfd05.c b/testcases/kernel/syscalls/userfaultfd/userfaultfd05.c\nindex e25a227cf..5412f12e1 100644\n--- a/testcases/kernel/syscalls/userfaultfd/userfaultfd05.c\n+++ b/testcases/kernel/syscalls/userfaultfd/userfaultfd05.c\n@@ -89,7 +89,14 @@ static void run(void)\n \tset_pages();\n \n \tuffd = SAFE_USERFAULTFD(O_CLOEXEC | O_NONBLOCK, false);\n+\tuffdio_api.api = UFFD_API;\n+\tuffdio_api.features = 0;\n+\tSAFE_IOCTL(uffd, UFFDIO_API, &uffdio_api);\n+\tif (!(uffdio_api.features & UFFD_FEATURE_PAGEFAULT_FLAG_WP))\n+\t\ttst_brk(TCONF, \"UFFD_FEATURE_PAGEFAULT_FLAG_WP not supported\");\n+\tSAFE_CLOSE(uffd);\n \n+\tuffd = SAFE_USERFAULTFD(O_CLOEXEC | O_NONBLOCK, false);\n \tuffdio_api.api = UFFD_API;\n \tuffdio_api.features = UFFD_FEATURE_PAGEFAULT_FLAG_WP;\n \n@@ -124,8 +131,4 @@ static void run(void)\n static struct tst_test test = {\n \t.test_all = run,\n \t.min_kver = \"5.7\",\n-\t.needs_kconfigs = (const char *[]) {\n-\t\t\"CONFIG_HAVE_ARCH_USERFAULTFD_WP=y\",\n-\t\tNULL\n-\t}\n };\ndiff --git a/testcases/kernel/syscalls/userfaultfd/userfaultfd06.c b/testcases/kernel/syscalls/userfaultfd/userfaultfd06.c\nindex 5b1252c35..7ad682f5a 100644\n--- a/testcases/kernel/syscalls/userfaultfd/userfaultfd06.c\n+++ b/testcases/kernel/syscalls/userfaultfd/userfaultfd06.c\n@@ -100,15 +100,19 @@ static void run(void)\n \tset_pages();\n \n \tuffd = SAFE_USERFAULTFD(O_CLOEXEC | O_NONBLOCK, false);\n+\tuffdio_api.api = UFFD_API;\n+\tuffdio_api.features = 0;\n+\tSAFE_IOCTL(uffd, UFFDIO_API, &uffdio_api);\n+\tif (!(uffdio_api.features & UFFD_FEATURE_POISON))\n+\t\ttst_brk(TCONF, \"UFFD_FEATURE_POISON not supported\");\n+\tSAFE_CLOSE(uffd);\n \n+\tuffd = SAFE_USERFAULTFD(O_CLOEXEC | O_NONBLOCK, false);\n \tuffdio_api.api = UFFD_API;\n \tuffdio_api.features = UFFD_FEATURE_POISON;\n \n \tSAFE_IOCTL(uffd, UFFDIO_API, &uffdio_api);\n \n-\tif (!(uffdio_api.features & UFFD_FEATURE_POISON))\n-\t\ttst_brk(TCONF, \"UFFD_FEATURE_POISON not supported\");\n-\n \tuffdio_register.range.start = (unsigned long) page;\n \tuffdio_register.range.len = page_size;\n \tuffdio_register.mode = UFFDIO_REGISTER_MODE_MISSING;\n","prefixes":[]}