Mellanox / libvma

Linux user space library for network socket acceleration based on RDMA compatible network adaptors
https://www.mellanox.com/products/software/accelerator-software/vma?mtag=vma
Other
573 stars 153 forks source link

`libvma` load failed in some situation #1064

Closed g199209 closed 9 months ago

g199209 commented 9 months ago
$ export LD_PRELOAD=libvma.so
$ export VMA_TRACELEVEL=info

Run sockperf server side:

$ sockperf sr -i 127.0.0.1
 VMA INFO: ---------------------------------------------------------------------------
 VMA INFO: VMA_VERSION: 9.7.2-1 Release built on Feb 20 2023 13:00:29
 VMA INFO: Cmd Line: sockperf sr -i 127.0.0.1
 VMA INFO: OFED Version: MLNX_OFED_LINUX-5.8-2.0.3.0:
 VMA INFO: ---------------------------------------------------------------------------
 VMA INFO: Log Level                      INFO                       [VMA_TRACELEVEL]
 VMA INFO: ---------------------------------------------------------------------------
sockperf: == version #3.10-no.git ==
sockperf: [SERVER] listen on:
[ 0] IP = 127.0.0.1       PORT = 11111 # UDP
sockperf: Warmup stage (sending a few dummy messages)...
sockperf: [tid 104373] using recvfrom() to block on socket(s)
^Csockperf: Test end (interrupted by user)
sockperf: No messages were received on the server.
sockperf: cleanupAfterLoop() exit

Works as expect.

Run ping:

$ ping 127.0.0.1
ERROR: ld.so: object 'libvma.so' from LD_PRELOAD cannot be preloaded: ignored.
PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data.
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.006 ms
64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.002 ms
^C
--- 127.0.0.1 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 999ms
rtt min/avg/max/mdev = 0.002/0.004/0.006/0.002 ms

Why?

g199209 commented 9 months ago

Found the reason: https://stackoverflow.com/questions/9232892/ld-preload-with-setuid-binary