Skip to content

Commit

Permalink
fix: veristat verify failed.
Browse files Browse the repository at this point in the history
sudo ../veristat/src/veristat -d user/bytecode/openssl_3_0_0_kern.o

Signed-off-by: cfc4n <cfc4n.cs@gmail.com>
  • Loading branch information
cfc4n committed Oct 8, 2023
1 parent ed72fe0 commit 85d5368
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 8 deletions.
25 changes: 17 additions & 8 deletions kern/openssl.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@ struct ssl_data_event_t {
s32 version;
};

struct {
__uint(type, BPF_MAP_TYPE_PERF_EVENT_ARRAY);
} tls_events SEC(".maps");

struct connect_event_t {
u64 timestamp_ns;
u32 pid;
Expand All @@ -48,10 +44,6 @@ struct connect_event_t {
char comm[TASK_COMM_LEN];
};

struct {
__uint(type, BPF_MAP_TYPE_PERF_EVENT_ARRAY);
} connect_events SEC(".maps");

struct active_ssl_buf {
/*
* protocol version (one of SSL2_VERSION, SSL3_VERSION, TLS1_VERSION,
Expand All @@ -67,6 +59,23 @@ struct active_ssl_buf {
* BPF MAPS
***********************************************************/


struct {
__uint(type, BPF_MAP_TYPE_PERF_EVENT_ARRAY);
__uint(key_size, sizeof(u32));
__uint(value_size, sizeof(u32));
__uint(max_entries, 1024);
} tls_events SEC(".maps");


struct {
__uint(type, BPF_MAP_TYPE_PERF_EVENT_ARRAY);
__uint(key_size, sizeof(u32));
__uint(value_size, sizeof(u32));
__uint(max_entries, 1024);
} connect_events SEC(".maps");


// Key is thread ID (from bpf_get_current_pid_tgid).
// Value is a pointer to the data buffer argument to SSL_write/SSL_read.
struct {
Expand Down
3 changes: 3 additions & 0 deletions kern/openssl_masterkey.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ struct ssl3_state_st {
// bpf map
struct {
__uint(type, BPF_MAP_TYPE_PERF_EVENT_ARRAY);
__uint(key_size, sizeof(u32));
__uint(value_size, sizeof(u32));
__uint(max_entries, 1024);
} mastersecret_events SEC(".maps");

struct {
Expand Down
3 changes: 3 additions & 0 deletions kern/openssl_masterkey_3.0.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ struct mastersecret_t {
// bpf map
struct {
__uint(type, BPF_MAP_TYPE_PERF_EVENT_ARRAY);
__uint(key_size, sizeof(u32));
__uint(value_size, sizeof(u32));
__uint(max_entries, 1024);
} mastersecret_events SEC(".maps");

struct {
Expand Down
2 changes: 2 additions & 0 deletions kern/tc.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ struct net_ctx_t {
////////////////////// ebpf maps //////////////////////
struct {
__uint(type, BPF_MAP_TYPE_PERF_EVENT_ARRAY);
__uint(key_size, sizeof(u32));
__uint(value_size, sizeof(u32));
__uint(max_entries, 10240);
} skb_events SEC(".maps");

Expand Down

0 comments on commit 85d5368

Please sign in to comment.