Linux Test Project
 help / color / mirror / Atom feed
* [LTP] [PATCH v2 1/1] Stop using libkeyutils
@ 2026-09-23  5:41 Petr Vorel
  2026-09-23  9:02 ` Li Wang
  2026-09-23 10:42 ` Cyril Hrubis
  0 siblings, 2 replies; 7+ messages in thread
From: Petr Vorel @ 2026-09-23  5:41 UTC (permalink / raw)
  To: ltp

Using directly <linux/keyctl.h> is enough. Move the rest of struct
checks in to configure.ac (together with other struct checks).

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
This is probably too much as a pre-release fix, it should probably wait
after the release.

Changes v1->v2:
* Remove printing "keyutils: ${have_keyutils:-yes}" in configure.ac (agent)
* Remove <keyutils.h> in configure.ac (agent)
* Remove Follow-up: of first commit (I'll add it before merge when we
  have correct hash) (agent)
* Reword commit subject

Link to v1:
https://patchwork.kernel.org/project/ltp/patch/20260922160911.2271754-5-pvorel@suse.cz/
https://lore.kernel.org/ltp/20260922160911.2271754-5-pvorel@suse.cz/


 configure.ac                                   |  7 ++++---
 include/mk/config.mk.in                        |  1 -
 m4/ltp-keyutils.m4                             | 15 ---------------
 testcases/cve/Makefile                         |  2 --
 testcases/kernel/syscalls/add_key/Makefile     |  2 --
 testcases/kernel/syscalls/keyctl/Makefile      |  1 -
 testcases/kernel/syscalls/landlock/Makefile    |  2 --
 testcases/kernel/syscalls/request_key/Makefile |  2 --
 testcases/kernel/watchqueue/Makefile           |  2 --
 9 files changed, 4 insertions(+), 30 deletions(-)
 delete mode 100644 m4/ltp-keyutils.m4

diff --git a/configure.ac b/configure.ac
index 18bfdb88c7..e979de0e78 100644
--- a/configure.ac
+++ b/configure.ac
@@ -56,7 +56,6 @@ AC_CHECK_HEADERS_ONCE([ \
     cpuid.h \
     emmintrin.h \
     ifaddrs.h \
-    keyutils.h \
     linux/blkdev.h \
     linux/can.h \
     linux/cgroupstats.h \
@@ -300,6 +299,10 @@ AC_CHECK_TYPES([struct uffdio_move],,,[#include <linux/userfaultfd.h>])
 AC_CHECK_TYPES([struct uffdio_poison],,,[#include <linux/userfaultfd.h>])
 AC_CHECK_TYPES([struct uffdio_writeprotect],,,[#include <linux/userfaultfd.h>])
 
+AC_CHECK_TYPES([struct keyctl_dh_params, struct keyctl_kdf_params,
+	struct keyctl_pkey_query, struct keyctl_pkey_params],,,
+	[#include <linux/keyctl.h>])
+
 # Tools knobs
 
 # Bash
@@ -422,7 +425,6 @@ LTP_CHECK_CLEAR_CACHE
 LTP_CHECK_CRYPTO
 LTP_CHECK_FORTIFY_SOURCE
 LTP_CHECK_KERNEL_DEVEL
-LTP_CHECK_KEYUTILS_SUPPORT
 LTP_CHECK_LIBMNL
 LTP_CHECK_SELINUX
 LTP_CHECK_SYNC_ADD_AND_FETCH
@@ -478,7 +480,6 @@ open posix testsuite: ${with_open_posix_testsuite:-no}
 TI-RPC testsuite: ${with_tirpc:-yes}
 
 LIBRARIES
-keyutils: ${have_keyutils:-yes}
 libacl: ${have_libacl:-no}
 libaio: ${have_libaio:-no} (aio: ${have_aio:-no})
 libcap: $cap_libs (newer: ${has_newer_libcap:-no})
diff --git a/include/mk/config.mk.in b/include/mk/config.mk.in
index 4c3da304fc..d796306e3a 100644
--- a/include/mk/config.mk.in
+++ b/include/mk/config.mk.in
@@ -38,7 +38,6 @@ SELINUX_LIBS		:= @SELINUX_LIBS@
 HAVE_RPC		:= @HAVE_RPC@
 LIBTIRPC_CFLAGS		:= @LIBTIRPC_CFLAGS@
 LIBTIRPC_LIBS		:= @LIBTIRPC_LIBS@
-KEYUTILS_LIBS		:= @KEYUTILS_LIBS@
 HAVE_FTS_H		:= @HAVE_FTS_H@
 LIBMNL_LIBS		:= @LIBMNL_LIBS@
 LIBMNL_CFLAGS		:= @LIBMNL_CFLAGS@
diff --git a/m4/ltp-keyutils.m4 b/m4/ltp-keyutils.m4
deleted file mode 100644
index 4a6b23dbce..0000000000
--- a/m4/ltp-keyutils.m4
+++ /dev/null
@@ -1,15 +0,0 @@
-dnl SPDX-License-Identifier: GPL-2.0-or-later
-dnl Copyright (c) 2016 Fujitsu Ltd.
-dnl Copyright (c) 2017 Petr Vorel <pvorel@suse.cz>
-dnl Copyright (c) Linux Test Project, 2019-2026
-dnl Author: Xiao Yang <yangx.jy@cn.fujitsu.com>
-
-AC_DEFUN([LTP_CHECK_KEYUTILS_SUPPORT], [
-	AC_CHECK_LIB([keyutils], [add_key],
-	[AC_DEFINE(HAVE_LIBKEYUTILS, 1, [Define to 1 if you have libkeyutils installed.])
-	      AC_SUBST(KEYUTILS_LIBS, "-lkeyutils")])
-
-	AC_CHECK_TYPES([struct keyctl_dh_params, struct keyctl_kdf_params,
-			struct keyctl_pkey_query, struct keyctl_pkey_params],,,
-			[#include <linux/keyctl.h>])
-])
diff --git a/testcases/cve/Makefile b/testcases/cve/Makefile
index b4e4178ebb..c7c160a1b1 100644
--- a/testcases/cve/Makefile
+++ b/testcases/cve/Makefile
@@ -9,8 +9,6 @@ CFLAGS			+= -D_GNU_SOURCE
 
 stack_clash:	CFLAGS += -fno-optimize-sibling-calls -Wno-infinite-recursion
 
-cve-2016-7042:	LDLIBS += $(KEYUTILS_LIBS)
-
 cve-2014-0196 cve-2016-7117 cve-2017-2671 cve-2017-17052 cve-2017-17053 ghostlock refluxfs:  CFLAGS += -pthread
 cve-2014-0196 cve-2016-7117 cve-2017-2671:  LDLIBS += -lrt
 
diff --git a/testcases/kernel/syscalls/add_key/Makefile b/testcases/kernel/syscalls/add_key/Makefile
index 0f51e0bc2f..1273a4e9cb 100644
--- a/testcases/kernel/syscalls/add_key/Makefile
+++ b/testcases/kernel/syscalls/add_key/Makefile
@@ -5,6 +5,4 @@ top_srcdir		?= ../../../..
 
 include $(top_srcdir)/include/mk/testcases.mk
 
-LDLIBS  += $(KEYUTILS_LIBS)
-
 include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/kernel/syscalls/keyctl/Makefile b/testcases/kernel/syscalls/keyctl/Makefile
index 180ece25a2..14d1d20a4e 100644
--- a/testcases/kernel/syscalls/keyctl/Makefile
+++ b/testcases/kernel/syscalls/keyctl/Makefile
@@ -5,7 +5,6 @@ top_srcdir		?= ../../../..
 
 include $(top_srcdir)/include/mk/testcases.mk
 
-LDLIBS	+= $(KEYUTILS_LIBS)
 keyctl02: LDLIBS	+= -lpthread
 
 include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/kernel/syscalls/landlock/Makefile b/testcases/kernel/syscalls/landlock/Makefile
index 3734d10349..02a66be910 100644
--- a/testcases/kernel/syscalls/landlock/Makefile
+++ b/testcases/kernel/syscalls/landlock/Makefile
@@ -5,6 +5,4 @@ top_srcdir		?= ../../../..
 
 include $(top_srcdir)/include/mk/testcases.mk
 
-landlock07: LDLIBS += $(KEYUTILS_LIBS)
-
 include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/kernel/syscalls/request_key/Makefile b/testcases/kernel/syscalls/request_key/Makefile
index 58a99875e5..15e07c4ca1 100644
--- a/testcases/kernel/syscalls/request_key/Makefile
+++ b/testcases/kernel/syscalls/request_key/Makefile
@@ -6,6 +6,4 @@ top_srcdir		?= ../../../..
 
 include $(top_srcdir)/include/mk/testcases.mk
 
-LDLIBS		+= $(KEYUTILS_LIBS)
-
 include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/kernel/watchqueue/Makefile b/testcases/kernel/watchqueue/Makefile
index 896d66d429..cba769739b 100644
--- a/testcases/kernel/watchqueue/Makefile
+++ b/testcases/kernel/watchqueue/Makefile
@@ -4,5 +4,3 @@ top_srcdir			?= ../../..
 
 include $(top_srcdir)/include/mk/testcases.mk
 include $(top_srcdir)/include/mk/generic_leaf_target.mk
-
-LDLIBS += $(KEYUTILS_LIBS)
-- 
2.53.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-09-24  8:34 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-23  5:41 [LTP] [PATCH v2 1/1] Stop using libkeyutils Petr Vorel
2026-09-23  9:02 ` Li Wang
2026-09-23 11:09   ` Cyril Hrubis
2026-09-23 11:37     ` Petr Vorel
2026-09-23 10:42 ` Cyril Hrubis
2026-09-23 19:37   ` Petr Vorel
2026-09-24  8:33     ` Cyril Hrubis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox