Re: [PATCH net v4] net/packet: account user-triggered allocations to memcg
From: Ahmad AG
Date: Mon Nov 02 2026 - 08:24:33 EST
> Does this fully close the PACKET_ADD_MEMBERSHIP bypass described in the
> commit message?
It covers the packet_mclist entries, which is what the commit message
claims, and the PACKET_MR_PROMISC numbers measure exactly that path.
The struct netdev_hw_addr entries are a separate case. They are device
state in net/core, shared and refcounted across every dev_uc_add() and
dev_mc_add() caller, and allocated with GFP_ATOMIC under
netif_addr_lock_bh(). Accounting them changes behaviour for all of
those callers, not just AF_PACKET, so I would rather keep it out of
this fix and look at it as a separate net/core patch if that is wanted.