diff --git a/avoid-array-index-out-of-bounds.patch b/avoid-array-index-out-of-bounds.patch new file mode 100644 index 0000000000000000000000000000000000000000..8c1040456198481e5f50171d747e1a27b602d1d6 --- /dev/null +++ b/avoid-array-index-out-of-bounds.patch @@ -0,0 +1,25 @@ +From ade9632aecbe1ed2d9a9220edcd42f56b9ad0eea Mon Sep 17 00:00:00 2001 +From: luochenglcs +Date: Tue, 30 Aug 2022 15:47:39 +0800 +Subject: [PATCH] avoid array index out-of-bounds + +--- + numad.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/numad.c b/numad.c +index 0721af4..58a198c 100644 +--- a/numad.c ++++ b/numad.c +@@ -1983,6 +1983,8 @@ id_list_p pick_numa_nodes(int pid, int cpus, int mbs, int assume_enough_cpus) { + // Next line optional, since we will not look at that node again + tmp_node[index[best_node_ix]].magnitude = combined_value_of_weighted_resources(0, mbs, cpus, tmp_node[index[best_node_ix]].MBs_free, tmp_node[index[best_node_ix]].CPUs_free); + best_node_ix += 1; ++ if (best_node_ix >= num_nodes) ++ break; + } + // For existing processes, calculate the non-local memory percent to see if + // process is already in the right place. +-- +1.8.3.1 + diff --git a/numad.spec b/numad.spec index b488eb90f471f1da27dedc109f13a33c238e1d78..747aae9f776827df8df0af288e90fe2f3ecb9645 100644 --- a/numad.spec +++ b/numad.spec @@ -1,6 +1,6 @@ Name: numad Version: 0.5 -Release: 32 +Release: 33 Summary: NUMA user daemon License: LGPLv2 URL: https://pagure.io/numad @@ -13,6 +13,7 @@ Requires(post): systemd-units Requires(preun): systemd-units Patch0: numad-0.5git-m-option.patch +Patch1: avoid-array-index-out-of-bounds.patch %description Numad is a deamon that monitors NUMA topology and usage and distributes @@ -56,6 +57,9 @@ install -m 644 numad.logrotate %{buildroot}%{_sysconfdir}/logrotate.d/%{name} %systemd_postun numad.service %changelog +* Thu Sep 1 2022 Chunsheng Luo - 0.5-33 +- Fix array index out-of-bounds + * Thu Nov 12 2020 xinghe - 0.5-32 - Add help for Recommends