summaryrefslogtreecommitdiff
path: root/net/ipv4/tcp.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2024-03-11 09:53:22 +0000
committerDavid S. Miller <davem@davemloft.net>2024-03-11 09:53:22 +0000
commite996401e06a5232f61b4906e2eea643fffa88396 (patch)
tree48f20850b5f6836baccc5e1e5c8bb01efe7ac1df /net/ipv4/tcp.c
parentc2b25092864a16c7865e406badedece5cc25fc2b (diff)
parentd6eb8de2015f0c24822e47356f839167ebde2945 (diff)
Merge branch 'getsockopt-parameter-validation'
Gavrilov Ilia says: ==================== fix incorrect parameter validation in the *_get_sockopt() functions This v2 series fix incorrent parameter validation in *_get_sockopt() functions in several places. version 2 changes: - reword the patch description - add two patches for net/kcm and net/x25 ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp.c')
-rw-r--r--net/ipv4/tcp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index c5b83875411a..b091149742b1 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -4011,11 +4011,11 @@ int do_tcp_getsockopt(struct sock *sk, int level,
if (copy_from_sockptr(&len, optlen, sizeof(int)))
return -EFAULT;
- len = min_t(unsigned int, len, sizeof(int));
-
if (len < 0)
return -EINVAL;
+ len = min_t(unsigned int, len, sizeof(int));
+
switch (optname) {
case TCP_MAXSEG:
val = tp->mss_cache;