eBPF-based security platform
// SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause
/*
* CVE-2025-71093 source-derived detector.
*
* e1000_tbi_should_accept() used data[length - 1] before checking length.
* This detector records the exact zero-length input branch. The upper-bound
* branch needs the private e1000_adapter rx_buffer_len layout and is not
* silently approximated here.
*/
#include "vmlinux.h"
#include <bpf/bpf_helpers.h>
#ifndef __TARGET_ARCH_x86
#define __TARGET_ARCH_x86
#endif
#include <bpf/bpf_tracing.h>
char _license[] SEC("license") = "Dual BSD/GPL";
struct {
__uint(type, BPF_MAP_TYPE_PERCPU_ARRAY);
__uint(max_entries, 1);
__type(key, __u32);
__type(value, __u64);
} hits SEC(".maps");
struct {
__uint(type, BPF_MAP_TYPE_PERCPU_ARRAY);
__uint(max_entries, 1);
__type(key, __u32);
__type(value, __u64);
} activity SEC(".maps");
static __always_inline void count_event(void *map)
{
__u32 zero = 0;
__u64 *count = bpf_map_lookup_elem(map, &zero);
if (count)
(*count)++;
}
SEC("kprobe/e1000_tbi_should_accept")
int BPF_KPROBE(cve_2025_71093_tbi, void *adapter, __u8 status,
__u8 errors, __u32 length, const __u8 *data)
{
count_event(&activity);
if (!length)
count_event(&hits);
return 0;
}