]> asedeno.scripts.mit.edu Git - linux.git/commit
net/tls: remove the record tail optimization
authorJakub Kicinski <jakub.kicinski@netronome.com>
Sat, 7 Sep 2019 05:29:59 +0000 (22:29 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sat, 7 Sep 2019 16:10:34 +0000 (18:10 +0200)
commite7b159a48ba6f7c243881c7ef3afa6e8785c0826
tree82dd0d59e0d2de03e3da81eb237131657684cdce
parentd4774ac0d49ae92c5176c9848db555e89a5a4e45
net/tls: remove the record tail optimization

For TLS device offload the tag/message authentication code are
filled in by the device. The kernel merely reserves space for
them. Because device overwrites it, the contents of the tag make
do no matter. Current code tries to save space by reusing the
header as the tag. This, however, leads to an additional frag
being created and defeats buffer coalescing (which trickles
all the way down to the drivers).

Remove this optimization, and try to allocate the space for
the tag in the usual way, leave the memory uninitialized.
If memory allocation fails rewind the record pointer so that
we use the already copied user data as tag.

Note that the optimization was actually buggy, as the tag
for TLS 1.2 is 16 bytes, but header is just 13, so the reuse
may had looked past the end of the page..

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Dirk van der Merwe <dirk.vandermerwe@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tls/tls_device.c