Re: [PATCH v9 bpf-next 9/9] bpf, x86_64: use bpf_jit_binary_pack_alloc

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

 



On Fri, Feb 04, 2022 at 10:57:42AM -0800, Song Liu wrote:
>  	if (image) {
>  		if (!prog->is_func || extra_pass) {
> +			/*
> +			 * bpf_jit_binary_pack_finalize fails in two scenarios:
> +			 *   1) header is not pointing to proper module memory;
> +			 *   2) the arch doesn't support bpf_arch_text_copy().
> +			 *
> +			 * Both cases are serious bugs that we should not continue.
> +			 */
> +			BUG_ON(bpf_jit_binary_pack_finalize(prog, header, rw_header));
>  			bpf_tail_call_direct_fixup(prog);
> -			bpf_jit_binary_lock_ro(header);

BUG_ON is discouraged.
It should only be used when the kernel absolutely cannot continue.
Here ro/rw_headers will be freed. We can WARN and goto out_addrs without drama.
Please send a follow up.

The rest looks great. Applied to bpf-next.



[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