From d24809c6f1cbcd0b930e3e947d9c51d0e48d0aa8 Mon Sep 17 00:00:00 2001 From: jiangheng Date: Wed, 23 Jul 2025 17:08:51 +0800 Subject: [PATCH] ensure proper 64-bit aligment in quantize() --- bind.spec | 9 +++++- ...e-proper-64-bit-aligment-in-quantize.patch | 28 +++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 ensure-proper-64-bit-aligment-in-quantize.patch diff --git a/bind.spec b/bind.spec index 9f3ad25..e21b5e0 100644 --- a/bind.spec +++ b/bind.spec @@ -30,7 +30,7 @@ Summary: The Berkeley Internet Name Domain (BIND) DNS (Domain Name System) serv Name: bind License: MPLv2.0 Version: 9.16.23 -Release: 26 +Release: 27 Epoch: 32 Url: https://www.isc.org/downloads/bind/ # @@ -255,6 +255,7 @@ Patch6171:backport-CVE-2024-1737-records-test2.patch Patch6172:backport-fix-build-failure-for-bind-dyndb-ldap.patch Patch9000:bugfix-limit-numbers-of-test-threads.patch +Patch9001:ensure-proper-64-bit-aligment-in-quantize.patch %{?systemd_ordering} Requires: coreutils @@ -1262,6 +1263,12 @@ fi; %endif %changelog +* Wed Jul 23 2025 jiangheng - 32:9.16.23-27 +- Type:bugfix +- CVE:NA +- SUG:NA +- DESC:ensure proper 64-bit alignment in quantize() + * Tue May 20 2025 xinghe - 32:9.16.23-26 - Type:bugfix - CVE:NA diff --git a/ensure-proper-64-bit-aligment-in-quantize.patch b/ensure-proper-64-bit-aligment-in-quantize.patch new file mode 100644 index 0000000..3b8d3ac --- /dev/null +++ b/ensure-proper-64-bit-aligment-in-quantize.patch @@ -0,0 +1,28 @@ +From b27c9c596064dd1931e3cf193533c4d506b176c4 Mon Sep 17 00:00:00 2001 +From: jiangheng +Date: Wed, 23 Jul 2025 16:54:27 +0800 +Subject: [PATCH] ensure proper 64-bit alignment in quantize() + +Changed ALIGNMENT_SIZE from 8 to (size_t)8 to prevent potential +truncation when calculating alignment masks. The original implementation +could result in incorrect alignment when size is 64-bit due to implicit +32-bit integer operations with the mask. +--- + lib/isc/mem.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/isc/mem.c b/lib/isc/mem.c +index f84d300..541cf24 100644 +--- a/lib/isc/mem.c ++++ b/lib/isc/mem.c +@@ -58,7 +58,7 @@ LIBISC_EXTERNAL_DATA unsigned int isc_mem_defaultflags = ISC_MEMFLAG_DEFAULT; + + #define DEF_MAX_SIZE 1100 + #define DEF_MEM_TARGET 4096 +-#define ALIGNMENT_SIZE 8U /*%< must be a power of 2 */ ++#define ALIGNMENT_SIZE (size_t)8U /*%< must be a power of 2 */ + #define NUM_BASIC_BLOCKS 64 /*%< must be > 1 */ + #define TABLE_INCREMENT 1024 + #define DEBUG_TABLE_COUNT 512U +-- +2.33.0 -- Gitee