Compare commits

...

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
fc39e07632
!17 Fix CVE-2022-47022
From: @wk333 
Reviewed-by: @caodongxia 
Signed-off-by: @caodongxia
2023-08-30 02:05:57 +00:00
wk333
37600dba39 Fix CVE-2022-47022 2023-08-30 09:41:14 +08:00
openeuler-ci-bot
ef9da401e8
!16 升级到上游社区最新版本2.9.1
From: @lyn1001 
Reviewed-by: @caodongxia 
Signed-off-by: @caodongxia
2023-04-13 02:02:00 +00:00
lyn1001
9f355c4994 Upgrade package to version 2.9.1 2023-04-13 09:19:50 +08:00
openeuler-ci-bot
ab9bc568d4
!11 Update to 2.7.1 stable
From: @young1c 
Reviewed-by: @small_leek 
Signed-off-by: @small_leek
2022-06-15 06:27:04 +00:00
Yicong Yang
1b32f6aba4 Update to 2.7.1 stable
Update the version to 2.7.1 stable, which includes the support of cluster
topology on Kunpeng 920.

Signed-off-by: Yicong Yang <young.yicong@outlook.com>
2022-06-05 20:31:01 +08:00
openeuler-ci-bot
e5d9f9b3e0
!10 License compliance rectification
From: @caodongxia 
Reviewed-by: @small_leek 
Signed-off-by: @small_leek
2022-05-10 13:06:21 +00:00
caodongxia
0896ffb9ed License compliance rectification 2022-05-09 18:16:47 +08:00
openeuler-ci-bot
8bed3c64c3 !9 [sync] PR-5: move %{_pkgdocdir} to help subpackage
From: @openeuler-sync-bot
Reviewed-by: @small_leek
Signed-off-by: @small_leek
2021-07-23 02:58:03 +00:00
shixuantong
1c0f8c99cc move %{_pkgdocdir} to help subpackage
(cherry picked from commit 9f77ef5952a961896919f34acfd83225551ac51c)
2021-07-23 10:20:13 +08:00
4 changed files with 101 additions and 9 deletions

72
CVE-2022-47022.patch Normal file
View File

