[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <170eca58-8950-40b5-b2af-3ac3844af3aa@gmail.com>
Date: Fri, 17 May 2024 18:09:42 +0200
From: Klara Modin <klarasmodin@...il.com>
To: Will Deacon <will@...nel.org>
Cc: Mike Rapoport <rppt@...nel.org>, linux-kernel@...r.kernel.org,
Alexandre Ghiti <alexghiti@...osinc.com>,
Andrew Morton <akpm@...ux-foundation.org>, Björn Töpel
<bjorn@...nel.org>, Catalin Marinas <catalin.marinas@....com>,
Christophe Leroy <christophe.leroy@...roup.eu>,
"David S. Miller" <davem@...emloft.net>, Dinh Nguyen <dinguyen@...nel.org>,
Donald Dutile <ddutile@...hat.com>, Eric Chanudet <echanude@...hat.com>,
Heiko Carstens <hca@...ux.ibm.com>, Helge Deller <deller@....de>,
Huacai Chen <chenhuacai@...nel.org>,
Kent Overstreet <kent.overstreet@...ux.dev>, Liviu Dudau
<liviu@...au.co.uk>, Luis Chamberlain <mcgrof@...nel.org>,
Mark Rutland <mark.rutland@....com>, Masami Hiramatsu <mhiramat@...nel.org>,
Michael Ellerman <mpe@...erman.id.au>, Nadav Amit <nadav.amit@...il.com>,
Palmer Dabbelt <palmer@...belt.com>, Peter Zijlstra <peterz@...radead.org>,
Philippe Mathieu-Daudé <philmd@...aro.org>,
Rick Edgecombe <rick.p.edgecombe@...el.com>,
Russell King <linux@...linux.org.uk>, Sam Ravnborg <sam@...nborg.org>,
Song Liu <song@...nel.org>, Steven Rostedt <rostedt@...dmis.org>,
Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
Thomas Gleixner <tglx@...utronix.de>, bpf@...r.kernel.org,
linux-arch@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-mips@...r.kernel.org, linux-mm@...ck.org,
linux-modules@...r.kernel.org, linux-parisc@...r.kernel.org,
linux-riscv@...ts.infradead.org, linux-s390@...r.kernel.org,
linux-trace-kernel@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org,
loongarch@...ts.linux.dev, netdev@...r.kernel.org,
sparclinux@...r.kernel.org, x86@...nel.org
Subject: Re: [PATCH RESEND v8 16/16] bpf: remove CONFIG_BPF_JIT dependency on
CONFIG_MODULES of
On 2024-05-17 17:46, Will Deacon wrote:
> Hi Klara,
>
> On Fri, May 17, 2024 at 01:00:31AM +0200, Klara Modin wrote:
>>
>> This does not seem to work entirely. If build with BPF_JIT without module
>> support for my Raspberry Pi 3 B I get warnings in my kernel log (easiest way
>> to trigger it seems to be trying to ssh into it, which fails).
>
> Thanks for the report. I was able to reproduce this using QEMU and it
> looks like the problem is because bpf_arch_text_copy() silently fails
> to write to the read-only area as a result of patch_map() faulting and
> the resulting -EFAULT being chucked away.
>
> Please can you try the diff below?
>
> Will
>
> --->8
>
> diff --git a/arch/arm64/kernel/patching.c b/arch/arm64/kernel/patching.c
> index 255534930368..94b9fea65aca 100644
> --- a/arch/arm64/kernel/patching.c
> +++ b/arch/arm64/kernel/patching.c
> @@ -36,7 +36,7 @@ static void __kprobes *patch_map(void *addr, int fixmap)
>
> if (image)
> page = phys_to_page(__pa_symbol(addr));
> - else if (IS_ENABLED(CONFIG_STRICT_MODULE_RWX))
> + else if (IS_ENABLED(CONFIG_EXECMEM))
> page = vmalloc_to_page(addr);
> else
> return addr;
>
This seems to work from my short testing.
Thanks,
Tested-by: Klara Modin <klarasmodin@...il.com>
Powered by blists - more mailing lists