Fix go_crypto_tls_ex_uprobe

This commit is contained in:
M. Mert Yildiran 2022-06-14 11:23:13 +03:00
parent 82befd14bb
commit b6345dcc9f

View File

@ -132,6 +132,15 @@ static __always_inline void go_crypto_tls_ex_uprobe(struct pt_regs *ctx, struct
return; return;
} }
// In case of read, the length is determined on return
if (flags == FLAGS_IS_READ_BIT) {
info.buffer_len = GO_ABI_INTERNAL_PT_REGS_R1(ctx); // n in return n, nil
// This check achieves ignoring 0 length reads (the reads result with an error)
if (info.buffer_len == 0) {
return;
}
}
output_ssl_chunk(ctx, &info, info.buffer_len, pid_tgid, flags); output_ssl_chunk(ctx, &info, info.buffer_len, pid_tgid, flags);
return; return;