-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored #3
Comments
Hi Joecowboy, Can you shortly describe what telephathy-ofono is? There is no readme and no description. I'm just curious. |
Hello JsBergbau, Telepathy-ofono (from the ofono platform) is basically man in the middle app between android layer and ubports (Ubuntu Touch -- Ubuntu 16.04) for mms on my phone. I am trying to figure out a way while I have WiFi enabled I can still send and receive pics, videos, emojis, ect. and have it routed to the cell network interface (rmnet_data0) only. As it stands if WiFi is enabled and Cell Network Data is enabled; sending and receiving files via mms will error but texting is fine. Disable Wifi everything works flawlessly. Even if I run the following command with sudo I still get the same error. Also, I cannot use IPtables because -m cgroup because match with cgroup is not enabled in the kernel. So I am looking at your solution. I am getting the same error with LD_PRELOAD: phablet@ubuntu-phablet:~/Downloads$ BIND_INTERFACE=rmnet_data0 LD_PRELOAD=/home/phablet/Downloads/bindToInterface.so /usr/lib/telepathy/telepathy-ofono |
It may be possible that telepathy-ofono runs under a different user account or drops some rights. So it could be possible that telepathy-ofono can't access |
Okay, here is killing the pid of telepathy-ofono with it copied to /opt as you suggested but as you notice the ERROR is still there. Do you have a way to compile this for Ubuntu 16.04 for testing?: phablet@ubuntu-phablet: |
Very strange: Can you please try |
Found something useful https://linux.die.net/man/8/ld-linux
So if I understand this correctly: If telepathy-ofono uses set-user-ID and/or set-group-ID LD_PRELOAD will only work if it is in a standard search directory. According to this https://unix.stackexchange.com/a/22999/334883 that are
If done
Also put library to So if the curl example |
I moved bindToInterface.so from /opt to /lib then chmod ug+s on the file and tried your curl requests. The error still persists as you can see from the last two outputs. Thank you for your time and trying to figure this out.
root@ubuntu-phablet:/lib# BIND_INTERFACE=ovpn LD_PRELOAD=bindToIntelibce.so curl ifconfig.me root@ubuntu-phablet:/lib# BIND_INTERFACE=rmnet_data0 DNS_OVERRIDE_IP=8.8.8.8 LD_PRELOAD=/lib/bindToInterface.so curl ifconfig.me |
Thanks for the output. So this problem has primarily nothing to do with telephathy-ofono. Did you compile bindInterface.so on that machine? Please post output of |
No I didn't, because it's my phone and no gcc compiler. I compiled it on an another ubuntu box. |
That should be the issue. You compiled for another architecture and thats why it can't be loaded. |
I thought about that too. I guess I can try and install gcc on the phone and report back. |
Ok I installed gcc and libc6-dev to compile your project. I compiled it without any errors on the phone now. However, I am still receiving the ERROR. Do you have any other ideas?: BIND_INTERFACE=ovpn LD_PRELOAD=/usr/local/lib/bindToIntelibce.so curl ifconfig.me |
Please try this line |
Here is the output from what you wanted me to try with "NO" ERROR:
However, I am still getting the ERROR with telepathy-ofono. Do you have anymore thoughts. I thought about moving it to /system/lib to see if that would make a difference.:
|
That looks better now. However resolving should work. Lets focus on getting this working first and than look regarding telepathy-ofono Try to use the DNS-Server of your provider in DNS_OVERRIDE_IP and see if you get the IP of your mobile data connection. If not please please uncomment line 13 in bindToInterface.c so debugging is enabled Then please compile again and execute again the example with curl and your provider DNS and post the output here. |
I uncommented line 13 to enable debugging. Curl seems to work if I disable the wlan0 interface:
With wlan0 enabled curl does not resolve the host:
|
It looks like there is some prevention that mobile data is used while wifi connection is established. To verify this please use without any preloading:
|
With wlan0 disabled:
With wlan0 enabled:
Here is output from: |
Thanks. So there is definitely something preventing using your mobile data while wlan0 is enabled. I recommend you to post your example on https://android.stackexchange.com/ using the |
Okay I will do that. |
OKay, I created a question over on Android Enthusiasts per your request: |
Another option to try |
It didn't work still times out using sudo. @irfanlatif from Android Enthusiasts was suggesting for me to look at his solution here and I was trying to think how this would help us with this situation because we don't want all traffic routed from wlan0 to rmnet_data0 we need it per application. Unless, I am missing something: |
Using routing tables is another solution. The beauty of BindToInterface or Asking for trying with sudo was to verfiy if it is some kind of permission thing, but it seems not. Just to check: Can you try |
phablet@ubuntu-phablet:~$ sudo whoami How can we test what might be blocking the rmnet_data0 interface while wlan0 is enabled. Both interfaces are set to default and what's weird if you look at the route tables when wlan0 is disabled the routes for rmnet_data0 do not changed. wlan0 routs |
I don't really know. If there was something in ip rule it would have been worth a closer look, but that is a normal routing table which should work. Have a look there https://unix.stackexchange.com/a/498140/334883 Preloading libraries are very common for this usecase and as already mentioned, if there is native support like with curl, then you don't even have to preload a library. |
I had to install curl on the phone. Here is my firewall on the phone for iptables: phablet@ubuntu-phablet:~$ sudo iptables -L Chain FORWARD (policy ACCEPT) Chain OUTPUT (policy ACCEPT) Chain nm_mdmprxy_doze_mode_skip (0 references) Chain nm_mdmprxy_iface_pkt_fwder (0 references) |
How do I use use ld_preload to force the interface gateway with your app like those other apps were talking about in the link you posted? |
LD_PRELOAD with my app does the same as |
I apologize I misunderstood. So I just need to figure out what's preventing binding to rmnet_data0. |
Exactly. Once |
Set a policy of accepting all traffic by default. I tried resetting the iptables and ACCEPT ALL on wlan0 and rmnet_data0 but the connection still times out doing curl --interface rmnet_data0. So tables look like this: Chain INPUT (policy ACCEPT) Chain FORWARD (policy ACCEPT) Chain OUTPUT (policy ACCEPT) Chain nm_mdmprxy_doze_mode_skip (0 references) Chain nm_mdmprxy_iface_pkt_fwder (0 references) |
When you have How did you reset iptables. If it is really an iptables issue, try https://serverfault.com/a/633623 to reset all tables. |
I am just trying to rule out any iptables issue. I reset the iptables by: I tried the solution but still curl still times out with Wi-Fi enabled: root@ubuntu-phablet:/# iptables -L Chain FORWARD (policy ACCEPT) Chain OUTPUT (policy ACCEPT) |
Then it is not iptables related and also not ip rule related. But still I have no clue what could be wrong here. |
I am trying to figure out if it's a Ubports Kernel Issue blocking the usage of Mobile network interface when Wi-Fi is enabled. Not sure how I would test this. |
Do you have a public IP adress on mobile data interface? If so you could try if ping works and see if it changes when enabling Wifi. |
Went to ipchicken.com and got my IP address when running only the Mobile Network Interface I went to https://www.ipaddressguide.com/ping and was able to ping the IP address with Wi-Fi enabled and disabled. |
Thats not the right way, because there is probably NAT inwolved. Is the ip from ipchicken.com the same as in ifconfig? If not this way doesn't work. |
Different Different IP from ifconfig. It will not ping that address with Wi-Fi enabled or disabled. |
Good Day to you JSBergbau, By the way here is the Halium 9 project I am using from @RyanAM I am still at a loss if it's UBports kernel preventing the binding to the interface or if its the ofono layer. I am not sure how to test to see what's preventing it. Unless I can find some kernel logs or ofono logs. |
Here is the output of dbs-monitor when executing: method call time=1635631597.369505 sender=:1.140 -> destination=com.lomiri.hfd serial=350 path=/com/lomiri/hfd; interface=org.freedesktop.DBus.Introspectable; member=Introspect |
@Joecowboy So basically for physical NICs you need to specify a default route for the NIC you want to bind to. Since you got
this might be a different error, because with missing gateway, I got "no route to host" with |
I am hitting the same issue..
No avail |
What happens when using |
sudo -i
unset LD_PRELOAD
unset LD_LIBRARY_PATH
LD_PRELOAD= LD_LIBRARY_PATH=
…On Mon, May 13, 2024, 1:41 PM JsBergbau ***@***.***> wrote:
What happens when using curl --interface <interfacename> ifconfig.me?
—
Reply to this email directly, view it on GitHub
<#3 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABSRO2UF2DD5SXIIDJBM743ZCEJO5AVCNFSM5FHEBWD2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TEMJQHA3DMMZYG42A>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
I know telephathy-ofono is already registered. I just have to kill it's process to get around it.
I am getting the following error trying to LD_PRELOAD:
BIND_INTERFACE=rmnet_data0 LD_PRELOAD=./bindToInterface.so /usr/lib/telepathy/telepathy-ofono
ERROR: ld.so: object './bindToInterface.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
tp-qt 0.9.7 DEBUG: Interface "org.freedesktop.Telepathy.Protocol.Interface.Addressing" plugged
tp-qt 0.9.7 DEBUG: Protocol "ofono" added to CM
tp-qt 0.9.7 DEBUG: Registering protocol "ofono" at path "/org/freedesktop/Telepathy/ConnectionManager/ofono/ofono" for CM "/org/freedesktop/Telepathy/ConnectionManager/ofono" at bus name "org.freedesktop.Telepathy.ConnectionManager.ofono"
tp-qt 0.9.7 WARN: Unable to register object "/org/freedesktop/Telepathy/ConnectionManager/ofono/ofono" - path already registered
The text was updated successfully, but these errors were encountered: