Commit Graph

1025 Commits

Author SHA1 Message Date
Hawker d769a4bd03 Bug:CLR_FD_BIT is undefined 2021-03-06 19:04:46 +08:00
Hawker 6819118ae2 Bug:CLR_FD_BIT is undefined 2021-03-06 19:04:46 +08:00
Jianfeng Tan e6161e2b0f fix use after free issue in mbuf free
Two kinds of mbuf are used in f-stack: freebsd mbuf and dpdk mbuf.

freebsd mbufs are metadata used in freebsd stack, and their data
pointers (m_data) point to dpdk mbuf's data (buf_addr). And they have
their own chain, like this:

  bsd_mbuf1 -> bsd_mbuf2 -> bsd_mbuf3
      \            \            \
    dpdk_mbuf1 -> dpdk_mbuf2 -> dpdk_mbuf3

Considering the map relationship,

- m_freem() is corresponding to rte_pktmbuf_free(), is to free the whole
  chain of mbufs.
- m_free() is corresponding to rte_pktmbuf_free_seg(), is to free the
  specified mbuf segment.

The current implementation in f-stack uses rte_pktmbuf_free() for
m_free(). This leads to mbufs, which are still in use, be freed
unexpectedly. For example, if the bsd_mbuf1 is trimed into zero length,
bsd will invoke m_free() to free the specified segment, however, the
whole mbuf chain is freed by calling rte_pktmbuf_free().

  #0 rte_pktmbuf_free (m=0x22006fb480)
  #1 in ff_dpdk_pktmbuf_free (m=0x22006fb480)
  #2 in ff_mbuf_ext_free (m=0x7ffff7f82800, arg1=0x22006fb480, arg2=0x0)
  #3 in mb_free_ext (m=0x7ffff7f82800)
  #4 in m_free (m=0x7ffff7f82800)
  #5 in sbcompress (sb=, m=0x7ffff7f82800, n=)
  #6 in sbappendstream_locked (sb=, m=0x7ffff7f82800, flags=0)

The fix is straightforward. Use the correct API for segment free.

Reported-by: Yong-Hao Zou <yonghaoz1994@gmail.com>
Signed-off-by: Jianfeng Tan <henry.tjf@antgroup.com>
2021-03-06 19:04:46 +08:00
Jianfeng Tan 84456118c7 fix use after free issue in mbuf free
Two kinds of mbuf are used in f-stack: freebsd mbuf and dpdk mbuf.

freebsd mbufs are metadata used in freebsd stack, and their data
pointers (m_data) point to dpdk mbuf's data (buf_addr). And they have
their own chain, like this:

  bsd_mbuf1 -> bsd_mbuf2 -> bsd_mbuf3
      \            \            \
    dpdk_mbuf1 -> dpdk_mbuf2 -> dpdk_mbuf3

Considering the map relationship,

- m_freem() is corresponding to rte_pktmbuf_free(), is to free the whole
  chain of mbufs.
- m_free() is corresponding to rte_pktmbuf_free_seg(), is to free the
  specified mbuf segment.

The current implementation in f-stack uses rte_pktmbuf_free() for
m_free(). This leads to mbufs, which are still in use, be freed
unexpectedly. For example, if the bsd_mbuf1 is trimed into zero length,
bsd will invoke m_free() to free the specified segment, however, the
whole mbuf chain is freed by calling rte_pktmbuf_free().

  #0 rte_pktmbuf_free (m=0x22006fb480)
  #1 in ff_dpdk_pktmbuf_free (m=0x22006fb480)
  #2 in ff_mbuf_ext_free (m=0x7ffff7f82800, arg1=0x22006fb480, arg2=0x0)
  #3 in mb_free_ext (m=0x7ffff7f82800)
  #4 in m_free (m=0x7ffff7f82800)
  #5 in sbcompress (sb=, m=0x7ffff7f82800, n=)
  #6 in sbappendstream_locked (sb=, m=0x7ffff7f82800, flags=0)

The fix is straightforward. Use the correct API for segment free.

