[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7535d0e3-e442-8611-3c35-cbc9f4cace8c@iogearbox.net>
Date: Thu, 9 Jul 2020 22:07:59 +0200
From: Daniel Borkmann <daniel@...earbox.net>
To: Martin KaFai Lau <kafai@...com>, bpf@...r.kernel.org
Cc: Alexei Starovoitov <ast@...nel.org>, kernel-team@...com,
netdev@...r.kernel.org
Subject: Re: [PATCH v2 bpf 1/2] bpf: net: Avoid copying sk_user_data of
reuseport_array during sk_clone
On 7/9/20 8:11 AM, Martin KaFai Lau wrote:
> It makes little sense for copying sk_user_data of reuseport_array during
> sk_clone_lock(). This patch reuses the SK_USER_DATA_NOCOPY bit introduced in
> commit f1ff5ce2cd5e ("net, sk_msg: Clear sk_user_data pointer on clone if tagged").
> It is used to mark the sk_user_data is not supposed to be copied to its clone.
>
> Although the cloned sk's sk_user_data will not be used/freed in
> bpf_sk_reuseport_detach(), this change can still allow the cloned
> sk's sk_user_data to be used by some other means.
>
> Freeing the reuseport_array's sk_user_data does not require a rcu grace
> period. Thus, the existing rcu_assign_sk_user_data_nocopy() is not
> used.
nit: Would have been nice though to add a nonrcu API for this nevertheless
instead of open coding.
> Fixes: 5dc4c4b7d4e8 ("bpf: Introduce BPF_MAP_TYPE_REUSEPORT_SOCKARRAY")
> Signed-off-by: Martin KaFai Lau <kafai@...com>
Powered by blists - more mailing lists