diff --git a/dist b/dist new file mode 100644 index 0000000000000000000000000000000000000000..9c0e36ec42a2d9bfefacb21ac6354c9ddd910533 --- /dev/null +++ b/dist @@ -0,0 +1 @@ +an8 diff --git a/openblas-CVE-2021-4048.patch b/openblas-CVE-2021-4048.patch new file mode 100644 index 0000000000000000000000000000000000000000..696c75b4c7c426a89659cdf9a456d52e0e77da7e --- /dev/null +++ b/openblas-CVE-2021-4048.patch @@ -0,0 +1,107 @@ +From 2be5ee3cca97a597f2ee2118808a2d5eacea050c Mon Sep 17 00:00:00 2001 +From: Martin Kroeker +Date: Fri, 1 Oct 2021 11:17:21 +0200 +Subject: [PATCH 1/4] Fix out of bounds read in ?llarv (Reference-LAPACK PR + 625) + +--- + lapack-netlib/SRC/clarrv.f | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lapack-netlib/SRC/clarrv.f b/lapack-netlib/SRC/clarrv.f +index a45f55ac..26a9febc 100644 +--- a/lapack-netlib/SRC/clarrv.f ++++ b/lapack-netlib/SRC/clarrv.f +@@ -351,7 +351,7 @@ + * + * Quick return if possible + * +- IF( N.LE.0 ) THEN ++ IF( (N.LE.0) .OR. (M.LE.0) ) THEN + RETURN + END IF + * +-- +2.34.1 + + +From fe497efa0510466fd93578aaf9da1ad8ed4edbe7 Mon Sep 17 00:00:00 2001 +From: Martin Kroeker +Date: Fri, 1 Oct 2021 11:18:20 +0200 +Subject: [PATCH 2/4] Fix out of bounds read in ?llarv (Reference-LAPACK PR + 625) + +--- + lapack-netlib/SRC/dlarrv.f | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lapack-netlib/SRC/dlarrv.f b/lapack-netlib/SRC/dlarrv.f +index 4a59a2bb..a1c6e9c9 100644 +--- a/lapack-netlib/SRC/dlarrv.f ++++ b/lapack-netlib/SRC/dlarrv.f +@@ -353,7 +353,7 @@ + * + * Quick return if possible + * +- IF( N.LE.0 ) THEN ++ IF( (N.LE.0).OR.(M.LE.0) ) THEN + RETURN + END IF + * +-- +2.34.1 + + +From ddb0ff5353637bb5f5ad060c9620e334c143e3d7 Mon Sep 17 00:00:00 2001 +From: Martin Kroeker +Date: Fri, 1 Oct 2021 11:19:07 +0200 +Subject: [PATCH 3/4] Fix out of bounds read in ?llarv (Reference-LAPACK PR + 625) + +--- + lapack-netlib/SRC/slarrv.f | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lapack-netlib/SRC/slarrv.f b/lapack-netlib/SRC/slarrv.f +index 04519fde..9448b2fd 100644 +--- a/lapack-netlib/SRC/slarrv.f ++++ b/lapack-netlib/SRC/slarrv.f +@@ -353,7 +353,7 @@ + * + * Quick return if possible + * +- IF( N.LE.0 ) THEN ++ IF( (N.LE.0).OR.(M.LE.0) ) THEN + RETURN + END IF + * +-- +2.34.1 + + +From 337b65133df174796794871b3988cd03426e6d41 Mon Sep 17 00:00:00 2001 +From: Martin Kroeker +Date: Fri, 1 Oct 2021 11:19:53 +0200 +Subject: [PATCH 4/4] Fix out of bounds read in ?llarv (Reference-LAPACK PR + 625) + +--- + lapack-netlib/SRC/zlarrv.f | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lapack-netlib/SRC/zlarrv.f b/lapack-netlib/SRC/zlarrv.f +index 23976dbe..8d10e3c2 100644 +--- a/lapack-netlib/SRC/zlarrv.f ++++ b/lapack-netlib/SRC/zlarrv.f +@@ -351,7 +351,7 @@ + * + * Quick return if possible + * +- IF( N.LE.0 ) THEN ++ IF( (N.LE.0).OR.(M.LE.0) ) THEN + RETURN + END IF + * +-- +2.34.1 + diff --git a/openblas.spec b/openblas.spec index 1eda872bcbd9f52477a11288a16cb929e5ed451b..f4c65524694e967d2473b5cb7ea5256c95b1a3db 100644 --- a/openblas.spec +++ b/openblas.spec @@ -1,11 +1,11 @@ -%define anolis_release .0.2 +%define anolis_release .0.1 %bcond_with system_lapack # Version of bundled lapack %global lapackver 3.9.1 %ifnarch loongarch64 # Use strip from gcc-toolset-11 -%global __strip "scl enable gcc-toolset-11 -- strip" +%global __strip "scl enable gcc-toolset-12 -- strip" %endif # DO NOT "CLEAN UP" OR MODIFY THIS SPEC FILE WITHOUT ASKING THE @@ -21,7 +21,7 @@ Name: openblas Version: 0.3.15 -Release: 3%{anolis_release}%{?dist} +Release: 6%{?dist} Summary: An optimized BLAS library based on GotoBLAS2 Group: Development/Libraries License: BSD @@ -42,14 +42,16 @@ Patch5: openblas-0.3.15-power-optimize.patch # Add optimization for LoongArch Patch6: openblas-0.3.15-opt-loongarch64.patch +Patch6: openblas-CVE-2021-4048.patch + %ifarch loongarch64 BuildRequires: gcc BuildRequires: gcc-gfortran %else BuildRequires: scl-utils -BuildRequires: gcc-toolset-11-gcc -BuildRequires: gcc-toolset-11-gcc-gfortran -BuildRequires: gcc-toolset-11-annobin-plugin-gcc +BuildRequires: gcc-toolset-12-gcc +BuildRequires: gcc-toolset-12-gcc-gfortran +BuildRequires: gcc-toolset-12-annobin-plugin-gcc %endif BuildRequires: perl-devel BuildRequires: multilib-rpm-config @@ -251,7 +253,8 @@ cd OpenBLAS-%{version} %patch3 -p1 -b .noopt %patch4 -p1 -b .asmflags %patch5 -p1 -b .power-optimize -%patch6 -p1 -b .opt-loongarch64 +%patch6 -p1 -b .cve-2021-4048 +%patch7 -p1 -b .opt-loongarch64 # Fix source permissions find -name \*.f -exec chmod 644 {} \; @@ -356,8 +359,8 @@ rm -rf netliblapack64 %build %ifnarch loongarch64 -# Enable gcc-toolset-11 -source scl_source enable gcc-toolset-11 +# Enable gcc-toolset-12 +source scl_source enable gcc-toolset-12 %endif %if !%{lapacke} @@ -393,7 +396,7 @@ TARGET="TARGET=POWER7 DYNAMIC_ARCH=1 DYNAMIC_OLDER=1" TARGET="TARGET=POWER8 DYNAMIC_ARCH=1 DYNAMIC_OLDER=1" %endif %ifarch aarch64 -TARGET="TARGET=ARMV8 DYNAMIC_ARCH=1 DYNAMIC_OLDER=1" +TARGET="TARGET=ARMV8 DYNAMIC_ARCH=0" %endif %ifarch s390x TARGET="TARGET=ZARCH_GENERIC DYNAMIC_ARCH=1 DYNAMIC_OLDER=1" @@ -455,13 +458,13 @@ make -C openmp64_ $TARGET USE_THREAD=1 USE_OPENMP=1 FC=gfortran CC=gcc COMMON_ %install %ifnarch loongarch64 -# Enable gcc-toolset-11 -source scl_source enable gcc-toolset-11 +# Enable gcc-toolset-12 +source scl_source enable gcc-toolset-12 %endif rm -rf %{buildroot} # Install serial library and headers -make -C serial USE_THREAD=0 PREFIX=%{buildroot} OPENBLAS_LIBRARY_DIR=%{buildroot}%{_libdir} OPENBLAS_INCLUDE_DIR=%{buildroot}%{_includedir}/%name OPENBLAS_BINARY_DIR=%{buildroot}%{_bindir} OPENBLAS_CMAKE_DIR=%{buildroot}%{_libdir}/cmake install +make -C serial USE_THREAD=0 DESTDIR=%{buildroot} OPENBLAS_LIBRARY_DIR=%{_libdir} OPENBLAS_INCLUDE_DIR=%{_includedir}/%name OPENBLAS_BINARY_DIR=%{_bindir} OPENBLAS_CMAKE_DIR=%{_libdir}/cmake install # Copy lapacke include files %if %{with system_lapack} && %{lapacke} @@ -477,6 +480,9 @@ suffix="" %ifarch armv7hl suffix="_armv7" %endif +%ifarch aarch64 +suffix="_armv8" +%endif %ifarch loongarch64 suffix="_loongsongeneric" %endif @@ -603,8 +609,6 @@ done # Get rid of generated CMake config rm -rf %{buildroot}%{_libdir}/cmake -# Get rid of generated pkgconfig -rm -rf %{buildroot}%{_libdir}/pkgconfig %post -p /sbin/ldconfig %postun -p /sbin/ldconfig @@ -676,6 +680,8 @@ rm -rf %{buildroot}%{_libdir}/pkgconfig %files devel %{_includedir}/%{name}/ +%{_libdir}/pkgconfig/ +%{_libdir}/pkgconfig/%{name}.pc %{_libdir}/lib%{name}.so %{_libdir}/lib%{name}o.so %{_libdir}/lib%{name}p.so @@ -705,11 +711,21 @@ rm -rf %{buildroot}%{_libdir}/pkgconfig %endif %changelog -* Thu Oct 20 2022 Liwei Ge - 0.3.15-3.0.2 +* Tue Jul 04 2023 Liwei Ge - 0.3.15-6.0.1 - Fix build on loongarch64 -* Fri Sep 30 2022 Liwei Ge - 0.3.15-3.0.1 -- Rebuild for loongarch +* Thu Feb 16 2023 Matej Mužila - 0.3.15-6 +- Include openblas.pc +- Resolves: #2115722 + +* Wed Feb 15 2023 Nikola Forró - 0.3.15-5 +- Disable dynamic CPU detection on aarch64 +- Use gcc-toolset-12 +- Resolves: #2170398 + +* Wed Jun 15 2022 Matej Mužila - 0.3.15-4 +- Fix out-of-bounds read in *larrv +- Resolves: CVE-2021-4048 * Fri Nov 12 2021 Nikola Forró - 0.3.15-3 - Fix missing header files in openblas-devel subpackage by enabling