From: Martin KaFai Lau <martin.lau@linux.dev>
To: Mykyta Yatsenko <mykyta.yatsenko5@gmail.com>
Cc: Amery Hung <ameryhung@gmail.com>,
bpf@vger.kernel.org, netdev@vger.kernel.org,
alexei.starovoitov@gmail.com, andrii@kernel.org,
daniel@iogearbox.net, eddyz87@gmail.com, memxor@gmail.com,
martin.lau@kernel.org, kernel-team@meta.com
Subject: Re: [PATCH bpf v1 1/1] bpf: Fix sk_local_storage diag dumping uninitialized special fields
Date: Fri, 24 Apr 2026 11:49:20 -0700 [thread overview]
Message-ID: <2026424184430.ui0Q.martin.lau@linux.dev> (raw)
In-Reply-To: <8cc73c03-afb6-4b7d-97ea-e05d9cc56c2d@gmail.com>
On Fri, Apr 24, 2026 at 12:50:34AM +0100, Mykyta Yatsenko wrote:
> > diff --git a/net/core/bpf_sk_storage.c b/net/core/bpf_sk_storage.c
> > index 14eb7812bda4..b50d26a542ed 100644
> > --- a/net/core/bpf_sk_storage.c
> > +++ b/net/core/bpf_sk_storage.c
> > @@ -558,6 +558,7 @@ static int diag_get(struct bpf_local_storage_data *sdata, struct sk_buff *skb)
> > sdata->data, true);
> > else
> > copy_map_value(&smap->map, nla_data(nla_value), sdata->data);
> > + check_and_init_map_value(&smap->map, nla_data(nla_value));
>
> I think check_and_init_map_value() should be moved before the
> copy_map_value(), because copy_map_value_locked() already uses
> spin lock special field, which if uninitialized can deadlock?
The src (sdata->data) lock is used instead of
the dst (nla_data(nla_value)) lock, so it should be fine.
next prev parent reply other threads:[~2026-04-24 18:49 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-23 22:23 [PATCH bpf v1 1/1] bpf: Fix sk_local_storage diag dumping uninitialized special fields Amery Hung
2026-04-23 23:50 ` Mykyta Yatsenko
2026-04-24 18:49 ` Martin KaFai Lau [this message]
2026-04-24 19:02 ` Mykyta Yatsenko
2026-04-24 19:00 ` patchwork-bot+netdevbpf
2026-04-24 22:24 ` sashiko-bot
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=2026424184430.ui0Q.martin.lau@linux.dev \
--to=martin.lau@linux.dev \
--cc=alexei.starovoitov@gmail.com \
--cc=ameryhung@gmail.com \
--cc=andrii@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=kernel-team@meta.com \
--cc=martin.lau@kernel.org \
--cc=memxor@gmail.com \
--cc=mykyta.yatsenko5@gmail.com \
--cc=netdev@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.