]> git.baikalelectronics.ru Git - kernel.git/commit
net/tls: avoid spurious decryption error with HW resync
authorJakub Kicinski <jakub.kicinski@netronome.com>
Fri, 10 Jan 2020 12:36:55 +0000 (04:36 -0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 10 Jan 2020 19:18:15 +0000 (11:18 -0800)
commit42d91af37d1b4757aef309f1bdcb3240d996977b
tree728fb2d0b6e72573d77d9c739c0915c29c3820eb
parent7fc9a286819de57eb50628f92886c8b5a278acbc
net/tls: avoid spurious decryption error with HW resync

When device loses sync mid way through a record - kernel
has to re-encrypt the part of the record which the device
already decrypted to be able to decrypt and authenticate
the record in its entirety.

The re-encryption piggy backs on the decryption routine,
but obviously because the partially decrypted record can't
be authenticated crypto API returns an error which is then
ignored by tls_device_reencrypt().

Commit 6ceb6e9e89b9 ("net/tls: add TlsDecryptError stat")
added a statistic to count decryption errors, this statistic
can't be incremented when we see the expected re-encryption
error. Move the inc to the caller.

Reported-and-tested-by: David Beckett <david.beckett@netronome.com>
Fixes: 6ceb6e9e89b9 ("net/tls: add TlsDecryptError stat")
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tls/tls_sw.c