]> git.baikalelectronics.ru Git - kernel.git/commit
net/tls: don't copy negative amounts of data in reencrypt
authorJakub Kicinski <jakub.kicinski@netronome.com>
Fri, 26 Apr 2019 00:35:09 +0000 (17:35 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sun, 28 Apr 2019 00:17:19 +0000 (20:17 -0400)
commita2edd4a5dff2901676020a40e17d437a71f2e32a
tree49c0a9a8eaf6ec2c1dc548f0e68fcc2c2f8ed91b
parent793d914754bdd38ff52df3f02a43b4acd45e2103
net/tls: don't copy negative amounts of data in reencrypt

There is no guarantee the record starts before the skb frags.
If we don't check for this condition copy amount will get
negative, leading to reads and writes to random memory locations.
Familiar hilarity ensues.

Fixes: 81b6ef1732a9 ("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