From a27d235e5a6a75e9f5eda43bc056380a54b65371 Mon Sep 17 00:00:00 2001 From: "M. Mert Yildiran" Date: Thu, 2 Jun 2022 04:31:49 +0300 Subject: [PATCH] Use constant read length --- tap/tlstapper/bpf/golang_uprobes.c | 4 ++-- tap/tlstapper/tlstapper_bpfeb.o | Bin 126064 -> 126064 bytes tap/tlstapper/tlstapper_bpfel.o | Bin 126064 -> 126064 bytes 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tap/tlstapper/bpf/golang_uprobes.c b/tap/tlstapper/bpf/golang_uprobes.c index eb2d3845e..3d99600e3 100644 --- a/tap/tlstapper/bpf/golang_uprobes.c +++ b/tap/tlstapper/bpf/golang_uprobes.c @@ -60,7 +60,7 @@ static __always_inline int golang_crypto_tls_write_uprobe(struct pt_regs *ctx) { b->len = ctx->rcx; b->cap = ctx->rdi; - status = bpf_probe_read_str(&b->data, sizeof(b->data), (void*)ctx->rbx); + status = bpf_probe_read(&b->data, CRYPTO_TLS_READ_LEN, (void*)ctx->rbx); if (status < 0) { bpf_printk("[golang_crypto_tls_write_uprobe] error reading data: %d", status); bpf_ringbuf_discard(b, BPF_RB_FORCE_WAKEUP); @@ -98,7 +98,7 @@ static __always_inline int golang_crypto_tls_read_uprobe(struct pt_regs *ctx) { return 0; } - status = bpf_probe_read_str(&b->data, sizeof(b->data), (void*)(data_p)); + status = bpf_probe_read(&b->data, CRYPTO_TLS_READ_LEN, (void*)(data_p)); if (status < 0) { bpf_printk("[golang_crypto_tls_read_uprobe] error reading data: %d", status); bpf_ringbuf_discard(b, BPF_RB_FORCE_WAKEUP); diff --git a/tap/tlstapper/tlstapper_bpfeb.o b/tap/tlstapper/tlstapper_bpfeb.o index d7792447b49742811fc9cf2b5f1f0f0b435b0985..0af714819dbfcb0ba790dc622840fc6bd87ca833 100644 GIT binary patch delta 254 zcmexxgZ;w|_6@ep+zbK?tqfqmGTEbf21{`U1JC3;%`%f(e39igN3=|_~2b6!BfiXsSdYn3A zJfrINed>&_R@pYOG_d?;{>R+H(#Z0c`9Jd&=F802n6EOovvjbuvUIYvv2?NgWNv2p g!~B`~Bl8dDFU;SVzcPPd{>1#A`TO>#ml(Sx0RstJ)c^nh diff --git a/tap/tlstapper/tlstapper_bpfel.o b/tap/tlstapper/tlstapper_bpfel.o index 10eb7b47230b821035c68690a316b1ec202ec7a6..fca6f78361e7ffc4c758b31954309c737a808e7b 100644 GIT binary patch delta 248 zcmexxgZ;w|_6@ep90CjstqcqdER$WEXEPVK@l3wmEIX;i7cRazv}L*_mxfxBu3buE zNuti=kNZR>bM1RH*?zwS8&EJOHE*)ue(}j{`^_dd?v|fiw%;91_2%3Ar>8M0PA^tt z+^tstw9B8LfuTZ}fk8Nik)Z*~pA6*lBrq~`K>1ri{FLc2>Wp!WiraUqGrnDA+sN{t z`4{tF=4O@#mOsq@m@hM5V!q0Jg}IHTou!4PgQbuD? T`91ST=6B5Bwm-eZ*ewYFS`JfC delta 290 zcmexxgZ;w|_6@ep91I)`tqcqdx|3a-XG?Eq1TqB}7?Q<+1P~;PiGbb z;}})9?^b7gyUMnSrGe!)^FQVmmPVGp%>S9MFkfcA#(b5zouz}Nm8FxVjirm_Cv!8) hALh@@ADMqJe_{T{{FV6w^C#x_%-^>^y~Nlp2>@W8TRs2)