kubeshark/tap/tlstapper
M. Mert Yıldıran 52c9251c00
Add ABI0 support to Go crypto/tls eBPF tracer (#1169)
* Determine the Go ABI and get `goid` offset from DWARF

* Add `ABI` enum and morph the function according to the detected ABI

* Pass `goid` offset to an eBPF map to retrieve it in eBPF context

* Add `vmlinux.h` and implement `get_goid_from_thread_local_storage`

* Fix BPF verifier errors

* Update the comments

* Add `go_abi_0.h` and implement `ABI0` specific reads for `arm64`

* Upgrade `github.com/cilium/ebpf` to `v0.9.0`

* Add a comment

* Add macros for x86 specific parts

* Update `x86.o`

* Fix the map key type

* Add `user_pt_regs`

* Update arm64 object file

* Fix the version detection logic

* Add `getGStructOffset` method

* Define `goid_offsets`, `goid_offsets_map` structs and pass the offsets correctly

* Fix the `net.TCPConn` and buffer addresses for `ABI0`

* Remove comment

* Fix the issues for arm64 build

* Update x86.o

* Revert "Fix the issues for arm64 build"

This reverts commit 48b041b1b6.

* Revert `user_pt_regs`

* Add `vmlinux` directory

* Fix the `build.sh` and `Dockerfile`

* Add vmlinux_arm64.h

* Disable `get_goid_from_thread_local_storage` on ARM64 with a macro

* Update x86.o

* Update arm64.o

* x86

* arm64

* Fix the cross-compilation issue from x86 to arm64

* Fix the same thing for x86

* Use `BPF_CORE_READ` macro instead of `bpf_ringbuf_reserve` to support kernel versions older than 5.8

Also;
Add legacy version of thread_struct: thread_struct___v46
Build an additional object file for the kernel versions older than or equal to 4.6 and load them accordingly.
Add github.com/moby/moby

* Make #define directives more definitive

* Select the x86 and arm64 versions of `vmlinux.h` using macros

* Put `goid` offsets into the map before installing `uprobe`(s)

* arm64

* #run_acceptance_tests

* Remove a forgotten `fmt.Printf`

* Log the detected Linux kernel version
2022-07-05 14:35:30 +03:00
..
bpf Add ABI0 support to Go crypto/tls eBPF tracer (#1169) 2022-07-05 14:35:30 +03:00
bpf-builder Add ABI0 support to Go crypto/tls eBPF tracer (#1169) 2022-07-05 14:35:30 +03:00
bpf_logger_messages.go Add Go crypto/tls eBPF tracer for TLS connections (#1120) 2022-06-12 14:14:41 +03:00
bpf_logger.go Make logger a separate module such that don't depend on shared module as a whole for logging (#1047) 2022-04-27 22:26:27 +03:00
chunk.go Fix problems that golang inspection reported (#1158) 2022-06-23 16:49:56 +03:00
go_hooks.go Add ABI0 support to Go crypto/tls eBPF tracer (#1169) 2022-07-05 14:35:30 +03:00
go_offsets.go Add ABI0 support to Go crypto/tls eBPF tracer (#1169) 2022-07-05 14:35:30 +03:00
sockfd_info.go Feature/fix tls not listening (#1046) 2022-05-02 21:33:26 +03:00
ssllib_finder.go Add Go crypto/tls eBPF tracer for TLS connections (#1120) 2022-06-12 14:14:41 +03:00
ssllib_hooks.go Fix problems that golang inspection reported (#1158) 2022-06-23 16:49:56 +03:00
ssllib_offsets.go Make logger a separate module such that don't depend on shared module as a whole for logging (#1047) 2022-04-27 22:26:27 +03:00
syscall_hooks.go Add ABI0 support to Go crypto/tls eBPF tracer (#1169) 2022-07-05 14:35:30 +03:00
tls_emitter.go Add kube namespace to tls (TRA-4443) (#1013) 2022-04-18 16:12:51 +03:00
tls_poller.go Fix problems that golang inspection reported (#1158) 2022-06-23 16:49:56 +03:00
tls_process_discoverer.go Fix problems that golang inspection reported (#1158) 2022-06-23 16:49:56 +03:00
tls_reader.go Add Go crypto/tls eBPF tracer for TLS connections (#1120) 2022-06-12 14:14:41 +03:00
tls_stream.go Call SetProtocol in AMQP faster and remove GetProtocol method (#1097) 2022-05-19 10:07:40 +03:00
tls_tapper.go Add ABI0 support to Go crypto/tls eBPF tracer (#1169) 2022-07-05 14:35:30 +03:00
tlstapper46_bpfel_arm64.go Add ABI0 support to Go crypto/tls eBPF tracer (#1169) 2022-07-05 14:35:30 +03:00
tlstapper46_bpfel_arm64.o Add ABI0 support to Go crypto/tls eBPF tracer (#1169) 2022-07-05 14:35:30 +03:00
tlstapper46_bpfel_x86.go Add ABI0 support to Go crypto/tls eBPF tracer (#1169) 2022-07-05 14:35:30 +03:00
tlstapper46_bpfel_x86.o Add ABI0 support to Go crypto/tls eBPF tracer (#1169) 2022-07-05 14:35:30 +03:00
tlstapper_bpfel_arm64.go Add ABI0 support to Go crypto/tls eBPF tracer (#1169) 2022-07-05 14:35:30 +03:00
tlstapper_bpfel_arm64.o Add ABI0 support to Go crypto/tls eBPF tracer (#1169) 2022-07-05 14:35:30 +03:00
tlstapper_bpfel_x86.go Add ABI0 support to Go crypto/tls eBPF tracer (#1169) 2022-07-05 14:35:30 +03:00
tlstapper_bpfel_x86.o Add ABI0 support to Go crypto/tls eBPF tracer (#1169) 2022-07-05 14:35:30 +03:00