linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Frederic Barrat <fbarrat@linux.vnet.ibm.com>
To: linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH] powerpc/mm: Prevent unlikely crash in copro_calculate_slb()
Date: Wed, 12 Oct 2016 16:14:35 +0200	[thread overview]
Message-ID: <3e856f04-23a7-b980-a857-27b3342f1548@linux.vnet.ibm.com> (raw)
In-Reply-To: <1466182408-17884-1-git-send-email-fbarrat@linux.vnet.ibm.com>

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 <fbarrat@linux.vnet.ibm.com>
> Cc: <stable@vger.kernel.org>
> ---
>  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);
>

  parent reply	other threads:[~2016-10-12 14:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-17 16:53 [PATCH] powerpc/mm: Prevent unlikely crash in copro_calculate_slb() Frederic Barrat
2016-06-21  4:25 ` Ian Munsie
2016-10-12 14:14 ` Frederic Barrat [this message]
2016-10-13 10:51   ` Michael Ellerman
2016-10-13 11:54     ` Frederic Barrat
2016-10-14  0:41       ` Michael Ellerman
2016-10-21 22:02 ` Michael Ellerman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3e856f04-23a7-b980-a857-27b3342f1548@linux.vnet.ibm.com \
    --to=fbarrat@linux.vnet.ibm.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).