Mark Johnston 5de79eeddb ktls: Disallow transmitting empty frames outside of TLS 1.0/CBC mode
There was nothing preventing one from sending an empty fragment on an
arbitrary KTLS TX-enabled socket, but ktls_frame() asserts that this
could not happen.  Though the transmit path handles this case for TLS
1.0 with AES-CBC, we should be strict and allow empty fragments only in
modes where it is explicitly allowed.

Modify sosend_generic() to reject writes to a KTLS-enabled socket if the
number of data bytes is zero, so that userspace cannot trigger the
aforementioned assertion.

Add regression tests to exercise this case.

Reported by:	syzkaller
Reviewed by:	gallatin, jhb
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34195
2022-02-08 12:40:41 -05:00
..
2022-01-27 11:40:34 +00:00
2022-01-27 11:40:34 +00:00
2021-06-07 16:45:50 -04:00
2020-11-19 02:50:48 +00:00
2022-01-26 13:40:27 -06:00
2021-11-29 22:04:43 +00:00
2021-12-28 13:51:25 -08:00
2021-09-09 10:11:02 -04:00
2021-04-18 11:19:15 -06:00
2021-11-10 21:18:54 +02:00
2020-11-05 15:08:56 +00:00
2021-09-14 14:29:27 -04:00
2021-08-08 21:54:49 -04:00
2021-12-14 14:52:25 +00:00
2020-11-09 00:34:23 +00:00
2020-08-13 20:48:14 +00:00
2021-04-02 15:41:51 +03:00
2021-12-09 02:49:10 +02:00
2021-12-09 02:49:10 +02:00
2021-04-18 11:14:17 -06:00
2020-08-27 05:11:15 +00:00
2021-09-03 22:18:51 -04:00
2021-11-17 20:12:26 +00:00
2022-02-01 06:54:50 +02:00
2022-01-08 05:41:44 +02:00