You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
typedef struct
{
uint16_t cipher_suits[50];
uint8_t cipher_suit_count;
} client_hello_info;
SEC("xdp_test")
int tls_client_hello_tracker(xdp_md_t* ctx)
{
client_hello_info info;
for (int i = 0;i < 50; i++)
info.cipher_suits[i] = 0;
bpf_ringbuf_output(&client_hello_info_pipe, &info, sizeof(info), 0);
bpf_printk("Add one message");
return XDP_PASS;
}
ebpf verification result
; C:\Users\User\Source\ebpfSamples/xdp1.c:142
; info.cipher_suits[i] = 0;
9: Lower bound must be at least 0 (valid_access(r3.offset, width=2) for write)
; C:\Users\User\Source\ebpfSamples/xdp1.c:142
; info.cipher_suits[i] = 0;
9: Upper bound must be at most EBPF_STACK_SIZE (valid_access(r3.offset, width=2) for write)
; C:\Users\User\Source\ebpfSamples/xdp1.c:144
; bpf_ringbuf_output(&client_hello_info_pipe, &info, sizeof(info), 0);
19: Stack content is not numeric (valid_access(r2.offset, width=r3) for read)
In the code, the size of the array is given. Why the verification still think the array access is not valid?
OS information
Windows11
Steps taken to reproduce bug
use clang to build code example.
netsh ebpf show verification xxx.o
Expected behavior
Verification succeed.
Actual outcome
Verification failed.
Additional details
No response
The text was updated successfully, but these errors were encountered:
Describe the bug
code example
ebpf verification result
In the code, the size of the array is given. Why the verification still think the array access is not valid?
OS information
Windows11
Steps taken to reproduce bug
Expected behavior
Verification succeed.
Actual outcome
Verification failed.
Additional details
No response
The text was updated successfully, but these errors were encountered: