[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1482324073.2260.4.camel@stressinduktion.org>
Date: Wed, 21 Dec 2016 13:41:13 +0100
From: Hannes Frederic Sowa <hannes@...essinduktion.org>
To: Cong Wang <xiyou.wangcong@...il.com>,
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 Wed, 2016-12-21 at 13:27 +0100, Hannes Frederic Sowa wrote:
> @@ -555,8 +566,8 @@ static int rawv6_push_pending_frames(struct sock *sk, struct flowi6 *fl6,
> goto out;
>
> offset = rp->offset;
> - total_len = inet_sk(sk)->cork.base.length;
> - if (offset >= total_len - 1) {
> + transport_len = raw6_corked_transport_len(sk);
> + if (offset >= transport_len - 1) {
> err = -EINVAL;
> ip6_flush_pending_frames(sk);
> goto out;
> @@ -598,7 +609,7 @@ static int rawv6_push_pending_frames(struct sock *sk, struct flowi6 *fl6,
> tmp_csum = csum_sub(tmp_csum, csum_unfold(csum));
>
> csum = csum_ipv6_magic(&fl6->saddr, &fl6->daddr,
> - total_len, fl6->flowi6_proto, tmp_csum);
> + transport_len, fl6->flowi6_proto, tmp_csum);
>
>
Ops, here we need actually the total_len plus the opt->opt_nflen to
always calculate the correct checksum.
Powered by blists - more mailing lists