[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220208022459.ufooz7cjbk6u3k6o@ast-mbp.dhcp.thefacebook.com>
Date: Mon, 7 Feb 2022 18:24:59 -0800
From: Alexei Starovoitov <alexei.starovoitov@...il.com>
To: Song Liu <song@...nel.org>
Cc: bpf@...r.kernel.org, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, ast@...nel.org, daniel@...earbox.net,
andrii@...nel.org, kernel-team@...com, peterz@...radead.org,
x86@...nel.org, iii@...ux.ibm.com, Song Liu <songliubraving@...com>
Subject: Re: [PATCH v9 bpf-next 9/9] bpf, x86_64: use
bpf_jit_binary_pack_alloc
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.
Powered by blists - more mailing lists