All of lore.kernel.org
 help / color / mirror / Atom feed
From: Olivier Matz <olivier.matz@6wind.com>
To: netdev@vger.kernel.org, "David S . Miller" <davem@davemloft.net>
Cc: Hannes Frederic Sowa <hannes@stressinduktion.org>
Subject: [PATCH net 0/2] ipv6: fix EFAULT on sendto with icmpv6 and hdrincl
Date: Thu,  6 Jun 2019 09:15:17 +0200	[thread overview]
Message-ID: <20190606071519.5841-1-olivier.matz@6wind.com> (raw)

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


             reply	other threads:[~2019-06-06  7:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-06  7:15 Olivier Matz [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190606071519.5841-1-olivier.matz@6wind.com \
    --to=olivier.matz@6wind.com \
    --cc=davem@davemloft.net \
    --cc=hannes@stressinduktion.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.