Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2218542/?format=api
{ "id": 2218542, "url": "http://patchwork.ozlabs.org/api/patches/2218542/?format=api", "web_url": "http://patchwork.ozlabs.org/project/ltp/patch/20260401115147.11604-1-chrubis@suse.cz/", "project": { "id": 59, "url": "http://patchwork.ozlabs.org/api/projects/59/?format=api", "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": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20260401115147.11604-1-chrubis@suse.cz>", "list_archive_url": null, "date": "2026-04-01T11:51:47", "name": "[v2] lib: tst_kconfig: Add runtime checks for CONFIG_*_NS", "commit_ref": null, "pull_url": null, "state": "needs-review-ack", "archived": false, "hash": "c14010fb37e88fa2f7cc644a3f960ec3a6371d41", "submitter": { "id": 8530, "url": "http://patchwork.ozlabs.org/api/people/8530/?format=api", "name": "Cyril Hrubis", "email": "chrubis@suse.cz" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/ltp/patch/20260401115147.11604-1-chrubis@suse.cz/mbox/", "series": [ { "id": 498323, "url": "http://patchwork.ozlabs.org/api/series/498323/?format=api", "web_url": "http://patchwork.ozlabs.org/project/ltp/list/?series=498323", "date": "2026-04-01T11:51:47", "name": "[v2] lib: tst_kconfig: Add runtime checks for CONFIG_*_NS", "version": 2, "mbox": "http://patchwork.ozlabs.org/series/498323/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2218542/comments/", "check": "success", "checks": "http://patchwork.ozlabs.org/api/patches/2218542/checks/", "tags": {}, "related": [], "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.cz header.i=@suse.cz header.a=rsa-sha256\n header.s=susede2_rsa header.b=2RqcsvuL;\n\tdkim=fail reason=\"signature verification failed\" header.d=suse.cz\n header.i=@suse.cz header.a=ed25519-sha256 header.s=susede2_ed25519\n header.b=9exbVB+H;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key)\n header.d=suse.cz header.i=@suse.cz header.a=rsa-sha256 header.s=susede2_rsa\n header.b=FCfaCNuZ;\n\tdkim=neutral header.d=suse.cz header.i=@suse.cz header.a=ed25519-sha256\n header.s=susede2_ed25519 header.b=CL3qwA07;\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-out1.suse.de;\n dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=FCfaCNuZ;\n dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=CL3qwA07" ], "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 4fm3Hc0ndBz1xtJ\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 01 Apr 2026 22:51:53 +1100 (AEDT)", "from picard.linux.it (localhost [IPv6:::1])\n\tby picard.linux.it (Postfix) with ESMTP id E2A2A3E5A94\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 1 Apr 2026 13:51:49 +0200 (CEST)", "from in-4.smtp.seeweb.it (in-4.smtp.seeweb.it [217.194.8.4])\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 F24923CAE45\n for <ltp@lists.linux.it>; Wed, 1 Apr 2026 13:51:45 +0200 (CEST)", "from smtp-out1.suse.de (smtp-out1.suse.de\n [IPv6:2a07:de40:b251:101:10:150:64:1])\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-4.smtp.seeweb.it (Postfix) with ESMTPS id 6D63B100074D\n for <ltp@lists.linux.it>; Wed, 1 Apr 2026 13:51:45 +0200 (CEST)", "from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org\n [IPv6:2a07:de40:b281:104: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-out1.suse.de (Postfix) with ESMTPS id D120D4D2E0;\n Wed, 1 Apr 2026 11:51:43 +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 C32FB4A0B0;\n Wed, 1 Apr 2026 11:51:43 +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 6r7sLs8GzWkZXgAAD6G6ig\n (envelope-from <chrubis@suse.cz>); Wed, 01 Apr 2026 11:51:43 +0000" ], "DKIM-Signature": [ "v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz;\n s=susede2_rsa;\n t=1775044304;\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=l0NBkrk3KK5uPwvxUQ8y0WatCK+0w5qY8w1wn0BCMSQ=;\n b=2RqcsvuLEbOruVKbej4QAIWkzjhQx7tHGTqrl2C3pZeTqc2KYHPpCqVxFuzyRAu+ON1TdF\n ehzi9GRAPwkyFUINg3IZEcHiPVkNxIz85LoL+zwL6K0BDOfy5dP+zhQPaN1EdWHhQkbvd8\n r/+EAnYBkFW7dFxbu6NZnwwBxbDlDEU=", "v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz;\n s=susede2_ed25519; t=1775044304;\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=l0NBkrk3KK5uPwvxUQ8y0WatCK+0w5qY8w1wn0BCMSQ=;\n b=9exbVB+HVGvskE+JnAo8C53Oq5nK6gkozxifnLVNqb90xqIzN5fs0piDE1rWej7BD1DZaQ\n Q45YKQPkEJg4zIDg==", "v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz;\n s=susede2_rsa;\n t=1775044303;\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=l0NBkrk3KK5uPwvxUQ8y0WatCK+0w5qY8w1wn0BCMSQ=;\n b=FCfaCNuZojVrQQ/qbSywd0GwwivIePL1KhE/WdFQRHaAhHcwZDDJ0wlSidq8+hQ/uDHJ3R\n pEOXEHmGTlotkfV0+rtK54xoaBaNQrSSuMU6ty4BaxOTL91M5cJ2S72mPvwhtZuDOjQFw6\n CnnMxSUEWYYw+6ypvNjFFTDijPjPHEU=", "v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz;\n s=susede2_ed25519; t=1775044303;\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=l0NBkrk3KK5uPwvxUQ8y0WatCK+0w5qY8w1wn0BCMSQ=;\n b=CL3qwA07JWOxGHNU1ozXTGKzu7O24YxD3kquHfFzN/5HcIygihfq8Arks7J+rsLMa1h1zJ\n 275TRwHATqsApFAg==" ], "From": "Cyril Hrubis <chrubis@suse.cz>", "To": "ltp@lists.linux.it", "Date": "Wed, 1 Apr 2026 13:51:47 +0200", "Message-ID": "<20260401115147.11604-1-chrubis@suse.cz>", "X-Mailer": "git-send-email 2.52.0", "MIME-Version": "1.0", "X-Rspamd-Action": "no action", "X-Rspamd-Server": "rspamd2.dmz-prg2.suse.org", "X-Spamd-Result": "default: False [-3.01 / 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)[];\n R_DKIM_ALLOW(-0.20)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519];\n NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain];\n MX_GOOD(-0.01)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[];\n RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from];\n MIME_TRACE(0.00)[0:+]; FUZZY_RATELIMITED(0.00)[rspamd.com];\n TO_DN_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2];\n RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received];\n FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[];\n DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns,suse.cz:dkim,suse.cz:mid,suse.cz:email];\n RCVD_TLS_ALL(0.00)[]; FROM_EQ_ENVFROM(0.00)[];\n RCPT_COUNT_TWO(0.00)[2];\n DKIM_SIGNED(0.00)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519];\n SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from];\n DKIM_TRACE(0.00)[suse.cz:+]", "X-Rspamd-Queue-Id": "D120D4D2E0", "X-Spam-Score": "-3.01", "X-Spam-Level": "", "X-Spam-Status": "No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID,\n DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS shortcircuit=no\n autolearn=disabled version=4.0.1", "X-Spam-Checker-Version": "SpamAssassin 4.0.1 (2024-03-25) on in-4.smtp.seeweb.it", "X-Virus-Scanned": "clamav-milter 1.0.9 at in-4.smtp.seeweb.it", "X-Virus-Status": "Clean", "Subject": "[LTP] [PATCH v2] lib: tst_kconfig: Add runtime checks for\n CONFIG_*_NS", "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": "Previously LTP Kconfig parsing logic only checked if a feature was\nenabled during kernel compilation (e.g., CONFIG_USER_NS=y). However,\nsome kernel features can be compiled in but disabled at runtime via\nkernel command-line or sysctls. Tests relying only on Kconfig variables\nmay have failed when features were runtime disabled.\n\nThis patch introduces a runtime check mechanism for Kconfig variables.\nWhen a CONFIG_* variable is parsed as 'y' or 'm' and when runtime check\nhas been associated with the variable we run the check and potentionaly\nprint a message and override the variable value.\n\nSigned-off-by: Cyril Hrubis <chrubis@suse.cz>\nReviewed-by: Petr Vorel <pvorel@suse.cz>\n---\n lib/newlib_tests/test_kconfig.c | 1 +\n lib/tst_kconfig.c | 38 ++++++++++++++++++++++++++++++++-\n lib/tst_kconfig_checks.h | 37 ++++++++++++++++++++++++++++++++\n 3 files changed, 75 insertions(+), 1 deletion(-)\n create mode 100644 lib/tst_kconfig_checks.h", "diff": "diff --git a/lib/newlib_tests/test_kconfig.c b/lib/newlib_tests/test_kconfig.c\nindex cea36b5ee..ed2c4610a 100644\n--- a/lib/newlib_tests/test_kconfig.c\n+++ b/lib/newlib_tests/test_kconfig.c\n@@ -18,6 +18,7 @@ static const char *kconfigs[] = {\n \t\"CONFIG_MMU & CONFIG_EXT4_FS=m\",\n \t\"CONFIG_EXT4_FS=m | CONFIG_MMU\",\n \t\"CONFIG_DEFAULT_HOSTNAME=\\\"(none)\\\"\",\n+\t\"CONFIG_USER_NS\",\n \tNULL\n };\n \ndiff --git a/lib/tst_kconfig.c b/lib/tst_kconfig.c\nindex adc56503e..52dd6d726 100644\n--- a/lib/tst_kconfig.c\n+++ b/lib/tst_kconfig.c\n@@ -1,6 +1,6 @@\n // SPDX-License-Identifier: GPL-2.0-or-later\n /*\n- * Copyright (c) 2018 Cyril Hrubis <chrubis@suse.cz>\n+ * Copyright (c) 2018-2026 Cyril Hrubis <chrubis@suse.cz>\n */\n \n #include <stdlib.h>\n@@ -16,6 +16,8 @@\n #include \"tst_bool_expr.h\"\n #include \"tst_safe_stdio.h\"\n \n+#include \"tst_kconfig_checks.h\"\n+\n static int kconfig_skip_check(void)\n {\n \tchar *skipped = getenv(\"KCONFIG_SKIP_CHECK\");\n@@ -110,6 +112,38 @@ static void close_kconfig(FILE *fp)\n \t\tfclose(fp);\n }\n \n+static struct runtime_check {\n+\tconst char *config;\n+\tbool (*runtime_check)(void);\n+} runtime_checks[] = {\n+\t{\"CONFIG_USER_NS\", tst_user_ns_enabled},\n+\t{\"CONFIG_NET_NS\", tst_net_ns_enabled},\n+\t{\"CONFIG_PID_NS\", tst_pid_ns_enabled},\n+\t{\"CONFIG_MNT_NS\", tst_mnt_ns_enabled},\n+\t{\"CONFIG_IPC_NS\", tst_ipc_ns_enabled},\n+\t{}\n+};\n+\n+static void runtime_check(struct tst_kconfig_var *var)\n+{\n+\tsize_t i;\n+\n+\tfor (i = 0; runtime_checks[i].config; i++) {\n+\t\tif (strcmp(runtime_checks[i].config, var->id))\n+\t\t\tcontinue;\n+\n+\t\ttst_res(TDEBUG, \"Running runtime check for '%s'\", var->id);\n+\n+\t\tif (!runtime_checks[i].runtime_check()) {\n+\t\t\ttst_res(TINFO,\n+\t\t\t\t\"%s=%c present but disabled at runtime\",\n+\t\t\t\tvar->id, var->choice);\n+\t\t\tvar->choice = 'n';\n+\t\t\treturn;\n+\t\t}\n+\t}\n+}\n+\n static inline int kconfig_parse_line(const char *line,\n struct tst_kconfig_var *vars,\n unsigned int vars_len)\n@@ -183,9 +217,11 @@ out:\n \t\t\tswitch (val[0]) {\n \t\t\tcase 'y':\n \t\t\t\tvars[i].choice = 'y';\n+\t\t\t\truntime_check(&vars[i]);\n \t\t\t\treturn 1;\n \t\t\tcase 'm':\n \t\t\t\tvars[i].choice = 'm';\n+\t\t\t\truntime_check(&vars[i]);\n \t\t\t\treturn 1;\n \t\t\t}\n \t\t}\ndiff --git a/lib/tst_kconfig_checks.h b/lib/tst_kconfig_checks.h\nnew file mode 100644\nindex 000000000..94aad6411\n--- /dev/null\n+++ b/lib/tst_kconfig_checks.h\n@@ -0,0 +1,37 @@\n+// SPDX-License-Identifier: GPL-2.0-or-later\n+/*\n+ * Copyright (c) 2026 Cyril Hrubis <chrubis@suse.cz>\n+ */\n+\n+#ifndef TST_KCONFIG_CHECKS_H\n+#define TST_KCONFIG_CHECKS_H\n+\n+#include <unistd.h>\n+#include <stdbool.h>\n+\n+static inline bool tst_user_ns_enabled(void)\n+{\n+\treturn access(\"/proc/self/ns/user\", F_OK) == 0;\n+}\n+\n+static inline bool tst_net_ns_enabled(void)\n+{\n+\treturn access(\"/proc/self/ns/net\", F_OK) == 0;\n+}\n+\n+static inline bool tst_pid_ns_enabled(void)\n+{\n+\treturn access(\"/proc/self/ns/pid\", F_OK) == 0;\n+}\n+\n+static inline bool tst_mnt_ns_enabled(void)\n+{\n+\treturn access(\"/proc/self/ns/mnt\", F_OK) == 0;\n+}\n+\n+static inline bool tst_ipc_ns_enabled(void)\n+{\n+\treturn access(\"/proc/self/ns/ipc\", F_OK) == 0;\n+}\n+\n+#endif /* TST_KCONFIG_CHECKS_H */\n", "prefixes": [ "v2" ] }