Skip to content

Conversation

@puwun
Copy link
Contributor

@puwun puwun commented Jan 14, 2026

Add documentation for socket tracking limitations.

The new 'Limitations' section covers:

  • LRU map overflow risks: Socket mappings use a fixed-size LRU hash that can evict old entries when full, potentially causing events to be attributed to the wrong process.

  • Socket sharing behavior: Sockets can be shared between processes via fork() or IPC, and Tetragon attributes activity to the creating process which may lead to stale mappings.

Both limitations are documented with appropriate warning and caution blocks to ensure visibility.

Fixes: #3493

Changelog

docs: document socket tracking limitations including LRU map overflow risks and socket sharing behavior

@puwun puwun requested review from a team and mtardy as code owners January 14, 2026 11:54
@netlify
Copy link

netlify bot commented Jan 14, 2026

Deploy Preview for tetragon ready!

Name Link
🔨 Latest commit 4bee701
🔍 Latest deploy log https://app.netlify.com/projects/tetragon/deploys/696a24a57b7a8600080fea88
😎 Deploy Preview https://deploy-preview-4521--tetragon.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@puwun puwun force-pushed the docs/socket-tracking-limitations branch from 59e99aa to 260520a Compare January 14, 2026 12:03
@mtardy mtardy added the release-note/docs This PR updates the documentation. label Jan 16, 2026
Copy link
Member

@mtardy mtardy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for doing, just a few comments

@@ -771,6 +771,39 @@ See [`TrackSock`](/docs/concepts/tracing-policy/selectors/#tracksock-action) and

Socket tracking is only available on kernels >=5.3.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be integrated into the limitations? wdyt

Comment on lines 776 to 804
Socket tracking has the following limitations that users should be aware of:

**LRU Map Overflow**

{{< warning >}}
Socket mappings are stored in an LRU (Least Recently Used) hash map in the
kernel with a fixed upper limit for entries. When the map is full, old entries
are evicted to make space for new ones. This means that if many sockets are
created in a short period, older socket mappings may be lost. When this happens,
network events related to those sockets may be attributed to the wrong process.
In adversarial scenarios, an attacker could intentionally create many sockets to
overflow the map and evade proper attribution of their network activity.
{{< /warning >}}

**Socket Sharing Between Processes**

{{< caution >}}
Sockets are not strictly owned by a single process—they can be shared between
processes. This happens when a process calls `fork()` and both parent and child
keep the file descriptor open, or when a process shares a file descriptor with
another process via IPC mechanisms.

Tetragon attributes all socket activity to the process that originally created
the socket. However, if that process exits while another process continues to
use the socket, the mapping will reference a process that no longer exists. This
can lead to events being associated with stale process information. In security
contexts, an adversary might exploit this behavior to obscure the true source of
network activity.
{{< /caution >}}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While I really appreciate that you found and reused warning and caution, for such amount of text I think it would be better to use plain paragraphs or list. Also avoid using bold text.

I think it could be nice to explain the limitations as you did with a few paragraphs, or a list with elements starting with the title you put in bold for example. Something a bit like:

  • LRU map overflow: socket mappings are stored in an LRU (Least Recently Used) hash map in the kernel with a fixed upper limit for entries. When the map is full, old entries are evicted to make space for new ones. This means that if many sockets are [...]
  • Socket sharing between processes: sockets are not strictly owned by a single process—they can be shared between processes. This happens when a process calls fork() and both parent and child [...]

You can have multiple paragraphs in a list item. But if you can also manage to make it less verbose that would be great, if it's not possible it's okay, we need to stay accurate.

You can always use warning at the end, insisting that for A and B limitations, you have security implications.

Add documentation for socket tracking limitations as requested in issue cilium#3493.

The new 'Limitations' section covers:

- LRU map overflow risks: Socket mappings use a fixed-size LRU hash that can evict old entries when full, potentially causing events to be attributed to the wrong process.

- Socket sharing behavior: Sockets can be shared between processes via fork() or IPC, and Tetragon attributes activity to the creating process which may lead to stale mappings.

Fixes: cilium#3493
Signed-off-by: Pavan More <[email protected]>
@puwun puwun force-pushed the docs/socket-tracking-limitations branch from 260520a to 4bee701 Compare January 16, 2026 11:44
@puwun
Copy link
Contributor Author

puwun commented Jan 16, 2026

@mtardy thanks, updated 👍🏼

Copy link
Member

@mtardy mtardy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, awesome

@mtardy mtardy merged commit 7969638 into cilium:main Jan 16, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-note/docs This PR updates the documentation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Document socket tracking limitations

2 participants