LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Shrikanth Hegde <sshegde@linux.ibm.com>
To: "Mukesh Kumar Chaurasiya (IBM)" <mkchauras@gmail.com>
Cc: Sayali Patil <sayalip@linux.ibm.com>,
	maddy@linux.ibm.com, mpe@ellerman.id.au, npiggin@gmail.com,
	chleroy@kernel.org, mkchauras@linux.ibm.com,
	ruanjinjie@huawei.com, linuxppc-dev@lists.ozlabs.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] powerpc: Restore kuap regs during syscall restart exit
Date: Mon, 15 Jun 2026 10:51:43 +0530	[thread overview]
Message-ID: <c08eaf78-38ce-47f9-883d-5a009e768584@linux.ibm.com> (raw)
In-Reply-To: <20260613123831.1510474-1-mkchauras@gmail.com>

Hi Mukesh.

On 6/13/26 6:08 PM, Mukesh Kumar Chaurasiya (IBM) wrote:
> During syscall restart, we block the kuap as we need to replay
> interrupts. Which are not restored when we exit to the user, hence we
> get a fault which ends up with `bad_access_pkey` and hence crashing the
> kernel.
> 
> We have already stored the kuap values during the entry, just restore
> them when we exit.
> 
> Applies on linux-next (next-20260610).
> 

Please re-write the changelog in imperative mood.
i.e Avoid we/you/I.

https://www.kernel.org/doc/html/v4.17/process/submitting-patches.html#describe-your-changes


> Fixes: bee25f97ad24 ("powerpc: Enable GENERIC_ENTRY feature")
> Reported-by: Sayali Patil <sayalip@linux.ibm.com>
> Signed-off-by: Mukesh Kumar Chaurasiya (IBM) <mkchauras@gmail.com>
> ---
>   arch/powerpc/kernel/interrupt.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/powerpc/kernel/interrupt.c b/arch/powerpc/kernel/interrupt.c
> index 89a999be1352..159901d6ba8c 100644
> --- a/arch/powerpc/kernel/interrupt.c
> +++ b/arch/powerpc/kernel/interrupt.c
> @@ -165,7 +165,7 @@ notrace unsigned long syscall_exit_restart(unsigned long r3, struct pt_regs *reg
>   		local_irq_disable();
>   		goto again;
>   	}
> -
> +	kuap_user_restore(regs);

Please describe where was kuap save was done in the stack.

>   	regs->exit_result |= regs->exit_flags;
>   
>   	return regs->exit_result;



  reply	other threads:[~2026-06-15  5:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-13 12:38 [PATCH] powerpc: Restore kuap regs during syscall restart exit Mukesh Kumar Chaurasiya (IBM)
2026-06-15  5:21 ` Shrikanth Hegde [this message]
2026-06-16  5:08   ` Mukesh Kumar Chaurasiya

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=c08eaf78-38ce-47f9-883d-5a009e768584@linux.ibm.com \
    --to=sshegde@linux.ibm.com \
    --cc=chleroy@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=maddy@linux.ibm.com \
    --cc=mkchauras@gmail.com \
    --cc=mkchauras@linux.ibm.com \
    --cc=mpe@ellerman.id.au \
    --cc=npiggin@gmail.com \
    --cc=ruanjinjie@huawei.com \
    --cc=sayalip@linux.ibm.com \
    /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