As skb->tail wasn't updated after skb_copy_to_linear_data(), subsequent
calls to skb_realloc_headroom() (as made by an ethernet driver's
ndo_start_xmit routine) would only effectively copy the packet headers,
leaving garbage in the payload.
In the process, removed some unnecessary code.
Signed-off-by: Bogdan Hamciuc <redacted>
---
net/core/netpoll.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
Netpoll used to compute its own csum; but if the device supports, we
should let it do the checksum itself.
Signed-off-by: Bogdan Hamciuc <redacted>
---
net/core/netpoll.c | 14 ++++++++++----
1 files changed, 10 insertions(+), 4 deletions(-)
From: Eric Dumazet <hidden> Date: 2012-06-12 12:22:51
On Tue, 2012-06-12 at 13:26 +0300, Bogdan Hamciuc wrote:
quoted hunk
As skb->tail wasn't updated after skb_copy_to_linear_data(), subsequent
calls to skb_realloc_headroom() (as made by an ethernet driver's
ndo_start_xmit routine) would only effectively copy the packet headers,
leaving garbage in the payload.
In the process, removed some unnecessary code.
Signed-off-by: Bogdan Hamciuc <redacted>
---
net/core/netpoll.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
Hmm, real question is why skb_realloc_headroom() is even necessary...
I suspect we need to reserve more bytes.
total_len = ip_len + ETH_HLEN + NET_IP_ALIGN + NET_SKB_PAD;
or something like that ?
Which driver triggers the bug ?
From: Eric Dumazet <hidden> Date: 2012-06-12 12:43:25
On Tue, 2012-06-12 at 13:26 +0300, Bogdan Hamciuc wrote:
quoted hunk
Netpoll used to compute its own csum; but if the device supports, we
should let it do the checksum itself.
Signed-off-by: Bogdan Hamciuc <redacted>
---
net/core/netpoll.c | 14 ++++++++++----
1 files changed, 10 insertions(+), 4 deletions(-)
From: Eric Dumazet <hidden> Date: 2012-06-12 13:15:21
On Tue, 2012-06-12 at 14:22 +0200, Eric Dumazet wrote:
On Tue, 2012-06-12 at 13:26 +0300, Bogdan Hamciuc wrote:
quoted
As skb->tail wasn't updated after skb_copy_to_linear_data(), subsequent
calls to skb_realloc_headroom() (as made by an ethernet driver's
ndo_start_xmit routine) would only effectively copy the packet headers,
leaving garbage in the payload.
In the process, removed some unnecessary code.
Signed-off-by: Bogdan Hamciuc <redacted>
---
net/core/netpoll.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
Hmm, real question is why skb_realloc_headroom() is even necessary...
I suspect we need to reserve more bytes.
total_len = ip_len + ETH_HLEN + NET_IP_ALIGN + NET_SKB_PAD;
or something like that ?
Which driver triggers the bug ?
From: Eric Dumazet <hidden> Date: 2012-06-12 13:34:16
On Tue, 2012-06-12 at 15:15 +0200, Eric Dumazet wrote:
On Tue, 2012-06-12 at 14:22 +0200, Eric Dumazet wrote:
quoted
Hmm, real question is why skb_realloc_headroom() is even necessary...
I suspect we need to reserve more bytes.
total_len = ip_len + ETH_HLEN + NET_IP_ALIGN + NET_SKB_PAD;
or something like that ?
Which driver triggers the bug ?
In case you wonder why I try so hard to avoid the
skb_realloc_headroom() :
netpoll has complicated^Wspecial^Wnice skb cache, to make sure it can
work even if memory is exhausted.
But if we trigger skb_realloc_headroom() the whole thing is useless.
Thanks
-----Original Message-----
From: Eric Dumazet [mailto:eric.dumazet@gmail.com]
Sent: Tuesday, June 12, 2012 4:34 PM
To: Hamciuc Bogdan-BHAMCIU1
Cc: davem@davemloft.net; netdev@vger.kernel.org
Subject: Re: [PATCH] netpoll: Fix skb tail pointer in netpoll_send_udp()
On Tue, 2012-06-12 at 15:15 +0200, Eric Dumazet wrote:
quoted
On Tue, 2012-06-12 at 14:22 +0200, Eric Dumazet wrote:
quoted
quoted
Hmm, real question is why skb_realloc_headroom() is even necessary...
Our driver (Freescale P4080, unfortunately not upstream yet) needs a minimum amount of headroom in order to communicate metadata to the NIC.
For instance, frame offsets to the protocol headers are stored there, which the NIC then uses to fill in the egress checksum.
Originating frames, on the other hand, don't always have that amount of headroom, so we occasionally need to realloc.
quoted
quoted
I suspect we need to reserve more bytes.
total_len = ip_len + ETH_HLEN + NET_IP_ALIGN + NET_SKB_PAD;
or something like that ?
Indeed, your counter-proposal patch (adding LL_RESERVED_SPACE()) worked fine.
quoted
quoted
Which driver triggers the bug ?
In case you wonder why I try so hard to avoid the
skb_realloc_headroom() :
netpoll has complicated^Wspecial^Wnice skb cache, to make sure it can
work even if memory is exhausted.
But if we trigger skb_realloc_headroom() the whole thing is useless.