xen-netfront sets partial checksum at wrong offset
Subsystems (2)
Hello All,
When handle_incoming_queue (xen-netfront.c) calls checksum_setup() the transport header didn't seem to be initialized yet. skb_checksum_setup_ipv4 ends up initializing the checksum at incorrect offset.
if (recalculate)
*csum = ~csum_tcpudp_magic(ip_hdr(skb)->saddr,
ip_hdr(skb)->daddr,
skb->len - off,
ip_hdr(skb)->protocol, 0);where csum is &tcp_hdr(skb)->check.
This problem got exposed when LRO was ON on the host.
It hits this case in checksum_setup().
/*
* A GSO SKB must be CHECKSUM_PARTIAL. However some buggy
* peers can fail to set NETRXF_csum_blank when sending a GSO
* frame. In this case force the SKB to CHECKSUM_PARTIAL and
* recalculate the partial checksum.
*/
skb->ip_summed was CHECKSUM_UNNECESSARY.
The guest was at 3.8.13 kernel.
I can send a patch if you think the problem exists in current releases too.
Thanks.
Venkat
Quoted 22 lines · Venkat Venkatsubra
Hello All,
When
handle_incoming_queue(xen-netfront.c) callschecksum_setup()the transport header didn't seem to be initialized yet.skb_checksum_setup_ipv4ends up initializing the checksum at incorrect offset.if (recalculate) *csum = ~csum_tcpudp_magic(ip_hdr(skb)->saddr, ip_hdr(skb)->daddr, skb->len - off, ip_hdr(skb)->protocol, 0);where csum is &tcp_hdr(skb)->check.
This problem got exposed when LRO was ON on the host.
It hits this case inchecksum_setup().
/*
* A GSO SKB must beCHECKSUM_PARTIAL. However some buggy
* peers can fail to setNETRXF_csum_blankwhen sending a GSO
* frame. In this case force the SKB toCHECKSUM_PARTIALand
* recalculate the partial checksum.
*/
Quoted 4 lines
skb->ip_summedwasCHECKSUM_UNNECESSARY.
The guest was at 3.8.13 kernel.I can send a patch if you think the problem exists in current releases too.
Please CC the maintainers of the driver. You can get that from 'scripts/get_maintainer.pl'
I've done that for you.
Quoted 9 lines
Thanks.
Venkat
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Quoted 22 lines · Venkat Venkatsubra
Hello All,
When
handle_incoming_queue(xen-netfront.c) callschecksum_setup()the transport header didn't seem to be initialized yet.skb_checksum_setup_ipv4ends up initializing the checksum at incorrect offset.if (recalculate) *csum = ~csum_tcpudp_magic(ip_hdr(skb)->saddr, ip_hdr(skb)->daddr, skb->len - off, ip_hdr(skb)->protocol, 0);where csum is &tcp_hdr(skb)->check.
This problem got exposed when LRO was ON on the host.
It hits this case inchecksum_setup().
/*
* A GSO SKB must beCHECKSUM_PARTIAL. However some buggy
* peers can fail to setNETRXF_csum_blankwhen sending a GSO
* frame. In this case force the SKB toCHECKSUM_PARTIALand
* recalculate the partial checksum.
*/
Quoted 4 lines
skb->ip_summedwasCHECKSUM_UNNECESSARY.
The guest was at 3.8.13 kernel.I can send a patch if you think the problem exists in current releases too.
Please CC the maintainers of the driver. You can get that from 'scripts/get_maintainer.pl'
I've done that for you.
Quoted 9 lines
Thanks.
Venkat
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Venkat Venkatsubra
Tested-by Sander EikelenboomQuoted 5 lines
Please CC the maintainers of the driver. You can get that from '
scripts/get_maintainer.pl'I've done that for you.
Thanks, Konrad.
I am copying Wei too who had fixed the below problem earlier. It fixed the incorrect ip_hdr(). tcp_hdr() still needs to fixed.
commit d554f73df6bc35ac8f6a65e5560bf1d31dfebed9
Author: Wei Liu <[email protected]> Date: Wed Feb 19 18:48:34 2014 +0000
xen-netfront: reset skb network header before checksum
In ed1f50c3a ("net: add skb_checksum_setup") we introduced some checksum functions in core driver. Subsequent change b5cf66cd1 ("xen-netfront:
use new skb_checksum_setup function") made use of those functions to replace its own implementation.
However with that change netfront is broken. It sees a lot of checksum error. That's because its own implementation of checksum function was a bit hacky (dereferencing skb->data directly) while the new function was implemented using ip_hdr(). The network header is not reset before skb is passed to the new function. When the new function tries to do its job, it's confused and reports error.
The fix is simple, we need to reset network header before passing skb to checksum function. Netback is not affected as it already does the right thing.
Thanks.
Venkat
Venkat Venkatsubra
Tested-by Sander EikelenboomQuoted 5 lines
Please CC the maintainers of the driver. You can get that from '
scripts/get_maintainer.pl'I've done that for you.
Thanks, Konrad.
I am copying Wei too who had fixed the below problem earlier. It fixed the incorrect ip_hdr(). tcp_hdr() still needs to fixed.
commit d554f73df6bc35ac8f6a65e5560bf1d31dfebed9
Author: Wei Liu <[email protected]> Date: Wed Feb 19 18:48:34 2014 +0000
xen-netfront: reset skb network header before checksum
In ed1f50c3a ("net: add skb_checksum_setup") we introduced some checksum functions in core driver. Subsequent change b5cf66cd1 ("xen-netfront:
use new skb_checksum_setup function") made use of those functions to replace its own implementation.
However with that change netfront is broken. It sees a lot of checksum error. That's because its own implementation of checksum function was a bit hacky (dereferencing skb->data directly) while the new function was implemented using ip_hdr(). The network header is not reset before skb is passed to the new function. When the new function tries to do its job, it's confused and reports error.
The fix is simple, we need to reset network header before passing skb to checksum function. Netback is not affected as it already does the right thing.
Thanks.
Venkat
Quoted 9 lines
Quoted 6 lines
Quoted 1 line · On 11.05.15 at 19:25, <[email protected]> wrote:
Please CC the maintainers of the driver. You can get that from '
scripts/get_maintainer.pl'I've done that for you.
Thanks, Konrad.
Quoted 8 lines
I am copying Wei too who had fixed the below problem earlier. It fixed the incorrect
ip_hdr().tcp_hdr()still needs to fixed.commit
d554f73df6bc35ac8f6a65e5560bf1d31dfebed9Author: Wei Liu <[email protected]> Date: Wed Feb 19 18:48:34 2014 +0000xen-netfront: reset skb network header before checksum
So no response at all so far from the maintainers made me look into
this: I first thought what we need would be calls to skb_probe_transport_header() in skb_checksum_setup_ip() after each of the skb_maybe_pull_tail() functions. But skb_partial_csum_set() already calls skb_set_transport_header(), so I now think things ought to be fine without any change. Can you clarify what you think is missing? Or is this an issue in just the old (3.8.x) kernel you're using?
(In either case netback's xenvif_tx_submit() calling skb_probe_transport_header() would seem pointless, as skb_checksum_setup() - with or without a fix - ought to be taking care of this anyway.)
Jan
Quoted 9 lines
Quoted 6 lines
Quoted 1 line · On 11.05.15 at 19:25, <[email protected]> wrote:
Please CC the maintainers of the driver. You can get that from '
scripts/get_maintainer.pl'I've done that for you.
Thanks, Konrad.
Quoted 8 lines
I am copying Wei too who had fixed the below problem earlier. It fixed the incorrect
ip_hdr().tcp_hdr()still needs to fixed.commit
d554f73df6bc35ac8f6a65e5560bf1d31dfebed9Author: Wei Liu <[email protected]> Date: Wed Feb 19 18:48:34 2014 +0000xen-netfront: reset skb network header before checksum
So no response at all so far from the maintainers made me look into
this: I first thought what we need would be calls to skb_probe_transport_header() in skb_checksum_setup_ip() after each of the skb_maybe_pull_tail() functions. But skb_partial_csum_set() already calls skb_set_transport_header(), so I now think things ought to be fine without any change. Can you clarify what you think is missing? Or is this an issue in just the old (3.8.x) kernel you're using?
(In either case netback's xenvif_tx_submit() calling skb_probe_transport_header() would seem pointless, as skb_checksum_setup() - with or without a fix - ought to be taking care of this anyway.)
Jan
Quoted 18 lines · Jan Beulich
Quoted 9 lines
Quoted 6 lines
Quoted 1 line · On 11.05.15 at 19:25, <[email protected]> wrote:
Please CC the maintainers of the driver. You can get that from '
scripts/get_maintainer.pl'I've done that for you.
Thanks, Konrad.
Quoted 8 lines
I am copying Wei too who had fixed the below problem earlier. It fixed the incorrect
ip_hdr().tcp_hdr()still needs to fixed.commit
d554f73df6bc35ac8f6a65e5560bf1d31dfebed9Author: Wei Liu <[email protected]> Date: Wed Feb 19 18:48:34 2014 +0000xen-netfront: reset skb network header before checksum
Quoted 9 lines
So no response at all so far from the maintainers made me look into
this: I first thought what we need would be calls toskb_probe_transport_header()inskb_checksum_setup_ip()after each of theskb_maybe_pull_tail()functions. Butskb_partial_csum_set()already callsskb_set_transport_header(), so I now think things ought to be fine without any change. Can you clarify what you think is missing? Or is this an issue in just the old (3.8.x) kernel you're using?
I think this is the follow-up thread <[email protected]>
And the conclusion is 3.8 is too old so the fix is not there.
Quoted 5 lines
(In either case netback's
xenvif_tx_submit()callingskb_probe_transport_header()would seem pointless, asskb_checksum_setup()- with or without a fix - ought to be taking care of this anyway.)
Patches welcome. :-)
Wei.
Quoted 1 line
Jan
Quoted 18 lines · Jan Beulich
Quoted 9 lines
Quoted 6 lines
Quoted 1 line · On 11.05.15 at 19:25, <[email protected]> wrote:
Please CC the maintainers of the driver. You can get that from '
scripts/get_maintainer.pl'I've done that for you.
Thanks, Konrad.
Quoted 8 lines
I am copying Wei too who had fixed the below problem earlier. It fixed the incorrect
ip_hdr().tcp_hdr()still needs to fixed.commit
d554f73df6bc35ac8f6a65e5560bf1d31dfebed9Author: Wei Liu <[email protected]> Date: Wed Feb 19 18:48:34 2014 +0000xen-netfront: reset skb network header before checksum
Quoted 9 lines
So no response at all so far from the maintainers made me look into
this: I first thought what we need would be calls toskb_probe_transport_header()inskb_checksum_setup_ip()after each of theskb_maybe_pull_tail()functions. Butskb_partial_csum_set()already callsskb_set_transport_header(), so I now think things ought to be fine without any change. Can you clarify what you think is missing? Or is this an issue in just the old (3.8.x) kernel you're using?
I think this is the follow-up thread <[email protected]>
And the conclusion is 3.8 is too old so the fix is not there.
Quoted 5 lines
(In either case netback's
xenvif_tx_submit()callingskb_probe_transport_header()would seem pointless, asskb_checksum_setup()- with or without a fix - ought to be taking care of this anyway.)
Patches welcome. :-)
Wei.
Quoted 1 line
Jan
Quoted 30 lines
Quoted 1 line
Quoted 1 line · On 29.05.15 at 12:39, <[email protected]> wrote:
Quoted 18 lines · Jan Beulich
Quoted 9 lines
Quoted 6 lines
Quoted 1 line · On 11.05.15 at 19:25, <[email protected]> wrote:
Please CC the maintainers of the driver. You can get that from '
scripts/get_maintainer.pl'I've done that for you.
Thanks, Konrad.
Quoted 8 lines
I am copying Wei too who had fixed the below problem earlier. It fixed the incorrect
ip_hdr().tcp_hdr()still needs to fixed.commit
d554f73df6bc35ac8f6a65e5560bf1d31dfebed9Author: Wei Liu <[email protected]> Date: Wed Feb 19 18:48:34 2014 +0000xen-netfront: reset skb network header before checksum
Quoted 9 lines
So no response at all so far from the maintainers made me look into
this: I first thought what we need would be calls toskb_probe_transport_header()inskb_checksum_setup_ip()after each of theskb_maybe_pull_tail()functions. Butskb_partial_csum_set()already callsskb_set_transport_header(), so I now think things ought to be fine without any change. Can you clarify what you think is missing? Or is this an issue in just the old (3.8.x) kernel you're using?
Quoted 3 lines
I think this is the follow-up thread <[email protected]>
And the conclusion is 3.8 is too old so the fix is not there.
Ah, right. Seems like I failed to remove the earlier mail from my list of things to look at when this came through. Sorry for the noise then.
Jan
Quoted 30 lines
Quoted 1 line
Quoted 1 line · On 29.05.15 at 12:39, <[email protected]> wrote:
Quoted 18 lines · Jan Beulich
Quoted 9 lines
Quoted 6 lines
Quoted 1 line · On 11.05.15 at 19:25, <[email protected]> wrote:
Please CC the maintainers of the driver. You can get that from '
scripts/get_maintainer.pl'I've done that for you.
Thanks, Konrad.
Quoted 8 lines
I am copying Wei too who had fixed the below problem earlier. It fixed the incorrect
ip_hdr().tcp_hdr()still needs to fixed.commit
d554f73df6bc35ac8f6a65e5560bf1d31dfebed9Author: Wei Liu <[email protected]> Date: Wed Feb 19 18:48:34 2014 +0000xen-netfront: reset skb network header before checksum
Quoted 9 lines
So no response at all so far from the maintainers made me look into
this: I first thought what we need would be calls toskb_probe_transport_header()inskb_checksum_setup_ip()after each of theskb_maybe_pull_tail()functions. Butskb_partial_csum_set()already callsskb_set_transport_header(), so I now think things ought to be fine without any change. Can you clarify what you think is missing? Or is this an issue in just the old (3.8.x) kernel you're using?
Quoted 3 lines
I think this is the follow-up thread <[email protected]>
And the conclusion is 3.8 is too old so the fix is not there.
Ah, right. Seems like I failed to remove the earlier mail from my list of things to look at when this came through. Sorry for the noise then.
Jan