Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8bcf9e92773fc1b5b4350bdb49e2bc60@yuhu.biz>
Date: Thu, 12 Nov 2026 16:05:34 +0000
From: "Marian Marinov" <hackman@...u.biz>
To: "Nakashima Seiichi" <s-nakashima@....biglobe.ne.jp>,
 kernel-hardening@...ts.openwall.com, linux-security-module@...ts.linux.dev
Cc: keescook@...omium.org, paul@...l-moore.com, mic@...ikod.net
Subject: Re: [RFC][IDEA] External Monitoring of Kernel Network Stack via
 BPF kprobe (KAF v2/v3 withdrawn)

Do you realize how slow this would be in a hot path in the kernel?

Please think this through. A network path on a 10G interface might process millions of packets per second.
Implementing what you want will kill the performance. Performance that is tightly optimized around CPU cache lines.
What you are proposing will introduce slowness and change of cache coherency that will have a heavy hit on performance. 

I think that we should allow the sysadmins to decide if they want to reduce their system performance for this kind of security measure. We already suffer some performance hit because of CPU mitigations and there is nothing the kernel can do about it. 

Additionally, most of the serious attack vectors would require multiple things in the kernel to be monitored. 
We also know that slowing down some parts of the kernel might open other parts of it to race condition attacks. 

Maybe we should focus more on educating people on how to handle these types of attacks with the tools we have at our disposal at the moment.

I really hope that this path you took, thought you more about how the kernel and its security works, so you can enhance your idea(s) in the future.

I would also suggest that you look at building this out-of-tree and getting some of your friends on board. Obviously you are doing a lot of work with an LLM. Force it to build the PoC for you. Show this as a viable option. 

At the moment, personally, I think this proposal is just loosing the valuable time of the people in these mailing lists. 

Marian

November 12, 2026 2:05 AM, "Nakashima Seiichi" <s-nakashima@....biglobe.ne.jp> wrote:

