BPF List
 help / color / mirror / Atom feed
From: Hou Tao <houtao1@huawei.com>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: Alexei Starovoitov <ast@kernel.org>,
	Martin KaFai Lau <kafai@fb.com>, Song Liu <songliubraving@fb.com>,
	John Fastabend <john.fastabend@gmail.com>,
	Yonghong Song <yhs@fb.com>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Andrii Nakryiko <andrii@kernel.org>,
	"David S . Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, KP Singh <kpsingh@kernel.org>,
	<netdev@vger.kernel.org>, <bpf@vger.kernel.org>
Subject: Re: [PATCH bpf-next 3/4] bpf: Fix net.core.bpf_jit_harden race
Date: Thu, 10 Mar 2022 09:01:46 +0800	[thread overview]
Message-ID: <06abdc4e-8806-10dd-c753-229d3e957add@huawei.com> (raw)
In-Reply-To: <20220309232253.v6oqev7jock7vm7i@ast-mbp.dhcp.thefacebook.com>

Hi,

On 3/10/2022 7:22 AM, Alexei Starovoitov wrote:
> On Wed, Mar 09, 2022 at 08:33:20PM +0800, Hou Tao wrote:
>> It is the bpf_jit_harden counterpart to commit 60b58afc96c9 ("bpf: fix
>> net.core.bpf_jit_enable race"). bpf_jit_harden will be tested twice
>> for each subprog if there are subprogs in bpf program and constant
>> blinding may increase the length of program, so when running
>> "./test_progs -t subprogs" and toggling bpf_jit_harden between 0 and 2,
>> jit_subprogs may fail because constant blinding increases the length
>> of subprog instructions during extra passs.
>>
>> So cache the value of bpf_jit_blinding_enabled() during program
>> allocation, and use the cached value during constant blinding, subprog
>> JITing and args tracking of tail call.
> Looks like this patch alone is enough.
> With race fixed. Patches 1 and 2 are no longer necessary, right?
Yes and no. With patch 3 applied, the problems described in patch 1 and patch 2
are gone, but it may recur due to other issue in JIT. So I post these two patch
together and hope these fixes can also be merged.
> .

  reply	other threads:[~2022-03-10  1:01 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-09 12:33 [PATCH bpf-next 0/4] fixes for bpf_jit_harden race Hou Tao
2022-03-09 12:33 ` [PATCH bpf-next 1/4] bpf, x86: Fall back to interpreter mode when extra pass fails Hou Tao
2022-03-09 12:33 ` [PATCH bpf-next 2/4] bpf: Introduce bpf_int_jit_abort() Hou Tao
2022-03-11 23:54   ` Daniel Borkmann
2022-03-12  0:20     ` Daniel Borkmann
2022-03-09 12:33 ` [PATCH bpf-next 3/4] bpf: Fix net.core.bpf_jit_harden race Hou Tao
2022-03-09 23:22   ` Alexei Starovoitov
2022-03-10  1:01     ` Hou Tao [this message]
2022-03-10  3:29       ` Alexei Starovoitov
2022-03-10  3:48         ` Hou Tao
2022-03-09 12:33 ` [PATCH bpf-next 4/4] selftests/bpf: Test subprog jit when toggle bpf_jit_harden repeatedly Hou Tao
2022-03-16 22:30 ` [PATCH bpf-next 0/4] fixes for bpf_jit_harden race patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=06abdc4e-8806-10dd-c753-229d3e957add@huawei.com \
    --to=houtao1@huawei.com \
    --cc=alexei.starovoitov@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=john.fastabend@gmail.com \
    --cc=kafai@fb.com \
    --cc=kpsingh@kernel.org \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=songliubraving@fb.com \
    --cc=yhs@fb.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox