Re: [PATCHv2 bpf 1/2] bpf: Add checkip argument to bpf_arch_text_poke

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11/28, Jiri Olsa wrote:
> We need to be able to skip ip address check for caller in following
> changes. Adding checkip argument to allow that.
> 
> Signed-off-by: Jiri Olsa <jolsa@xxxxxxxxxx>
> ---
>  arch/arm64/net/bpf_jit_comp.c   |  3 ++-
>  arch/riscv/net/bpf_jit_comp64.c |  5 +++--
>  arch/s390/net/bpf_jit_comp.c    |  3 ++-
>  arch/x86/net/bpf_jit_comp.c     | 24 +++++++++++++-----------
>  include/linux/bpf.h             |  2 +-
>  kernel/bpf/arraymap.c           |  8 ++++----
>  kernel/bpf/core.c               |  2 +-
>  kernel/bpf/trampoline.c         | 12 ++++++------
>  8 files changed, 32 insertions(+), 27 deletions(-)
> 
> diff --git a/arch/arm64/net/bpf_jit_comp.c b/arch/arm64/net/bpf_jit_comp.c
> index 7d4af64e3982..b52549d18730 100644
> --- a/arch/arm64/net/bpf_jit_comp.c
> +++ b/arch/arm64/net/bpf_jit_comp.c
> @@ -2167,7 +2167,8 @@ static int gen_branch_or_nop(enum aarch64_insn_branch_type type, void *ip,
>   * locations during the patching process, making the patching process easier.
>   */
>  int bpf_arch_text_poke(void *ip, enum bpf_text_poke_type poke_type,
> -		       void *old_addr, void *new_addr)
> +		       void *old_addr, void *new_addr,

[..]

> +		       bool checkip __maybe_unused)

Any idea why only riscv and x86 do this check?

Asking because maybe it makes sense to move this check into some
new generic bpf_text_poke and call it in the places where you currently
call checkip=true (and keep using bpf_arch_text_poke for checkip=false
case).

(don't see any issues with the current approach btw, just interested..)




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux