From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B4401C04AB5 for ; Thu, 6 Jun 2019 07:21:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8E6C32083D for ; Thu, 6 Jun 2019 07:21:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726581AbfFFHVg (ORCPT ); Thu, 6 Jun 2019 03:21:36 -0400 Received: from host.76.145.23.62.rev.coltfrance.com ([62.23.145.76]:59637 "EHLO proxy.6wind.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725267AbfFFHVg (ORCPT ); Thu, 6 Jun 2019 03:21:36 -0400 X-Greylist: delayed 354 seconds by postgrey-1.27 at vger.kernel.org; Thu, 06 Jun 2019 03:21:36 EDT Received: from glumotte.dev.6wind.com. (unknown [10.16.0.195]) by proxy.6wind.com (Postfix) with ESMTP id B8F632C6039; Thu, 6 Jun 2019 09:15:39 +0200 (CEST) From: Olivier Matz To: netdev@vger.kernel.org, "David S . Miller" Cc: Hannes Frederic Sowa Subject: [PATCH net 0/2] ipv6: fix EFAULT on sendto with icmpv6 and hdrincl Date: Thu, 6 Jun 2019 09:15:17 +0200 Message-Id: <20190606071519.5841-1-olivier.matz@6wind.com> X-Mailer: git-send-email 2.11.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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