Skip to content

Commit 914d116

Browse files
ij1davem330
authored andcommitted
ipv6: IPV6_PKTINFO relied userspace providing correct length
Signed-off-by: Ilpo Järvinen <[email protected]> Reported-by: Eric Sesterhenn <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 22604c8 commit 914d116

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/ipv6/ipv6_sockglue.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ static int do_ipv6_setsockopt(struct sock *sk, int level, int optname,
404404
else if (optlen < sizeof(struct in6_pktinfo) || optval == NULL)
405405
goto e_inval;
406406

407-
if (copy_from_user(&pkt, optval, optlen)) {
407+
if (copy_from_user(&pkt, optval, sizeof(struct in6_pktinfo))) {
408408
retv = -EFAULT;
409409
break;
410410
}

0 commit comments

Comments
 (0)