Skip to content

Commit 6a1015b

Browse files
Dan Carpenterdavem330
authored andcommitted
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: 2e04172 ("ipv4: do compat setsockopt for MCAST_MSFILTER directly") Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent ca23cb0 commit 6a1015b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/ipv4/ip_sockglue.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1347,8 +1347,8 @@ int compat_ip_setsockopt(struct sock *sk, int level, int optname,
13471347
{
13481348
const int size0 = offsetof(struct compat_group_filter, gf_slist);
13491349
struct compat_group_filter *gf32;
1350+
unsigned int n;
13501351
void *p;
1351-
int n;
13521352

13531353
if (optlen < size0)
13541354
return -EINVAL;

0 commit comments

Comments
 (0)