Problem Description:
The code in sosend_generic() which parses TLS_SET_RECORD_TYPE
control messages failed to verify that the message was large enough
to hold its one-byte payload. A control message containing only a
cmsghdr would pass the size check, causing the kernel to read one
byte past the end of the message and use it as the TLS record
type.
Impact:
A local user with a KTLS-enabled socket can send a crafted
TLS_SET_RECORD_TYPE control message to cause the kernel to read one
byte of uninitialized kernel memory and use it as the TLS record
type in an outgoing TLS record. For TLS 1.2 connections, the record
type is visible in the plaintext record header, constituting a
kernel information disclosure.