Reported-by: Yong-Hao Zou <yonghaoz1994@gmail.com>
Signed-off-by: Jianfeng Tan <henry.tjf@antgroup.com>
2021-03-06 19:04:46 +08:00
Hawker fc7cff57bb update comments 2021-03-06 19:04:46 +08:00
Hawker 76f39db167 update comments 2021-03-06 19:04:46 +08:00
Hawker 663e85b1d7 update comments 2021-03-06 19:04:46 +08:00
Hawker c2cb022c64 update comments 2021-03-06 19:04:46 +08:00
Hawker cb0cb8ee1f update comments 2021-03-06 19:04:45 +08:00
Hawker d957b83157 update comments 2021-03-06 19:04:45 +08:00
Hawker c0e965e941 update create_tcp_flow parameter 2021-03-06 19:04:45 +08:00
Hawker 637df35cd2 update create_tcp_flow parameter 2021-03-06 19:04:45 +08:00
Hawker cd0965ba8a update init_flow 2021-03-06 19:04:45 +08:00
Hawker 900256fd7d update create_tcp_flow parameter 2021-03-06 19:04:45 +08:00
Hawker be1c8e2e75 Replace deprecated filter api with generic flowapi 2021-03-06 19:04:45 +08:00
Hawker fc73e3a9a4 update init_flow 2021-03-06 19:04:45 +08:00
Xin Wang f4073352dc Fix compile error of micro_thread with gcc 8.3. 2021-03-06 19:04:45 +08:00
Hawker 6c89f403ee Replace deprecated filter api with generic flowapi 2021-03-06 19:04:45 +08:00
patrick.zeng c1b64d492e Add codedog configuration file .code.yml 2021-03-06 19:04:45 +08:00
Xin Wang 973ff95de2 Fix compile error of micro_thread with gcc 8.3. 2021-03-06 19:04:45 +08:00
patrick.zeng 2c7595d6e9 Add codedog configuration file .code.yml 2021-03-06 19:04:45 +08:00
Hawker 55151ab9d2 Bugfix: support rte_flow_isolate for multi lcore (#562)
* Bugfix: support rte_flow_isolate

init flow isolate mode only run once
2020-11-25 11:31:04 +08:00
Hawker 2474e16370
Bugfix: support rte_flow_isolate for multi lcore (#562)
* Bugfix: support rte_flow_isolate

init flow isolate mode only run once
2020-11-25 11:31:04 +08:00
fengbojiang 62653ab1a5 Fix bug of `sysctl` in tools/compat/sysctl.c.
The ff msg shouldn't to free while `ff_ipc_send` success but `ff_ipc_recv` failed (such as F-Stack app are breaking by gdb).
2020-11-21 21:27:55 +08:00
fengbojiang 32ff8fda83 Fix bug of `sysctl` in tools/compat/sysctl.c.
The ff msg shouldn't to free while `ff_ipc_send` success but `ff_ipc_recv` failed (such as F-Stack app are breaking by gdb).
2020-11-21 21:27:55 +08:00
johnjiang a4f09e1c9b Merge pull request #559 from hawkxiang/parse_multi_processes_config
Config: Support parse "--file-prefix"&"--pci-whitelist" for multi-processes
2020-11-19 14:43:26 +08:00
johnjiang 9817534a21
Merge pull request #559 from hawkxiang/parse_multi_processes_config
Config: Support parse "--file-prefix"&"--pci-whitelist" for multi-processes
2020-11-19 14:43:26 +08:00
zhangxiang10 eff1a060f0 解析file_prefix&pci-whitelist配置 2020-11-17 19:19:19 +08:00
zhangxiang10 199154d90d 解析file_prefix&pci-whitelist配置 2020-11-17 19:19:19 +08:00
zhangxiang10 c661338e72 解析file_prefix&pci-whitelist配置 2020-11-17 19:04:23 +08:00
zhangxiang10 838bd0fa9c 解析file_prefix&pci-whitelist配置 2020-11-17 19:04:23 +08:00
fengbojiang 3f8e2795fc Add doc of `ndp` tool. 2020-10-27 22:45:06 +08:00
fengbojiang db7072c6b2 Add doc of `ndp` tool. 2020-10-27 22:45:06 +08:00
johnjiang 4a90157670 Merge pull request #554 from chopin11/feature-tools-ndp-for-ipv6-neigh
feature: add ndp tool for ipv6 neighbor
2020-10-27 21:26:46 +08:00
johnjiang 98325fc3be
Merge pull request #554 from chopin11/feature-tools-ndp-for-ipv6-neigh
feature: add ndp tool for ipv6 neighbor
2020-10-27 21:26:46 +08:00
chopin c090a0d78c feature: add ndp tool for ipv6 neighbor 2020-10-18 15:57:04 +08:00
chopin ebf5cedb54 feature: add ndp tool for ipv6 neighbor 2020-10-18 15:57:04 +08:00
logwang 7654fe3687 Merge pull request #551 from philberty/dev
When compiling with GCC we hit compilation error of taking address of packed member.
2020-10-15 23:57:27 +08:00
logwang 83438cffc0
Merge pull request #551 from philberty/dev
When compiling with GCC we hit compilation error of taking address of packed member.
2020-10-15 23:57:27 +08:00
Philip Herron f065aa325e When compiling with GCC we hit compilation error of taking address
of packed member.

This adds -Wno-address-of-packed-member to avoid this warning.
2020-10-15 14:58:21 +01:00
Philip Herron a1d3d0a7ad When compiling with GCC we hit compilation error of taking address
of packed member.

This adds -Wno-address-of-packed-member to avoid this warning.
2020-10-15 14:58:21 +01:00
fengbojiang 3a84cd1fec User APP can use AF_INET6/PF_INET6 directly whether call ff socket or linux API, such as inet_ntoa/inet_aton. 2020-09-03 01:35:22 +08:00
fengbojiang 8d21adc4b7 User APP can use AF_INET6/PF_INET6 directly whether call ff socket or linux API, such as inet_ntoa/inet_aton. 2020-09-03 01:35:22 +08:00
fengbojiang 1b5649a396 Add configuration options `symmetric_rss` to set whether to use symmetric RSS. 2020-08-30 00:55:08 +08:00
fengbojiang f41205e9f3 Add configuration options `symmetric_rss` to set whether to use symmetric RSS. 2020-08-30 00:55:08 +08:00
fengbojiang(姜凤波) 56101252f6 upgrade F-STACK_VERSION to 1.21. 2020-06-19 10:54:34 +08:00
fengbojiang(姜凤波) 591a17d568 upgrade F-STACK_VERSION to 1.21. 2020-06-19 10:54:34 +08:00
fengbojiang 46556365b1 Add defconfig that be igroned. 2020-06-18 17:29:41 +00:00
fengbojiang 6d7fe6ec72 Add defconfig that be igroned. 2020-06-18 17:29:41 +00:00
johnjiang 37a7c72f09 DPDK: upgrade to DPDK 19.11.2(LTS). 2020-06-18 16:55:50 +00:00