[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220802193612.2886170-1-Liam.Howlett@oracle.com>
Date: Tue, 2 Aug 2022 19:36:24 +0000
From: Liam Howlett <liam.howlett@...cle.com>
To: "maple-tree@...ts.infradead.org" <maple-tree@...ts.infradead.org>,
"linux-mm@...ck.org" <linux-mm@...ck.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Dmitry Osipenko <digetx@...il.com>
Subject: [PATCH] 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 <Liam.Howlett@...cle.com>
---
lib/maple_tree.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/maple_tree.c b/lib/maple_tree.c
index 4e41f3394114..032e7bb0d44f 100644
--- a/lib/maple_tree.c
+++ b/lib/maple_tree.c
@@ -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;
--
2.35.1
Powered by blists - more mailing lists