From 28961f74648dfd0f5ecc7baadce0728ab4fc1153 Mon Sep 17 00:00:00 2001 From: Lorenzo Colitti Date: Thu, 3 Jul 2025 04:42:26 -0700 Subject: [PATCH] Ignore null or empty interface names in EthernetTracker. If EthernetTracker ever gets a null or empty interface name from a netlink message, it will crash the system. This likely cannot happen, but because the code runs all the time on all interfaces that have a MAC address, it seems safer to have a check for it. Test: None Flag: EXEMPT bugfix Change-Id: Iff93de9a42e5d8aa51e0183b45608c808ef31c38 --- service-t/src/com/android/server/ethernet/EthernetTracker.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/service-t/src/com/android/server/ethernet/EthernetTracker.java b/service-t/src/com/android/server/ethernet/EthernetTracker.java index 08923a9a86..38248bf429 100644 --- a/service-t/src/com/android/server/ethernet/EthernetTracker.java +++ b/service-t/src/com/android/server/ethernet/EthernetTracker.java @@ -287,6 +287,8 @@ public class EthernetTracker { // (for existing interfaces). Up until then, this code runs for every network interface // on the system. final String ifname = msg.getInterfaceName(); + if (TextUtils.isEmpty(ifname)) return; // TODO: can this happen? + final EthernetPort port = new EthernetPort(ifname, mac, ifinfomsg.index); switch (msg.getHeader().nlmsg_type) {