ipv6: IPV6_PKTINFO relied userspace providing correct length
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi> Reported-by: Eric Sesterhenn <snakebyte@gmx.de> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
22604c8668
commit
914d11647b
1 changed files with 1 additions and 1 deletions
|
@ -404,7 +404,7 @@ static int do_ipv6_setsockopt(struct sock *sk, int level, int optname,
|
||||||
else if (optlen < sizeof(struct in6_pktinfo) || optval == NULL)
|
else if (optlen < sizeof(struct in6_pktinfo) || optval == NULL)
|
||||||
goto e_inval;
|
goto e_inval;
|
||||||
|
|
||||||
if (copy_from_user(&pkt, optval, optlen)) {
|
if (copy_from_user(&pkt, optval, sizeof(struct in6_pktinfo))) {
|
||||||
retv = -EFAULT;
|
retv = -EFAULT;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue