[Devel] [PATCH hci-8.2 5/8] ms/calipso: hash the cache key, not the option start, in calipso_cache_add()

no-reply at sashiko.virtuozzo.com no-reply at sashiko.virtuozzo.com
Tue Dec 1 04:23:30 MSK 2026


> From: Joas Antonio dos Santos <joasantonio108 at gmail.com>
> 
> [ Upstream commit d538cc3ec0bc4cb7b40981b3213a6c6671959ed5 ]
> 
> calipso_cache_add() stores calipso_ptr + 2 as the cache key, but
> computes entry->hash over calipso_ptr, i.e. starting two bytes earlier
> at the option type and length.  calipso_opt_getattr() looks entries up
> with calipso_cache_check(calipso + 2, calipso[1], ...), which hashes the
> key itself.
> 
> The two hashes only match on a jhash collision, so the CALIPSO label
> cache never hits and every labelled packet takes the full DOI lookup and
> category conversion path.  The memcmp() on the key keeps lookups
> correct, so this is a performance bug only.
> 
> Hash the stored key, as cipso_v4_cache_add() does for CIPSO.
> 
> Fixes: 4fee5242bf41 ("calipso: Add a label cache.")
> Signed-off-by: Joas Antonio dos Santos <joasantonio108 at gmail.com>
> Assisted-by: Claude:claude-opus-5-5
> Reviewed-by: Daniel Machon <daniel.machon at microchip.com>
> Link: https://patch.msgid.link/179138670045.80227.16155454353416856947@gmail.com
> Signed-off-by: Paolo Abeni <pabeni at redhat.com>
> Signed-off-by: Sasha Levin <sashal at kernel.org>
> (cherry picked from commit 75cdfd788d6d5b6891a52f4bf3946d74cf47fb1b)
> 
> https://virtuozzo.atlassian.net/browse/VSTOR-157577
> Feature: fix ms/net
> 
> Signed-off-by: Eva Kurchatova <eva.kurchatova at virtuozzo.com>

Sashiko has reviewed this patch and found no issues.

Carry the trailer below into the next revision and Sashiko will not review this patch again.

Reviewed-by: Sashiko <no-reply at sashiko.virtuozzo.com>

-- 
Sashiko AI review · https://sashiko.vzint.dev/#/patchset/20261130184822.2743885-1-eva.kurchatova@virtuozzo.com?part=5




More information about the Devel mailing list