diff --git a/add-a-test-case-to-parse-code93-in-option_unittest.patch b/add-a-test-case-to-parse-code93-in-option_unittest.patch index 3070344c2a671b0b7a344b29161232a4b12e5ee9..0c57fea49df62b5e8b53badca12ed46ab80097e9 100644 --- a/add-a-test-case-to-parse-code93-in-option_unittest.patch +++ b/add-a-test-case-to-parse-code93-in-option_unittest.patch @@ -8,7 +8,7 @@ Subject: [PATCH] add a test case to parse code93 in option_unittest 1 file changed, 71 insertions(+) diff --git a/common/tests/option_unittest.c b/common/tests/option_unittest.c -index 600ebe6..688762d 100644 +index 963b566..891cc93 100644 --- a/common/tests/option_unittest.c +++ b/common/tests/option_unittest.c @@ -213,6 +213,76 @@ ATF_TC_BODY(parse_X, tc) @@ -85,17 +85,17 @@ index 600ebe6..688762d 100644 + } +} + - /* This macro defines main() method that will call specified - test cases. tp and simple_test_case names can be whatever you want - as long as it is a valid variable identifier. */ -@@ -221,6 +291,7 @@ ATF_TP_ADD_TCS(tp) + ATF_TC(add_option_ref_cnt); + + ATF_TC_HEAD(add_option_ref_cnt, tc) +@@ -274,6 +344,7 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, option_refcnt); ATF_TP_ADD_TC(tp, pretty_print_option); ATF_TP_ADD_TC(tp, parse_X); + ATF_TP_ADD_TC(tp, parse_code93_option); + ATF_TP_ADD_TC(tp, add_option_ref_cnt); return (atf_no_error()); - } -- -2.23.0 +2.43.0 diff --git a/backport-Fix-CVE-2022-2928.patch b/backport-Fix-CVE-2022-2928.patch deleted file mode 100644 index ab0961dc0bf2e94810d349774388f6ffd6e2266f..0000000000000000000000000000000000000000 --- a/backport-Fix-CVE-2022-2928.patch +++ /dev/null @@ -1,114 +0,0 @@ -Conflict:NA -Reference:https://downloads.isc.org/isc/dhcp/4.4.3-P1/patches/CVE-2022-2928.4-4-3.diff ---- - common/options.c | 7 +++++ - common/tests/option_unittest.c | 54 ++++++++++++++++++++++++++++++++++ - 2 files changed, 61 insertions(+) - -diff --git a/common/options.c b/common/options.c -index 4e26094..8e5dfb1 100644 ---- a/common/options.c -+++ b/common/options.c -@@ -4499,6 +4499,8 @@ add_option(struct option_state *options, - if (!option_cache_allocate(&oc, MDL)) { - log_error("No memory for option cache adding %s (option %d).", - option->name, option_num); -+ /* Get rid of reference created during hash lookup. */ -+ option_dereference(&option, MDL); - return 0; - } - -@@ -4510,6 +4512,8 @@ add_option(struct option_state *options, - MDL)) { - log_error("No memory for constant data adding %s (option %d).", - option->name, option_num); -+ /* Get rid of reference created during hash lookup. */ -+ option_dereference(&option, MDL); - option_cache_dereference(&oc, MDL); - return 0; - } -@@ -4518,6 +4522,9 @@ add_option(struct option_state *options, - save_option(&dhcp_universe, options, oc); - option_cache_dereference(&oc, MDL); - -+ /* Get rid of reference created during hash lookup. */ -+ option_dereference(&option, MDL); -+ - return 1; - } - -diff --git a/common/tests/option_unittest.c b/common/tests/option_unittest.c -index 688762d..afd041c 100644 ---- a/common/tests/option_unittest.c -+++ b/common/tests/option_unittest.c -@@ -283,6 +283,59 @@ ATF_TC_BODY(parse_code93_option, tc) - } - } - -+ATF_TC(add_option_ref_cnt); -+ -+ATF_TC_HEAD(add_option_ref_cnt, tc) -+{ -+ atf_tc_set_md_var(tc, "descr", -+ "Verify add_option() does not leak option ref counts."); -+} -+ -+ATF_TC_BODY(add_option_ref_cnt, tc) -+{ -+ struct option_state *options = NULL; -+ struct option *option = NULL; -+ unsigned int cid_code = DHO_DHCP_CLIENT_IDENTIFIER; -+ char *cid_str = "1234"; -+ int refcnt_before = 0; -+ -+ // Look up the option we're going to add. -+ initialize_common_option_spaces(); -+ if (!option_code_hash_lookup(&option, dhcp_universe.code_hash, -+ &cid_code, 0, MDL)) { -+ atf_tc_fail("cannot find option definition?"); -+ } -+ -+ // Get the option's reference count before we call add_options. -+ refcnt_before = option->refcnt; -+ -+ // Allocate a option_state to which to add an option. -+ if (!option_state_allocate(&options, MDL)) { -+ atf_tc_fail("cannot allocat options state"); -+ } -+ -+ // Call add_option() to add the option to the option state. -+ if (!add_option(options, cid_code, cid_str, strlen(cid_str))) { -+ atf_tc_fail("add_option returned 0"); -+ } -+ -+ // Verify that calling add_option() only adds 1 to the option ref count. -+ if (option->refcnt != (refcnt_before + 1)) { -+ atf_tc_fail("after add_option(), count is wrong, before %d, after: %d", -+ refcnt_before, option->refcnt); -+ } -+ -+ // Derefrence the option_state, this should reduce the ref count to -+ // it's starting value. -+ option_state_dereference(&options, MDL); -+ -+ // Verify that dereferencing option_state restores option ref count. -+ if (option->refcnt != refcnt_before) { -+ atf_tc_fail("after state deref, count is wrong, before %d, after: %d", -+ refcnt_before, option->refcnt); -+ } -+} -+ - /* This macro defines main() method that will call specified - test cases. tp and simple_test_case names can be whatever you want - as long as it is a valid variable identifier. */ -@@ -292,6 +345,7 @@ ATF_TP_ADD_TCS(tp) - ATF_TP_ADD_TC(tp, pretty_print_option); - ATF_TP_ADD_TC(tp, parse_X); - ATF_TP_ADD_TC(tp, parse_code93_option); -+ ATF_TP_ADD_TC(tp, add_option_ref_cnt); - - return (atf_no_error()); - } --- -2.23.0 - diff --git a/backport-Fix-CVE-2022-2929.patch b/backport-Fix-CVE-2022-2929.patch deleted file mode 100644 index c657641bffb07f5b65eef2bb1bdee3d594446796..0000000000000000000000000000000000000000 --- a/backport-Fix-CVE-2022-2929.patch +++ /dev/null @@ -1,34 +0,0 @@ -Conflict:NA -Reference:https://downloads.isc.org/isc/dhcp/4.4.3-P1/patches/CVE-2022-2929.4-4-3.diff ---- - common/options.c | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/common/options.c b/common/options.c -index 40238f7..11b1961 100644 ---- a/common/options.c -+++ b/common/options.c -@@ -454,16 +454,16 @@ int fqdn_universe_decode (struct option_state *options, - while (s < &bp -> data[0] + length + 2) { - len = *s; - if (len > 63) { -- log_info ("fancy bits in fqdn option"); -- return 0; -+ log_info ("label length exceeds 63 in fqdn option"); -+ goto bad; - } - if (len == 0) { - terminated = 1; - break; - } - if (s + len > &bp -> data [0] + length + 3) { -- log_info ("fqdn tag longer than buffer"); -- return 0; -+ log_info ("fqdn label longer than buffer"); -+ goto bad; - } - - if (first_len == 0) { --- -2.27.0 - diff --git a/dhcp-4.4.3.tar.gz b/dhcp-4.4.3.tar.gz index e4d59147133ff1acfc16322a7143f4bf3a7a7636..7c1d79180a869754d5ad21159f06d808d0beae69 100644 Binary files a/dhcp-4.4.3.tar.gz and b/dhcp-4.4.3.tar.gz differ diff --git a/dhcp.spec b/dhcp.spec index 8ae219064bcdfe6aa7a4687eca977451e816b1e5..29cfc16474c94cf98e5a7bbdf7ff1e780545b791 100644 --- a/dhcp.spec +++ b/dhcp.spec @@ -3,13 +3,13 @@ Name: dhcp Version: 4.4.3 -Release: 11 +Release: 12 Summary: Dynamic host configuration protocol software #Please don't change the epoch on this package Epoch: 12 License: ISC -URL: https://www.isc.org/dhcp/ -Source0: http://ftp.isc.org/isc/dhcp/%{version}/dhcp-%{version}.tar.gz +URL: https://gitee.com/openeuler/dhcp +Source0: https://gitee.com/openeuler/dhcp/archive/refs/tags/%{version}.tar.gz Source1: dhclient-script Source2: README.dhclient.d Source3: 11-dhclient @@ -54,8 +54,6 @@ Patch34: fix-coredump-when-client-active-is-NULL.patch Patch35: feature-lease-time-config-ipv6.patch Patch36: add-a-test-case-to-parse-code93-in-option_unittest.patch Patch38: backport-Fix-CVE-2021-25220.patch -Patch39: backport-Fix-CVE-2022-2928.patch -Patch40: backport-Fix-CVE-2022-2929.patch Patch41: Revert-correcting-the-logic-in-dhclient.patch Patch42: backport-CVE-2022-2795.patch Patch43: backport-CVE-2022-38177.patch @@ -319,6 +317,12 @@ exit 0 %{_mandir}/man3/omapi.3.gz %changelog +* Tue Dec 02 2025 luoguocui - 12:4.4.3-12 +- Type:bugfix +- ID:NA +- SUG:restart +- DESC:Switch upstream source to openeuler + * Mon Aug 04 2025 Liu Qingtao -12:4.4.3-11 - Ignore Wincompatible-pointer-types error when compiling with gcc-14.3