Skip to contentSkip to conversation

maple_tree-reduce-user-error-potential.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Feb 10, 2023

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: maple_tree: reduce user error potential
has been removed from the -mm tree. Its filename was
maple_tree-reduce-user-error-potential.patch

This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: "Liam R. Howlett" <[email protected]>
Subject: maple_tree: reduce user error potential
Date: Fri, 20 Jan 2023 11:26:04 -0500

When iterating, a user may operate on the tree and cause the maple state to be altered and left in an unintuitive state. Detect this scenario and correct it by setting to the limit and invalidating the state.

---

 lib/maple_tree.c |   10 ++++++++++
 1 file changed, 10 insertions(+)
lib/maple_tree.c renamed from lib/maple_tree.c~maple_tree-reduce-user-error-potential +10 -0
@@ -4732,6 +4732,11 @@ static inline void *mas_next_entry(struc
 	unsigned long last;
 	enum maple_type mt;
 
+	if (mas->index > limit) {
+		mas->index = mas->last = limit;
+		mas_pause(mas);
+		return NULL;
+	}
 	last = mas->last;
 retry:
 	offset = mas->offset;
@@ -4838,6 +4843,11 @@ static inline void *mas_prev_entry(struc
 {
 	void *entry;
 
+	if (mas->index < min) {
+		mas->index = mas->last = min;
+		mas_pause(mas);
+		return NULL;
+	}
 retry:
 	while (likely(!mas_is_none(mas))) {
 		entry = mas_prev_nentry(mas, min, mas->index);

_

Patches currently in -mm which might be from [email protected] are