Open
update to 5.4.2.1 #51
xu_pingAdd on 7 days ago
update to 5.4.2.1 #51
Open
Total: 5 files changed+261-530
Binary files do not support preview
Binary files do not support preview
| @@ -1,5 +1,5 @@ | |||
| 1 | Name: hyperscan | 1 | Name: hyperscan |
| 2 | -Version: 5.4.2 | 2 | +Version: 5.4.2.1 |
| 3 | Release: 1 | 3 | Release: 1 |
| 4 | Summary: High-performance regular expression matching library | 4 | Summary: High-performance regular expression matching library |
| 5 | 5 | ||
| @@ -9,6 +9,9 @@ Source0: https://github.com/intel/%{name}/archive/v%{version}.tar.gz#/%{name}-%{ | |||
| 9 | 9 | ||
| 10 | Patch0: hyperscan-aarch64-support.patch | 10 | Patch0: hyperscan-aarch64-support.patch |
| 11 | Patch1: Fix-hyperscan-gcc10.patch | 11 | Patch1: Fix-hyperscan-gcc10.patch |
| 12 | +%if "%{?toolchain}" == "clang" | ||
| 13 | +Patch2: support-clang-build.patch | ||
| 14 | +%endif | ||
| 12 | 15 | ||
| 13 | BuildRequires: gcc-c++ | 16 | BuildRequires: gcc-c++ |
| 14 | BuildRequires: boost-devel | 17 | BuildRequires: boost-devel |
| @@ -18,6 +21,7 @@ BuildRequires: python3 | |||
| 18 | BuildRequires: ragel | 21 | BuildRequires: ragel |
| 19 | BuildRequires: sqlite-devel >= 3.0 | 22 | BuildRequires: sqlite-devel >= 3.0 |
| 20 | BuildRequires: libpcap-devel | 23 | BuildRequires: libpcap-devel |
| 24 | +BuildRequires: openssl-devel | ||
| 21 | 25 | ||
| 22 | %description | 26 | %description |
| 23 | Hyperscan is a high-performance multiple regex matching library. It | 27 | Hyperscan is a high-performance multiple regex matching library. It |
| @@ -52,14 +56,12 @@ needed for developing Hyperscan applications. | |||
| 52 | 56 | ||
| 53 | %prep | 57 | %prep |
| 54 | %setup -q -n %{name}-%{version} | 58 | %setup -q -n %{name}-%{version} |
| 55 | -cd %{_builddir}/%{name}-%{version} | ||
| 56 | -mv src/util/simd_utils.h src/util/simd_x86.h | ||
| 57 | -sed -i 's/SIMD_UTILS/SIMD_X86/' src/util/simd_x86.h | ||
| 58 | sed -i 's/_mm_set_epi32/set32x4/' src/util/state_compress.c | 59 | sed -i 's/_mm_set_epi32/set32x4/' src/util/state_compress.c |
| 59 | sed -i 's/_mm_set_epi64x/set64x2/' src/util/state_compress.c | 60 | sed -i 's/_mm_set_epi64x/set64x2/' src/util/state_compress.c |
| 60 | sed -i 's/_mm_srli_si128/rshiftbyte_m128/' src/util/state_compress.c | 61 | sed -i 's/_mm_srli_si128/rshiftbyte_m128/' src/util/state_compress.c |
| 61 | -cd - | ||
| 62 | %autopatch -p1 | 62 | %autopatch -p1 |
| 63 | +# glibc in 22.03-LTS-SP4 does not expose MAP_ANONYMOUS to -std=c99 builds | ||
| 64 | +sed -i '1i #define _GNU_SOURCE' src/db_protect.c | ||
| 63 | 65 | ||
| 64 | %build | 66 | %build |
| 65 | %cmake -DBUILD_SHARED_LIBS:BOOL=ON -DBUILD_STATIC_AND_SHARED:BOOL=OFF . | 67 | %cmake -DBUILD_SHARED_LIBS:BOOL=ON -DBUILD_STATIC_AND_SHARED:BOOL=OFF . |
| @@ -85,6 +87,19 @@ cd - | |||
| 85 | %{_includedir}/hs/ | 87 | %{_includedir}/hs/ |
| 86 | 88 | ||
| 87 | %changelog | 89 | %changelog |
| 90 | +* Fri Nov 20 2026 xu_ping <707078654@qq.com> - 5.4.2.1-1 | ||
| 91 | +- Update to 5.4.2.1, which fixes INTEL-SA-01511 (CVE-2026-34489, CVE-2026-40216, | ||
| 92 | + CVE-2026-40424, CVE-2026-40694, CVE-2026-63540, CVE-2026-28730, CVE-2026-33094, | ||
| 93 | + CVE-2026-34017) | ||
| 94 | +- Sync the clang toolchain support from openEuler-24.03-LTS-Next | ||
| 95 | + (support-clang-build.patch, applied only for the clang toolchain) | ||
| 96 | +- Rebase hyperscan-aarch64-support.patch for 5.4.2.1: crc32.c was removed upstream | ||
| 97 | + (DB HMAC moved to hs_db_hmac_key.h), simd_x86.h was merged into simd_utils.h | ||
| 98 | +- Add openssl-devel BuildRequires, upstream CMakeLists requires OpenSSL for db HMAC | ||
| 99 | +- Define _GNU_SOURCE in src/db_protect.c: glibc of 22.03-LTS-SP4 does not expose | ||
| 100 | + MAP_ANONYMOUS when compiling with -std=c99 (build fails on db_protect.c) | ||
| 101 | +- Drop the simd_utils.h -> simd_x86.h rename and SIMD_UTILS sed workaround, which | ||
| 102 | + is no longer applicable to 5.4.2.1 | ||
| 88 | * Fri Sep 01 2023 wangkai <13474090681@163.com> - 5.4.2-1 | 103 | * Fri Sep 01 2023 wangkai <13474090681@163.com> - 5.4.2-1 |
| 89 | - Update to 5.4.2 for fix CVE-2023-28711 | 104 | - Update to 5.4.2 for fix CVE-2023-28711 |
| 90 | 105 | ||
| @@ -0,0 +1,111 @@ | |||
| 1 | +From 34f04fb1e5a0c305463016d99ca47b2ed52ff472 Mon Sep 17 00:00:00 2001 | ||
| 2 | +From: luofeng 00425382 <luofeng13@huawei.com> | ||
| 3 | +Date: Sat, 9 Sep 2023 16:55:00 +0800 | ||
| 4 | +Subject: [PATCH] support clang build | ||
| 5 | + | ||
| 6 | +--- | ||
| 7 | + src/util/simd_arm.h | 26 ++++++++++++++++---------- | ||
| 8 | + 1 file changed, 16 insertions(+), 10 deletions(-) | ||
| 9 | + | ||
| 10 | +diff --git a/src/util/simd_arm.h b/src/util/simd_arm.h | ||
| 11 | +index cce119f..feaf504 100644 | ||
| 12 | +--- a/src/util/simd_arm.h | ||
| 13 | ++++ b/src/util/simd_arm.h | ||
| 14 | +@@ -82,6 +82,12 @@ vmvnq_u64(uint64x2_t a) { | ||
| 15 | + #pragma GCC diagnostic push | ||
| 16 | + #pragma GCC diagnostic ignored "-Wshadow" | ||
| 17 | + | ||
| 18 | ++#define VSHLQ_N_S64(a0, a1) vshlq_n_s64(a0, a1) | ||
| 19 | ++#define VSHRQ_N_U64(a0, a1) vshrq_n_u64(a0, a1) | ||
| 20 | ++#define VEXTQ_S8(a0, a1, a2) vextq_s8(a0, a1, a2) | ||
| 21 | ++#define VGETQ_LANE_S32(a0, a1) vgetq_lane_s32(a0, a1) | ||
| 22 | ++#define VGETQ_LANE_S64(a0, a1) vgetq_lane_s64(a0, a1) | ||
| 23 | ++ | ||
| 24 | + static really_inline m128 ones128(void) { | ||
| 25 | + m128 result; | ||
| 26 | + result.vect_s32 = vdupq_n_s32(0xFFFFFFFF); | ||
| 27 | +@@ -130,7 +136,7 @@ static really_inline u32 diffrich64_128(m128 a, m128 b) { | ||
| 28 | + static really_really_inline m128 lshift64_m128(m128 a, unsigned b) { | ||
| 29 | + assert(b <= 63); | ||
| 30 | + m128 result; | ||
| 31 | +- result.vect_s64 = vshlq_n_s64(a.vect_s64, b); | ||
| 32 | ++ result.vect_s64 = VSHLQ_N_S64(a.vect_s64, b); | ||
| 33 | + return result; | ||
| 34 | + } | ||
| 35 | + | ||
| 36 | +@@ -140,7 +146,7 @@ static really_really_inline m128 rshift64_m128(m128 a, int imm8) { | ||
| 37 | + return a; | ||
| 38 | + } | ||
| 39 | + m128 result; | ||
| 40 | +- result.vect_u64 = vshrq_n_u64(a.vect_u64, imm8); | ||
| 41 | ++ result.vect_u64 = VSHRQ_N_U64(a.vect_u64, imm8); | ||
| 42 | + return result; | ||
| 43 | + } | ||
| 44 | + | ||
| 45 | +@@ -163,7 +169,7 @@ static really_really_inline u32 movemask128(m128 a) { | ||
| 46 | + static really_really_inline m128 rshiftbyte_m128(m128 a, int imm8) { | ||
| 47 | + assert(imm8 >= 0 && imm8 <= 15); | ||
| 48 | + m128 result; | ||
| 49 | +- result.vect_s8 = vextq_s8(a.vect_s8, vdupq_n_s8(0), imm8); | ||
| 50 | ++ result.vect_s8 = VEXTQ_S8(a.vect_s8, vdupq_n_s8(0), imm8); | ||
| 51 | + return result; | ||
| 52 | + } | ||
| 53 | + | ||
| 54 | +@@ -173,7 +179,7 @@ static really_really_inline m128 lshiftbyte_m128(m128 a, int imm8) { | ||
| 55 | + if (unlikely(imm8 == 0)) { | ||
| 56 | + return a; | ||
| 57 | + } | ||
| 58 | +- result.vect_s8 = vextq_s8(vdupq_n_s8(0), a.vect_s8, (16 - imm8)); | ||
| 59 | ++ result.vect_s8 = VEXTQ_S8(vdupq_n_s8(0), a.vect_s8, (16 - imm8)); | ||
| 60 | + return result; | ||
| 61 | + } | ||
| 62 | + | ||
| 63 | +@@ -219,13 +225,13 @@ static really_inline m128 load_m128_from_u64a(const u64a *p) { | ||
| 64 | + /*The x86 platform does not perform the lower 2 bit operation. | ||
| 65 | + If the value of imm exceeds 2 bit, a compilation error occurs.*/ | ||
| 66 | + static really_inline u32 extract32from128(m128 a, int imm) { | ||
| 67 | +- return vgetq_lane_s32(a.vect_s32, imm & 0x0003); | ||
| 68 | ++ return VGETQ_LANE_S32(a.vect_s32, imm & 0x0003); | ||
| 69 | + } | ||
| 70 | + | ||
| 71 | + /*The x86 platform does not perform the lower 1 bit operation. | ||
| 72 | + If the value of imm exceeds 1 bit, a compilation error occurs.*/ | ||
| 73 | + static really_inline u64a extract64from128(m128 a, int imm) { | ||
| 74 | +- return vgetq_lane_s64(a.vect_s64, imm & 0x0001); | ||
| 75 | ++ return VGETQ_LANE_S64(a.vect_s64, imm & 0x0001); | ||
| 76 | + } | ||
| 77 | + | ||
| 78 | + #define extractlow64from256(a) movq(a.lo) | ||
| 79 | +@@ -234,14 +240,14 @@ static really_inline u64a extract64from128(m128 a, int imm) { | ||
| 80 | + /*The x86 platform does not perform the lower 2 bit operation. | ||
| 81 | + If the value of imm exceeds 2 bit, a compilation error occurs.*/ | ||
| 82 | + static really_inline u32 extract32from256(m256 a, int imm) { | ||
| 83 | +- return vgetq_lane_s32((imm >> 2) ? a.hi.vect_s32 : a.lo.vect_s32, | ||
| 84 | ++ return VGETQ_LANE_S32((imm >> 2) ? a.hi.vect_s32 : a.lo.vect_s32, | ||
| 85 | + imm & 0x0003); | ||
| 86 | + } | ||
| 87 | + | ||
| 88 | + /*The x86 platform does not perform the lower 1 bit operation. | ||
| 89 | + If the value of imm exceeds 1 bit, a compilation error occurs.*/ | ||
| 90 | + static really_inline u64a extract64from256(m256 a, int imm) { | ||
| 91 | +- return vgetq_lane_s64((imm >> 1) ? a.hi.vect_s64 : a.lo.vect_s64, | ||
| 92 | ++ return VGETQ_LANE_S64((imm >> 1) ? a.hi.vect_s64 : a.lo.vect_s64, | ||
| 93 | + imm & 0x0001); | ||
| 94 | + } | ||
| 95 | + | ||
| 96 | +@@ -355,9 +361,9 @@ static really_inline m128 palignr(m128 a, m128 b, int count) { | ||
| 97 | + m128 result; | ||
| 98 | + count = count & 0xff; | ||
| 99 | + if (likely(count < 16)) { | ||
| 100 | +- result.vect_s8 = vextq_s8(b.vect_s8, a.vect_s8, count); | ||
| 101 | ++ result.vect_s8 = VEXTQ_S8(b.vect_s8, a.vect_s8, count); | ||
| 102 | + } else if (count < 32) { | ||
| 103 | +- result.vect_s8 = vextq_s8(a.vect_s8, vdupq_n_s8(0x0), count - 16); | ||
| 104 | ++ result.vect_s8 = VEXTQ_S8(a.vect_s8, vdupq_n_s8(0x0), count - 16); | ||
| 105 | + } else { | ||
| 106 | + result.vect_s32 = vdupq_n_s32(0); | ||
| 107 | + } | ||
| 108 | +-- | ||
| 109 | +2.28.0.windows.1 | ||
| 110 | + | ||
| 111 | + | ||