Skip to content

Car Report: scrub addresses in the iptables dump like the routes - #482

Merged
isaacwisdom merged 2 commits into
mainfrom
fix/report-scrub-netd-chains
Dec 2, 2026
Merged

isaacwisdom merged 2 commits into
mainfrom
fix/report-scrub-netd-chains

Conversation

@VysseCodes

Copy link
Copy Markdown
Collaborator

Not tied to any release.

Problem

The Car Report's network section scrubs ip addr, ip route and ip rule: public and carrier-NAT addresses become a.b.x.x. The iptables dump only had MAC addresses taken out.

Android's own st_mangle_EXEMPT chain is filled in at runtime with:

  • the unit's current mobile-data address;
  • its carrier's servers.

So a 2024 Ioniq 5 report (US 260903) carried 100.x.y.z in full in the rules, while its routes showed 100.x.x.x.

Change

NetReport runs the iptables output (-S and the counters) through the same scrub() as the routes.

  • Private addresses stay: 10/8, 172.16/12, 192.168/16, link-local, loopback, multicast and netmasks.
  • Chain names, ports, policies and marks stay.
  • The stock firewall script is still kept whole.

Tested

  • core/runtime/net-test.sh (98 ok) has new checks:
    • the mobile-data address in st_mangle_EXEMPT is scrubbed;
    • a public server address is removed;
    • a private address and the stock rules are kept.
  • Run against that car's real iptables dump, only the 6 st_mangle_EXEMPT lines holding those addresses change.

The rules only had MACs taken out. Android's own chains (netd's
st_mangle_EXEMPT) hold the unit's current mobile-data address and its
carrier's servers, so a 2024 Ioniq 5's reports carried its 100.x address
in full while the routes showed 100.x.x.x. Public and carrier-NAT addresses
in the rules now become a.b.x.x; private ones, ports and policies stay.

Checked on that car's real dump: only the 6 st_mangle_EXEMPT lines with
those addresses change. net-test.sh covers it.
@VysseCodes
VysseCodes requested a review from a team as a code owner December 2, 2026 00:03
isaacwisdom
isaacwisdom previously approved these changes Dec 2, 2026

@isaacwisdom isaacwisdom left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found.

@isaacwisdom
isaacwisdom merged commit 430c18c into main Dec 2, 2026
3 checks passed
@isaacwisdom
isaacwisdom deleted the fix/report-scrub-netd-chains branch December 2, 2026 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants