* [PATCH 1/4] arm: Fix wrong bounds check.
2016-01-23 15:05 [PATCH 0/4] set_memory_xx fixes mika.penttila
@ 2016-01-23 15:05 ` mika.penttila
2016-01-25 18:37 ` Laura Abbott
2016-01-23 15:05 ` [PATCH 2/4] arm: let set_memory_xx(addr, 0) succeed mika.penttila
` (2 subsequent siblings)
3 siblings, 1 reply; 10+ messages in thread
From: mika.penttila @ 2016-01-23 15:05 UTC (permalink / raw)
To: linux-kernel; +Cc: linux-mm, rientjes, linux, Mika Penttilä
From: Mika PenttilA? <mika.penttila@nextfour.com>
Not related to this oops, but while at it, fix incorrect bounds check.
Signed-off-by: Mika PenttilA? mika.penttila@nextfour.com
---
arch/arm/mm/pageattr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/mm/pageattr.c b/arch/arm/mm/pageattr.c
index cf30daf..be7fe4b 100644
--- a/arch/arm/mm/pageattr.c
+++ b/arch/arm/mm/pageattr.c
@@ -52,7 +52,7 @@ static int change_memory_common(unsigned long addr, int numpages,
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.9.1
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply related [flat|nested] 10+ messages in thread* Re: [PATCH 1/4] arm: Fix wrong bounds check.
2016-01-23 15:05 ` [PATCH 1/4] arm: Fix wrong bounds check mika.penttila
@ 2016-01-25 18:37 ` Laura Abbott
0 siblings, 0 replies; 10+ messages in thread
From: Laura Abbott @ 2016-01-25 18:37 UTC (permalink / raw)
To: mika.penttila, linux-kernel; +Cc: linux-mm, rientjes, linux
On 01/23/2016 07:05 AM, mika.penttila@nextfour.com wrote:
> From: Mika PenttilA? <mika.penttila@nextfour.com>
>
> Not related to this oops, but while at it, fix incorrect bounds check.
>
> Signed-off-by: Mika PenttilA? mika.penttila@nextfour.com
>
> ---
> arch/arm/mm/pageattr.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/arm/mm/pageattr.c b/arch/arm/mm/pageattr.c
> index cf30daf..be7fe4b 100644
> --- a/arch/arm/mm/pageattr.c
> +++ b/arch/arm/mm/pageattr.c
> @@ -52,7 +52,7 @@ static int change_memory_common(unsigned long addr, int numpages,
> 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;
>
This has been submitted a few times before, not sure if it is pending
in Russell's patch tracker or nobody has actually submitted it to the
patch tracker.
Russell, is this pending somewhere already?
Thanks,
Laura
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 2/4] arm: let set_memory_xx(addr, 0) succeed.
2016-01-23 15:05 [PATCH 0/4] set_memory_xx fixes mika.penttila
2016-01-23 15:05 ` [PATCH 1/4] arm: Fix wrong bounds check mika.penttila
@ 2016-01-23 15:05 ` mika.penttila
2016-01-25 18:41 ` Laura Abbott
2016-01-23 15:05 ` [PATCH 3/4] arm64: " mika.penttila
2016-01-23 15:05 ` [PATCH 4/4] make apply_to_page_range() more robust mika.penttila
3 siblings, 1 reply; 10+ messages in thread
From: mika.penttila @ 2016-01-23 15:05 UTC (permalink / raw)
To: linux-kernel; +Cc: linux-mm, rientjes, linux, Mika Penttilä
From: Mika PenttilA? <mika.penttila@nextfour.com>
This makes set_memory_xx() consistent with x86.
Signed-off-by: Mika PenttilA? mika.penttila@nextfour.com
---
arch/arm/mm/pageattr.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/arm/mm/pageattr.c b/arch/arm/mm/pageattr.c
index be7fe4b..9edf6b0 100644
--- a/arch/arm/mm/pageattr.c
+++ b/arch/arm/mm/pageattr.c
@@ -49,6 +49,9 @@ static int change_memory_common(unsigned long addr, int numpages,
WARN_ON_ONCE(1);
}
+ if (!numpages)
+ return 0;
+
if (start < MODULES_VADDR || start >= MODULES_END)
return -EINVAL;
--
1.9.1
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH 2/4] arm: let set_memory_xx(addr, 0) succeed.
2016-01-23 15:05 ` [PATCH 2/4] arm: let set_memory_xx(addr, 0) succeed mika.penttila
@ 2016-01-25 18:41 ` Laura Abbott
0 siblings, 0 replies; 10+ messages in thread
From: Laura Abbott @ 2016-01-25 18:41 UTC (permalink / raw)
To: mika.penttila, linux-kernel
Cc: linux-mm, rientjes, linux,
linux-arm-kernel@lists.infradead.org >> linux-arm-kernel
On 01/23/2016 07:05 AM, mika.penttila@nextfour.com wrote:
> From: Mika PenttilA? <mika.penttila@nextfour.com>
>
> This makes set_memory_xx() consistent with x86.
>
> Signed-off-by: Mika PenttilA? mika.penttila@nextfour.com
>
> ---
> arch/arm/mm/pageattr.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/arch/arm/mm/pageattr.c b/arch/arm/mm/pageattr.c
> index be7fe4b..9edf6b0 100644
> --- a/arch/arm/mm/pageattr.c
> +++ b/arch/arm/mm/pageattr.c
> @@ -49,6 +49,9 @@ static int change_memory_common(unsigned long addr, int numpages,
> WARN_ON_ONCE(1);
> }
>
> + if (!numpages)
> + return 0;
> +
> if (start < MODULES_VADDR || start >= MODULES_END)
> return -EINVAL;
>
>
Reviewed-by: Laura Abbott <labbott@redhat.com>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 3/4] arm64: let set_memory_xx(addr, 0) succeed.
2016-01-23 15:05 [PATCH 0/4] set_memory_xx fixes mika.penttila
2016-01-23 15:05 ` [PATCH 1/4] arm: Fix wrong bounds check mika.penttila
2016-01-23 15:05 ` [PATCH 2/4] arm: let set_memory_xx(addr, 0) succeed mika.penttila
@ 2016-01-23 15:05 ` mika.penttila
2016-01-25 18:44 ` Laura Abbott
2016-01-23 15:05 ` [PATCH 4/4] make apply_to_page_range() more robust mika.penttila
3 siblings, 1 reply; 10+ messages in thread
From: mika.penttila @ 2016-01-23 15:05 UTC (permalink / raw)
To: linux-kernel; +Cc: linux-mm, rientjes, linux, Mika Penttilä
From: Mika PenttilA? <mika.penttila@nextfour.com>
This makes set_memory_xx() consistent with x86.
Signed-off-by: Mika PenttilA? mika.penttila@nextfour.com
---
arch/arm64/mm/pageattr.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/arm64/mm/pageattr.c b/arch/arm64/mm/pageattr.c
index 3571c73..52220dd 100644
--- a/arch/arm64/mm/pageattr.c
+++ b/arch/arm64/mm/pageattr.c
@@ -51,6 +51,9 @@ static int change_memory_common(unsigned long addr, int numpages,
WARN_ON_ONCE(1);
}
+ if (!numpages)
+ return 0;
+
if (start < MODULES_VADDR || start >= MODULES_END)
return -EINVAL;
--
1.9.1
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH 3/4] arm64: let set_memory_xx(addr, 0) succeed.
2016-01-23 15:05 ` [PATCH 3/4] arm64: " mika.penttila
@ 2016-01-25 18:44 ` Laura Abbott
2016-01-26 2:34 ` David Rientjes
0 siblings, 1 reply; 10+ messages in thread
From: Laura Abbott @ 2016-01-25 18:44 UTC (permalink / raw)
To: mika.penttila, linux-kernel; +Cc: linux-mm, rientjes, linux, linux-arm-kernel
On 01/23/2016 07:05 AM, mika.penttila@nextfour.com wrote:
> From: Mika PenttilA? <mika.penttila@nextfour.com>
>
> This makes set_memory_xx() consistent with x86.
>
> Signed-off-by: Mika PenttilA? mika.penttila@nextfour.com
>
> ---
> arch/arm64/mm/pageattr.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/arch/arm64/mm/pageattr.c b/arch/arm64/mm/pageattr.c
> index 3571c73..52220dd 100644
> --- a/arch/arm64/mm/pageattr.c
> +++ b/arch/arm64/mm/pageattr.c
> @@ -51,6 +51,9 @@ static int change_memory_common(unsigned long addr, int numpages,
> WARN_ON_ONCE(1);
> }
>
> + if (!numpages)
> + return 0;
> +
> if (start < MODULES_VADDR || start >= MODULES_END)
> return -EINVAL;
>
>
I think this is going to conflict with Ard's patch
lkml.kernel.org/g/<1453125665-26627-1-git-send-email-ard.biesheuvel@linaro.org>
Can you rebase on top of that?
Thanks,
Laura
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 3/4] arm64: let set_memory_xx(addr, 0) succeed.
2016-01-25 18:44 ` Laura Abbott
@ 2016-01-26 2:34 ` David Rientjes
0 siblings, 0 replies; 10+ messages in thread
From: David Rientjes @ 2016-01-26 2:34 UTC (permalink / raw)
To: Laura Abbott
Cc: mika.penttila, linux-kernel, linux-mm, linux, linux-arm-kernel
[-- Attachment #1: Type: TEXT/PLAIN, Size: 1343 bytes --]
On Mon, 25 Jan 2016, Laura Abbott wrote:
> On 01/23/2016 07:05 AM, mika.penttila@nextfour.com wrote:
> > From: Mika PenttilA? <mika.penttila@nextfour.com>
> >
> > This makes set_memory_xx() consistent with x86.
> >
> > Signed-off-by: Mika PenttilA? mika.penttila@nextfour.com
> >
> > ---
> > arch/arm64/mm/pageattr.c | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> > diff --git a/arch/arm64/mm/pageattr.c b/arch/arm64/mm/pageattr.c
> > index 3571c73..52220dd 100644
> > --- a/arch/arm64/mm/pageattr.c
> > +++ b/arch/arm64/mm/pageattr.c
> > @@ -51,6 +51,9 @@ static int change_memory_common(unsigned long addr, int
> > numpages,
> > WARN_ON_ONCE(1);
> > }
> >
> > + if (!numpages)
> > + return 0;
> > +
> > if (start < MODULES_VADDR || start >= MODULES_END)
> > return -EINVAL;
> >
> >
>
> I think this is going to conflict with Ard's patch
> lkml.kernel.org/g/<1453125665-26627-1-git-send-email-ard.biesheuvel@linaro.org>
>
> Can you rebase on top of that?
>
Also, I think patch 2 and 3 can be folded together since the change is the
same to both functions.
I think the changelog should be expanded to explain that
charge_memory_common() with numpages == 0 should be a no-op.
When both of those are done, and it's rebased as requested, feel free to
add my:
Acked-by: David Rientjes <rientjes@google.com>
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 4/4] make apply_to_page_range() more robust.
2016-01-23 15:05 [PATCH 0/4] set_memory_xx fixes mika.penttila
` (2 preceding siblings ...)
2016-01-23 15:05 ` [PATCH 3/4] arm64: " mika.penttila
@ 2016-01-23 15:05 ` mika.penttila
2016-01-26 2:32 ` David Rientjes
3 siblings, 1 reply; 10+ messages in thread
From: mika.penttila @ 2016-01-23 15:05 UTC (permalink / raw)
To: linux-kernel; +Cc: linux-mm, rientjes, linux, Mika Penttilä
From: Mika PenttilA? <mika.penttila@nextfour.com>
Now the arm/arm64 don't trigger this BUG_ON() any more,
but WARN_ON() is here enough to catch buggy callers
but still let potential other !size callers pass with warning.
Signed-off-by: Mika PenttilA? mika.penttila@nextfour.com
---
mm/memory.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/mm/memory.c b/mm/memory.c
index 30991f8..9178ee6 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -1871,7 +1871,9 @@ int apply_to_page_range(struct mm_struct *mm, unsigned long addr,
unsigned long end = addr + size;
int err;
- BUG_ON(addr >= end);
+ if (WARN_ON(addr >= end))
+ return -EINVAL;
+
pgd = pgd_offset(mm, addr);
do {
next = pgd_addr_end(addr, end);
--
1.9.1
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply related [flat|nested] 10+ messages in thread