Subject: [QUESTION] Packet uid for kernel-generated multicast

From: Andrew Fenton <[email-masked]>
Date: Tue, 2 Jun 2026 14:00:33 -0400

Certain multicast-related system calls such as setsockopt with options
IP_ADD_MEMBERSHIP, IPV6_ADD_MEMBERSHIP and MCAST_JOIN_GROUP result in outgoing
kernel-generated packets that don't have an associated uid.

Not having the packet uid set to the uid of the system caller makes it
difficult to use netfilter to ensure a specific uid can't send any traffic out
a particular interface. It is possible to use network namespaces or system call
filtering, but neither of these options are feasible for us working on top of 
Android Open Source Project.

If we submit a patch that adds a kernel configuration for setting the packet uid
to the uid that made the system call, would this get merged? Or is this not a
viable approach?