[Devel] [PATCH RHEL7 COMMIT] kmapset: lost map->size update in kmapset_del_value()

Vasily Averin vvs at virtuozzo.com
Fri Mar 26 17:46:35 MSK 2021


The commit is pushed to "branch-rh7-3.10.0-1160.21.1.vz7.174.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-1160.21.1.vz7.174.2
------>
commit 8b72ba96a0c3e08c929626d2723db8ee8fa8d88a
Author: Vasily Averin <vvs at virtuozzo.com>
Date:   Fri Mar 26 17:46:35 2021 +0300

    kmapset: lost map->size update in kmapset_del_value()
    
    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 4b7feaa..47176f2 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);


More information about the Devel mailing list