From: Ingo Molnar <mingo@kernel.org>
To: "Joan Bruguera Micó" <joanbrugueram@gmail.com>
Cc: x86@kernel.org, linux-kernel@vger.kernel.org,
Thomas Gleixner <tglx@linutronix.de>,
Uros Bizjak <ubizjak@gmail.com>, Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>,
Peter Zijlstra <peterz@infradead.org>,
"H. Peter Anvin" <hpa@zytor.com>
Subject: Re: [PATCH 2/2] x86/bpf: Fix IP for relocating call depth accounting
Date: Thu, 21 Mar 2024 10:05:08 +0100 [thread overview]
Message-ID: <Zfv4RGwe5+h0zNI5@gmail.com> (raw)
In-Reply-To: <20240316232104.368561-3-joanbrugueram@gmail.com>
* Joan Bruguera Micó <joanbrugueram@gmail.com> wrote:
> The recently introduced support for %rip-relative relocations in the
> call thunk template assumes that the code is being patched in-place,
> so the destination of the relocation matches the address of the code.
> This is not true for the call depth accounting emitted by the BPF JIT,
> so the calculated address is wrong and usually causes a page fault.
>
> Pass the destination IP when the BPF JIT emits call depth accounting.
>
> Fixes: 17bce3b2ae2d ("x86/callthunks: Handle %rip-relative relocations in call thunk template")
> Signed-off-by: Joan Bruguera Micó <joanbrugueram@gmail.com>
> ---
> arch/x86/include/asm/alternative.h | 4 ++--
> arch/x86/kernel/callthunks.c | 4 ++--
For the generic x86 changes - I guess you want to push this upstream via
the networking tree:
Acked-by: Ingo Molnar <mingo@kernel.org>
Thanks,
Ingo
prev parent reply other threads:[~2024-03-21 9:05 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-16 23:21 [PATCH 0/2] x86/bpf: Fixes for the BPF JIT with retbleed=stuff Joan Bruguera Micó
2024-03-16 23:21 ` [PATCH 1/2] x86/bpf: Fix IP after emitting call depth accounting Joan Bruguera Micó
2024-03-16 23:21 ` [PATCH 2/2] x86/bpf: Fix IP for relocating " Joan Bruguera Micó
2024-03-18 7:12 ` Uros Bizjak
2024-03-21 9:05 ` Ingo Molnar [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=Zfv4RGwe5+h0zNI5@gmail.com \
--to=mingo@kernel.org \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=joanbrugueram@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=ubizjak@gmail.com \
--cc=x86@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.