diff options
| author | Aamir Ahmed <elb12345@hotmail.co.uk> | 2026-10-20 23:33:46 +0100 |
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2026-10-23 13:53:53 -0700 |
| commit | 45e0a63f9c86a558afc70d79b6df38f8ec7f502a (patch) | |
| tree | 6ff4a029f7684692f902a45873218205ad66610b /tools/perf/scripts/python/export-to-postgresql.py | |
| parent | f62e18ccc68e188e2ff9df1588d91c2d5596bb99 (diff) | |
gve: fix out-of-bounds read in gve_get_flow_rule_entry()
gve_get_flow_rule_entry() checks the requested location against the
first and last cached rules, but rules_cache_num can be 0 while
rules_cache_synced is true: GVE_FLOW_RULE_QUERY_RULES returns the rules
from the requested location onwards, so a request past the last
installed rule - or any request when no rules are installed - returns
zero rules, which the driver accepts and marks as synced.
The next query evaluates rules_cache[*cache_num - 1] with
*cache_num == 0. The zero-initialised cache does not trip the earlier
comparison, *cache_num - 1 wraps to 0xFFFFFFFF in u32, and the read
faults about 352 GiB past the cache. ETHTOOL_GRXCLSRULE needs no
capability, so an unprivileged user can trigger it:
BUG: unable to handle page fault for address: ff240996c4c64fa8
#PF: supervisor read access in kernel mode
RIP: gve_get_flow_rule_entry+0xd4/0x110 [gve]
Treat an empty cache as a cache miss and re-query.
Fixes: 6f3bc487565d ("gve: Add flow steering ethtool support")
Cc: stable@vger.kernel.org
Signed-off-by: Aamir Ahmed <elb12345@hotmail.co.uk>
Reviewed-by: Eugene Lee <eugenehlee@google.com>
Reviewed-by: Harshitha Ramamurthy <hramamurthy@google.com>
Link: https://patch.msgid.link/AS8P251MB0001135AF3233180DC42DCD1C8672@AS8P251MB0001.EURP251.PROD.OUTLOOK.COM
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions
