Skip to content

ipv6: fix EFAULT on sendto with icmpv6 and hdrincl

Olivier Matz netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2ipv6: use READ_ONCE() for inet->hdrincl as in ipv4net/ipv6/raw.c+10 -20 replies
2/2ipv6: fix EFAULT on sendto with icmpv6 and hdrinclnet/ipv6/raw.c+8 -51 reply

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by.

PatchNicolas Dichtel
1/2
2/2A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH net 0/2] ipv6: fix EFAULT on sendto with icmpv6 and hdrincl

The following code returns EFAULT (Bad address):

  s = socket(AF_INET6, SOCK_RAW, IPPROTO_ICMPV6);
  setsockopt(s, SOL_IPV6, IPV6_HDRINCL, 1);
  sendto(ipv6_icmp6_packet, addr);   /* returns -1, errno = EFAULT */

The problem is fixed in the second patch. The first one aligns the code to ipv4, to avoid a race condition in the second patch.

Olivier Matz (2):
ipv6: use READ_ONCE() for inet->hdrincl as in ipv4
ipv6: fix EFAULT on sendto with icmpv6 and hdrincl

 net/ipv6/raw.c | 25 ++++++++++++++++++-------
 1 file changed, 18 insertions(+), 7 deletions(-)
Signature · 1 line
2.11.0