[PATCH 6/6] bitmap: test bitmap_parselist() with a group size close to UINT_MAX
From: shashank
Date: Fri Sep 25 2026 - 06:24:19 EST
Add bitmap_parselist() cases where the group size makes start +
group_len overflow an unsigned int. Before "bitmap: bitmap_parselist():
don't wrap around on a huge group size" the region walk wrapped around
and also set bit 0.
Assisted-by: LLM
Signed-off-by: shashank <jain.sm@xxxxxxxxx>
---
lib/test_bitmap.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/lib/test_bitmap.c b/lib/test_bitmap.c
index f316a82840f5..ba09d057f47f 100644
--- a/lib/test_bitmap.c
+++ b/lib/test_bitmap.c
@@ -502,6 +502,8 @@ static const struct test_bitmap_parselist parselist_tests[] __initconst = {
{0, "0-N:1/3,1-N:1/3,2-N:1/3", &exp1[8 * step], 32, 0},
{0, "0-31:1/3,1-31:1/3,2-31:1/3", &exp1[8 * step], 32, 0},
{0, "1-10:8/12,8-31:24/29,0-31:0/3", &exp1[9 * step], 32, 0},
+ {0, "1-1:1/4294967295", &exp1[1 * step], 32, 0},
+ {0, "15-15:1/4294967281", &exp1[13 * step], 32, 0},
{0, "all", &exp1[8 * step], 32, 0},
{0, "0, 1, all, ", &exp1[8 * step], 32, 0},
--
2.43.0