summaryrefslogtreecommitdiff
path: root/net/ipv4/udp.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/udp.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/udp.c')
-rw-r--r--net/ipv4/udp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index 2beabf5b2d86..43ec4812b60e 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -2791,11 +2791,11 @@ int udp_lib_getsockopt(struct sock *sk, int level, int optname,
if (get_user(len, optlen))
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 UDP_CORK:
val = udp_test_bit(CORK, sk);