Thread (20 messages) flat view 20 messages, 4 authors, 2016-12-22

Re: ipv6: handle -EFAULT from skb_copy_bits

From: Cong Wang <hidden>
Date: 2016-12-21 06:10:11

On Tue, Dec 20, 2016 at 2:12 PM, Dave Jones [off-list ref] 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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help