From a0aa57b9de0d6dffa5c428e5f106bded12efad69 Mon Sep 17 00:00:00 2001 From: jinag12138 Date: Tue, 25 Jan 2022 20:44:29 +0800 Subject: [PATCH] fix Undefine-shift in sldns_str2wire_hip_buf (cherry picked from commit 9c73b21a8bf141927233890f429879f301e316e2) --- ...fine-shift-in-sldns_str2wire_hip_buf.patch | 42 +++++++++++++++++++ unbound.spec | 14 +++++-- 2 files changed, 52 insertions(+), 4 deletions(-) create mode 100644 backport-Fix-610-Undefine-shift-in-sldns_str2wire_hip_buf.patch diff --git a/backport-Fix-610-Undefine-shift-in-sldns_str2wire_hip_buf.patch b/backport-Fix-610-Undefine-shift-in-sldns_str2wire_hip_buf.patch new file mode 100644 index 0000000..3864192 --- /dev/null +++ b/backport-Fix-610-Undefine-shift-in-sldns_str2wire_hip_buf.patch @@ -0,0 +1,42 @@ +From 12a1053dfa9f978d875402456c2c836140e9ad47 Mon Sep 17 00:00:00 2001 +From: "W.C.A. Wijngaards" +Date: Tue, 25 Jan 2022 08:57:49 +0100 +Subject: [PATCH] - Fix #610: Undefine-shift in sldns_str2wire_hip_buf. + +--- + sldns/str2wire.c | 4 +++- + sldns/str2wire.h | 2 +- + 2 files changed, 4 insertions(+), 2 deletions(-) + +diff --git a/sldns/str2wire.c b/sldns/str2wire.c +index 977cda2..bb7aacc 100644 +--- a/sldns/str2wire.c ++++ b/sldns/str2wire.c +@@ -25,8 +25,10 @@ + #include + #endif + ++/** bits for the offset */ ++#define RET_OFFSET_MASK (((unsigned)(~LDNS_WIREPARSE_MASK))>>LDNS_WIREPARSE_SHIFT) + /** return an error */ +-#define RET_ERR(e, off) ((int)((e)|((off)<>LDNS_WIREPARSE_SHIFT) ++#define LDNS_WIREPARSE_OFFSET(e) ((((unsigned)(e))&~LDNS_WIREPARSE_MASK)>>LDNS_WIREPARSE_SHIFT) + /* use lookuptable to get error string, sldns_wireparse_errors */ + #define LDNS_WIREPARSE_ERR_OK 0 + #define LDNS_WIREPARSE_ERR_GENERAL 342 +-- +1.8.3.1 + diff --git a/unbound.spec b/unbound.spec index 2dbcbd8..4e3751e 100644 --- a/unbound.spec +++ b/unbound.spec @@ -23,6 +23,8 @@ Source13: unbound-anchor.service Patch0: CVE-2020-28935.patch +Patch6000: backport-Fix-610-Undefine-shift-in-sldns_str2wire_hip_buf.patch + BuildRequires: make flex swig pkgconfig systemd python-unversioned-command BuildRequires: libevent-devel expat-devel openssl-devel python3-devel BuildRequires: unbound-libs @@ -68,12 +70,10 @@ Summary: Man pages for unbound Package help includes includes man pages for unbound. %prep - -%setup -qcn %{name}-%{version} +%autosetup -c -N -n %{name}-%{version} pushd %{name}-%{version} - -%patch0 -p1 +%autopatch -p1 cp -pr doc pythonmod libunbound ../ popd @@ -229,6 +229,12 @@ popd %{_mandir}/man* %changelog +* Tue Jan 25 2022 jiangheng - 1.11.0-3 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:fix Undefine-shift in sldns_str2wire_hip_buf + * Tue Feb 23 2021 zhouyihang - 1.11.0-2 - Type:CVE - ID:NA -- Gitee