Skip to content

Commit 1c3b63f

Browse files
Emantordavem330
authored andcommitted
net/tls: allow MSG_CMSG_COMPAT in sendmsg
Trying to use ktls on a system with 32-bit userspace and 64-bit kernel results in a EOPNOTSUPP message during sendmsg: setsockopt(3, SOL_TLS, TLS_TX, …, 40) = 0 sendmsg(3, …, msg_flags=0}, 0) = -1 EOPNOTSUPP (Operation not supported) The tls_sw implementation does strict flag checking and does not allow the MSG_CMSG_COMPAT flag, which is set if the message comes in through the compat syscall. This patch adds MSG_CMSG_COMPAT to the flag check to allow the usage of the TLS SW implementation on systems using the compat syscall path. Note that the same check is present in the sendmsg path for the TLS device implementation, however the flag hasn't been added there for lack of testing hardware. Signed-off-by: Rouven Czerwinski <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 64cae2f commit 1c3b63f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

net/tls/tls_sw.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -935,7 +935,8 @@ int tls_sw_sendmsg(struct sock *sk, struct msghdr *msg, size_t size)
935935
int ret = 0;
936936
int pending;
937937

938-
if (msg->msg_flags & ~(MSG_MORE | MSG_DONTWAIT | MSG_NOSIGNAL))
938+
if (msg->msg_flags & ~(MSG_MORE | MSG_DONTWAIT | MSG_NOSIGNAL |
939+
MSG_CMSG_COMPAT))
939940
return -EOPNOTSUPP;
940941

941942
mutex_lock(&tls_ctx->tx_lock);

0 commit comments

Comments
 (0)