I have Pixel Experience (Android 10) installed on my Redmi K20. + Magisk 21.4.
In terminal I enter command iptables -t mangle -L -n | grep TTL
which throws Another app is currently holding the xtables lock. Perhaps you want to use the -w option?
. How to find the this application? Or how to drop xtables lock?
1 Answer
/system/bin/iptables
binary holds an advisory lock on /system/etc/xtables.lock
file (which is usually /run/xtables.lock
on normal Linux distros).
It's the native netd
service which performs operations with NetFilter but on a rooted device normal apps (e.g. AFWall+) may also execute the binary to add or remove firewall rules.
Use the lslocks
command to list all the system locks currently held and the applications holding them. Or read the /proc/locks
file directly.
You should not try to drop a lock, instead (using iptables [-w|--wait]
option) wait for the ongoing execution to end.
-
Hello! Thank you for answering. First problem is that -w option doesn't help. It just never unlocks no matter how much seconds I pass. second one is that lslocks is not present in system. Third, the inum of /etc/xtables.lock is not present in /proc/locks. Commented Feb 12, 2021 at 15:15
-
1) Then
iptables
or the executing app must be misbehaving. 2) Build it: github.com/karelzak/util-linux/blob/master/misc-utils/lslocks.c 3) Youriptables
binary seems to be the culprit. Use a custom built. // I have both binaries forarm64
and I can share if needed. Commented Feb 12, 2021 at 15:58 -
-
androidfilehost.com/?fid=17248734326145737067, androidfilehost.com/?fid=17248734326145737068 Commented Feb 15, 2021 at 13:53
-
1Fair enough, thank you for explanations, I'll digg deeper Commented Feb 18, 2021 at 6:28