mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-06-25 15:54:43 +00:00
Set all buffer sizes to CHUNK_SIZE
This commit is contained in:
parent
3e7d08bf2c
commit
3f4e03d381
@ -9,9 +9,6 @@ Copyright (C) UP9 Inc.
|
|||||||
#include "include/headers.h"
|
#include "include/headers.h"
|
||||||
#include "include/maps.h"
|
#include "include/maps.h"
|
||||||
|
|
||||||
#define BUFFER_SIZE_READ_WRITE (1 << 19) // 512 KiB
|
|
||||||
#define CRYPTO_TLS_READ_LEN (1 << 12) // constant 4KiB is observed
|
|
||||||
|
|
||||||
|
|
||||||
struct golang_read_write {
|
struct golang_read_write {
|
||||||
__u32 pid;
|
__u32 pid;
|
||||||
@ -20,7 +17,7 @@ struct golang_read_write {
|
|||||||
bool is_request;
|
bool is_request;
|
||||||
__u32 len;
|
__u32 len;
|
||||||
__u32 cap;
|
__u32 cap;
|
||||||
__u8 data[BUFFER_SIZE_READ_WRITE];
|
__u8 data[CHUNK_SIZE];
|
||||||
};
|
};
|
||||||
|
|
||||||
const struct golang_read_write *unused __attribute__((unused));
|
const struct golang_read_write *unused __attribute__((unused));
|
||||||
@ -60,7 +57,7 @@ static __always_inline int golang_crypto_tls_write_uprobe(struct pt_regs *ctx) {
|
|||||||
b->len = ctx->rcx;
|
b->len = ctx->rcx;
|
||||||
b->cap = ctx->rdi;
|
b->cap = ctx->rdi;
|
||||||
|
|
||||||
status = bpf_probe_read(&b->data, CRYPTO_TLS_READ_LEN, (void*)ctx->rbx);
|
status = bpf_probe_read(&b->data, CHUNK_SIZE, (void*)ctx->rbx);
|
||||||
if (status < 0) {
|
if (status < 0) {
|
||||||
bpf_printk("[golang_crypto_tls_write_uprobe] error reading data: %d", status);
|
bpf_printk("[golang_crypto_tls_write_uprobe] error reading data: %d", status);
|
||||||
bpf_ringbuf_discard(b, BPF_RB_FORCE_WAKEUP);
|
bpf_ringbuf_discard(b, BPF_RB_FORCE_WAKEUP);
|
||||||
@ -98,7 +95,7 @@ static __always_inline int golang_crypto_tls_read_uprobe(struct pt_regs *ctx) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
status = bpf_probe_read(&b->data, CRYPTO_TLS_READ_LEN, (void*)(data_p));
|
status = bpf_probe_read(&b->data, CHUNK_SIZE, (void*)(data_p));
|
||||||
if (status < 0) {
|
if (status < 0) {
|
||||||
bpf_printk("[golang_crypto_tls_read_uprobe] error reading data: %d", status);
|
bpf_printk("[golang_crypto_tls_read_uprobe] error reading data: %d", status);
|
||||||
bpf_ringbuf_discard(b, BPF_RB_FORCE_WAKEUP);
|
bpf_ringbuf_discard(b, BPF_RB_FORCE_WAKEUP);
|
||||||
|
@ -21,7 +21,7 @@ type tlsTapperGolangReadWrite struct {
|
|||||||
_ [3]byte
|
_ [3]byte
|
||||||
Len uint32
|
Len uint32
|
||||||
Cap uint32
|
Cap uint32
|
||||||
Data [524288]uint8
|
Data [4096]uint8
|
||||||
}
|
}
|
||||||
|
|
||||||
type tlsTapperTlsChunk struct {
|
type tlsTapperTlsChunk struct {
|
||||||
|
Binary file not shown.
@ -21,7 +21,7 @@ type tlsTapperGolangReadWrite struct {
|
|||||||
_ [3]byte
|
_ [3]byte
|
||||||
Len uint32
|
Len uint32
|
||||||
Cap uint32
|
Cap uint32
|
||||||
Data [524288]uint8
|
Data [4096]uint8
|
||||||
}
|
}
|
||||||
|
|
||||||
type tlsTapperTlsChunk struct {
|
type tlsTapperTlsChunk struct {
|
||||||
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user