[Devel] [PATCH RH7/RH8] kmapset: lost map->size update in kmapset_del_value()
Vasily Averin
vvs at virtuozzo.com
Fri Mar 26 12:47:10 MSK 2021
If map->size will not be properly updated kmapset_cmp() can crash
on access to non-exisitng links.
https://jira.sw.ru/browse/PSBM-127478
Signed-off-by: Vasily Averin <vvs at virtuozzo.com>
---
lib/kmapset.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/lib/kmapset.c b/lib/kmapset.c
index 4b7feaa1bf36..47176f2a010c 100644
--- a/lib/kmapset.c
+++ b/lib/kmapset.c
@@ -299,6 +299,7 @@ bool kmapset_del_value(struct kmapset_map *map, struct kmapset_key *key)
hlist_del_rcu(&link->map_link);
hlist_del(&link->key_link);
kfree_rcu(link, rcu_head);
+ map->size--;
ret = true;
}
kmapset_unlock(set);
--
2.25.1
More information about the Devel
mailing list