> Dear ML,
> 
> I withdraw the KAF (Kernel API Firewall) v2/v3 proposals.
> Instead, I am re-posting the results of my BPF kprobe-based
> interception and monitoring experiments on the kernel network stack
> as a new RFC idea.
> 
> == Background and Motivation ==
> 
> In the original RFC idea, I assumed hooking kernel API calls inside
> the kernel and embedding a mechanism to detect and block invalid
> parameters or abnormal call patterns within the kernel itself.
> 
> However, experiments with bpftrace revealed that function calls
> inside the kernel and metadata from structures such as struct sk_buff
> can be traced from outside the kernel. This suggests that anomaly
> detection and defense logic may be realized as an external process,
> without modifying the kernel itself.
> 
> == Test Environment ==
> 
> The following environment was built and used for this verification.
> 
> Host OS : Linux Mint 22.3
> Host Kernel : 7.0.0-43-generic
> Virtualization : KVM (QEMU)
> Guest OS : Ubuntu 26.04
> Guest Kernel : 7.0.0-43-generic
> BPF toolchain : clang, bpftool v7.7.0, libbpf v1.7
> Test target : CVE-2026-99999 (virtual checksum validation
> scenario)
> 
> A KVM environment was built on the Host, and BPF program compilation,
> loading, and operation were verified on the Guest Ubuntu.
> The Guest kernel is the same as the Host (7.0.0-43-generic) and
> runs with BTF (BPF Type Format) information enabled.
> 
> == Experiment Flow and Verified Items ==
> 
> To verify this possibility, I conducted a step-by-step investigation
> from proof-of-concept with bpftrace to a full BPF program using
> libbpf/CO-RE.
> 
> === 1. Proof-of-concept with bpftrace ===
> 
> - Confirmed attachment to kprobe:__skb_checksum_complete
> - Confirmed reading of basic struct sk_buff fields (len, protocol,
> csum_start, csum_offset, etc.)
> - Confirmed difficulty of accessing the bit-field (ip_summed)
> - Confirmed limitations of bpf_override_return()
> 
> At this stage, I realized that kernel-internal processing could be
> tracked and intercepted from the outside, and moved on to a more
> complete implementation.
> 
> === 2. Full implementation with libbpf/CO-RE ===
> 
> Experiments were conducted on the Guest with the following structure.
> 
> - csum_guard_kprobe.c : BPF kernel program (kprobe + ringbuf)
> - load_kprobe.c : User-space loader (using CO-RE skeleton)
> - common.h : Event structure shared between BPF and user-
> space
> - vmlinux.h : Kernel structure header generated from BTF
> 
> === 3. Technically confirmed feasibility ===
> 
> BPF kprobe-based network stack interception : Confirmed
> CO-RE reading of struct sk_buff fields : Confirmed
> Bit-field reading : Confirmed via
> __builtin_preserve_field_info()
> BPF -> user-space communication via ringbuf : Confirmed
> Loader structure using libbpf skeleton : Confirmed
> 
> === 4. Key technical issues resolved ===
> 
> Bit-field reading :
> Resolved the problem that BPF_CORE_READ() cannot be used for
> sk_buff->ip_summed (__u8 ip_summed: 2) by obtaining the offset,
> size, and shift amount with __builtin_preserve_field_info() and
> reading with bpf_core_read().
> 
> Structure sharing :
> Eliminated inconsistency by sharing struct event between the BPF
> side and the user-space side as common.h.
> 
> Skeleton function names :
> Adapted to the prefix rules of bpftool gen skeleton.
> 
> GPL license :
> bpf_probe_read_kernel() is GPL-only, so SEC("license") = "GPL"
> is mandatory.
> 
> Ringbuf reference management :
> Memory reserved with bpf_ringbuf_reserve() must always be
> released with bpf_ringbuf_submit().
> 
> == Current Limitations and Future Work ==
> 
> Hook point :
> On kernel 7.0, __skb_checksum_complete is likely on the kprobe
> blacklist (or is a hot path that cannot be attached), so
> tcp_v4_rcv is currently used as the hook point for verification.
> Selecting an appropriate hook point at checksum validation time
> remains future work.
> 
> Timing :
> tcp_v4_rcv is the packet receive entry point, and csum_start/
> csum_offset may still be in the middle of initialization, making
> it unsuitable as a checksum validation timing. Future work will
> consider attachment to more appropriate functions.
> 
> Return value override :
> Faking the validation result with bpf_override_return() depends
> on attaching to an appropriate function.
> 
> == About the Author and Acknowledgments ==
> 
> The proposer of this RFC idea is not a professional developer.
> Most of the technical implementation and analysis in this
> verification, including BPF program code creation, compilation error
> analysis, bit-field reading method investigation, and libbpf/CO-RE
> skeleton coordination, was carried out with the assistance of the
> AI assistant Namazu provided by Sakana AI.
> 
> Please note that this proposal explores the feasibility of the idea
> of "external monitoring of kernel security," and that the
> implementation details were verified with AI assistance.
> 
> == Conclusion ==
> 
> This RFC idea suggests that processing targeting kernel
> vulnerabilities may be embedded as an external process, rather than
> inside the kernel itself.
> 
> Using the combination of BPF kprobe + CO-RE + ringbuf, we
> successfully operated a mechanism to monitor and record metadata
> from inside the kernel's network stack from the outside, and to
> detect anomalies on kernel 7.0. We believe this opens a path to
> dynamically realizing security monitoring and anomaly detection
> without applying kernel patches or loading kernel modules.
> 
> I would like the core security members to discuss the feasibility
> of this approach in depth.
> 
> KAF v2/v3 are withdrawn and this is re-posted as an RFC idea.
> 
> == Appendix: About CVE-2026-99999 ==
> 
> The CVE-2026-99999 mentioned is a virtual vulnerability scenario used
> for this verification. It is not an actual CVE, but a test case
> assuming an attack exploiting a checksum validation flaw. If
> extending this to verification against an actual vulnerability,
> adjustments tailored to the details of the target CVE will be
> required.
> 
> Nakashima Seiichi

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.