From 6ae145733c760b9bbb00e79d39e97e986e38092a Mon Sep 17 00:00:00 2001 From: renmingshuai Date: Tue, 1 Jun 2021 09:47:56 +0800 Subject: [PATCH] fix CVE-2021-25217 --- CVE-2021-25217.patch | 33 +++++++++++++++++++++++++++++++++ dhcp.spec | 9 ++++++++- 2 files changed, 41 insertions(+), 1 deletion(-) 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 6cf1895..adc58de 100644 --- a/dhcp.spec +++ b/dhcp.spec @@ -3,7 +3,7 @@ Name: dhcp Version: 4.4.2 -Release: 4 +Release: 5 Summary: Dynamic host configuration protocol software #Please don't change the epoch on this package Epoch: 12 @@ -54,6 +54,7 @@ Patch31: dhcpd-coredump-infiniband.patch Patch32: bugfix-dhclient-check-if-pid-was-held.patch Patch33: bugfix-error-message-display.patch Patch34: bugfix-dhcp-64-bit-lease-parse.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 @@ -293,6 +294,12 @@ exit 0 %{_mandir}/man3/omapi.3.gz %changelog +* Tue Jun 1 2021 renmingshuai - 4.4.2-5 +- Type:bugfix +- ID:NA +- SUG:restart +- DESC:fix CVE-2021-25217 + * Tue Dec 29 2020 quanhongfei - 4.4.2-4 - Type:bugfix - ID:NA -- Gitee