[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAM_iQpXWCWMKDjLVTLuHNSKKGq5MWf5ZRLpyE=PDD3EgQ7PS4Q@mail.gmail.com>
Date: Tue, 20 Dec 2016 22:09:49 -0800
From: Cong Wang <xiyou.wangcong@...il.com>
To: Dave Jones <davej@...emonkey.org.uk>
Cc: David Miller <davem@...emloft.net>,
Linux Kernel Network Developers <netdev@...r.kernel.org>
Subject: Re: ipv6: handle -EFAULT from skb_copy_bits
On Tue, Dec 20, 2016 at 2:12 PM, Dave Jones <davej@...emonkey.org.uk> wrote:
> fd = socket(AF_INET6, SOCK_RAW, 7);
>
> setsockopt(fd, SOL_IPV6, IPV6_CHECKSUM, &zero, 4);
> setsockopt(fd, SOL_IPV6, IPV6_DSTOPTS, &buf, LEN);
>
Interesting, you set the checksum offset to be 0, but the packet size
is actually 49, transport header is located at offset 48, so apparently
the packet doesn't have room for a 16bit checksum after network header.
Your original patch seems reasonable to me, unless there is some
check in __ip6_append_data() which is supposed to catch this, but
CHECKSUM is specific to raw socket only.
Powered by blists - more mailing lists