[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAP01T76zWax4YSQO5nP2Kt_85JvUPvxTwpOn5Dho6co32r+FBA@mail.gmail.com>
Date: Sat, 20 Aug 2022 01:52:44 +0200
From: Kumar Kartikeya Dwivedi <memxor@...il.com>
To: Daniel Xu <dxu@...uu.xyz>
Cc: bpf@...r.kernel.org, ast@...nel.org, daniel@...earbox.net,
andrii@...nel.org, pablo@...filter.org, fw@...len.de,
toke@...nel.org, martin.lau@...ux.dev,
netfilter-devel@...r.kernel.org, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH bpf-next v3 4/5] bpf: Add support for writing to nf_conn:mark
On Sat, 20 Aug 2022 at 01:46, Kumar Kartikeya Dwivedi <memxor@...il.com> wrote:
>
> CPU 0 CPU 1
> sa = READ_ONCE(nf_ct_bsa);
>
> delete_module("nf_conntrack", ..);
>
> WRITE_ONCE(nf_ct_bsa, NULL);
> // finishes
> successfully
> if (sa)
> return sa(...); // oops
>
Ew, I completely screwed it up. Not trying again.
CPU 0 does:
sa = READ_ONCE(nf_ct_bsa);
then CPU 1 does:
delete_module("nf_conntrack", ...);
WRITE_ONCE(nf_ct_bsa, NULL);
then CPU 0 does:
if (sa) sa(...); // bad
Powered by blists - more mailing lists