Skip to content

ebpf security impact #20

Open
Open

Description

@patryk4815

Hi,
I wanted to raise a concern regarding the security implications of using eBPF with tracepoints in our C application. While this combination provides powerful capabilities for monitoring kernel behavior, there are some risks you need to consider, particularly in terms of security.

One significant issue is that under heavy kernel load, not all tracepoint functions may be executed. This could lead to missed tracepoint or unpredictable behavior in your application, especially if you rely on tracepoints for security-related purposes. Additionally, there's a risk associated with depending on kernel functions that may change or be removed in subsequent OS releases, potentially leading to inconsistencies or errors in our application.

As a result, I suggest we refrain from positioning your product as a security tool per se. While it can be valuable for monitoring and analysis purposes, it should not be considered the sole means of securing a system against threats.

I also recommend considering adding a warning in Readme to alert users to these potential security issues.

Ref1: https://www.brendangregg.com/blog/2023-04-28/ebpf-security-issues.html
Ref2: https://blog.trailofbits.com/2023/09/25/pitfalls-of-relying-on-ebpf-for-security-monitoring-and-some-solutions/

Activity

  1. matthill commented on Jan 29, 2026

    @matthill
    Contributor

    Great point! It would be interesting to have a test program to demonstrate missing callbacks. I just created a test program that maxed out program process invocations on all cores (firing off /bin/true) to 100% CPU and did a count against the eBPF callbacks (generated versus expected) and the numbers came out to a perfect match. I wonder what circumstances this could happen. The second article mentions kRetProbes, but we don't use those. Perhaps it's a non-issue, or so extremely rare it's difficult to reproduce.

    The program will intentionally throttle data when the terminal volume gets high, but those are terminal updates, it would never throttle the program executions and logins. However, this is worth noting because someone could depend on scanning terminal output to perform some sort of security function.

    Regading forward compatibility, the callbacks we're using in https://github.com/sshlog/agent/blob/master/libsshlog/bpf/sshtrace.bpf.c are exceptionally generic syscalls (e.g., file open, read/write, etc), so I don't think there's much risk of them being removed (unlike some of the more specialized bpf callbacks).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions