Skip to content

eBPF-based security platform

upatches: indent the kernel-cve sources with tabs

Daniel Borkmannce6a6830b9b9
diff --git a/upatches/kernel-cve/sources/cve-2025-71116-libceph-make-decode-pool-more-resilient-against-corrupted/observability/cve_2025_71116-offset-predicate.bpf.c b/upatches/kernel-cve/sources/cve-2025-71116-libceph-make-decode-pool-more-resilient-against-corrupted/observability/cve_2025_71116-offset-predicate.bpf.c
index 3f90aa65..ae47db0f 100644
--- a/upatches/kernel-cve/sources/cve-2025-71116-libceph-make-decode-pool-more-resilient-against-corrupted/observability/cve_2025_71116-offset-predicate.bpf.c
+++ b/upatches/kernel-cve/sources/cve-2025-71116-libceph-make-decode-pool-more-resilient-against-corrupted/observability/cve_2025_71116-offset-predicate.bpf.c
@@ -17,25 +17,26 @@
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);
+ __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);
+ __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_map(void *map)
{
- __u32 zero = 0;
- __u64 *count = bpf_map_lookup_elem(map, &zero);
- if (count)
- (*count)++;
+ __u32 zero = 0;
+ __u64 *count = bpf_map_lookup_elem(map, &zero);
+
+ if (count)
+ (*count)++;
}
#define count_activity() count_map(&activity)
@@ -45,17 +46,17 @@ SEC("kprobe/__decode_pools+0x0")
int BPF_KPROBE(cve_2025_71116_predicate)
{
- void *cursor = 0;
- void *end = (void *)ctx->si;
- __u64 paddr = ctx->di;
-
- count_activity();
- if (!paddr || !end ||
- bpf_probe_read_kernel(&cursor, sizeof(cursor), (void *)paddr))
- return 0;
- if (!cursor || (unsigned long)cursor >= (unsigned long)end ||
- (unsigned long)end - (unsigned long)cursor < sizeof(__u32))
- count_event();
- return 0;
+ void *cursor = 0;
+ void *end = (void *)ctx->si;
+ __u64 paddr = ctx->di;
+
+ count_activity();
+ if (!paddr || !end ||
+ bpf_probe_read_kernel(&cursor, sizeof(cursor), (void *)paddr))
+ return 0;
+ if (!cursor || (unsigned long)cursor >= (unsigned long)end ||
+ (unsigned long)end - (unsigned long)cursor < sizeof(__u32))
+ count_event();
+ return 0;
}
diff --git a/upatches/kernel-cve/sources/cve-2026-23003-ip6-tunnel-skb-vlan-inet-prepare-ip6-tnl/observability/cve-2026-23003-caller-offset.bpf.c b/upatches/kernel-cve/sources/cve-2026-23003-ip6-tunnel-skb-vlan-inet-prepare-ip6-tnl/observability/cve-2026-23003-caller-offset.bpf.c
index d1cdabba..532c5223 100644
--- a/upatches/kernel-cve/sources/cve-2026-23003-ip6-tunnel-skb-vlan-inet-prepare-ip6-tnl/observability/cve-2026-23003-caller-offset.bpf.c
+++ b/upatches/kernel-cve/sources/cve-2026-23003-ip6-tunnel-skb-vlan-inet-prepare-ip6-tnl/observability/cve-2026-23003-caller-offset.bpf.c
@@ -21,52 +21,52 @@
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);
+ __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);
+ __uint(type, BPF_MAP_TYPE_PERCPU_ARRAY);
+ __uint(max_entries, 1);
+ __type(key, __u32);
+ __type(value, __u64);
} activity SEC(".maps");
struct {
- __uint(type, BPF_MAP_TYPE_ARRAY);
- __uint(max_entries, 1);
- __type(key, __u32);
- __type(value, __u64);
+ __uint(type, BPF_MAP_TYPE_ARRAY);
+ __uint(max_entries, 1);
+ __type(key, __u32);
+ __type(value, __u64);
} control SEC(".maps");
static __always_inline void count_event(void *map)
{
- __u32 zero = 0;
- __u64 *count = bpf_map_lookup_elem(map, &zero);
+ __u32 zero = 0;
+ __u64 *count = bpf_map_lookup_elem(map, &zero);
- if (count)
- (*count)++;
+ if (count)
+ (*count)++;
}
SEC("kprobe/__ip6_tnl_rcv.isra.0+0xfb")
int BPF_KPROBE(cve_2026_23003_vlan_pull_check)
{
- struct sk_buff *skb = (struct sk_buff *)ctx->bx;
- __be16 protocol = 0;
+ struct sk_buff *skb = (struct sk_buff *)ctx->bx;
+ __be16 protocol = 0;
- count_event(&activity);
- if (!skb)
- return 0;
+ count_event(&activity);
+ if (!skb)
+ return 0;
- protocol = BPF_CORE_READ(skb, protocol);
- protocol = __builtin_bswap16(protocol);
- if (protocol != 0x8100 && protocol != 0x88a8)
- return 0;
+ protocol = BPF_CORE_READ(skb, protocol);
+ protocol = __builtin_bswap16(protocol);
+ if (protocol != 0x8100 && protocol != 0x88a8)
+ return 0;
- if ((__u32)ctx->r10 < (__u32)ctx->ax)
- count_event(&hits);
+ if ((__u32)ctx->r10 < (__u32)ctx->ax)
+ count_event(&hits);
- return 0;
+ return 0;
}
diff --git a/upatches/kernel-cve/sources/cve-2026-23315-wifi-mt76-oob-access-mt76-connac2-mac-write/observability/cve-2026-23315-caller-predicate.bpf.c b/upatches/kernel-cve/sources/cve-2026-23315-wifi-mt76-oob-access-mt76-connac2-mac-write/observability/cve-2026-23315-caller-predicate.bpf.c
index 8658ae73..4c355abf 100644
--- a/upatches/kernel-cve/sources/cve-2026-23315-wifi-mt76-oob-access-mt76-connac2-mac-write/observability/cve-2026-23315-caller-predicate.bpf.c
+++ b/upatches/kernel-cve/sources/cve-2026-23315-wifi-mt76-oob-access-mt76-connac2-mac-write/observability/cve-2026-23315-caller-predicate.bpf.c
@@ -11,33 +11,33 @@
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);
+ __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);
+ __uint(type, BPF_MAP_TYPE_PERCPU_ARRAY);
+ __uint(max_entries, 1);
+ __type(key, __u32);
+ __type(value, __u64);
} activity SEC(".maps");
struct {
- __uint(type, BPF_MAP_TYPE_ARRAY);
- __uint(max_entries, 1);
- __type(key, __u32);
- __type(value, __u64);
+ __uint(type, BPF_MAP_TYPE_ARRAY);
+ __uint(max_entries, 1);
+ __type(key, __u32);
+ __type(value, __u64);
} control SEC(".maps");
static __always_inline void count_event(void *map)
{
- __u32 zero = 0;
- __u64 *count = bpf_map_lookup_elem(map, &zero);
+ __u32 zero = 0;
+ __u64 *count = bpf_map_lookup_elem(map, &zero);
- if (count)
- (*count)++;
+ if (count)
+ (*count)++;
}
/*
@@ -47,15 +47,15 @@ static __always_inline void count_event(void *map)
*/
SEC("kprobe/mt76_connac2_mac_write_txwi")
int BPF_KPROBE(cve_2026_23315_caller_predicate,
- void *dev, void *txwi, struct sk_buff *skb)
+ void *dev, void *txwi, struct sk_buff *skb)
{
- __u32 len;
-
- count_event(&activity);
- if (!skb)
- return 0;
- len = BPF_CORE_READ(skb, len);
- if (len < 28)
- count_event(&hits);
- return 0;
+ __u32 len;
+
+ count_event(&activity);
+ if (!skb)
+ return 0;
+ len = BPF_CORE_READ(skb, len);
+ if (len < 28)
+ count_event(&hits);
+ return 0;
}
diff --git a/upatches/kernel-cve/sources/cve-2026-31393-bluetooth-l2cap-validate-l2cap-info-rsp-payload-length/observability/cve-2026-31393-caller-predicate.bpf.c b/upatches/kernel-cve/sources/cve-2026-31393-bluetooth-l2cap-validate-l2cap-info-rsp-payload-length/observability/cve-2026-31393-caller-predicate.bpf.c
index 7c44447d..44569539 100644
--- a/upatches/kernel-cve/sources/cve-2026-31393-bluetooth-l2cap-validate-l2cap-info-rsp-payload-length/observability/cve-2026-31393-caller-predicate.bpf.c
+++ b/upatches/kernel-cve/sources/cve-2026-31393-bluetooth-l2cap-validate-l2cap-info-rsp-payload-length/observability/cve-2026-31393-caller-predicate.bpf.c
@@ -11,71 +11,71 @@
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);
+ __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);
+ __uint(type, BPF_MAP_TYPE_PERCPU_ARRAY);
+ __uint(max_entries, 1);
+ __type(key, __u32);
+ __type(value, __u64);
} activity SEC(".maps");
struct {
- __uint(type, BPF_MAP_TYPE_ARRAY);
- __uint(max_entries, 1);
- __type(key, __u32);
- __type(value, __u64);
+ __uint(type, BPF_MAP_TYPE_ARRAY);
+ __uint(max_entries, 1);
+ __type(key, __u32);
+ __type(value, __u64);
} control SEC(".maps");
static __always_inline void count_event(void *map)
{
- __u32 zero = 0;
- __u64 *count = bpf_map_lookup_elem(map, &zero);
+ __u32 zero = 0;
+ __u64 *count = bpf_map_lookup_elem(map, &zero);
- if (count)
- (*count)++;
+ if (count)
+ (*count)++;
}
struct l2cap_wire_hdr {
- __u16 len;
- __u16 cid;
+ __u16 len;
+ __u16 cid;
};
struct l2cap_cmd_wire {
- __u8 code;
- __u8 ident;
- __u16 len;
+ __u8 code;
+ __u8 ident;
+ __u16 len;
};
struct l2cap_info_wire {
- __u16 type;
- __u16 result;
+ __u16 type;
+ __u16 result;
};
static __always_inline int read_l2cap_command(struct sk_buff *skb,
- struct l2cap_wire_hdr *lh,
- struct l2cap_cmd_wire *cmd,
- const void **payload)
+ struct l2cap_wire_hdr *lh,
+ struct l2cap_cmd_wire *cmd,
+ const void **payload)
{
- const void *data;
- __u32 len;
+ const void *data;
+ __u32 len;
- if (!skb)
- return 0;
- data = BPF_CORE_READ(skb, data);
- len = BPF_CORE_READ(skb, len);
- if (!data || len < sizeof(*lh) + sizeof(*cmd))
- return 0;
- if (bpf_probe_read_kernel(lh, sizeof(*lh), data))
- return 0;
- if (bpf_probe_read_kernel(cmd, sizeof(*cmd), data + sizeof(*lh)))
- return 0;
- *payload = data + sizeof(*lh) + sizeof(*cmd);
- return 1;
+ if (!skb)
+ return 0;
+ data = BPF_CORE_READ(skb, data);
+ len = BPF_CORE_READ(skb, len);
+ if (!data || len < sizeof(*lh) + sizeof(*cmd))
+ return 0;
+ if (bpf_probe_read_kernel(lh, sizeof(*lh), data))
+ return 0;
+ if (bpf_probe_read_kernel(cmd, sizeof(*cmd), data + sizeof(*lh)))
+ return 0;
+ *payload = data + sizeof(*lh) + sizeof(*cmd);
+ return 1;
}
#define L2CAP_CID_SIGNALING 0x0001
@@ -85,27 +85,27 @@ static __always_inline int read_l2cap_command(struct sk_buff *skb,
SEC("kprobe/l2cap_recv_frame")
int BPF_KPROBE(cve_2026_31393_l2cap, void *conn,
- struct sk_buff *skb)
+ struct sk_buff *skb)
{
- struct l2cap_wire_hdr lh = {};
- struct l2cap_cmd_wire cmd = {};
- struct l2cap_info_wire info = {};
- const void *payload;
- __u16 cid, cmd_len, type, result;
+ struct l2cap_wire_hdr lh = {};
+ struct l2cap_cmd_wire cmd = {};
+ struct l2cap_info_wire info = {};
+ const void *payload;
+ __u16 cid, cmd_len, type, result;
- count_event(&activity);
- if (!read_l2cap_command(skb, &lh, &cmd, &payload))
- return 0;
- cid = bpf_ntohs(lh.cid);
- cmd_len = bpf_ntohs(cmd.len);
- if (cid != L2CAP_CID_SIGNALING || cmd.code != L2CAP_INFO_RSP ||
- cmd_len < sizeof(info) || cmd_len >= sizeof(info) + sizeof(__u32))
- return 0;
- if (bpf_probe_read_kernel(&info, sizeof(info), payload))
- return 0;
- type = bpf_ntohs(info.type);
- result = bpf_ntohs(info.result);
- if (type == L2CAP_IT_FEAT_MASK && result == L2CAP_IR_SUCCESS)
- count_event(&hits);
- return 0;
+ count_event(&activity);
+ if (!read_l2cap_command(skb, &lh, &cmd, &payload))
+ return 0;
+ cid = bpf_ntohs(lh.cid);
+ cmd_len = bpf_ntohs(cmd.len);
+ if (cid != L2CAP_CID_SIGNALING || cmd.code != L2CAP_INFO_RSP ||
+ cmd_len < sizeof(info) || cmd_len >= sizeof(info) + sizeof(__u32))
+ return 0;
+ if (bpf_probe_read_kernel(&info, sizeof(info), payload))
+ return 0;
+ type = bpf_ntohs(info.type);
+ result = bpf_ntohs(info.result);
+ if (type == L2CAP_IT_FEAT_MASK && result == L2CAP_IR_SUCCESS)
+ count_event(&hits);
+ return 0;
}
diff --git a/upatches/kernel-cve/sources/cve-2026-31682-bridge-br-nd-send-linearize-skb-parsing-nd/observability/cve_2026_31682-offset-predicate.bpf.c b/upatches/kernel-cve/sources/cve-2026-31682-bridge-br-nd-send-linearize-skb-parsing-nd/observability/cve_2026_31682-offset-predicate.bpf.c
index dbb34b96..6e066e32 100644
--- a/upatches/kernel-cve/sources/cve-2026-31682-bridge-br-nd-send-linearize-skb-parsing-nd/observability/cve_2026_31682-offset-predicate.bpf.c
+++ b/upatches/kernel-cve/sources/cve-2026-31682-bridge-br-nd-send-linearize-skb-parsing-nd/observability/cve_2026_31682-offset-predicate.bpf.c
@@ -17,25 +17,26 @@
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);
+ __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);
+ __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_map(void *map)
{
- __u32 zero = 0;
- __u64 *count = bpf_map_lookup_elem(map, &zero);
- if (count)
- (*count)++;
+ __u32 zero = 0;
+ __u64 *count = bpf_map_lookup_elem(map, &zero);
+
+ if (count)
+ (*count)++;
}
#define count_activity() count_map(&activity)
@@ -45,16 +46,16 @@ SEC("kprobe/br_do_suppress_nd+0x0")
int BPF_KPROBE(cve_2026_31682_predicate)
{
- struct sk_buff *skb = (struct sk_buff *)ctx->di;
- __u32 len, data_len;
-
- count_activity();
- if (!skb)
- return 0;
- len = BPF_CORE_READ(skb, len);
- data_len = BPF_CORE_READ(skb, data_len);
- if (data_len && data_len <= len)
- count_event();
- return 0;
+ struct sk_buff *skb = (struct sk_buff *)ctx->di;
+ __u32 len, data_len;
+
+ count_activity();
+ if (!skb)
+ return 0;
+ len = BPF_CORE_READ(skb, len);
+ data_len = BPF_CORE_READ(skb, data_len);
+ if (data_len && data_len <= len)
+ count_event();
+ return 0;
}
diff --git a/upatches/kernel-cve/sources/cve-2026-43062-bluetooth-l2cap-type-confusion-l2cap-ecred-reconf-rsp/observability/cve-2026-43062-caller-predicate.bpf.c b/upatches/kernel-cve/sources/cve-2026-43062-bluetooth-l2cap-type-confusion-l2cap-ecred-reconf-rsp/observability/cve-2026-43062-caller-predicate.bpf.c
index 30340e4e..ab83fd02 100644
--- a/upatches/kernel-cve/sources/cve-2026-43062-bluetooth-l2cap-type-confusion-l2cap-ecred-reconf-rsp/observability/cve-2026-43062-caller-predicate.bpf.c
+++ b/upatches/kernel-cve/sources/cve-2026-43062-bluetooth-l2cap-type-confusion-l2cap-ecred-reconf-rsp/observability/cve-2026-43062-caller-predicate.bpf.c
@@ -11,71 +11,71 @@
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);
+ __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);
+ __uint(type, BPF_MAP_TYPE_PERCPU_ARRAY);
+ __uint(max_entries, 1);
+ __type(key, __u32);
+ __type(value, __u64);
} activity SEC(".maps");
struct {
- __uint(type, BPF_MAP_TYPE_ARRAY);
- __uint(max_entries, 1);
- __type(key, __u32);
- __type(value, __u64);
+ __uint(type, BPF_MAP_TYPE_ARRAY);
+ __uint(max_entries, 1);
+ __type(key, __u32);
+ __type(value, __u64);
} control SEC(".maps");
static __always_inline void count_event(void *map)
{
- __u32 zero = 0;
- __u64 *count = bpf_map_lookup_elem(map, &zero);
+ __u32 zero = 0;
+ __u64 *count = bpf_map_lookup_elem(map, &zero);
- if (count)
- (*count)++;
+ if (count)
+ (*count)++;
}
struct l2cap_wire_hdr {
- __u16 len;
- __u16 cid;
+ __u16 len;
+ __u16 cid;
};
struct l2cap_cmd_wire {
- __u8 code;
- __u8 ident;
- __u16 len;
+ __u8 code;
+ __u8 ident;
+ __u16 len;
};
struct l2cap_info_wire {
- __u16 type;
- __u16 result;
+ __u16 type;
+ __u16 result;
};
static __always_inline int read_l2cap_command(struct sk_buff *skb,
- struct l2cap_wire_hdr *lh,
- struct l2cap_cmd_wire *cmd,
- const void **payload)
+ struct l2cap_wire_hdr *lh,
+ struct l2cap_cmd_wire *cmd,
+ const void **payload)
{
- const void *data;
- __u32 len;
+ const void *data;
+ __u32 len;
- if (!skb)
- return 0;
- data = BPF_CORE_READ(skb, data);
- len = BPF_CORE_READ(skb, len);
- if (!data || len < sizeof(*lh) + sizeof(*cmd))
- return 0;
- if (bpf_probe_read_kernel(lh, sizeof(*lh), data))
- return 0;
- if (bpf_probe_read_kernel(cmd, sizeof(*cmd), data + sizeof(*lh)))
- return 0;
- *payload = data + sizeof(*lh) + sizeof(*cmd);
- return 1;
+ if (!skb)
+ return 0;
+ data = BPF_CORE_READ(skb, data);
+ len = BPF_CORE_READ(skb, len);
+ if (!data || len < sizeof(*lh) + sizeof(*cmd))
+ return 0;
+ if (bpf_probe_read_kernel(lh, sizeof(*lh), data))
+ return 0;
+ if (bpf_probe_read_kernel(cmd, sizeof(*cmd), data + sizeof(*lh)))
+ return 0;
+ *payload = data + sizeof(*lh) + sizeof(*cmd);
+ return 1;
}
#define L2CAP_CID_LE_SIGNALING 0x0005
@@ -83,21 +83,21 @@ static __always_inline int read_l2cap_command(struct sk_buff *skb,
SEC("kprobe/l2cap_recv_frame")
int BPF_KPROBE(cve_2026_43062_l2cap, void *conn,
- struct sk_buff *skb)
+ struct sk_buff *skb)
{
- struct l2cap_wire_hdr lh = {};
- struct l2cap_cmd_wire cmd = {};
- const void *payload;
- __u16 cid, cmd_len;
+ struct l2cap_wire_hdr lh = {};
+ struct l2cap_cmd_wire cmd = {};
+ const void *payload;
+ __u16 cid, cmd_len;
- count_event(&activity);
- if (!read_l2cap_command(skb, &lh, &cmd, &payload))
- return 0;
- cid = bpf_ntohs(lh.cid);
- cmd_len = bpf_ntohs(cmd.len);
- if (cid == L2CAP_CID_LE_SIGNALING &&
- cmd.code == L2CAP_ECRED_RECONF_RSP &&
- cmd_len >= sizeof(__u16) && cmd_len < 8)
- count_event(&hits);
- return 0;
+ count_event(&activity);
+ if (!read_l2cap_command(skb, &lh, &cmd, &payload))
+ return 0;
+ cid = bpf_ntohs(lh.cid);
+ cmd_len = bpf_ntohs(cmd.len);
+ if (cid == L2CAP_CID_LE_SIGNALING &&
+ cmd.code == L2CAP_ECRED_RECONF_RSP &&
+ cmd_len >= sizeof(__u16) && cmd_len < 8)
+ count_event(&hits);
+ return 0;
}
diff --git a/upatches/kernel-cve/sources/cve-2026-52906-9p-access-mode-flags-being-ored-instead-replaced/observability/cve_2026_52906-offset-predicate.bpf.c b/upatches/kernel-cve/sources/cve-2026-52906-9p-access-mode-flags-being-ored-instead-replaced/observability/cve_2026_52906-offset-predicate.bpf.c
index 2b2694ee..9fe93ef9 100644
--- a/upatches/kernel-cve/sources/cve-2026-52906-9p-access-mode-flags-being-ored-instead-replaced/observability/cve_2026_52906-offset-predicate.bpf.c
+++ b/upatches/kernel-cve/sources/cve-2026-52906-9p-access-mode-flags-being-ored-instead-replaced/observability/cve_2026_52906-offset-predicate.bpf.c
@@ -17,25 +17,26 @@
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);
+ __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);
+ __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_map(void *map)
{
- __u32 zero = 0;
- __u64 *count = bpf_map_lookup_elem(map, &zero);
- if (count)
- (*count)++;
+ __u32 zero = 0;
+ __u64 *count = bpf_map_lookup_elem(map, &zero);
+
+ if (count)
+ (*count)++;
}
#define count_activity() count_map(&activity)
@@ -45,15 +46,15 @@ SEC("kprobe/v9fs_session_init+0x0")
int BPF_KPROBE(cve_2026_52906_predicate)
{
- struct v9fs_session_info *v9ses = (struct v9fs_session_info *)ctx->di;
- __u32 flags;
+ struct v9fs_session_info *v9ses = (struct v9fs_session_info *)ctx->di;
+ __u32 flags;
- count_activity();
- if (!v9ses)
- return 0;
- flags = BPF_CORE_READ(v9ses, flags);
- if ((flags & (0x08U | 0x10U)) == (0x08U | 0x10U))
- count_event();
- return 0;
+ count_activity();
+ if (!v9ses)
+ return 0;
+ flags = BPF_CORE_READ(v9ses, flags);
+ if ((flags & (0x08U | 0x10U)) == (0x08U | 0x10U))
+ count_event();
+ return 0;
}
diff --git a/upatches/kernel-cve/sources/cve-2026-52974-net-tls-strparser-anchor-skb-leak-offload-rx/observability/cve-2026-52974-caller-predicate.bpf.c b/upatches/kernel-cve/sources/cve-2026-52974-net-tls-strparser-anchor-skb-leak-offload-rx/observability/cve-2026-52974-caller-predicate.bpf.c
index 91ccd85f..c9a8face 100644
--- a/upatches/kernel-cve/sources/cve-2026-52974-net-tls-strparser-anchor-skb-leak-offload-rx/observability/cve-2026-52974-caller-predicate.bpf.c
+++ b/upatches/kernel-cve/sources/cve-2026-52974-net-tls-strparser-anchor-skb-leak-offload-rx/observability/cve-2026-52974-caller-predicate.bpf.c
@@ -11,65 +11,65 @@
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);
+ __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);
+ __uint(type, BPF_MAP_TYPE_PERCPU_ARRAY);
+ __uint(max_entries, 1);
+ __type(key, __u32);
+ __type(value, __u64);
} activity SEC(".maps");
struct {
- __uint(type, BPF_MAP_TYPE_ARRAY);
- __uint(max_entries, 1);
- __type(key, __u32);
- __type(value, __u64);
+ __uint(type, BPF_MAP_TYPE_ARRAY);
+ __uint(max_entries, 1);
+ __type(key, __u32);
+ __type(value, __u64);
} control SEC(".maps");
static __always_inline void count_event(void *map)
{
- __u32 zero = 0;
- __u64 *count = bpf_map_lookup_elem(map, &zero);
+ __u32 zero = 0;
+ __u64 *count = bpf_map_lookup_elem(map, &zero);
- if (count)
- (*count)++;
+ if (count)
+ (*count)++;
}
struct {
- __uint(type, BPF_MAP_TYPE_LRU_HASH);
- __uint(max_entries, 4096);
- __type(key, __u64);
- __type(value, __u8);
+ __uint(type, BPF_MAP_TYPE_LRU_HASH);
+ __uint(max_entries, 4096);
+ __type(key, __u64);
+ __type(value, __u8);
} rx_calls SEC(".maps");
SEC("kprobe/do_tls_setsockopt_conf")
int BPF_KPROBE(cve_2026_52974_tls_enter, struct sock *sk,
- void *optval, unsigned int optlen, int tx)
+ void *optval, unsigned int optlen, int tx)
{
- __u64 key = bpf_get_current_pid_tgid();
- __u8 one = 1;
+ __u64 key = bpf_get_current_pid_tgid();
+ __u8 one = 1;
- count_event(&activity);
- if (!tx)
- bpf_map_update_elem(&rx_calls, &key, &one, BPF_ANY);
- return 0;
+ count_event(&activity);
+ if (!tx)
+ bpf_map_update_elem(&rx_calls, &key, &one, BPF_ANY);
+ return 0;
}
SEC("kretprobe/do_tls_setsockopt_conf")
int BPF_KRETPROBE(cve_2026_52974_tls_exit)
{
- __u64 key = bpf_get_current_pid_tgid();
- __u8 *rx = bpf_map_lookup_elem(&rx_calls, &key);
- long ret = PT_REGS_RC(ctx);
+ __u64 key = bpf_get_current_pid_tgid();
+ __u8 *rx = bpf_map_lookup_elem(&rx_calls, &key);
+ long ret = PT_REGS_RC(ctx);
- if (rx && ret < 0)
- count_event(&hits);
- if (rx)
- bpf_map_delete_elem(&rx_calls, &key);
- return 0;
+ if (rx && ret < 0)
+ count_event(&hits);
+ if (rx)
+ bpf_map_delete_elem(&rx_calls, &key);
+ return 0;
}
diff --git a/upatches/kernel-cve/sources/cve-2026-53043-ocfs2-dlm-validate-qr-numregions-dlm-match-regions/observability/cve-2026-53043-caller-predicate.bpf.c b/upatches/kernel-cve/sources/cve-2026-53043-ocfs2-dlm-validate-qr-numregions-dlm-match-regions/observability/cve-2026-53043-caller-predicate.bpf.c
index 0ee17404..285f3072 100644
--- a/upatches/kernel-cve/sources/cve-2026-53043-ocfs2-dlm-validate-qr-numregions-dlm-match-regions/observability/cve-2026-53043-caller-predicate.bpf.c
+++ b/upatches/kernel-cve/sources/cve-2026-53043-ocfs2-dlm-validate-qr-numregions-dlm-match-regions/observability/cve-2026-53043-caller-predicate.bpf.c
@@ -11,33 +11,33 @@
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);
+ __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);
+ __uint(type, BPF_MAP_TYPE_PERCPU_ARRAY);
+ __uint(max_entries, 1);
+ __type(key, __u32);
+ __type(value, __u64);
} activity SEC(".maps");
struct {
- __uint(type, BPF_MAP_TYPE_ARRAY);
- __uint(max_entries, 1);
- __type(key, __u32);
- __type(value, __u64);
+ __uint(type, BPF_MAP_TYPE_ARRAY);
+ __uint(max_entries, 1);
+ __type(key, __u32);
+ __type(value, __u64);
} control SEC(".maps");
static __always_inline void count_event(void *map)
{
- __u32 zero = 0;
- __u64 *count = bpf_map_lookup_elem(map, &zero);
+ __u32 zero = 0;
+ __u64 *count = bpf_map_lookup_elem(map, &zero);
- if (count)
- (*count)++;
+ if (count)
+ (*count)++;
}
#define O2NET_MSG_BUF_OFFSET 24
@@ -46,19 +46,19 @@ static __always_inline void count_event(void *map)
SEC("kprobe/dlm_query_region_handler")
int BPF_KPROBE(cve_2026_53043_caller_predicate,
- void *msg, __u32 len)
+ void *msg, __u32 len)
{
- __u8 numregions = 0;
- const char *qr;
+ __u8 numregions = 0;
+ const char *qr;
- count_event(&activity);
- if (!msg || len < O2NET_MSG_BUF_OFFSET + 2)
- return 0;
- qr = (const char *)msg + O2NET_MSG_BUF_OFFSET;
- if (bpf_probe_read_kernel(&numregions, sizeof(numregions),
- qr + DLM_QUERY_REGION_NUMREGIONS_OFFSET))
- return 0;
- if (numregions > O2NM_MAX_REGIONS)
- count_event(&hits);
- return 0;
+ count_event(&activity);
+ if (!msg || len < O2NET_MSG_BUF_OFFSET + 2)
+ return 0;
+ qr = (const char *)msg + O2NET_MSG_BUF_OFFSET;
+ if (bpf_probe_read_kernel(&numregions, sizeof(numregions),
+ qr + DLM_QUERY_REGION_NUMREGIONS_OFFSET))
+ return 0;
+ if (numregions > O2NM_MAX_REGIONS)
+ count_event(&hits);
+ return 0;
}
diff --git a/upatches/kernel-cve/sources/cve-2026-53078-bpf-same-register-dst-src-oob-read-pointer/observability/cve-2026-53078-caller-predicate.bpf.c b/upatches/kernel-cve/sources/cve-2026-53078-bpf-same-register-dst-src-oob-read-pointer/observability/cve-2026-53078-caller-predicate.bpf.c
index c0084b88..54d55f79 100644
--- a/upatches/kernel-cve/sources/cve-2026-53078-bpf-same-register-dst-src-oob-read-pointer/observability/cve-2026-53078-caller-predicate.bpf.c
+++ b/upatches/kernel-cve/sources/cve-2026-53078-bpf-same-register-dst-src-oob-read-pointer/observability/cve-2026-53078-caller-predicate.bpf.c
@@ -11,50 +11,50 @@
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);
+ __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);
+ __uint(type, BPF_MAP_TYPE_PERCPU_ARRAY);
+ __uint(max_entries, 1);
+ __type(key, __u32);
+ __type(value, __u64);
} activity SEC(".maps");
struct {
- __uint(type, BPF_MAP_TYPE_ARRAY);
- __uint(max_entries, 1);
- __type(key, __u32);
- __type(value, __u64);
+ __uint(type, BPF_MAP_TYPE_ARRAY);
+ __uint(max_entries, 1);
+ __type(key, __u32);
+ __type(value, __u64);
} control SEC(".maps");
static __always_inline void count_event(void *map)
{
- __u32 zero = 0;
- __u64 *count = bpf_map_lookup_elem(map, &zero);
+ __u32 zero = 0;
+ __u64 *count = bpf_map_lookup_elem(map, &zero);
- if (count)
- (*count)++;
+ if (count)
+ (*count)++;
}
SEC("kprobe/sock_ops_convert_ctx_access")
int BPF_KPROBE(cve_2026_53078_sock_ops, int type,
- const struct bpf_insn *si, struct bpf_insn *insn_buf,
- struct bpf_prog *prog, __u32 *target_size)
+ const struct bpf_insn *si, struct bpf_insn *insn_buf,
+ struct bpf_prog *prog, __u32 *target_size)
{
- struct bpf_insn copy = {};
- __u8 dst, src;
-
- count_event(&activity);
- if (!si || type != 1 ||
- bpf_probe_read_kernel(&copy, sizeof(copy), si))
- return 0;
- dst = copy.dst_reg;
- src = copy.src_reg;
- if (dst == src)
- count_event(&hits);
- return 0;
+ struct bpf_insn copy = {};
+ __u8 dst, src;
+
+ count_event(&activity);
+ if (!si || type != 1 ||
+ bpf_probe_read_kernel(&copy, sizeof(copy), si))
+ return 0;
+ dst = copy.dst_reg;
+ src = copy.src_reg;
+ if (dst == src)
+ count_event(&hits);
+ return 0;
}
diff --git a/upatches/kernel-cve/sources/cve-2026-53092-bpf-linked-reg-delta-tracking-src-reg-dst/observability/cve-2026-53092-caller-predicate.bpf.c b/upatches/kernel-cve/sources/cve-2026-53092-bpf-linked-reg-delta-tracking-src-reg-dst/observability/cve-2026-53092-caller-predicate.bpf.c
index 849737fd..8ff9d12d 100644
--- a/upatches/kernel-cve/sources/cve-2026-53092-bpf-linked-reg-delta-tracking-src-reg-dst/observability/cve-2026-53092-caller-predicate.bpf.c
+++ b/upatches/kernel-cve/sources/cve-2026-53092-bpf-linked-reg-delta-tracking-src-reg-dst/observability/cve-2026-53092-caller-predicate.bpf.c
@@ -11,33 +11,33 @@
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);
+ __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);
+ __uint(type, BPF_MAP_TYPE_PERCPU_ARRAY);
+ __uint(max_entries, 1);
+ __type(key, __u32);
+ __type(value, __u64);
} activity SEC(".maps");
struct {
- __uint(type, BPF_MAP_TYPE_ARRAY);
- __uint(max_entries, 1);
- __type(key, __u32);
- __type(value, __u64);
+ __uint(type, BPF_MAP_TYPE_ARRAY);
+ __uint(max_entries, 1);
+ __type(key, __u32);
+ __type(value, __u64);
} control SEC(".maps");
static __always_inline void count_event(void *map)
{
- __u32 zero = 0;
- __u64 *count = bpf_map_lookup_elem(map, &zero);
+ __u32 zero = 0;
+ __u64 *count = bpf_map_lookup_elem(map, &zero);
- if (count)
- (*count)++;
+ if (count)
+ (*count)++;
}
#define BPF_ALU 0x04
@@ -50,21 +50,21 @@ static __always_inline void count_event(void *map)
SEC("kprobe/check_alu_op")
int BPF_KPROBE(cve_2026_53092_alu, struct bpf_verifier_env *env,
- struct bpf_insn *insn)
+ struct bpf_insn *insn)
{
- struct bpf_insn copy = {};
- __u8 code, op, cls, src, dst;
+ struct bpf_insn copy = {};
+ __u8 code, op, cls, src, dst;
- count_event(&activity);
- if (!insn || bpf_probe_read_kernel(&copy, sizeof(copy), insn))
- return 0;
- code = copy.code;
- src = copy.src_reg;
- dst = copy.dst_reg;
- cls = code & BPF_CLASS_MASK;
- op = code & BPF_OP_MASK;
- if ((cls == BPF_ALU || cls == BPF_ALU64) && (code & BPF_X) &&
- src == dst && (op == BPF_ADD || op == BPF_SUB))
- count_event(&hits);
- return 0;
+ count_event(&activity);
+ if (!insn || bpf_probe_read_kernel(&copy, sizeof(copy), insn))
+ return 0;
+ code = copy.code;
+ src = copy.src_reg;
+ dst = copy.dst_reg;
+ cls = code & BPF_CLASS_MASK;
+ op = code & BPF_OP_MASK;
+ if ((cls == BPF_ALU || cls == BPF_ALU64) && (code & BPF_X) &&
+ src == dst && (op == BPF_ADD || op == BPF_SUB))
+ count_event(&hits);
+ return 0;
}
diff --git a/upatches/kernel-cve/sources/cve-2026-53194-usb-serial-kl5kusb105-bulk-out-buffer-overflow/observability/cve-2026-53194-candidate.bpf.c b/upatches/kernel-cve/sources/cve-2026-53194-usb-serial-kl5kusb105-bulk-out-buffer-overflow/observability/cve-2026-53194-candidate.bpf.c
index 0c86fce1..9bd8cdcc 100644
--- a/upatches/kernel-cve/sources/cve-2026-53194-usb-serial-kl5kusb105-bulk-out-buffer-overflow/observability/cve-2026-53194-candidate.bpf.c
+++ b/upatches/kernel-cve/sources/cve-2026-53194-usb-serial-kl5kusb105-bulk-out-buffer-overflow/observability/cve-2026-53194-candidate.bpf.c
@@ -11,41 +11,41 @@
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);
+ __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);
+ __uint(type, BPF_MAP_TYPE_PERCPU_ARRAY);
+ __uint(max_entries, 1);
+ __type(key, __u32);
+ __type(value, __u64);
} activity SEC(".maps");
struct {
- __uint(type, BPF_MAP_TYPE_ARRAY);
- __uint(max_entries, 1);
- __type(key, __u32);
- __type(value, __u64);
+ __uint(type, BPF_MAP_TYPE_ARRAY);
+ __uint(max_entries, 1);
+ __type(key, __u32);
+ __type(value, __u64);
} control SEC(".maps");
static __always_inline void count_event(void *map)
{
- __u32 zero = 0;
- __u64 *count = bpf_map_lookup_elem(map, &zero);
+ __u32 zero = 0;
+ __u64 *count = bpf_map_lookup_elem(map, &zero);
- if (count)
- (*count)++;
+ if (count)
+ (*count)++;
}
SEC("kprobe/klsi_105_prepare_write_buffer")
int BPF_KPROBE(cve_2026_53194_klsi, void *port, void *dest, __u64 size)
{
- count_event(&activity);
- /* KLSI_HDR_LEN is 2; smaller buffers underflow size - KLSI_HDR_LEN. */
- if (size < 2)
- count_event(&hits);
- return 0;
+ count_event(&activity);
+ /* KLSI_HDR_LEN is 2; smaller buffers underflow size - KLSI_HDR_LEN. */
+ if (size < 2)
+ count_event(&hits);
+ return 0;
}
diff --git a/upatches/kernel-cve/sources/cve-2026-63947-bluetooth-hidp-missing-length-checks-hidp-input-report/observability/cve-2026-63947-candidate.bpf.c b/upatches/kernel-cve/sources/cve-2026-63947-bluetooth-hidp-missing-length-checks-hidp-input-report/observability/cve-2026-63947-candidate.bpf.c
index 2be8d726..ce6811d4 100644
--- a/upatches/kernel-cve/sources/cve-2026-63947-bluetooth-hidp-missing-length-checks-hidp-input-report/observability/cve-2026-63947-candidate.bpf.c
+++ b/upatches/kernel-cve/sources/cve-2026-63947-bluetooth-hidp-missing-length-checks-hidp-input-report/observability/cve-2026-63947-candidate.bpf.c
@@ -12,60 +12,60 @@
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);
+ __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);
+ __uint(type, BPF_MAP_TYPE_PERCPU_ARRAY);
+ __uint(max_entries, 1);
+ __type(key, __u32);
+ __type(value, __u64);
} activity SEC(".maps");
struct {
- __uint(type, BPF_MAP_TYPE_ARRAY);
- __uint(max_entries, 1);
- __type(key, __u32);
- __type(value, __u64);
+ __uint(type, BPF_MAP_TYPE_ARRAY);
+ __uint(max_entries, 1);
+ __type(key, __u32);
+ __type(value, __u64);
} control SEC(".maps");
static __always_inline void count_event(void *map)
{
- __u32 zero = 0;
- __u64 *count = bpf_map_lookup_elem(map, &zero);
+ __u32 zero = 0;
+ __u64 *count = bpf_map_lookup_elem(map, &zero);
- if (count)
- (*count)++;
+ if (count)
+ (*count)++;
}
SEC("kprobe/hidp_input_report")
int BPF_KPROBE(cve_2026_63947_hidp, void *session,
- const struct sk_buff *skb)
+ const struct sk_buff *skb)
{
- __u32 len;
- __u8 hdr;
- const void *data;
+ __u32 len;
+ __u8 hdr;
+ const void *data;
- count_event(&activity);
- if (!skb)
- return 0;
+ count_event(&activity);
+ if (!skb)
+ return 0;
- len = BPF_CORE_READ(skb, len);
- /* hidp_input_report() reads skb->data[0] before any payload check. */
- if (len < 1) {
- count_event(&hits);
- return 0;
- }
+ len = BPF_CORE_READ(skb, len);
+ /* hidp_input_report() reads skb->data[0] before any payload check. */
+ if (len < 1) {
+ count_event(&hits);
+ return 0;
+ }
- data = BPF_CORE_READ(skb, data);
- if (!data || bpf_probe_read_kernel(&hdr, sizeof(hdr), data))
- return 0;
+ data = BPF_CORE_READ(skb, data);
+ if (!data || bpf_probe_read_kernel(&hdr, sizeof(hdr), data))
+ return 0;
- /* The vulnerable function needs one header plus the complete report. */
- if ((hdr == 0x01 && len < 9) || (hdr == 0x02 && len < 4))
- count_event(&hits);
- return 0;
+ /* The vulnerable function needs one header plus the complete report. */
+ if ((hdr == 0x01 && len < 9) || (hdr == 0x02 && len < 4))
+ count_event(&hits);
+ return 0;
}
diff --git a/upatches/kernel-cve/sources/cve-2026-63976-bluetooth-l2cap-clear-chan-ident-ecred-reconfiguration-success/observability/cve-2026-63976-caller-predicate.bpf.c b/upatches/kernel-cve/sources/cve-2026-63976-bluetooth-l2cap-clear-chan-ident-ecred-reconfiguration-success/observability/cve-2026-63976-caller-predicate.bpf.c
index 376aeb89..683adde1 100644
--- a/upatches/kernel-cve/sources/cve-2026-63976-bluetooth-l2cap-clear-chan-ident-ecred-reconfiguration-success/observability/cve-2026-63976-caller-predicate.bpf.c
+++ b/upatches/kernel-cve/sources/cve-2026-63976-bluetooth-l2cap-clear-chan-ident-ecred-reconfiguration-success/observability/cve-2026-63976-caller-predicate.bpf.c
@@ -11,71 +11,71 @@
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);
+ __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);
+ __uint(type, BPF_MAP_TYPE_PERCPU_ARRAY);
+ __uint(max_entries, 1);
+ __type(key, __u32);
+ __type(value, __u64);
} activity SEC(".maps");
struct {
- __uint(type, BPF_MAP_TYPE_ARRAY);
- __uint(max_entries, 1);
- __type(key, __u32);
- __type(value, __u64);
+ __uint(type, BPF_MAP_TYPE_ARRAY);
+ __uint(max_entries, 1);
+ __type(key, __u32);
+ __type(value, __u64);
} control SEC(".maps");
static __always_inline void count_event(void *map)
{
- __u32 zero = 0;
- __u64 *count = bpf_map_lookup_elem(map, &zero);
+ __u32 zero = 0;
+ __u64 *count = bpf_map_lookup_elem(map, &zero);
- if (count)
- (*count)++;
+ if (count)
+ (*count)++;
}
struct l2cap_wire_hdr {
- __u16 len;
- __u16 cid;
+ __u16 len;
+ __u16 cid;
};
struct l2cap_cmd_wire {
- __u8 code;
- __u8 ident;
- __u16 len;
+ __u8 code;
+ __u8 ident;
+ __u16 len;
};
struct l2cap_info_wire {
- __u16 type;
- __u16 result;
+ __u16 type;
+ __u16 result;
};
static __always_inline int read_l2cap_command(struct sk_buff *skb,
- struct l2cap_wire_hdr *lh,
- struct l2cap_cmd_wire *cmd,
- const void **payload)
+ struct l2cap_wire_hdr *lh,
+ struct l2cap_cmd_wire *cmd,
+ const void **payload)
{
- const void *data;
- __u32 len;
+ const void *data;
+ __u32 len;
- if (!skb)
- return 0;
- data = BPF_CORE_READ(skb, data);
- len = BPF_CORE_READ(skb, len);
- if (!data || len < sizeof(*lh) + sizeof(*cmd))
- return 0;
- if (bpf_probe_read_kernel(lh, sizeof(*lh), data))
- return 0;
- if (bpf_probe_read_kernel(cmd, sizeof(*cmd), data + sizeof(*lh)))
- return 0;
- *payload = data + sizeof(*lh) + sizeof(*cmd);
- return 1;
+ if (!skb)
+ return 0;
+ data = BPF_CORE_READ(skb, data);
+ len = BPF_CORE_READ(skb, len);
+ if (!data || len < sizeof(*lh) + sizeof(*cmd))
+ return 0;
+ if (bpf_probe_read_kernel(lh, sizeof(*lh), data))
+ return 0;
+ if (bpf_probe_read_kernel(cmd, sizeof(*cmd), data + sizeof(*lh)))
+ return 0;
+ *payload = data + sizeof(*lh) + sizeof(*cmd);
+ return 1;
}
#define L2CAP_CID_LE_SIGNALING 0x0005
@@ -83,23 +83,23 @@ static __always_inline int read_l2cap_command(struct sk_buff *skb,
SEC("kprobe/l2cap_recv_frame")
int BPF_KPROBE(cve_2026_63976_l2cap, void *conn,
- struct sk_buff *skb)
+ struct sk_buff *skb)
{
- struct l2cap_wire_hdr lh = {};
- struct l2cap_cmd_wire cmd = {};
- __u16 result;
- const void *payload;
+ struct l2cap_wire_hdr lh = {};
+ struct l2cap_cmd_wire cmd = {};
+ __u16 result;
+ const void *payload;
- count_event(&activity);
- if (!read_l2cap_command(skb, &lh, &cmd, &payload))
- return 0;
- if (bpf_ntohs(lh.cid) != L2CAP_CID_LE_SIGNALING ||
- cmd.code != L2CAP_ECRED_RECONF_RSP ||
- bpf_ntohs(cmd.len) < sizeof(__u16))
- return 0;
- if (bpf_probe_read_kernel(&result, sizeof(result), payload))
- return 0;
- if (result == 0)
- count_event(&hits);
- return 0;
+ count_event(&activity);
+ if (!read_l2cap_command(skb, &lh, &cmd, &payload))
+ return 0;
+ if (bpf_ntohs(lh.cid) != L2CAP_CID_LE_SIGNALING ||
+ cmd.code != L2CAP_ECRED_RECONF_RSP ||
+ bpf_ntohs(cmd.len) < sizeof(__u16))
+ return 0;
+ if (bpf_probe_read_kernel(&result, sizeof(result), payload))
+ return 0;
+ if (result == 0)
+ count_event(&hits);
+ return 0;
}
diff --git a/upatches/kernel-cve/sources/cve-2026-63992-tunnels-not-assume-transport-header-iptunnel-pmtud-check/observability/cve-2026-63992-caller-predicate.bpf.c b/upatches/kernel-cve/sources/cve-2026-63992-tunnels-not-assume-transport-header-iptunnel-pmtud-check/observability/cve-2026-63992-caller-predicate.bpf.c
index 42c0038a..ebcff9c7 100644
--- a/upatches/kernel-cve/sources/cve-2026-63992-tunnels-not-assume-transport-header-iptunnel-pmtud-check/observability/cve-2026-63992-caller-predicate.bpf.c
+++ b/upatches/kernel-cve/sources/cve-2026-63992-tunnels-not-assume-transport-header-iptunnel-pmtud-check/observability/cve-2026-63992-caller-predicate.bpf.c
@@ -11,33 +11,33 @@
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);
+ __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);
+ __uint(type, BPF_MAP_TYPE_PERCPU_ARRAY);
+ __uint(max_entries, 1);
+ __type(key, __u32);
+ __type(value, __u64);
} activity SEC(".maps");
struct {
- __uint(type, BPF_MAP_TYPE_ARRAY);
- __uint(max_entries, 1);
- __type(key, __u32);
- __type(value, __u64);
+ __uint(type, BPF_MAP_TYPE_ARRAY);
+ __uint(max_entries, 1);
+ __type(key, __u32);
+ __type(value, __u64);
} control SEC(".maps");
static __always_inline void count_event(void *map)
{
- __u32 zero = 0;
- __u64 *count = bpf_map_lookup_elem(map, &zero);
+ __u32 zero = 0;
+ __u64 *count = bpf_map_lookup_elem(map, &zero);
- if (count)
- (*count)++;
+ if (count)
+ (*count)++;
}
#define ETH_P_IP 0x0800
@@ -45,17 +45,17 @@ static __always_inline void count_event(void *map)
SEC("kprobe/skb_tunnel_check_pmtu")
int BPF_KPROBE(cve_2026_63992_pmtu, struct sk_buff *skb,
- struct dst_entry *encap_dst, int headroom, bool reply)
+ struct dst_entry *encap_dst, int headroom, bool reply)
{
- __u16 protocol, transport_header;
-
- count_event(&activity);
- if (!skb || !reply)
- return 0;
- protocol = BPF_CORE_READ(skb, protocol);
- transport_header = BPF_CORE_READ(skb, transport_header);
- if ((protocol == bpf_htons(ETH_P_IP) ||
- protocol == bpf_htons(ETH_P_IPV6)) && transport_header == 0xffff)
- count_event(&hits);
- return 0;
+ __u16 protocol, transport_header;
+
+ count_event(&activity);
+ if (!skb || !reply)
+ return 0;
+ protocol = BPF_CORE_READ(skb, protocol);
+ transport_header = BPF_CORE_READ(skb, transport_header);
+ if ((protocol == bpf_htons(ETH_P_IP) ||
+ protocol == bpf_htons(ETH_P_IPV6)) && transport_header == 0xffff)
+ count_event(&hits);
+ return 0;
}
diff --git a/upatches/kernel-cve/sources/cve-2026-64036-cgroup-rstat-validate-cpu-css-rstat-cpu-access/observability/cve-2026-64036-caller-predicate.bpf.c b/upatches/kernel-cve/sources/cve-2026-64036-cgroup-rstat-validate-cpu-css-rstat-cpu-access/observability/cve-2026-64036-caller-predicate.bpf.c
index b4a98d19..5ebf660a 100644
--- a/upatches/kernel-cve/sources/cve-2026-64036-cgroup-rstat-validate-cpu-css-rstat-cpu-access/observability/cve-2026-64036-caller-predicate.bpf.c
+++ b/upatches/kernel-cve/sources/cve-2026-64036-cgroup-rstat-validate-cpu-css-rstat-cpu-access/observability/cve-2026-64036-caller-predicate.bpf.c
@@ -11,48 +11,48 @@
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);
+ __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);
+ __uint(type, BPF_MAP_TYPE_PERCPU_ARRAY);
+ __uint(max_entries, 1);
+ __type(key, __u32);
+ __type(value, __u64);
} activity SEC(".maps");
struct {
- __uint(type, BPF_MAP_TYPE_ARRAY);
- __uint(max_entries, 1);
- __type(key, __u32);
- __type(value, __u64);
+ __uint(type, BPF_MAP_TYPE_ARRAY);
+ __uint(max_entries, 1);
+ __type(key, __u32);
+ __type(value, __u64);
} control SEC(".maps");
static __always_inline void count_event(void *map)
{
- __u32 zero = 0;
- __u64 *count = bpf_map_lookup_elem(map, &zero);
+ __u32 zero = 0;
+ __u64 *count = bpf_map_lookup_elem(map, &zero);
- if (count)
- (*count)++;
+ if (count)
+ (*count)++;
}
SEC("kprobe/__css_rstat_updated")
int BPF_KPROBE(cve_2026_64036_rstat,
- struct cgroup_subsys_state *css, int cpu)
+ struct cgroup_subsys_state *css, int cpu)
{
- int possible;
+ int possible;
- count_event(&activity);
- extern const volatile int nr_cpu_ids __ksym;
+ count_event(&activity);
+ extern const volatile int nr_cpu_ids __ksym;
- if (bpf_probe_read_kernel(&possible, sizeof(possible),
- (const void *)&nr_cpu_ids))
- return 0;
- if (cpu < 0 || (possible > 0 && cpu >= possible))
- count_event(&hits);
- return 0;
+ if (bpf_probe_read_kernel(&possible, sizeof(possible),
+ (const void *)&nr_cpu_ids))
+ return 0;
+ if (cpu < 0 || (possible > 0 && cpu >= possible))
+ count_event(&hits);
+ return 0;
}
diff --git a/upatches/kernel-cve/sources/cve-2026-64116-ipv6-ioam-add-null-check-idev-ipv6-hop/observability/cve_2026_64116-offset-predicate.bpf.c b/upatches/kernel-cve/sources/cve-2026-64116-ipv6-ioam-add-null-check-idev-ipv6-hop/observability/cve_2026_64116-offset-predicate.bpf.c
index 4be2d912..d3abd694 100644
--- a/upatches/kernel-cve/sources/cve-2026-64116-ipv6-ioam-add-null-check-idev-ipv6-hop/observability/cve_2026_64116-offset-predicate.bpf.c
+++ b/upatches/kernel-cve/sources/cve-2026-64116-ipv6-ioam-add-null-check-idev-ipv6-hop/observability/cve_2026_64116-offset-predicate.bpf.c
@@ -17,25 +17,26 @@
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);
+ __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);
+ __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_map(void *map)
{
- __u32 zero = 0;
- __u64 *count = bpf_map_lookup_elem(map, &zero);
- if (count)
- (*count)++;
+ __u32 zero = 0;
+ __u64 *count = bpf_map_lookup_elem(map, &zero);
+
+ if (count)
+ (*count)++;
}
#define count_activity() count_map(&activity)
@@ -45,20 +46,20 @@ SEC("kprobe/ip6_parse_tlv+0x0")
int BPF_KPROBE(cve_2026_64116_predicate)
{
- bool hopbyhop = (bool)ctx->di;
- struct sk_buff *skb = (struct sk_buff *)ctx->si;
- struct net_device *dev;
- void *ip6_ptr;
+ bool hopbyhop = (bool)ctx->di;
+ struct sk_buff *skb = (struct sk_buff *)ctx->si;
+ struct net_device *dev;
+ void *ip6_ptr;
- count_activity();
- if (!hopbyhop || !skb)
- return 0;
- dev = BPF_CORE_READ(skb, dev);
- if (!dev)
- return 0;
- ip6_ptr = BPF_CORE_READ(dev, ip6_ptr);
- if (!ip6_ptr)
- count_event();
- return 0;
+ count_activity();
+ if (!hopbyhop || !skb)
+ return 0;
+ dev = BPF_CORE_READ(skb, dev);
+ if (!dev)
+ return 0;
+ ip6_ptr = BPF_CORE_READ(dev, ip6_ptr);
+ if (!ip6_ptr)
+ count_event();
+ return 0;
}
diff --git a/upatches/kernel-cve/sources/cve-2026-64133-alsa-asihpi-oob-array-access-at-reading-cache/observability/cve-2026-64133-caller-predicate.bpf.c b/upatches/kernel-cve/sources/cve-2026-64133-alsa-asihpi-oob-array-access-at-reading-cache/observability/cve-2026-64133-caller-predicate.bpf.c
index 99b8fe2d..a3daf299 100644
--- a/upatches/kernel-cve/sources/cve-2026-64133-alsa-asihpi-oob-array-access-at-reading-cache/observability/cve-2026-64133-caller-predicate.bpf.c
+++ b/upatches/kernel-cve/sources/cve-2026-64133-alsa-asihpi-oob-array-access-at-reading-cache/observability/cve-2026-64133-caller-predicate.bpf.c
@@ -11,33 +11,33 @@
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);
+ __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);
+ __uint(type, BPF_MAP_TYPE_PERCPU_ARRAY);
+ __uint(max_entries, 1);
+ __type(key, __u32);
+ __type(value, __u64);
} activity SEC(".maps");
struct {
- __uint(type, BPF_MAP_TYPE_ARRAY);
- __uint(max_entries, 1);
- __type(key, __u32);
- __type(value, __u64);
+ __uint(type, BPF_MAP_TYPE_ARRAY);
+ __uint(max_entries, 1);
+ __type(key, __u32);
+ __type(value, __u64);
} control SEC(".maps");
static __always_inline void count_event(void *map)
{
- __u32 zero = 0;
- __u64 *count = bpf_map_lookup_elem(map, &zero);
+ __u32 zero = 0;
+ __u64 *count = bpf_map_lookup_elem(map, &zero);
- if (count)
- (*count)++;
+ if (count)
+ (*count)++;
}
#define HPI_CACHE_CONTROL_COUNT_OFFSET 4
@@ -45,19 +45,19 @@ static __always_inline void count_event(void *map)
SEC("kprobe/hpi_check_control_cache")
int BPF_KPROBE(cve_2026_64133_caller_predicate,
- void *cache, void *message)
+ void *cache, void *message)
{
- __u32 control_count = 0;
- __u16 obj_index = 0;
-
- count_event(&activity);
- if (!cache || !message ||
- bpf_probe_read_kernel(&control_count, sizeof(control_count),
- (const char *)cache + HPI_CACHE_CONTROL_COUNT_OFFSET) ||
- bpf_probe_read_kernel(&obj_index, sizeof(obj_index),
- (const char *)message + HPI_MESSAGE_OBJ_INDEX_OFFSET))
- return 0;
- if (obj_index >= control_count)
- count_event(&hits);
- return 0;
+ __u32 control_count = 0;
+ __u16 obj_index = 0;
+
+ count_event(&activity);
+ if (!cache || !message ||
+ bpf_probe_read_kernel(&control_count, sizeof(control_count),
+ (const char *)cache + HPI_CACHE_CONTROL_COUNT_OFFSET) ||
+ bpf_probe_read_kernel(&obj_index, sizeof(obj_index),
+ (const char *)message + HPI_MESSAGE_OBJ_INDEX_OFFSET))
+ return 0;
+ if (obj_index >= control_count)
+ count_event(&hits);
+ return 0;
}
diff --git a/upatches/kernel-cve/sources/cve-2026-68118-tcp-challenge-ack-non-exact-rst-syn-received/observability/cve-2026-68118-candidate.bpf.c b/upatches/kernel-cve/sources/cve-2026-68118-tcp-challenge-ack-non-exact-rst-syn-received/observability/cve-2026-68118-candidate.bpf.c
index cc9f4ef7..558aa577 100644
--- a/upatches/kernel-cve/sources/cve-2026-68118-tcp-challenge-ack-non-exact-rst-syn-received/observability/cve-2026-68118-candidate.bpf.c
+++ b/upatches/kernel-cve/sources/cve-2026-68118-tcp-challenge-ack-non-exact-rst-syn-received/observability/cve-2026-68118-candidate.bpf.c
@@ -19,38 +19,38 @@
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);
+ __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);
+ __uint(type, BPF_MAP_TYPE_PERCPU_ARRAY);
+ __uint(max_entries, 1);
+ __type(key, __u32);
+ __type(value, __u64);
} activity SEC(".maps");
struct {
- __uint(type, BPF_MAP_TYPE_ARRAY);
- __uint(max_entries, 1);
- __type(key, __u32);
- __type(value, __u64);
+ __uint(type, BPF_MAP_TYPE_ARRAY);
+ __uint(max_entries, 1);
+ __type(key, __u32);
+ __type(value, __u64);
} control SEC(".maps");
static __always_inline void count_activity(void)
{
- __u32 zero = 0;
- __u64 *count = bpf_map_lookup_elem(&activity, &zero);
+ __u32 zero = 0;
+ __u64 *count = bpf_map_lookup_elem(&activity, &zero);
- if (count)
- (*count)++;
+ if (count)
+ (*count)++;
}
SEC("kprobe/tcp_check_req")
int BPF_KPROBE(cve_2026_68118_candidate)
{
- count_activity();
- return 0;
+ count_activity();
+ return 0;
}
diff --git a/upatches/kernel-cve/sources/cve-2026-68118-tcp-challenge-ack-non-exact-rst-syn-received/observability/cve_2026_68118-6.1-offset-predicate.bpf.c b/upatches/kernel-cve/sources/cve-2026-68118-tcp-challenge-ack-non-exact-rst-syn-received/observability/cve_2026_68118-6.1-offset-predicate.bpf.c
index 4060254c..c724567f 100644
--- a/upatches/kernel-cve/sources/cve-2026-68118-tcp-challenge-ack-non-exact-rst-syn-received/observability/cve_2026_68118-6.1-offset-predicate.bpf.c
+++ b/upatches/kernel-cve/sources/cve-2026-68118-tcp-challenge-ack-non-exact-rst-syn-received/observability/cve_2026_68118-6.1-offset-predicate.bpf.c
@@ -18,47 +18,47 @@
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);
+ __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);
+ __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);
+ __u32 zero = 0;
+ __u64 *count = bpf_map_lookup_elem(map, &zero);
- if (count)
- (*count)++;
+ if (count)
+ (*count)++;
}
SEC("kprobe/tcp_check_req+0x11c")
int BPF_KPROBE(cve_2026_68118_offset_predicate)
{
- struct sk_buff *skb = (void *)BPF_CORE_READ(ctx, bx);
- struct request_sock *req = (void *)BPF_CORE_READ(ctx, bp);
- struct tcp_skb_cb cb = {};
- __u32 flags = (__u32)BPF_CORE_READ(ctx, r14);
- __u32 rcv_nxt;
+ struct sk_buff *skb = (void *)BPF_CORE_READ(ctx, bx);
+ struct request_sock *req = (void *)BPF_CORE_READ(ctx, bp);
+ struct tcp_skb_cb cb = {};
+ __u32 flags = (__u32)BPF_CORE_READ(ctx, r14);
+ __u32 rcv_nxt;
- count_event(&activity);
- if (!skb || !req || !(flags & 0x400U)) /* TCP_FLAG_RST in this image */
- return 0;
+ count_event(&activity);
+ if (!skb || !req || !(flags & 0x400U)) /* TCP_FLAG_RST in this image */
+ return 0;
- if (bpf_probe_read_kernel(&cb, sizeof(cb), skb->cb))
- return 0;
- rcv_nxt = BPF_CORE_READ((struct tcp_request_sock *)req, rcv_nxt);
+ if (bpf_probe_read_kernel(&cb, sizeof(cb), skb->cb))
+ return 0;
+ rcv_nxt = BPF_CORE_READ((struct tcp_request_sock *)req, rcv_nxt);
- /* The fixed code challenges an in-window RST whose sequence is not exact. */
- if (cb.seq != rcv_nxt)
- count_event(&hits);
- return 0;
+ /* The fixed code challenges an in-window RST whose sequence is not exact. */
+ if (cb.seq != rcv_nxt)
+ count_event(&hits);
+ return 0;
}
diff --git a/upatches/kernel-cve/sources/cve-2026-68118-tcp-challenge-ack-non-exact-rst-syn-received/observability/cve_2026_68118-6.1-predicate-deferred.bpf.c b/upatches/kernel-cve/sources/cve-2026-68118-tcp-challenge-ack-non-exact-rst-syn-received/observability/cve_2026_68118-6.1-predicate-deferred.bpf.c
index dc78d8fa..0271ea2c 100644
--- a/upatches/kernel-cve/sources/cve-2026-68118-tcp-challenge-ack-non-exact-rst-syn-received/observability/cve_2026_68118-6.1-predicate-deferred.bpf.c
+++ b/upatches/kernel-cve/sources/cve-2026-68118-tcp-challenge-ack-non-exact-rst-syn-received/observability/cve_2026_68118-6.1-predicate-deferred.bpf.c
@@ -16,26 +16,26 @@
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);
+ __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);
+ __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);
+ __u32 zero = 0;
+ __u64 *count = bpf_map_lookup_elem(map, &zero);
- if (count)
- (*count)++;
+ if (count)
+ (*count)++;
}
#define ARG1(ctx) ((__u64)(ctx)->di)
@@ -47,14 +47,14 @@ static __always_inline void count_event(void *map)
static __always_inline int read_u8(const void *ptr, __u32 offset, __u8 *out)
{
- return bpf_probe_read_kernel(out, sizeof(*out),
- (const char *)ptr + offset);
+ return bpf_probe_read_kernel(out, sizeof(*out),
+ (const char *)ptr + offset);
}
static __always_inline int read_u16(const void *ptr, __u32 offset, __u16 *out)
{
- return bpf_probe_read_kernel(out, sizeof(*out),
- (const char *)ptr + offset);
+ return bpf_probe_read_kernel(out, sizeof(*out),
+ (const char *)ptr + offset);
}
/* CVE-2026-68118: deferred source-context witness */
@@ -64,7 +64,7 @@ static __always_inline int read_u16(const void *ptr, __u32 offset, __u16 *out)
SEC("kprobe/tcp_check_req")
int BPF_KPROBE(cve_2026_68118_predicate_deferred)
{
- count_event(&activity);
- /* Intentionally no hits increment: this is not a detector. */
- return 0;
+ count_event(&activity);
+ /* Intentionally no hits increment: this is not a detector. */
+ return 0;
}