]> git.baikalelectronics.ru Git - kernel.git/commit
net/tls: allow MSG_CMSG_COMPAT in sendmsg
authorRouven Czerwinski <r.czerwinski@pengutronix.de>
Thu, 6 Aug 2020 06:49:06 +0000 (08:49 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sat, 8 Aug 2020 00:40:45 +0000 (17:40 -0700)
commit0350057c4686a0998badd019f6ee1775152a1f6e
tree6f854b2ee721470b78f9770b707f3cdb99c6a37c
parent787042dd3a55fb1dc51c6680d50f43340ed7c075
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 <r.czerwinski@pengutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tls/tls_sw.c