All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sven Schnelle <svens@linux.ibm.com>
To: Heiko Carstens <hca@linux.ibm.com>
Cc: Alexander Gordeev <agordeev@linux.ibm.com>,
	Vasily Gorbik <gor@linux.ibm.com>,
	Christian Borntraeger <borntraeger@linux.ibm.com>,
	linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org
Subject: Re: [PATCH] s390/uprobes: Fix off-by-one bug in emulated PER handling
Date: Mon, 12 Oct 2026 09:05:07 +0200	[thread overview]
Message-ID: <yt9dy0c3pffg.fsf@linux.ibm.com> (raw)
In-Reply-To: <20261009132604.2434271-1-hca@linux.ibm.com> (Heiko Carstens's message of "Fri, 9 Oct 2026 15:26:04 +0200")

Heiko Carstens <hca@linux.ibm.com> writes:

> The uprobes code emulates some instructions, and with that also
> PER storage-alteration handling, in case a debugger is attached.
>
> The PER storage-alteration handling contains an off-by-one bug, which
> may lead to PER traps which should not happen. Adjust the comparison
> in sim_stor_event() to fix that.
>
> Fixes: 8d1a2427d8fc ("s390/uprobes: fix user space PER events")
> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
> ---
>  arch/s390/kernel/uprobes.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/s390/kernel/uprobes.c b/arch/s390/kernel/uprobes.c
> index c624f3361e43..b2b8a377ced6 100644
> --- a/arch/s390/kernel/uprobes.c
> +++ b/arch/s390/kernel/uprobes.c
> @@ -241,7 +241,7 @@ static void sim_stor_event(struct pt_regs *regs, void *addr, int len)
>  		return;
>  	if (!(current->thread.per_user.control & PER_EVENT_STORE))
>  		return;
> -	if ((void *)current->thread.per_user.start > (addr + len))
> +	if ((void *)current->thread.per_user.start > (addr + len - 1))
>  		return;
>  	if ((void *)current->thread.per_user.end < addr)
>  		return;

Reviewed-by: Sven Schnelle <svens@linux.ibm.com>

      parent reply	other threads:[~2026-10-12  7:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-09 13:26 [PATCH] s390/uprobes: Fix off-by-one bug in emulated PER handling Heiko Carstens
2026-10-09 13:33 ` sashiko-bot
2026-10-12  7:05 ` Sven Schnelle [this message]

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=yt9dy0c3pffg.fsf@linux.ibm.com \
    --to=svens@linux.ibm.com \
    --cc=agordeev@linux.ibm.com \
    --cc=borntraeger@linux.ibm.com \
    --cc=gor@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.