the-z-labs / bof-launcher Goto Github PK
View Code? Open in Web Editor NEWBeacon Object File (BOF) launcher - library for executing BOF files in C/C++/Zig applications
License: BSD 3-Clause "New" or "Revised" License
Beacon Object File (BOF) launcher - library for executing BOF files in C/C++/Zig applications
License: BSD 3-Clause "New" or "Revised" License
bof-launcher/bofs/src/wDirectSyscall.asm
Lines 44 to 48 in 5d33547
include 'encoding/utf8.inc'
align 8
filename du 'file.txt'
.SIZE = $ - filename
See: ziglang/zig#17062
Calling bofObjectRunAsyncThread()
on a system with an older GLIBC versions (prior to 2.34) will cause a segmentation fault due to a NULL pointer dereference. This is because pthread functionality wasn't integrated into libc.so.6
in those GLIBC versions so the pthread_create
and pthread_detach
function pointers are NULL.
This should be reproducible by modifying the integration-with-c
example to use bofObjectRunAsyncThread
(demo.patch
) and executing it on a system with an older GLIBC. I also have an example fix that patches bof_launcher.zig
to load the functions from libpthread.so.0
(fix.patch
).
test@test:~$ unzip demo.zip
Archive: demo.zip
inflating: demo.sh
inflating: demo.patch
inflating: fix.patch
# run an example that produces a crash
test@test:~$ docker run --rm -it --entrypoint bash -v`pwd`:/data oraclelinux:8.9 /data/demo.sh
# run the example with the example fix applied
test@test:~$ docker run --rm -it --entrypoint bash -v`pwd`:/data oraclelinux:8.9 /data/demo.sh 1
I have tested this patch on GLIBC 2.17, 2.28, 2.34, and 2.39 and the patch worked in all cases. However, I have only been able to test x86_64 and not architectures such as arm or aarch64.
I don't know if introducing a reliance on libpthread.so.0
(or the stub provided with modern GLIBC versions) is how you wanted to address this until issue #1 is solved so I didn't want to preemptively make a pull request. Let me know if you would like me to make one though.
Thanks for making and maintaining this project, I've found it to be quite interesting and useful!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.