maple_tree: Fix mas_alloc_nodes()
Subsystems (3)
PATCH 1/1 maple_tree: Fix mas_alloc_nodes()
Use MAPLE_ALLOC_SLOTS, which differs on 32bit. This was causing an out of bounds issue on 32bit bulk allocations
Fixes 06b152b7980a (Maple Tree: add new data structure)
Signed-off-by Liam R. Howlett <[email protected]>
--- lib/maple_tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/maple_tree.c +1 -1
@@ -1242,7 +1242,7 @@ static inline void mas_alloc_nodes(struct ma_state *mas, gfp_t gfp) node = mas->alloc;while (requested) { - max_req =MAPLE_NODE_SLOTS -1 ; + max_req =MAPLE_ALLOC_SLOTS ;if (node->slot[0 ]) {unsigned int offset = node->node_count +1 ;
Signature · 1 line
2.35.1
02.08.2022 22:36, Liam Howlett пишет:
Quoted 14 lines
Use
MAPLE_ALLOC_SLOTS, which differs on 32bit. This was causing an out of bounds issue on 32bit bulk allocationsFixes 06b152b7980a (Maple Tree: add new data structure)Signed-off-by Liam R. Howlett <[email protected]>--- lib/maple_tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)lib/maple_tree.c +0
-0
lib/maple_tree.c static inline void mas_alloc_nodes(struct ma_state *mas, gfp_t gfp) · line 1248
Quoted 8 lines
lib/maple_tree.c +1
-1@@ -1242,7 +1242,7 @@ static inline void mas_alloc_nodes(struct ma_state *mas, gfp_t gfp) node = mas->alloc;while (requested) { - max_req =MAPLE_NODE_SLOTS -1 ; + max_req =MAPLE_ALLOC_SLOTS ;if (node->slot[0 ]) {unsigned int offset = node->node_count +1 ;
Hello Liam,
This fixed the bug, thank you!