summaryrefslogtreecommitdiff
path: root/net/kcm/kcmsock.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2024-03-11 12:53:22 +0300
committerDavid S. Miller <davem@davemloft.net>2024-03-11 12:53:22 +0300
commite996401e06a5232f61b4906e2eea643fffa88396 (patch)
tree48f20850b5f6836baccc5e1e5c8bb01efe7ac1df /net/kcm/kcmsock.c
parentc2b25092864a16c7865e406badedece5cc25fc2b (diff)
parentd6eb8de2015f0c24822e47356f839167ebde2945 (diff)
downloadlinux-e996401e06a5232f61b4906e2eea643fffa88396.tar.xz
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/kcm/kcmsock.c')
-rw-r--r--net/kcm/kcmsock.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/kcm/kcmsock.c b/net/kcm/kcmsock.c
index dc46f17a3187..2f191e50d4fc 100644
--- a/net/kcm/kcmsock.c
+++ b/net/kcm/kcmsock.c
@@ -1153,10 +1153,11 @@ static int kcm_getsockopt(struct socket *sock, 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 KCM_RECV_DISABLE:
val = kcm->rx_disabled;