Re: [PATCH net] gve: bound the device reported rule count in the flow rules query

From: Yehyeong Lee

Date: Sun Nov 08 2026 - 06:18:50 EST


> Could the commit message also
> mention the write overflow for more than 1024 ids and the multiply wrap on
> both paths?

All three points are correct. 1025 or more ids overrun the 4096 byte
rule_ids_cache, and 1 << 29 rules or 1 << 30 ids wrap rule_info_len to zero
while the count still reaches ETHTOOL_GRXCLSRULE and ETHTOOL_GRXCLSRLALL,
neither of which needs CAP_NET_ADMIN. The bound in this patch rejects all
of them; only the description falls short. I can send a v2 with it
corrected if the maintainers want one.

KUnit under KASAN, harness not in the patch: a bad count from the device is
a 4136 byte write into the 4048 byte rules_cache at 47 rules and a 4100 byte
write into the 4096 byte rule_ids_cache at 1025 ids; both are -EINVAL with
the patch.

> does gve_adminq_process_rss_query() in gve_adminq.c need the same kind of
> bound?

Yes, sent separately:
https://lore.kernel.org/all/20261104070041.1902653-1-yhlee@xxxxxxxxxxxxxxxxxx/

Yehyeong