diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2020-05-23 19:46:48 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-05-26 02:51:28 +0200 |
commit | 6a1015b0b4b1f3a0de9e40d2ba86877d13f50918 (patch) | |
tree | 3f24921700cd271bf6e50771ff8acafe64b1363b /net/ipv4/ip_sockglue.c | |
parent | mvneta: MVNETA_SKB_HEADROOM set last 3 bits to zero (diff) | |
download | linux-6a1015b0b4b1f3a0de9e40d2ba86877d13f50918.tar.xz linux-6a1015b0b4b1f3a0de9e40d2ba86877d13f50918.zip |
ipv4: potential underflow in compat_ip_setsockopt()
The value of "n" is capped at 0x1ffffff but it checked for negative
values. I don't think this causes a problem but I'm not certain and
it's harmless to prevent it.
Fixes: 2e04172875c9 ("ipv4: do compat setsockopt for MCAST_MSFILTER directly")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/ip_sockglue.c')
-rw-r--r-- | net/ipv4/ip_sockglue.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c index a2469bc57cfe..f43d5f12aa86 100644 --- a/net/ipv4/ip_sockglue.c +++ b/net/ipv4/ip_sockglue.c @@ -1347,8 +1347,8 @@ int compat_ip_setsockopt(struct sock *sk, int level, int optname, { const int size0 = offsetof(struct compat_group_filter, gf_slist); struct compat_group_filter *gf32; + unsigned int n; void *p; - int n; if (optlen < size0) return -EINVAL; |