Skip to content

Commit 8556200

Browse files
iamkafaikernel-patches-bot
authored andcommitted
The sk_storage->list will be traversed by rcu reader in parallel.
Thus, hlist_add_head_rcu() is needed in __selem_link_sk(). This patch fixes it. This part of the code has recently been refactored in bpf-next. A separate fix will be provided for the bpf-next tree. Fixes: 6ac99e8 ("bpf: Introduce bpf sk local storage") Signed-off-by: Martin KaFai Lau <kafai@fb.com> --- net/core/bpf_sk_storage.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
1 parent 400fccb commit 8556200

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/core/bpf_sk_storage.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ static void __selem_link_sk(struct bpf_sk_storage *sk_storage,
219219
struct bpf_sk_storage_elem *selem)
220220
{
221221
RCU_INIT_POINTER(selem->sk_storage, sk_storage);
222-
hlist_add_head(&selem->snode, &sk_storage->list);
222+
hlist_add_head_rcu(&selem->snode, &sk_storage->list);
223223
}
224224

225225
static void selem_unlink_map(struct bpf_sk_storage_elem *selem)

0 commit comments

Comments
 (0)