Re: [PATCH v1] LoongArch: BPF: Make arch_protect_bpf_trampoline() return 0

From: Huacai Chen

Date: Thu Mar 19 2026 - 23:27:47 EST


On Fri, Mar 20, 2026 at 5:24 AM <patchwork-bot+netdevbpf@xxxxxxxxxx> wrote:
>
> Hello:
>
> This patch was applied to netdev/net.git (main)
> by Huacai Chen <chenhuacai@xxxxxxxxxxx>:
Emmm, this patch has already been upstream...

Huacai

>
> On Tue, 10 Mar 2026 14:47:06 +0800 you wrote:
> > Occasionally, there exists "text_copy_cb: operation failed" when executing
> > bpf selftests, the reason is copy_to_kernel_nofault() failed and the ecode
> > of estat register is 0x4 (PME: Page Modification Exception) due to the pte
> > is not writeable, the root cause is that there is another place to set pte
> > readonly which is in the generic weak arch_protect_bpf_trampoline().
> >
> > There are two ways to fix this race condition issue, the direct way is to
> > modify the generic weak arch_protect_bpf_trampoline() to add a mutex lock
> > for set_memory_rox(), but the other simple and proper way is to just make
> > arch_protect_bpf_trampoline() return 0 in the arch-specific code because
> > LoongArch already uses BPF prog pack allocator for trampoline.
> >
> > [...]
>
> Here is the summary with links:
> - [v1] LoongArch: BPF: Make arch_protect_bpf_trampoline() return 0
> https://git.kernel.org/netdev/net/c/b254c629a963
>
> You are awesome, thank you!
> --
> Deet-doot-dot, I am a bot.
> https://korg.docs.kernel.org/patchwork/pwbot.html
>
>