From 591f5aee7138fbe07b7aaa00da60fd1038fad1bc Mon Sep 17 00:00:00 2001 From: renmingshuai Date: Mon, 31 May 2021 19:41:27 +0800 Subject: [PATCH] fix CVE-2021-25217 --- CVE-2021-25217.patch | 33 +++++++++++++++++++++++++++++++++ dhcp.spec | 11 +++++++++-- 2 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 CVE-2021-25217.patch diff --git a/CVE-2021-25217.patch b/CVE-2021-25217.patch new file mode 100644 index 0000000..680a9ea --- /dev/null +++ b/CVE-2021-25217.patch @@ -0,0 +1,33 @@ +diff --git a/common/parse.c b/common/parse.c +index 3329657..8772540 100644 +--- a/common/parse.c ++++ b/common/parse.c +@@ -3,7 +3,7 @@ + Common parser code for dhcpd and dhclient. */ + + /* +- * Copyright (c) 2004-2019 by Internet Systems Consortium, Inc. ("ISC") ++ * Copyright (c) 2004-2021 by Internet Systems Consortium, Inc. ("ISC") + * Copyright (c) 1995-2003 by Internet Software Consortium + * + * This Source Code Form is subject to the terms of the Mozilla Public +@@ -5613,13 +5613,14 @@ int parse_X (cfile, buf, max) + skip_to_semi (cfile); + return 0; + } +- convert_num (cfile, &buf [len], val, 16, 8); +- if (len++ > max) { ++ if (len >= max) { + parse_warn (cfile, + "hexadecimal constant too long."); + skip_to_semi (cfile); + return 0; + } ++ convert_num (cfile, &buf [len], val, 16, 8); ++ len++; + token = peek_token (&val, (unsigned *)0, cfile); + if (token == COLON) + token = next_token (&val, +-- +1.8.3.1 + diff --git a/dhcp.spec b/dhcp.spec index 5eb5f90..25a313e 100644 --- a/dhcp.spec +++ b/dhcp.spec @@ -3,7 +3,7 @@ Name: dhcp Version: 4.4.2 -Release: 5 +Release: 6 Summary: Dynamic host configuration protocol software #Please don't change the epoch on this package Epoch: 12 @@ -43,7 +43,7 @@ Patch22: 0022-dhclient-make-sure-link-local-address-is-ready-in-st.patch Patch23: 0023-option-97-pxe-client-id.patch Patch24: 0024-Detect-system-time-changes.patch Patch26: 0026-Add-dhclient-5-B-option-description.patch -Patch27: 0027-Add-missed-sd-notify-patch-to-manage-dhcpd-with-syst.patch +Patch27: 0027-Add-missed-sd-notify-patch-to-manage-dhcpd-with-syst.patch Patch28: bugfix-dhcp-4.2.5-check-dhclient-pid.patch Patch29: bugfix-reduce-getifaddr-calls.patch @@ -53,6 +53,7 @@ Patch31: dhcpd-coredump-infiniband.patch Patch32: bugfix-dhclient-check-if-pid-was-held.patch Patch33: bugfix-dhcp-64-bit-lease-parse.patch Patch34: dhcp-remove-bind.patch +Patch35: CVE-2021-25217.patch BuildRequires: gcc autoconf automake libtool openldap-devel krb5-devel libcap-ng-devel bind-export-devel BuildRequires: systemd systemd-devel @@ -287,6 +288,12 @@ exit 0 %{_mandir}/man3/omapi.3.gz %changelog +* Mon May 31 2021 renmingshuai - 4.4.2-6 +- Type:CVE +- ID:NA +- SUG:restart +- DESC:CVE-2021-25217 + * Sat Feb 20 2021 hanzhijun - 4.4.2-5 - Type:bugfix - ID:NA -- Gitee