Skip to content

Design Materials

Chuck Lever edited this page Sep 26, 2026 · 6 revisions

Project Design

As the components of ktls-utils are developed, their design can be discussed and documented here on this wiki.

The material below is historical. It records the design as it stood before any code was written, and it is kept here to show the requirements the project started from. The kernel side has since diverged from the second item: Linux 6.5 added the net/handshake genetlink upcall, and tlshd receives handshake requests over that socket rather than through request_key. Kernel keyrings remain the way authentication material reaches tlshd, as tlshd.conf(5) and nfstlskey(8) in the source tree describe.

Initially we envision the use of kernel keyrings for two purposes:

  1. Administrative interfaces such as mount.nfs will prime a special kernel keyring (via add_key(2)) with x.509 certificates or pre-shared keys that enable ktls-utils to authenticate the communicating peers. When a handshake is needed, ktls-utils user agents search this keyring for appropriate authentication material.

  2. A second kernel keyring can be used to pass handshake requests to ktls-utils using the request_key mechanism or something similar. The kernel passes a socket that needs to be instantiated for use with KTLS, and the ktls-utils user agent performs a TLS handshake on that socket and returns it to the kernel.

Further requirements

  • These mechanisms must maintain the authentication material separately and securely for each network namespace.

  • The user agents must support both initial session establishment and re-keying, both of which are handled via the TLS handshake protocol.

  • It might be possible to share session key material between kernel TLS sessions. Investigation is needed to demonstrate feasibility and benefit.

Items that cannot be supported via a user agent

One long-term requirement is support for NFSROOT using TLS, and the block equivalent of hosting the root filesystem on an NVMe device using TCP with TLS. This usage scenario is impossible to implement with a user agent that is stored on the root filesystem. Once the ktls-utils infrastructure described here is established, some or all of the handshake implementation will have to be moved into the kernel to support protected root filesystems properly.

TLS library choice

ktls-utils uses GnuTLS for its handshakes. That is a licensing decision rather than a technical preference. ktls-utils is released under GPLv2, the same license as the kernel it serves, and the Apache License 2.0 that OpenSSL carries since version 3.0 is not compatible with GPLv2. GnuTLS is LGPLv2.1 or later, which is.

The same constraint applies to any proposal to add an alternative backend or to port a component to another language: a TLS library that is available only under Apache-2.0 is ruled out regardless of its technical merit. A library offered under several licenses, one of them GPLv2-compatible, is acceptable. rustls (Apache-2.0, MIT, or ISC at the user's choice) is an example.

Clone this wiki locally