#
56a96c51 |
| 01-Feb-2025 |
Gleb Smirnoff <glebius@FreeBSD.org> |
rpcsec_tls/client: API refactoring between kernel and rpc.tlsclntd(8)
Now that the conversion of rpcsec_tls/client + rpc.tlsclntd(8) to the netlink(4) socket as RPC transport started using kernel so
rpcsec_tls/client: API refactoring between kernel and rpc.tlsclntd(8)
Now that the conversion of rpcsec_tls/client + rpc.tlsclntd(8) to the netlink(4) socket as RPC transport started using kernel socket pointer as a reliable cookie, we can shave off quite a lot of complexity. We will utilize the same kernel-generated cookie in all RPCs. And the need for the daemon generated cookie in the form of timestamp+sequence vanishes.
In the clnt_vc.c we no longer need to store the userland cookie, but we still need to observe the TLS life cycle of the client. We observe RPCTLS_INHANDSHAKE state, that lives for a short time when the socket had already been fetched by the daemon with the syscall, but the RPC call is still waiting for the reply from daemon.
This time bump the RPC version.
Reviewed by: rmacklem Differential Revision: https://reviews.freebsd.org/D48564
show more ...
|
#
a3a6dc24 |
| 01-Feb-2025 |
Gleb Smirnoff <glebius@FreeBSD.org> |
rpcsec_tls/client: use netlink RPC client to talk to rpc.tlsclntd(8)
In addition to using netlink(4) socket instead of unix(4) to pass rpctlscd_* RPC commands to rpc.tlsclntd(8), the logic of passin
rpcsec_tls/client: use netlink RPC client to talk to rpc.tlsclntd(8)
In addition to using netlink(4) socket instead of unix(4) to pass rpctlscd_* RPC commands to rpc.tlsclntd(8), the logic of passing file descriptor is also changed. Since clnt_nl provides us all needed parallelism and waits on individual RPC xids, we don't need to store socket in a global variable and serialize all communication to the daemon. Instead, we will augment rpctlscd_connect arguments with a cookie that is basically a pointer to socket, that we keep for the daemon. While sleeping on the request, we will store a database of all sockets associated with rpctlscd_connect RPCs that we have sent to userland. The daemon then will send us back the cookie in the rpctls_syscall(RPCTLS_SYSC_CLSOCKET) argument and we will find and return the socket for this upcall.
This will be optimized further in a separate commit, that will also touch clnt_vc.c and other krpc files. This commit is intentionally made minimal, so that it is easier to understand what changes with netlink(4) transport.
Reviewed by: rmacklem Differential Revision: https://reviews.freebsd.org/D48559
show more ...
|
Revision tags: release/14.1.0-p7, release/14.2.0-p1, release/13.4.0-p3, release/14.2.0, release/13.4.0, release/14.1.0, release/13.3.0, release/14.0.0 |
|
#
71625ec9 |
| 16-Aug-2023 |
Warner Losh <imp@FreeBSD.org> |
sys: Remove $FreeBSD$: one-line .c comment pattern
Remove /^/[*/]\s*\$FreeBSD\$.*\n/
|
Revision tags: release/13.2.0, release/12.4.0, release/13.1.0, release/12.3.0, release/13.0.0 |
|
#
665b1365 |
| 22-Dec-2020 |
Rick Macklem <rmacklem@FreeBSD.org> |
Add a new "tlscertname" NFS mount option.
When using NFS-over-TLS, an NFS client can optionally provide an X.509 certificate to the server during the TLS handshake. For some situations, such as dif
Add a new "tlscertname" NFS mount option.
When using NFS-over-TLS, an NFS client can optionally provide an X.509 certificate to the server during the TLS handshake. For some situations, such as different NFS servers or different certificates being mapped to different user credentials on the NFS server, there may be a need for different mounts to provide different certificates.
This new mount option called "tlscertname" may be used to specify a non-default certificate be provided. This alernate certificate will be stored in /etc/rpc.tlsclntd in a file with a name based on what is provided by this mount option.
show more ...
|
Revision tags: release/12.2.0 |
|
#
e2515283 |
| 27-Aug-2020 |
Glen Barber <gjb@FreeBSD.org> |
MFH
Sponsored by: Rubicon Communications, LLC (netgate.com)
|
#
ab0c29af |
| 22-Aug-2020 |
Rick Macklem <rmacklem@FreeBSD.org> |
Add TLS support to the kernel RPC.
An internet draft titled "Towards Remote Procedure Call Encryption By Default" describes how TLS is to be used for Sun RPC, with NFS as an intended use case. This
Add TLS support to the kernel RPC.
An internet draft titled "Towards Remote Procedure Call Encryption By Default" describes how TLS is to be used for Sun RPC, with NFS as an intended use case. This patch adds client and server support for this to the kernel RPC, using KERN_TLS and upcalls to daemons for the handshake, peer reset and other non-application data record cases.
The upcalls to the daemons use three fields to uniquely identify the TCP connection. They are the time.tv_sec, time.tv_usec of the connection establshment, plus a 64bit sequence number. The time fields avoid problems with re-use of the sequence number after a daemon restart. For the server side, once a Null RPC with AUTH_TLS is received, kernel reception on the socket is blocked and an upcall to the rpctlssd(8) daemon is done to perform the TLS handshake. Upon completion, the completion status of the handshake is stored in xp_tls as flag bits and the reply to the Null RPC is sent. For the client, if CLSET_TLS has been set, a new TCP connection will send the Null RPC with AUTH_TLS to initiate the handshake. The client kernel RPC code will then block kernel I/O on the socket and do an upcall to the rpctlscd(8) daemon to perform the handshake. If the upcall is successful, ct_rcvstate will be maintained to indicate if/when an upcall is being done.
If non-application data records are received, the code does an upcall to the appropriate daemon, which will do a SSL_read() of 0 length to handle the record(s).
When the socket is being shut down, upcalls are done to the daemons, so that they can perform SSL_shutdown() calls to perform the "peer reset".
The rpctlssd(8) and rpctlscd(8) daemons require a patched version of the openssl library and, as such, will not be committed to head at this time.
Although the changes done by this patch are fairly numerous, there should be no semantics change to the kernel RPC at this time. A future commit to the NFS code will optionally enable use of TLS for NFS.
show more ...
|