[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <60bfb6b5-5d2e-cfc2-cc68-2e016ed06918@huawei.com>
Date: Thu, 10 Mar 2022 11:48:45 +0800
From: Hou Tao <houtao1@...wei.com>
To: Alexei Starovoitov <alexei.starovoitov@...il.com>
CC: Alexei Starovoitov <ast@...nel.org>,
Martin KaFai Lau <kafai@...com>,
Song Liu <songliubraving@...com>,
John Fastabend <john.fastabend@...il.com>,
Yonghong Song <yhs@...com>,
Daniel Borkmann <daniel@...earbox.net>,
Andrii Nakryiko <andrii@...nel.org>,
"David S . Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
KP Singh <kpsingh@...nel.org>,
Network Development <netdev@...r.kernel.org>,
bpf <bpf@...r.kernel.org>
Subject: Re: [PATCH bpf-next 3/4] bpf: Fix net.core.bpf_jit_harden race
Hi,
On 3/10/2022 11:29 AM, Alexei Starovoitov wrote:
> On Wed, Mar 9, 2022 at 5:01 PM Hou Tao <houtao1@...wei.com> wrote:
>> 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.
> What kind of 'issues in JIT'?
> I'd rather fix them than do defensive programming.
Understand. For "issues in JIT" I just mean all kinds of error path handling in
jit, not a real problem.
> patch 2 is a hack that should not happen in a correct JIT.
> .
And "the hack" is partially due to the introduction of an extra pass in JIT. So
I am fine to drop it.
Regards,
Tao
Powered by blists - more mailing lists