]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/bpf: Enable bpf_probe_read{, str}() on powerpc again
authorPetr Mladek <pmladek@suse.com>
Wed, 27 May 2020 12:28:44 +0000 (14:28 +0200)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 28 May 2020 15:12:18 +0000 (17:12 +0200)
commit0c6af2628f34f0d2b2a3044811a8a12474037543
treea806a8b3e096f7e8d1e6b2ffffd52c549bdf9353
parent6ab6d1bec9c2518b032f17574c7a0f89b49ab1ef
powerpc/bpf: Enable bpf_probe_read{, str}() on powerpc again

The commit 42d31d665587706b4d1 ("bpf: Restrict bpf_probe_read{, str}() only
to archs where they work") caused that bpf_probe_read{, str}() functions
were not longer available on architectures where the same logical address
might have different content in kernel and user memory mapping. These
architectures should use probe_read_{user,kernel}_str helpers.

For backward compatibility, the problematic functions are still available
on architectures where the user and kernel address spaces are not
overlapping. This is defined CONFIG_ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE.

At the moment, these backward compatible functions are enabled only on x86_64,
arm, and arm64. Let's do it also on powerpc that has the non overlapping
address space as well.

Fixes: 42d31d665587 ("bpf: Restrict bpf_probe_read{, str}() only to archs where they work")
Signed-off-by: Petr Mladek <pmladek@suse.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/lkml/20200527122844.19524-1-pmladek@suse.com
arch/powerpc/Kconfig