tirdad - TCP ISN CPU Information Leak Protection
This page explains a Linux TCP Initial Sequence Number (ISN) side-channel information leak and introduces tirdad, a kernel module that helps mitigate it by randomizing TCP ISNs.
TCP ISN CPU Information Leaks
[edit]- Issue summary: The Linux kernel has a side-channel information leak bug that can leak information through outgoing TCP traffic. This can allow side-channel attacks because sensitive information about a system's CPU activity may be inferred remotely.
- Why it matters: This may be particularly dangerous for long-running cryptographic operations.
- Real-world impact: Research has demonstrated that related techniques can be used for de-anonymization of location-hidden services. [1]
- Clock skew notes:
- Leak source: Clock skew is leaked through TCP ISNs (Initial Sequence Numbers) by the Linux kernel.
- Remote detection: Clock skew can be remotely detected by observing ISNs.
- Attack amplification: Clock skew can be induced by an attacker by producing load on the victim machine.
What the Linux ISN leaks is the difference between two timestamps, not the timestamp itself. A difference lets you work out drift and skew, which can help someone fingerprint the computer hardware, its environment and load. Of course that only works if you can probe a computer, and maintain the same source/destination port and IP address.Add research idea for Linux TCP Initial Sequence Numbers may aid correlation
: comment by Steven J. Murdoch
... it is worth complaining to the kernel developers for the simple reason that adding the 64ns timer post-hash probably *does* leak side channels about CPU activity, and that may prove very dangerous for long-running cryptographic operations (along the lines of the hot-or-not issue). Unfortunately, someone probably needs to produce more research papers before they will listen.Add research idea for Linux TCP Initial Sequence Numbers may aid correlation
: comment by Mike Perry
- Further reading:
- Introduction: An analysis of TCP secure sequence number generation in Linux and its privacy issues

.
- Background discussion: Initial sequence number generation in Linux TCP stack

- Linux source reference: Linux source: secure_seq.c (v3.16-rc1)

- Forum discussion: TCP ISNs and temperature induced clock skews

- Forum discussion: TCP ISN CPU information leak protection (
tirdad)
- IETF tcpm thread: IETF: [tcpm

Security concerns with relative timestamp exposure through TCP ISNs - mailing list thread]
- Introduction: An analysis of TCP secure sequence number generation in Linux and its privacy issues
Mitigation
[edit]TCP Initial Sequence Numbers (ISNs) randomization to help prevent TCP ISN based CPU information leaks.
tirdad is a kernel module to hot-patch the Linux kernel to generate random TCP Initial Sequence Numbers for IPv4 and IPv6 TCP connections.
Platform specific.
- Kicksecure:
tirdadis installed by default. - Kicksecure for Qubes: Requires In-VM Kernel.
Architecture Support
[edit]tirdad has limited Intel/AMD64 only. For "normal" computers that most people are using. At the time of writing, tirdad has limited Architecture Support. For technical reasons, see footnote. [2]
For example, tirdad is unsupported on ARM64, Apple Silicon (M#). This list is not exhaustive.
Development
[edit]- source code: https://github.com/Kicksecure/tirdad

Footnotes
[edit]- ↑
- ↑
- https://forums.whonix.org/t/tcp-isn-cpu-information-leak-protection-tirdad/8552/33

- https://github.com/Kicksecure/tirdad/commit/29267ea5b4080d26075217e3aa76a27458bf64d2

- https://github.com/Kicksecure/tirdad/blob/master/debian/control#L16

- compilation issue when using a kernel without livepatching support: https://github.com/0xsirus/tirdad/issues/30

- https://www.phoronix.com/news/ARM64-Linux-Live-Kernel-Patch

- https://docs.kernel.org/arch/arm64/features.html

- kprobes-on-ftrace
- live patching
- TODO
- kprobes-on-ftrace
- might be possible in the future:
- https://github.com/dynup/kpatch?tab=readme-ov-file#supported-architectures

- Not merged into mainline Linux yet at the time of writing according to the knowledge of the author.
- https://github.com/dynup/kpatch?tab=readme-ov-file#supported-architectures
- https://forums.whonix.org/t/tcp-isn-cpu-information-leak-protection-tirdad/8552/33
We believe security software like Kicksecure needs to remain Open Source and independent. Would you help sustain and grow the project? Learn more about our 13 year success story and maybe DONATE!