aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2024-02-16 10:17:23 -0800
committerKees Cook <keescook@chromium.org>2024-02-20 21:23:24 -0800
commit0022c7f08e85bc4c9f0d56926893ce787129221b (patch)
treeea2c408e79fe2fe9253c9ef9e2374d192d1389dd
parentdb6f545ffb1c0fe635e849d8dda063c0c15cd7fe (diff)
downloadlinux-dev/v6.8-rc2/signed-trunc-sanitizer.tar.gz
[WIP] maple_tree: Avoid while (var--) patterndev/v6.8-rc2/signed-trunc-sanitizer
Avoid a sanitizer splat when reaching 0 during "while (var--)" Signed-off-by: Kees Cook <keescook@chromium.org> --- Cc: Andrew Morton <akpm@linux-foundation.org> Cc: "Liam R. Howlett" <Liam.Howlett@oracle.com> Cc: maple-tree@lists.infradead.org Cc: linux-mm@kvack.org
-rw-r--r--lib/maple_tree.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/maple_tree.c b/lib/maple_tree.c
index 6f241bb3879920..940e6c1654a992 100644
--- a/lib/maple_tree.c
+++ b/lib/maple_tree.c
@@ -1554,7 +1554,7 @@ static inline unsigned long
ma_max_gap(struct maple_node *node, unsigned long *gaps, enum maple_type mt,
unsigned char *off)
{
- unsigned char offset, i;
+ unsigned short offset, i;
unsigned long max_gap = 0;
i = offset = ma_meta_end(node, mt);
@@ -1689,7 +1689,7 @@ static inline void mas_adopt_children(struct ma_state *mas,
void __rcu **slots = ma_slots(node, type);
unsigned long *pivots = ma_pivots(node, type);
struct maple_enode *child;
- unsigned char offset;
+ short offset;
offset = ma_data_end(node, type, pivots, mas->max);
do {