Skip to content

Commit

Permalink
ipv6: IPV6_PKTINFO relied userspace providing correct length
Browse files Browse the repository at this point in the history
Signed-off-by: Ilpo Järvinen <[email protected]>
Reported-by: Eric Sesterhenn <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
ij1 authored and davem330 committed Jan 5, 2009
1 parent 22604c8 commit 914d116
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/ipv6/ipv6_sockglue.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
goto e_inval;

if (copy_from_user(&pkt, optval, optlen)) {
if (copy_from_user(&pkt, optval, sizeof(struct in6_pktinfo))) {
retv = -EFAULT;
break;
}
Expand Down

0 comments on commit 914d116

Please sign in to comment.