mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-27 13:05:03 +08:00
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: 2e04172875
("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>
This commit is contained in:
parent
ca23cb0bc5
commit
6a1015b0b4
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user