[RFC PATCH v1 6/8] nfs: refuse P2PDMA pages with krb5i and krb5p
From: Pranjal Shrivastava
Date: Tue Oct 06 2026 - 19:37:46 EST
krb5i checksums and krb5p encrypts the payload via CPU accesses
while the RPC is encoded, before the transport can refuse it.
Fail such READs and WRITEs with -EREMOTEIO in nfs_pgio_prepare(),
before encoding. Check the task's RPC client, which for a WRITE may
be the krb5i client that SP4_MACH_CRED swaps in.
Signed-off-by: Pranjal Shrivastava <praan@xxxxxxxxxx>
---
fs/nfs/pagelist.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/fs/nfs/pagelist.c b/fs/nfs/pagelist.c
index 3ec4e1e5fe1f..ec535ed3051d 100644
--- a/fs/nfs/pagelist.c
+++ b/fs/nfs/pagelist.c
@@ -771,6 +771,14 @@ static void nfs_pgio_prepare(struct rpc_task *task, void *calldata)
{
struct nfs_pgio_header *hdr = calldata;
int err;
+
+ /* P2PDMA payloads move only by DMA */
+ if (hdr->args.p2pdma &&
+ test_bit(RPCAUTH_AUTH_DATATOUCH,
+ &task->tk_client->cl_auth->au_flags)) {
+ rpc_exit(task, -EREMOTEIO);
+ return;
+ }
err = NFS_PROTO(hdr->inode)->pgio_rpc_prepare(task, hdr);
if (err)
rpc_exit(task, err);
--
2.56.0.rc1.315.gc6ed9934b7-goog