Skip to content

[Bug]: Linux/Btrfs executable identity mismatch bypasses DIRECT classification and breaks NetworkManager connectivity checks #283

Closed

Description

@jzwo

Platform

Linux

ProxyBridge Version

4.0.0 (installed Linux executable reports this version).
Source inspected separately: master at 2eb0076. The installed executable has not been independently matched to that commit.

OS and Version

Fedora Linux 44, x86_64
Kernel: 7.2.14-200.fc44.x86_64
NetworkManager: 1.56.1-2.fc44
systemd-resolved: 259.10-1.fc44
Root filesystem: Btrfs, root subvolume.

Documentation and existing issues

The Linux rules, troubleshooting, and architecture documentation were reviewed. Related: #281 reports a device-ID mismatch in UDP sender validation on this Btrfs machine. This report documents a distinct TCP failure: NetworkManager connectivity checks are redirected to the loopback relay despite a DIRECT rule. The two failures may share the same executable-identity mismatch; a common root cause has not yet been confirmed by a patched build.

Describe the Bug

With ProxyBridge running, NetworkManager reports LIMITED connectivity and the desktop Wi-Fi icon shows a question mark, although ordinary HTTP requests work. DNS resolution succeeds, but both IPv4 and IPv6 connectivity checks time out after approximately 20 seconds.

Adding an enabled, first-priority DIRECT rule for NetworkManager does not resolve the problem. The stored rule survives a ProxyBridge restart, yet NetworkManager sockets are still redirected to the local TCP relay at 127.0.0.1:24010. These sockets are bound to the physical Wi-Fi interface and remain in SYN-SENT.

Expected: NetworkManager's DIRECT rule should be recognized before destination rewriting, allowing interface-bound connectivity checks to reach the original server.

Actual: the destination is rewritten to the local relay despite the DIRECT rule, and the connectivity checks time out.

Steps to Reproduce

  1. Run ProxyBridge 4.0.0 on this Fedora/Btrfs setup, with the service enabled and StartAtBoot=true.
  2. Use the proxy/rules listed below. Connect to a Wi-Fi network (an iPhone hotspot in this case).
  3. Add the first-priority NetworkManager DIRECT rule below and restart ProxyBridge.
  4. Run nmcli networking connectivity check after the engine has loaded. Observe limited. An immediate check during a restart can transiently report full; this is not a durable fix.
  5. While the check is pending, inspect sudo ss -ntop and locate NetworkManager sockets. Their destinations are 127.0.0.1:24010 and they remain bound to the Wi-Fi interface.
  6. Temporarily stop proxybridge.service and run the same check: it reports full. Restart ProxyBridge: subsequent checks return limited again.

This has been reproduced on this machine; an independent clean-machine reproduction has not yet been performed.

Your Rules

In order (personal home path redacted):

1. Name: NetworkManager Direct
   ProcessName: NetworkManager
   TargetHosts: *
   TargetPorts: *
   TargetDomains: empty
   Protocol: BOTH
   Action: DIRECT
   IsEnabled: true
   ProxyConfigId: 0
   LocalhostViaProxy: false

