[ovs-git] [openvswitch/ovs] 4fc904: netdev-dpdk: Fix incorrect shinfo initialization.

Yi Yang noreply at github.com
Mon Feb 1 19:38:19 UTC 2021


  Branch: refs/heads/branch-2.15
  Home:   https://github.com/openvswitch/ovs
  Commit: 4fc9041cfa39af0af8adb7e99dd87839542493cf
      https://github.com/openvswitch/ovs/commit/4fc9041cfa39af0af8adb7e99dd87839542493cf
  Author: Yi Yang <yangyi01 at inspur.com>
  Date:   2021-02-01 (Mon, 01 Feb 2021)

  Changed paths:
    M lib/netdev-dpdk.c

  Log Message:
  -----------
  netdev-dpdk: Fix incorrect shinfo initialization.

shinfo is used to store reference counter and free callback
of an external buffer, but it is stored in mbuf if the mbuf
has tailroom for it.

This is wrong because the mbuf (and its data) can be freed
before the external buffer, for example:

  pkt2 = rte_pktmbuf_alloc(mp);
  rte_pktmbuf_attach(pkt2, pkt);
  rte_pktmbuf_free(pkt);

After this, pkt is freed, but it still contains shinfo, which
is referenced by pkt2.

This sequence of operations is possible inside DPDK e.g., while
performing TSO operations for 'net_tap' PMD.

Fix this by always storing shinfo at the tail of external buffer.

Fixes: 29cf9c1b3b9c ("userspace: Add TCP Segmentation Offload support")
Co-authored-by: Olivier Matz <olivier.matz at 6wind.com>
Signed-off-by: Olivier Matz <olivier.matz at 6wind.com>
Signed-off-by: Yi Yang <yangyi01 at inspur.com>
Acked-by: Flavio Leitner <fbl at sysclose.org>
Signed-off-by: Ilya Maximets <i.maximets at ovn.org>




More information about the git mailing list