git: 77e6a5a66898 - main - nfs_clvfsops.c: Don't allow krb5i/krb5p or TLS for RDMA
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 26 Nov 2026 23:23:24 UTC
The branch main has been updated by rmacklem:
URL: https://cgit.FreeBSD.org/src/commit/?id=77e6a5a66898d951bae899295495141682dca96a
commit 77e6a5a66898d951bae899295495141682dca96a
Author: Rick Macklem <rmacklem@FreeBSD.org>
AuthorDate: 2026-11-26 23:21:07 +0000
Commit: Rick Macklem <rmacklem@FreeBSD.org>
CommitDate: 2026-11-26 23:21:07 +0000
nfs_clvfsops.c: Don't allow krb5i/krb5p or TLS for RDMA
I don't think it makes any sense to do encryption/decryption via
the cpu for data being RDMA'd. (The whole point of RDMA is to
move the data fast.) Disallow the combination of "rdma" and
"krb5i", "krb5p" or "tls".
MFC after: 1 month
Fixes: 884ee8d6c9b4 ("nfscl: Add some glue for client side NFS over RDMA")
---
sys/fs/nfsclient/nfs_clvfsops.c | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/sys/fs/nfsclient/nfs_clvfsops.c b/sys/fs/nfsclient/nfs_clvfsops.c
index d2ed135b5a73..1ed0d78acdb0 100644
--- a/sys/fs/nfsclient/nfs_clvfsops.c
+++ b/sys/fs/nfsclient/nfs_clvfsops.c
@@ -1268,6 +1268,9 @@ nfs_mount(struct mount *mp)
}
if (vfs_getopt(mp->mnt_optnew, "syskrb5", NULL, NULL) == 0)
newflag |= NFSMNT_SYSKRB5;
+ if (vfs_getopt(mp->mnt_optnew, "sec",
+ (void **) &secname, NULL) == 0)
+ nfs_sec_name(secname, &args.flags);
if (vfs_getopt(mp->mnt_optnew, "rdma", (void **)&opt, NULL) ==
0) {
ret = sscanf(opt, "%d", &rdma_port);
@@ -1281,6 +1284,17 @@ nfs_mount(struct mount *mp)
error = EINVAL;
goto out;
}
+ if ((args.flags & (NFSMNT_INTEGRITY | NFSMNT_PRIVACY)) != 0) {
+ vfs_mount_error(mp, "RDMA is not supported for "
+ "krb5i/krb5p");
+ error = EINVAL;
+ goto out;
+ }
+ if ((newflag & NFSMNT_TLS) != 0) {
+ vfs_mount_error(mp, "RDMA is not supported for TLS");
+ error = EINVAL;
+ goto out;
+ }
if (clnt_rdma_create_call == NULL) {
vfs_mount_error(mp, "RDMA requires the nfsclrdma.ko "
"module be loaded");
@@ -1294,9 +1308,6 @@ nfs_mount(struct mount *mp)
args.flags |= NFSMNT_READAHEAD;
}
}
- if (vfs_getopt(mp->mnt_optnew, "sec",
- (void **) &secname, NULL) == 0)
- nfs_sec_name(secname, &args.flags);
if (mp->mnt_flag & MNT_UPDATE) {
struct nfsmount *nmp = VFSTONFS(mp);