@ -0,0 +1,72 @@
From eec84f84d4c4a7af6ed2c57ba95a9256e56e73b4 Mon Sep 17 00:00:00 2001
From: Brice Goglin <Brice.Goglin@inria.fr>
Date: Wed, 23 Aug 2023 19:52:47 +0200
Subject: [PATCH] linux: handle glibc cpuset allocation failures
Origin: https://github.com/open-mpi/hwloc/commit/eec84f84d4c4a7af6ed2c57ba95a9256e56e73b4
Closes #544
CVE-2022-47022
Signed-off-by: Brice Goglin <Brice.Goglin@inria.fr>
(cherry picked from commit ac1f8db9a0790d2bf153711ff4cbf6101f89aace)
---
hwloc/topology-linux.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/hwloc/topology-linux.c b/hwloc/topology-linux.c
index bfc5dc23f..cae4f84d1 100644
--- a/hwloc/topology-linux.c
+++ b/hwloc/topology-linux.c
@@ -877,6 +877,8 @@ hwloc_linux_set_tid_cpubind(hwloc_topology_t topology __hwloc_attribute_unused,
setsize = CPU_ALLOC_SIZE(last+1);
plinux_set = CPU_ALLOC(last+1);
+ if (!plinux_set)
+ return -1;
CPU_ZERO_S(setsize, plinux_set);
hwloc_bitmap_foreach_begin(cpu, hwloc_set)
@@ -957,7 +959,10 @@ hwloc_linux_find_kernel_nr_cpus(hwloc_topology_t topology)
while (1) {
cpu_set_t *set = CPU_ALLOC(nr_cpus);
size_t setsize = CPU_ALLOC_SIZE(nr_cpus);
- int err = sched_getaffinity(0, setsize, set); /* always works, unless setsize is too small */
+ int err;
+ if (!set)
+ return -1; /* caller will return an error, and we'll try again later */
+ err = sched_getaffinity(0, setsize, set); /* always works, unless setsize is too small */
CPU_FREE(set);
nr_cpus = setsize * 8; /* that's the value that was actually tested */
if (!err)
@@ -985,8 +990,12 @@ hwloc_linux_get_tid_cpubind(hwloc_topology_t topology __hwloc_attribute_unused,
/* find the kernel nr_cpus so as to use a large enough cpu_set size */
kernel_nr_cpus = hwloc_linux_find_kernel_nr_cpus(topology);
+ if (kernel_nr_cpus < 0)
+ return -1;
setsize = CPU_ALLOC_SIZE(kernel_nr_cpus);
plinux_set = CPU_ALLOC(kernel_nr_cpus);
+ if (!plinux_set)
+ return -1;
err = sched_getaffinity(tid, setsize, plinux_set);
@@ -1340,6 +1349,8 @@ hwloc_linux_set_thread_cpubind(hwloc_topology_t topology, pthread_t tid, hwloc_c
setsize = CPU_ALLOC_SIZE(last+1);
plinux_set = CPU_ALLOC(last+1);
+ if (!plinux_set)
+ return -1;
CPU_ZERO_S(setsize, plinux_set);
hwloc_bitmap_foreach_begin(cpu, hwloc_set)
@@ -1431,6 +1442,8 @@ hwloc_linux_get_thread_cpubind(hwloc_topology_t topology, pthread_t tid, hwloc_b
setsize = CPU_ALLOC_SIZE(last+1);
plinux_set = CPU_ALLOC(last+1);
+ if (!plinux_set)
+ return -1;
err = pthread_getaffinity_np(tid, setsize, plinux_set);
if (err) {

Binary file not shown.

BIN
hwloc-2.9.1.tar.bz2 Normal file

Binary file not shown.

View File

@ -1,10 +1,11 @@
Name: hwloc
Version: 1.11.9
Release: 3
Version: 2.9.1
Release: 2
Summary: Hardware locality utilities and libraries
License: BSD
License: BSD-3-Clause
URL: https://www.open-mpi.org/projects/hwloc/
Source0: https://download.open-mpi.org/release/%{name}/v1.11/%{name}-%{version}.tar.bz2
Source0: https://download.open-mpi.org/release/%{name}/v2.9/%{name}-%{version}.tar.bz2
Patch0: CVE-2022-47022.patch
BuildRequires: gcc-c++ cairo-devel libpciaccess-devel libtool-ltdl-devel libX11-devel libxml2-devel texlive-latex
BuildRequires: desktop-file-utils systemd texlive-makeindex ncurses-devel transfig doxygen
@ -64,7 +65,7 @@ rm %{buildroot}%{_datadir}/%{name}/hwloc-dump-hwdata.service
%endif
%check
LD_LIBRARY_PATH=$PWD/src/.libs make check
LD_LIBRARY_PATH=$PWD/hwloc/.libs make check
%ifarch x86_64
%post
@ -79,21 +80,23 @@ LD_LIBRARY_PATH=$PWD/src/.libs make check
%ldconfig_postun
%files
%dir %{_pkgdocdir}/
%{_pkgdocdir}/*[^c]
%{_bindir}/%{name}*
%{_bindir}/lstopo*
%dir %{_datadir}/%{name}
%{_datadir}/%{name}/%{name}.dtd
%{_datadir}/%{name}/%{name}2.dtd
%{_datadir}/%{name}/%{name}2-diff.dtd
%{_datadir}/%{name}/%{name}-valgrind.supp
%{_datadir}/%{name}/%{name}-ps.www
%{_datadir}/applications/lstopo.desktop
%{_datadir}/bash-completion/completions/hwloc
%ifarch x86_64
%{_sbindir}/hwloc-dump-hwdata
%{_unitdir}/hwloc-dump-hwdata.service
%endif
%dir %{_libdir}/%{name}
%{_libdir}/%{name}/hwloc*
%{_libdir}/libhwloc*so.5*
%{_libdir}/libhwloc*so.15*
%files devel
%{_libdir}/pkgconfig/*
@ -105,7 +108,24 @@ LD_LIBRARY_PATH=$PWD/src/.libs make check
%files help
%{_mandir}/man*/*
%dir %{_pkgdocdir}/
%{_pkgdocdir}/*[^c]
%changelog
* Thu Nov 15 2019 chenzhenyu <chenzhenyu13@huawei.com> - 1.11.9-3
* Wed Aug 30 2023 wangkai <13474090681@163.com> - 2.9.1-2
- Fix CVE-2022-47022
* Thu Apr 13 2023 liyanan <thistleslyn@163.com> - 2.9.1-1
- Update to 2.9.1
* Sun May 22 2022 Yicong Yang <young.yicong@outlook.com> - 2.7.1-1
- Update to 2.7.1 stable
* Mon May 9 2022 caodongxia <caodongxia@h-partners.com> - 1.11.9-5
- License compliance rectification
* Thu Jul 22 2021 shixuantong <shixuantong@huawei.com> - 1.11.9-4
- move %{_pkgdocdir} to help subpackage
* Fri Nov 15 2019 chenzhenyu <chenzhenyu13@huawei.com> - 1.11.9-3
- Package init