From 94b1e7893c057f6492d1874cfd050aed81dc3f29 Mon Sep 17 00:00:00 2001 From: compile_success <980965867@qq.com> Date: Fri, 23 Sep 2022 02:37:55 +0000 Subject: [PATCH] add reinit-ok args --- ...-to-resolv-duplicated-initialization.patch | 63 +++++++++++++++++++ dpdk.spec | 7 ++- 2 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 0019-add-reinit-ok-args-to-resolv-duplicated-initialization.patch diff --git a/0019-add-reinit-ok-args-to-resolv-duplicated-initialization.patch b/0019-add-reinit-ok-args-to-resolv-duplicated-initialization.patch new file mode 100644 index 0000000..9a37107 --- /dev/null +++ b/0019-add-reinit-ok-args-to-resolv-duplicated-initialization.patch @@ -0,0 +1,63 @@ +From 5a4bd95ff4d29523788df2ba5e569514b37fee37 Mon Sep 17 00:00:00 2001 +From: compile_success <980965867@qq.com> +Date: Fri, 23 Sep 2022 13:33:33 +0000 +Subject: [PATCH 2/2] add reinit-ok args to resolv duplicated initialization + +--- + lib/librte_eal/common/eal_common_options.c | 1 + + lib/librte_eal/common/eal_options.h | 4 +- + lib/librte_eal/linux/eal/eal.c | 8 ++++++++ + 3 files changed, 10 insertions(+), 1 deletion(-) + +diff -Nur dpdk-19.11/lib/librte_eal/common/eal_common_options.c dpdk-19.11-bak/lib/librte_eal/common/eal_common_options.c +--- dpdk-19.11/lib/librte_eal/common/eal_common_options.c 2022-09-23 13:36:11.164000000 +0000 ++++ dpdk-19.11-bak/lib/librte_eal/common/eal_common_options.c 2022-09-23 13:37:52.908000000 +0000 +@@ -83,6 +83,7 @@ + {OPT_SINGLE_FILE_SEGMENTS, 0, NULL, OPT_SINGLE_FILE_SEGMENTS_NUM}, + {OPT_MATCH_ALLOCATIONS, 0, NULL, OPT_MATCH_ALLOCATIONS_NUM}, + {OPT_MAP_PERFECT, 0, NULL, OPT_MAP_PERFECT_NUM }, ++ {OPT_REINIT_OK, 0, NULL, OPT_REINIT_OK_NUM }, + {0, 0, NULL, 0 } + }; + +diff -Nur dpdk-19.11/lib/librte_eal/common/eal_options.h dpdk-19.11-bak/lib/librte_eal/common/eal_options.h +--- dpdk-19.11/lib/librte_eal/common/eal_options.h 2022-09-23 13:36:11.164000000 +0000 ++++ dpdk-19.11-bak/lib/librte_eal/common/eal_options.h 2022-09-23 13:37:52.908000000 +0000 +@@ -73,7 +73,9 @@ + OPT_PRI_AND_SEC_NUM, + #define OPT_MAP_PERFECT "map-perfect" + OPT_MAP_PERFECT_NUM, +- OPT_LONG_MAX_NUM ++ OPT_LONG_MAX_NUM, ++#define OPT_REINIT_OK "reinit_ok" ++ OPT_REINIT_OK_NUM + }; + + extern const char eal_short_options[]; +diff -Nur dpdk-19.11/lib/librte_eal/linux/eal/eal.c dpdk-19.11-bak/lib/librte_eal/linux/eal/eal.c +--- dpdk-19.11/lib/librte_eal/linux/eal/eal.c 2022-09-23 13:36:11.204000000 +0000 ++++ dpdk-19.11-bak/lib/librte_eal/linux/eal/eal.c 2022-09-23 13:37:52.912000000 +0000 +@@ -1086,6 +1086,7 @@ + char cpuset[RTE_CPU_AFFINITY_STR_LEN]; + char thread_name[RTE_MAX_THREAD_NAME_LEN]; + bool phys_addrs; ++ static int reinit_flag = 0; + + /* checks if the machine is adequate */ + if (!rte_cpu_is_supported()) { +@@ -1093,8 +1094,15 @@ + rte_errno = ENOTSUP; + return -1; + } ++ if (argc > 1 &&!strncmp(argv[1], "reinit-ok", strlen("reinit-ok") + 1)){ ++ reinit_flag = 1; ++ } + + if (!rte_atomic32_test_and_set(&run_once)) { ++ if(reinit_flag){ ++ return 0; ++ } ++ + rte_eal_init_alert("already called initialization."); + rte_errno = EALREADY; + return -1; diff --git a/dpdk.spec b/dpdk.spec index 315762c..b22ea62 100644 --- a/dpdk.spec +++ b/dpdk.spec @@ -1,6 +1,6 @@ Name: dpdk Version: 19.11 -Release: 20 +Release: 21 Packager: packaging@6wind.com URL: http://dpdk.org %global source_version 19.11 @@ -49,6 +49,8 @@ Patch6001: backport-0001-CVE-2022-2132.patch Patch6002: backport-0002-CVE-2022-2131.patch Patch6003: backport-CVE-2022-28199.patch +Patch37: 0019-add-reinit-ok-args-to-resolv-duplicated-initialization.patch + Summary: Data Plane Development Kit core Group: System Environment/Libraries License: BSD and LGPLv2 and GPLv2 @@ -200,6 +202,9 @@ strip -g $RPM_BUILD_ROOT/lib/modules/${namer}/extra/dpdk/rte_kni.ko /usr/sbin/depmod %changelog +* Fri Sep 23 2022 zhujh - 19.11-21 +- add reinit-ok args + * Fri Sep 9 2022 jiangheng - 19.11-20 - fix CVE-2022-28199 -- Gitee