Android: how to find application locking xtables? 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?
/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.