Open 98hq opened 1 month ago
I can test SUD and int3 signaling successfully, but when I tested ld_preload, it crashed. Can I know the source code of your program using ld_preload to use lwip API?
To use LD_PRELOAD with https://github.com/yasukata/glue-lwip-dpdk-zpoline , please try the following by replacing the content of glue-lwip-dpdk-zpoline/zpoline/main.c
.
Supposedly, the program above can be compiled by make -C zpoline
typed in glue-lwip-dpdk-zpoline
, and the command shown in README of https://github.com/yasukata/glue-lwip-dpdk-zpoline can be used for running it.
In addition, I would like to know how you use ptrace to let the program apply lwip's API.
To use ptrace with https://github.com/yasukata/glue-lwip-dpdk-zpoline , please try the following by replacing the content of glue-lwip-dpdk-zpoline/main.c
and glue-lwip-dpdk-zpoline/Makefile
.
Supposedly, the program above can be compiled by make
typed in glue-lwip-dpdk-zpoline
, and the following command will launch the Redis server while applying hooks through ptrace.
sudo NET_ADDR=10.100.0.20 NET_MASK=255.255.255.0 NET_GATE=10.100.0.1 DPDK_ARGS="-l 0 --vdev=net_tap,iface=tap001 --no-pci" LD_LIBRARY_PATH=./dpdk/install/lib/x86_64-linux-gnu ./ptracenet ~/code/redis-stable/src/redis-server --protected-mode no
Thank you very much for your message.
Hello, I used the code of glue-lwip-dpdk-zpoline and successfully used zpoline to improve the efficiency of a program. Then I want to test the efficiency improvement of the program after applying lwip API compared with other hook mechanisms. I can test SUD and int3 signaling successfully, but when I tested ld_preload, it crashed. Can I know the source code of your program using ld_preload to use lwip API?
This is the hook code I wrote for LD_PRELOAD, it is compiled into libpreload.so and then loaded via LD_PRELOAD.
I basically did not modify main.c in glue-lwip-dpdk-zpoline , but replaced the places where next_sys_call appeared with the corresponding original system call name.
This is the source code of main.c after I modified it: main.c
This is the command I use to start the program:
When the hooked object is redis-server, the following error occurs:
Accepting client connection: accept: Socket operation on non-socket
When the hooked object is a simple server program, the program crashes after connecting. After debugging it, I found that the accept return value is often 0xfffffff5. The source code of the simple server program is at server program
In addition, I would like to know how you use ptrace to let the program apply lwip's API. As we discussed before, ptrace cannot jump over the original system call #10(comment). How do you avoid this problem?
Looking forward to your reply.