summaryrefslogtreecommitdiffstats
path: root/net/ipv4
diff options
context:
space:
mode:
authorKui-Feng Lee <thinker.li@gmail.com>2024-02-24 14:34:16 -0800
committerMartin KaFai Lau <martin.lau@kernel.org>2024-03-04 10:03:57 -0800
commit73e4f9e615d7b99f39663d4722dc73e8fa5db5f9 (patch)
treeaf6063b8367fde8327b948b44be205ca7817c50d /net/ipv4
parent01031fd473059bf69bb6edc6d51d4bd58ad92e50 (diff)
downloadlinux-73e4f9e615d7b99f39663d4722dc73e8fa5db5f9.tar.gz
linux-73e4f9e615d7b99f39663d4722dc73e8fa5db5f9.tar.bz2
linux-73e4f9e615d7b99f39663d4722dc73e8fa5db5f9.zip
bpf, net: validate struct_ops when updating value.
Perform all validations when updating values of struct_ops maps. Doing validation in st_ops->reg() and st_ops->update() is not necessary anymore. However, tcp_register_congestion_control() has been called in various places. It still needs to do validations. Cc: netdev@vger.kernel.org Signed-off-by: Kui-Feng Lee <thinker.li@gmail.com> Link: https://lore.kernel.org/r/20240224223418.526631-2-thinker.li@gmail.com Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/tcp_cong.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/net/ipv4/tcp_cong.c b/net/ipv4/tcp_cong.c
index 1b34050a7538..28ffcfbeef14 100644
--- a/net/ipv4/tcp_cong.c
+++ b/net/ipv4/tcp_cong.c
@@ -146,11 +146,7 @@ EXPORT_SYMBOL_GPL(tcp_unregister_congestion_control);
int tcp_update_congestion_control(struct tcp_congestion_ops *ca, struct tcp_congestion_ops *old_ca)
{
struct tcp_congestion_ops *existing;
- int ret;
-
- ret = tcp_validate_congestion_control(ca);
- if (ret)
- return ret;
+ int ret = 0;
ca->key = jhash(ca->name, sizeof(ca->name), strlen(ca->name));