From ed9bf3bd2ea92f05668e51e1fe1cadbd631377d5 Mon Sep 17 00:00:00 2001 From: Lorenz Bauer Date: Wed, 11 Oct 2023 14:40:00 +0100 Subject: [PATCH] internal: fix reading auxv on 32-bit platforms It turns out that the auxiliary vector has a platform specific size. Adjust the code to use uintptr to approximate "unsigned long" from C. auxv32le.bin is from an i686 Debian bookworm machine. Fixes https://github.com/cilium/ebpf/issues/1133 Signed-off-by: Lorenz Bauer --- internal/testdata/auxv32le.bin | Bin 0 -> 176 bytes .../testdata/auxv64le.bin | Bin .../testdata/auxv64le_no_vdso.bin | Bin {testdata => internal/testdata}/vdso.bin | Bin .../testdata}/vdso_multiple_notes.bin | Bin internal/vdso.go | 44 ++++++++++++--- internal/vdso_test.go | 50 ++++++++++++------ 7 files changed, 70 insertions(+), 24 deletions(-) create mode 100644 internal/testdata/auxv32le.bin rename testdata/auxv.bin => internal/testdata/auxv64le.bin (100%) rename testdata/auxv_no_vdso.bin => internal/testdata/auxv64le_no_vdso.bin (100%) rename {testdata => internal/testdata}/vdso.bin (100%) rename {testdata => internal/testdata}/vdso_multiple_notes.bin (100%) diff --git a/internal/testdata/auxv32le.bin b/internal/testdata/auxv32le.bin new file mode 100644 index 0000000000000000000000000000000000000000..b4270a7bfd83ca4c5d1ebda321982057001726bd GIT binary patch literal 176 zcmY#jU|