Commit 914d11647b6d6fe81bdf0c059612ee36282b8cee

Authored by Ilpo Järvinen
Committed by David S. Miller
1 parent 22604c8668

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>

Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff

net/ipv6/ipv6_sockglue.c
... ... @@ -404,7 +404,7 @@
404 404 else if (optlen < sizeof(struct in6_pktinfo) || optval == NULL)
405 405 goto e_inval;
406 406  
407   - if (copy_from_user(&pkt, optval, optlen)) {
  407 + if (copy_from_user(&pkt, optval, sizeof(struct in6_pktinfo))) {
408 408 retv = -EFAULT;
409 409 break;
410 410 }