Commit 6610b3e4 authored by Konrad Sztyber's avatar Konrad Sztyber Committed by Tomasz Zawadzki
Browse files

module/keyring: add linux keyring module



This module uses the keyutils library to fetch keys managed by the Linux
kernel keyring.  The keys are created implicitly in the probe_key()
callback.  For now, they need to be attached to the kernel's keyring
before requesting them.  The following patches will add the ability to
specify callout information which will allow  the kernel to instantiate
the keys if they're unavailable.

Change-Id: I0aedd19247c6c35f22bcb61f4b387d5d85b42cdf
Signed-off-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/21760


Reviewed-by: default avatarAleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: default avatarJim Harris <jim.harris@samsung.com>
Community-CI: Mellanox Build Bot
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent b095c515
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -215,6 +215,9 @@ CONFIG_HAVE_LIBARCHIVE=n
# execinfo.h is available
CONFIG_HAVE_EXECINFO_H=n

# libkeytuils is available
CONFIG_HAVE_KEYUTILS=n

# Path to IPSEC_MB used by DPDK
CONFIG_IPSEC_MB_DIR=

+5 −0
Original line number Diff line number Diff line
@@ -1123,6 +1123,11 @@ if echo -e '#include <execinfo.h>' | "${BUILD_CMD[@]}" -c - 2> /dev/null; then
	CONFIG[HAVE_EXECINFO_H]=y
fi

if echo -e '#include <keyutils.h>\nint main(void) { request_key(0, 0, 0, -1); return 0; }' \
	| "${BUILD_CMD[@]}" - -lkeyutils 2> /dev/null; then
	CONFIG[HAVE_KEYUTILS]=y
fi

if [[ "${CONFIG[OCF]}" = "y" ]]; then
	# If OCF_PATH is a file, assume it is a library and use it to compile with
	if [ -f ${CONFIG[OCF_PATH]} ]; then
+4 −0
Original line number Diff line number Diff line
@@ -365,6 +365,10 @@ ifeq ($(OS).$(CC_TYPE),Windows.gcc)
SYS_LIBS += -l:libssp.a
endif

ifeq ($(CONFIG_HAVE_KEYUTILS),y)
SYS_LIBS += -lkeyutils
endif

MAKEFLAGS += --no-print-directory

C_SRCS += $(C_SRCS-y)
+1 −0
Original line number Diff line number Diff line
@@ -196,3 +196,4 @@ endif

# module/keyring
DEPDIRS-keyring_file := log keyring util $(JSON_LIBS)
DEPDIRS-keyring_linux := json log keyring util
+3 −0
Original line number Diff line number Diff line
@@ -128,6 +128,9 @@ VFU_DEVICE_MODULES_LIST = vfu_device
endif

KEYRING_MODULES_LIST = event_keyring keyring_file
ifeq ($(CONFIG_HAVE_KEYUTILS),y)
KEYRING_MODULES_LIST += keyring_linux
endif

EVENT_BDEV_SUBSYSTEM = event_bdev event_accel event_vmd event_sock event_iobuf

Loading