]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
bpf, sockmap: Fix map type error in sock_map_del_link
authorXu Kuohai <xukuohai@huawei.com>
Fri, 4 Aug 2023 07:37:37 +0000 (03:37 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Aug 2023 16:22:00 +0000 (18:22 +0200)
commit20d53895d5c0789f2409d0fe41c4877f367f7f03
treecf949bb1e8b1cf7882969efdb6904c4f4498734f
parenta09c258cfa77d3ba0a7acc555c73eb6b005c4bd8
bpf, sockmap: Fix map type error in sock_map_del_link

commit 7e96ec0e6605b69bb21bbf6c0ff9051e656ec2b1 upstream.

sock_map_del_link() operates on both SOCKMAP and SOCKHASH, although
both types have member named "progs", the offset of "progs" member in
these two types is different, so "progs" should be accessed with the
real map type.

Fixes: 604326b41a6f ("bpf, sockmap: convert to generic sk_msg interface")
Signed-off-by: Xu Kuohai <xukuohai@huawei.com>
Reviewed-by: John Fastabend <john.fastabend@gmail.com>
Link: https://lore.kernel.org/r/20230804073740.194770-2-xukuohai@huaweicloud.com
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/core/sock_map.c