Re: [PATCH] powerpc/mm: Prevent unlikely crash in copro_calculate_slb()

2016-10-13 Thread Michael Ellerman
Frederic Barrat  writes:

> Le 13/10/2016 à 12:51, Michael Ellerman a écrit :
>> Frederic Barrat  writes:
>>
>>> ping? The patch still applies cleanly on recent trees.
>>
>> Fell through the cracks :/
>>
>> Fixes: ?
>
> Nothing obvious. Current code was introduced by 
> 73d16a6e0e51990cbe13f8d8f43bd5329bbab30a
> but it was apparently moved from cell, where the issue may not have 
> applied, I don't know. I guess we should use that id if really needed:
>
> Fixes: 73d16a6e0e51 ("powerpc/cell: Move data segment faulting code out of 
> cell platform")

Yeah that works, it allows us to mechanically determine that "if you
have backported 73d16a6e0e51 then you need this fix", which can be
useful.

cheers


Re: [PATCH] powerpc/mm: Prevent unlikely crash in copro_calculate_slb()

2016-10-13 Thread Frederic Barrat



Le 13/10/2016 à 12:51, Michael Ellerman a écrit :

Frederic Barrat  writes:


ping? The patch still applies cleanly on recent trees.


Fell through the cracks :/

Fixes: ?


Nothing obvious. Current code was introduced by 
73d16a6e0e51990cbe13f8d8f43bd5329bbab30a
but it was apparently moved from cell, where the issue may not have 
applied, I don't know. I guess we should use that id if really needed:


Fixes: 73d16a6e0e51 ("powerpc/cell: Move data segment faulting code out 
of cell platform")


  Fred





Re: [PATCH] powerpc/mm: Prevent unlikely crash in copro_calculate_slb()

2016-10-13 Thread Michael Ellerman
Frederic Barrat  writes:

> ping? The patch still applies cleanly on recent trees.

Fell through the cracks :/

Fixes: ?

cheers


Re: [PATCH] powerpc/mm: Prevent unlikely crash in copro_calculate_slb()

2016-10-12 Thread Frederic Barrat

ping? The patch still applies cleanly on recent trees.

  Fred

Le 17/06/2016 à 18:53, Frederic Barrat a écrit :

If a cxl adapter faults on an invalid address for a kernel context, we
may enter copro_calculate_slb() with a NULL mm pointer (kernel
context) and an effective address which looks like a user
address. Which will cause a crash when dereferencing mm. It is clearly
an AFU bug, but there's no reason to crash either. So return an error,
so that cxl can ack the interrupt with an address error.

Signed-off-by: Frederic Barrat 
Cc: 
---
 arch/powerpc/mm/copro_fault.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/powerpc/mm/copro_fault.c b/arch/powerpc/mm/copro_fault.c
index 6527882..ddfd274 100644
--- a/arch/powerpc/mm/copro_fault.c
+++ b/arch/powerpc/mm/copro_fault.c
@@ -106,6 +106,8 @@ int copro_calculate_slb(struct mm_struct *mm, u64 ea, 
struct copro_slb *slb)
switch (REGION_ID(ea)) {
case USER_REGION_ID:
pr_devel("%s: 0x%llx -- USER_REGION_ID\n", __func__, ea);
+   if (mm == NULL)
+   return 1;
psize = get_slice_psize(mm, ea);
ssize = user_segment_size(ea);
vsid = get_vsid(mm->context.id, ea, ssize);





Re: [PATCH] powerpc/mm: Prevent unlikely crash in copro_calculate_slb()

2016-06-20 Thread Ian Munsie
Acked-by: Ian Munsie 

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH] powerpc/mm: Prevent unlikely crash in copro_calculate_slb()

2016-06-17 Thread Frederic Barrat
If a cxl adapter faults on an invalid address for a kernel context, we
may enter copro_calculate_slb() with a NULL mm pointer (kernel
context) and an effective address which looks like a user
address. Which will cause a crash when dereferencing mm. It is clearly
an AFU bug, but there's no reason to crash either. So return an error,
so that cxl can ack the interrupt with an address error.

Signed-off-by: Frederic Barrat 
Cc: 
---
 arch/powerpc/mm/copro_fault.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/powerpc/mm/copro_fault.c b/arch/powerpc/mm/copro_fault.c
index 6527882..ddfd274 100644
--- a/arch/powerpc/mm/copro_fault.c
+++ b/arch/powerpc/mm/copro_fault.c
@@ -106,6 +106,8 @@ int copro_calculate_slb(struct mm_struct *mm, u64 ea, 
struct copro_slb *slb)
switch (REGION_ID(ea)) {
case USER_REGION_ID:
pr_devel("%s: 0x%llx -- USER_REGION_ID\n", __func__, ea);
+   if (mm == NULL)
+   return 1;
psize = get_slice_psize(mm, ea);
ssize = user_segment_size(ea);
vsid = get_vsid(mm->context.id, ea, ssize);
-- 
2.7.4

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev