Re: [PATCH net v10 2/2] selftests: net: test joining genetlink groups no family owns

From: Nicolas Dichtel

Date: Mon Nov 30 2026 - 05:37:40 EST


Le 27/11/2026 à 04:22, Anil Kaushik a écrit :> Check that a Generic Netlink
group ID no family owns cannot be joined:
>
> - setsockopt(NETLINK_ADD_MEMBERSHIP) on a free ID fails with ENOENT,
> and still works on an owned group.
> - bind() with a mask of free IDs succeeds and joins nothing. With an
> owned group in the mask, it joins only that group.
> - A socket bound to the free IDs is not a member of the NET_DM groups
> after drop_monitor is loaded. The test unloads drop_monitor again
> after it loaded it. Skipped when NET_DM is already registered or
> drop_monitor is not available.
>
> The free IDs are found with a family dump, which only lists the families
> of the current network namespace, so these checks are skipped outside
> the initial one. It is found with its fixed nsfs inode number, which
> also works in a container with its own PID namespace. Kernels before
> v6.17 do not have that number, so the checks are skipped there too.
>
> Suggested-by: Nicolas Dichtel <nicolas.dichtel@xxxxxxxxx>
> Signed-off-by: Anil Kaushik <anilkaushikwireless@xxxxxxxxx>

Reviewed-by: Nicolas Dichtel <nicolas.dichtel@xxxxxxxxx>