[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1322710962.2577.3.camel@edumazet-laptop>
Date: Thu, 01 Dec 2011 04:42:42 +0100
From: Eric Dumazet <eric.dumazet@...il.com>
To: Tom Herbert <therbert@...gle.com>
Cc: Linux Netdev List <netdev@...r.kernel.org>,
David Miller <davem@...emloft.net>
Subject: Re: Bug in computing data_len in tcp_sendmsg?
Le mercredi 30 novembre 2011 à 17:48 -0800, Tom Herbert a écrit :
> I believe that skb->data_len might no be computed correctly in
> tcp_sendmsg. Specifically, when skb_add_data_nocache (or
> skb_add_data) is called skb->data_len is not updated (skb_put only
> updates skb->len). This results in the datalen in the head skbuf
> being zero so any subsequent uses of the value lead to incorrect
> results. For instance, skb_headlen returns the length of the head
> skbu data and not just that of the headers. If I'm reading this
> correctly, it's a pretty fundamental bug.
>
> I don't have a fix for this yet.
>
> Tom
On which tree do you see a problem ?
For example net-next seems fine to me :
static inline int skb_copy_to_page_nocache(struct sock *sk, char __user *from,
struct sk_buff *skb,
struct page *page,
int off, int copy)
{
int err;
err = skb_do_copy_data_nocache(sk, skb, from, page_address(page) + off,
copy, skb->len);
if (err)
return err;
skb->len += copy;
skb->data_len += copy;
skb->truesize += copy;
sk->sk_wmem_queued += copy;
sk_mem_charge(sk, copy);
return 0;
}
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists