linux/drivers/crypto/chelsio
Arnd Bergmann cca9bab1b7 tcp: use monotonic timestamps for PAWS
Using get_seconds() for timestamps is deprecated since it can lead
to overflows on 32-bit systems. While the interface generally doesn't
overflow until year 2106, the specific implementation of the TCP PAWS
algorithm breaks in 2038 when the intermediate signed 32-bit timestamps
overflow.

A related problem is that the local timestamps in CLOCK_REALTIME form
lead to unexpected behavior when settimeofday is called to set the system
clock backwards or forwards by more than 24 days.

While the first problem could be solved by using an overflow-safe method
of comparing the timestamps, a nicer solution is to use a monotonic
clocksource with ktime_get_seconds() that simply doesn't overflow (at
least not until 136 years after boot) and that doesn't change during
settimeofday().

To make 32-bit and 64-bit architectures behave the same way here, and
also save a few bytes in the tcp_options_received structure, I'm changing
the type to a 32-bit integer, which is now safe on all architectures.

Finally, the ts_recent_stamp field also (confusingly) gets used to store
a jiffies value in tcp_synq_overflow()/tcp_synq_no_recent_overflow().
This is currently safe, but changing the type to 32-bit requires
some small changes there to keep it working.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2018-07-12 14:50:40 -07:00
..
chtls tcp: use monotonic timestamps for PAWS 2018-07-12 14:50:40 -07:00
chcr_algo.c crypto: chelsio - Remove separate buffer used for DMA map B0 block in CCM 2018-05-31 00:13:48 +08:00
chcr_algo.h crypt: chelsio - Send IV as Immediate for cipher algo 2018-05-31 00:13:48 +08:00
chcr_core.c chcr: Add support for Inline IPSec 2017-11-29 17:33:29 +11:00
chcr_core.h crypt: chelsio - Send IV as Immediate for cipher algo 2018-05-31 00:13:48 +08:00
chcr_crypto.h crypto: chelsio - Remove separate buffer used for DMA map B0 block in CCM 2018-05-31 00:13:48 +08:00
chcr_ipsec.c crypto: chelsio - request to HW should wrap 2018-05-19 00:13:56 +08:00
Kconfig crypto: chtls - Makefile Kconfig 2018-03-31 23:37:33 -04:00
Makefile crypto: chtls - Makefile Kconfig 2018-03-31 23:37:33 -04:00