netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net 0/2] ipv6: fix EFAULT on sendto with icmpv6 and hdrincl
@ 2019-06-06  7:15 Olivier Matz
  2019-06-06  7:15 ` [PATCH net 1/2] ipv6: use READ_ONCE() for inet->hdrincl as in ipv4 Olivier Matz
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Olivier Matz @ 2019-06-06  7:15 UTC (permalink / raw)
  To: netdev, David S . Miller; +Cc: Hannes Frederic Sowa

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(-)

-- 
2.11.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-06-06 17:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-06  7:15 [PATCH net 0/2] ipv6: fix EFAULT on sendto with icmpv6 and hdrincl Olivier Matz
2019-06-06  7:15 ` [PATCH net 1/2] ipv6: use READ_ONCE() for inet->hdrincl as in ipv4 Olivier Matz
2019-06-06  7:15 ` [PATCH net 2/2] ipv6: fix EFAULT on sendto with icmpv6 and hdrincl Olivier Matz
2019-06-06 11:52   ` Nicolas Dichtel
2019-06-06 17:30 ` [PATCH net 0/2] " David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).