2. Name: Antigravity
   ProcessName: /home/<user>/.local/opt/antigravity/*
   TargetHosts: *
   TargetPorts: *
   TargetDomains: empty
   Protocol: BOTH
   Action: PROXY
   IsEnabled: true
   ProxyConfigId: 1
   LocalhostViaProxy: false

3. Name: ChatGPT
   ProcessName: /usr/lib/chatgpt/*
   TargetHosts: *
   TargetPorts: *
   TargetDomains: empty
   Protocol: BOTH
   Action: PROXY
   IsEnabled: false
   ProxyConfigId: 1
   LocalhostViaProxy: false

DnsViaProxy: false

Your Proxy Server

SOCKS5, same machine, 127.0.0.1:7897, configured as "Clash" (ID 1).
Software: Clash Verge with its mihomo core; exact core version/authentication configuration was not collected.
Clash TUN was disabled; its system proxy setting was enabled during initial diagnosis. No ProxyBridge proxy test was run. The failure concerns a DIRECT rule, before SOCKS negotiation should be relevant.

Your Setup

Wi-Fi connection through an iPhone hotspot. systemd-resolved uses DNS provided by the hotspot. No additional policy-routing rules were observed. NetworkManager has no configured per-connection proxy, and its systemd unit does not use PrivateNetwork or IPAddressDeny.

Ordinary curl requests explicitly bound to the Wi-Fi interface succeeded over IPv4 and IPv6. The connectivity endpoint returned HTTP 200 with body OK. All 10 addresses returned by DNS during testing were individually reachable. Firewall/SELinux state has not been exhaustively audited.

Logs and Diagnostic Evidence

NetworkManager connectivity endpoint:
http://fedoraproject.org/static/hotspot.txt
Expected response: OK

Relevant NetworkManager log excerpts:

connectivity: (wlp12s0,IPv4,979) start request to 'http://fedoraproject.org/static/hotspot.txt' (try resolving 'fedoraproject.org' using systemd-resolved with ifindex 3)
connectivity: (wlp12s0,IPv4,979) set curl resolve list to 'fedoraproject.org:80:...'
connectivity: (wlp12s0,IPv6,980) set curl resolve list to 'fedoraproject.org:80:...'
connectivity: (wlp12s0,IPv4,979) check completed: LIMITED; timeout
connectivity: (wlp12s0,IPv6,980) check completed: LIMITED; timeout

Example socket state (source address replaced with a placeholder):

SYN-SENT <wifi-address>%wlp12s0:<ephemeral-port> -> 127.0.0.1:24010 users:(("NetworkManager",pid=901,...))

IPv4-mapped IPv6 sockets showed the same local-relay destination.

A root diagnostic script used read-only BPF map enumeration/lookups to compare the process executable's userspace stat identity with existing ProxyBridge map entries:

USERSPACE_EXE_KEY 38 214983
MAP by_cookie keysize 8 valuesize 48
KERNEL_EXE_KEY 36 214983
MAP exe2class keysize 16 valuesize 4
CLASS_KEY 38 214983 CLASS 1
MAP classes keysize 4 valuesize 72

The by_cookie value was filtered to NetworkManager PID 901; exe_dev and exe_ino were decoded according to the source struct pb_orig layout. The exe2class entry above matches the same inode. The contents of class 1 were not decoded, so its class ID alone is not evidence of a particular rule action.

Suspected Cause / Source Review

The device-ID mismatch is directly observed; the following explanation is an inference from the source and runtime data, not yet confirmed by a tested patch.

In Linux/src/pb_bpf.c, scan_proc() builds executable keys from stat(/proc//exe), using kernel_dev(st_dev) and st_ino.
In Linux/src/bpf/proxybridge.bpf.c, decide() builds executable keys from mm->exe_file->f_inode->i_sb->s_dev and i_ino. If exe2class lacks the key, it returns ACT_DECIDE, and the connect hook rewrites the destination to the local relay.

On this Btrfs setup, the two device identities differ (38 vs 36), even though the inode matches. This appears to explain the classification miss. NetworkManager's interface-bound connection cannot complete the local-relay detour, so it cannot reach the userspace decision/learning path either.

Please check whether executable keys need Btrfs-aware identity normalization, and whether interface-bound sockets need special handling before redirection to a loopback relay.

Privacy / Scope

Passwords, subscription URLs, hotspot name, MAC addresses, personal home path, and public IPv6 addresses have been omitted. No patch has been installed and no permanent workaround is claimed.

Activity

  1. added
    bug
    on Nov 13, 2026
  2. self-assigned this
    on Nov 13, 2026
  3. moved this from Backlog to Ready in ProxyBridgeon Nov 13, 2026
  4. moved this from Ready to In review in ProxyBridgeon Nov 13, 2026
  5. moved this from In review to Done in ProxyBridgeon Nov 13, 2026
  6. closed this as completedby moving to Done in ProxyBridgeon Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Fixed ReleasedLinuxbug

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions