]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
bpf, sockmap: Several fixes to bpf_msg_pop_data
authorZijian Zhang <zijianzhang@bytedance.com>
Wed, 6 Nov 2024 22:25:19 +0000 (22:25 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 14 Dec 2024 18:50:58 +0000 (19:50 +0100)
commite1f54c61c4c9a5244eb8159dce60d248f7d97b32
treee3e9ef76d33ae81e5e034762e704e67d5f8b975a
parent0f8db9b3693004c8cfe9ddb5e80b64a0db338a87
bpf, sockmap: Several fixes to bpf_msg_pop_data

[ Upstream commit 5d609ba262475db450ba69b8e8a557bd768ac07a ]

Several fixes to bpf_msg_pop_data,
1. In sk_msg_shift_left, we should put_page
2. if (len == 0), return early is better
3. pop the entire sk_msg (last == msg->sg.size) should be supported
4. Fix for the value of variable "a"
5. In sk_msg_shift_left, after shifting, i has already pointed to the next
element. Addtional sk_msg_iter_var_next may result in BUG.

Fixes: 7246d8ed4dcc ("bpf: helper to pop data from messages")
Signed-off-by: Zijian Zhang <zijianzhang@bytedance.com>
Reviewed-by: John Fastabend <john.fastabend@gmail.com>
Link: https://lore.kernel.org/r/20241106222520.527076-8-zijianzhang@bytedance.com
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/core/filter.c