Skip to content

Commit 9339b4e

Browse files
jworrellgregkh
authored andcommitted
SUNRPC: call xs_sock_process_cmsg for all cmsg
[ Upstream commit 9559d2f ] xs_sock_recv_cmsg was failing to call xs_sock_process_cmsg for any cmsg type other than TLS_RECORD_TYPE_ALERT (TLS_RECORD_TYPE_DATA, and other values not handled.) Based on my reading of the previous commit (cc5d590: sunrpc: fix client side handling of tls alerts), it looks like only iov_iter_revert should be conditional on TLS_RECORD_TYPE_ALERT (but that other cmsg types should still call xs_sock_process_cmsg). On my machine, I was unable to connect (over mtls) to an NFS share hosted on FreeBSD. With this patch applied, I am able to mount the share again. Fixes: cc5d590 ("sunrpc: fix client side handling of tls alerts") Signed-off-by: Justin Worrell <jworrell@gmail.com> Reviewed-and-tested-by: Scott Mayhew <smayhew@redhat.com> Link: https://lore.kernel.org/r/20250904211038.12874-3-jworrell@gmail.com Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent fd00ae0 commit 9339b4e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

net/sunrpc/xprtsock.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -407,9 +407,9 @@ xs_sock_recv_cmsg(struct socket *sock, unsigned int *msg_flags, int flags)
407407
iov_iter_kvec(&msg.msg_iter, ITER_DEST, &alert_kvec, 1,
408408
alert_kvec.iov_len);
409409
ret = sock_recvmsg(sock, &msg, flags);
410-
if (ret > 0 &&
411-
tls_get_record_type(sock->sk, &u.cmsg) == TLS_RECORD_TYPE_ALERT) {
412-
iov_iter_revert(&msg.msg_iter, ret);
410+
if (ret > 0) {
411+
if (tls_get_record_type(sock->sk, &u.cmsg) == TLS_RECORD_TYPE_ALERT)
412+
iov_iter_revert(&msg.msg_iter, ret);
413413
ret = xs_sock_process_cmsg(sock, &msg, msg_flags, &u.cmsg,
414414
-EAGAIN);
415415
}

0 commit comments

Comments
 (0)