Skip to content

eBPF-based security platform

953 B
Raw Blame
// SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause
/* CVE-2026-63984 source-derived detector. */

#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/ipv6_rpl_srh_decompress")
int BPF_KPROBE(cve_2026_63984_rpl, void *outhdr, const void *inhdr,
	       const void *daddr, __u8 n)
{
	count_event(&activity);
	if ((__u32)n + 1 > 127)
		count_event(&hits);
	return 0;
}