]> git.baikalelectronics.ru Git - kernel.git/commit
net/tls: fix copy to fragments in reencrypt
authorJakub Kicinski <jakub.kicinski@netronome.com>
Fri, 26 Apr 2019 00:35:10 +0000 (17:35 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sun, 28 Apr 2019 00:17:19 +0000 (20:17 -0400)
commit500cdfcefac5a03c86b915f7d51a2dde7b3a3103
tree19cc2e28953e3f4b42b2e96fb83fca36f877659a
parentb9c7651eaae1e5bf0ff9a822ddf0958bc049df05
net/tls: fix copy to fragments in reencrypt

Fragments may contain data from other records so we have to account
for that when we calculate the destination and max length of copy we
can perform.  Note that 'offset' is the offset within the message,
so it can't be passed as offset within the frag..

Here skb_store_bits() would have realised the call is wrong and
simply not copy data.

Fixes: 512639d24cd0 ("tls: Add rx inline crypto offload")
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: John Hurley <john.hurley@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tls/tls_device.c