lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <504c5fc7-57d3-f36a-b9e7-801d7e40bc60@xen0n.name>
Date:   Wed, 26 Jul 2023 15:33:53 +0800
From:   WANG Xuerui <kernel@...0n.name>
To:     zhaochenguang <zhaochenguang@...inos.cn>, chenhuacai@...nel.org
Cc:     loongarch@...ts.linux.dev, linux-kernel@...r.kernel.org,
        bpf@...r.kernel.org
Subject: Re: [PATCH] LoongArch: eBPF: Restrict bpf_probe_read{, str}() only to
 archs where they work

On 2023/7/26 14:29, zhaochenguang wrote:
> When we run nettrace on LoongArch, there is a problem that
> ERROR: failed to load kprobe-based eBPF
> ERROR: failed to load kprobe-based bpf
> 
> Because ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE dose not exist,
> so we enable it.
> 
> The patch reference upstream id 0ebeea8ca8a4d1d453ad299aef0507dab04f6e8d.

The description is a bit hard to follow. Rephrasing a bit:

"Currently nettrace does not work on LoongArch due to missing 
bpf_probe_read{,str}() support, with the error message:

     ERROR: failed to load kprobe-based eBPF
     ERROR: failed to load kprobe-based bpf

According to commit 0ebeea8ca8a4d ("bpf: Restrict bpf_probe_read{, 
str}() only to archs where they work"), we only need to select 
CONFIG_ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE to add said support, 
because LoongArch does have non-overlapping address ranges for kernel 
and userspace."

Also, the patch subject does not make sense. Looking at precedents such 
as commit 66633abd0642f ("MIPS/bpf: Enable bpf_probe_read{, str}() on 
MIPS again") and commit d195b1d1d1196 ("powerpc/bpf: Enable 
bpf_probe_read{, str}() on powerpc again"), we can instead re-title the 
commit as "LoongArch/bpf: Enable bpf_probe_read{, str}() on LoongArch". 
(No "again" because commit 0ebeea8ca8a4d actually predated the LoongArch 
port.)

> 
> Signed-off-by: zhaochenguang <zhaochenguang@...inos.cn>
> ---
>   arch/loongarch/Kconfig | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/arch/loongarch/Kconfig b/arch/loongarch/Kconfig
> index 903096bd87f8..4a156875e9cc 100644
> --- a/arch/loongarch/Kconfig
> +++ b/arch/loongarch/Kconfig
> @@ -11,6 +11,7 @@ config LOONGARCH
>   	select ARCH_ENABLE_MEMORY_HOTREMOVE
>   	select ARCH_HAS_ACPI_TABLE_UPGRADE	if ACPI
>   	select ARCH_HAS_PTE_SPECIAL
> +	select ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE

Please keep the list in alphabetical order by moving this one line above.

>   	select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
>   	select ARCH_INLINE_READ_LOCK if !PREEMPTION
>   	select ARCH_INLINE_READ_LOCK_BH if !PREEMPTION

-- 
WANG "xen0n" Xuerui

Linux/LoongArch mailing list: https://lore.kernel.org/loongarch/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