Skip to contentSkip to conversation

ARM: fix module-bound check in setting page attributes

PATCH In review Hillf Danton 2 participants 5 messages Mar 25, 2015 – May 4, 2015 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: fix module-bound check in setting page attributes

It was introduced in commit f2ca09f381a59
(ARM: 8311/1: Don't use is_module_addr in setting page attributes)

We have no need to check start twice, but see if end is also in range.

---

arch/arm/mm/pageattr.c +1 -1
@@ -52,7 +52,7 @@ static int change_memory_common(unsigned
 	if (start < MODULES_VADDR || start >= MODULES_END)
 		return -EINVAL;
 
-	if (end < MODULES_VADDR || start >= MODULES_END)
+	if (end < MODULES_VADDR || end >= MODULES_END)
 		return -EINVAL;
 
 	data.set_mask = set_mask;

--

#1 lore raw

Ping

Quoted 21 lines

It was introduced in commit f2ca09f381a59
(ARM: 8311/1: Don't use is_module_addr in setting page attributes)

We have no need to check start twice, but see if end is also in range.

---

arch/arm/mm/pageattr.c +1 -2
@@ -52,7 +52,7 @@ static int change_memory_common(unsigned
 	if (start < MODULES_VADDR || start >= MODULES_END)
 		return -EINVAL;
 
-	if (end < MODULES_VADDR || start >= MODULES_END)
+	if (end < MODULES_VADDR || end >= MODULES_END)
 		return -EINVAL;
 
 	data.set_mask = set_mask;
--
#2 lore raw

Ping

Quoted 29 lines

-----Original Message-----
From: Hillf Danton [mailto:[email protected]]
Sent: Tuesday, April 07, 2015 4:31 PM
To: Hillf Danton; 'Laura Abbott'
Cc: 'Russell King'; 'linux-kernel'; [email protected]
Subject: Re: [patch] ARM: fix module-bound check in setting page attributes

Ping

Quoted 21 lines

It was introduced in commit f2ca09f381a59
(ARM: 8311/1: Don't use is_module_addr in setting page attributes)

We have no need to check start twice, but see if end is also in range.

---

arch/arm/mm/pageattr.c +1 -2
@@ -52,7 +52,7 @@ static int change_memory_common(unsigned
 	if (start < MODULES_VADDR || start >= MODULES_END)
 		return -EINVAL;
 
-	if (end < MODULES_VADDR || start >= MODULES_END)
+	if (end < MODULES_VADDR || end >= MODULES_END)
 		return -EINVAL;
 
 	data.set_mask = set_mask;
--
Acked-by on v1 1/1
#3 lore raw
In reply to Hillf Danton
Quoted 13 lines · Hillf Danton

It was introduced in commit f2ca09f381a59
(ARM: 8311/1: Don't use is_module_addr in setting page attributes)

We have no need to check start twice, but see if end is also in range.

---

arch/arm/mm/pageattr.c static int change_memory_common(unsigned

Quoted 9 lines
arch/arm/mm/pageattr.c +1 -2
@@ -52,7 +52,7 @@ static int change_memory_common(unsigned
  	if (start < MODULES_VADDR || start >= MODULES_END)
  		return -EINVAL;
 
-	if (end < MODULES_VADDR || start >= MODULES_END)
+	if (end < MODULES_VADDR || end >= MODULES_END)
  		return -EINVAL;
 
  	data.set_mask = set_mask;
--

Sorry for the delay, that e-mail address is being phased out. Please remember to Cc linux-arm-kernel when sending anything in arch/arm. If this hasn't been picked up, please resend with linux-arm-kernel Cc'ed and you can add

#4 lore raw

PATCH 1/1 ARM: fix module-bound check in setting page attributes

It was introduced in commit f2ca09f381a59
(ARM: 8311/1: Don't use is_module_addr in setting page attributes)

We have no need to check start twice, but see if end is also in range.

---

arch/arm/mm/pageattr.c +1 -1
@@ -52,7 +52,7 @@ static int change_memory_common(unsigned
 	if (start < MODULES_VADDR || start >= MODULES_END)
 		return -EINVAL;
 
-	if (end < MODULES_VADDR || start >= MODULES_END)
+	if (end < MODULES_VADDR || end >= MODULES_END)
 		return -EINVAL;
 
 	data.set_mask = set_mask;

--