Skip to content

Commit bc236a1

Browse files
[AUTO-CHERRYPICK] Switched mysql to use AZL's version of protobuf to fix CVE-2024-2410. - branch 3.0-dev (#10893)
Co-authored-by: Pawel Winogrodzki <pawelwi@microsoft.com>
1 parent 61e1f39 commit bc236a1

2 files changed

Lines changed: 79 additions & 4 deletions

File tree

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
From 540814076995de6bcb119a68fa4cce9e7214b3c0 Mon Sep 17 00:00:00 2001
2+
From: Pawel Winogrodzki <pawelwi@microsoft.com>
3+
Date: Tue, 29 Oct 2024 15:37:51 -0700
4+
Subject: [PATCH] Remove ciphers unsupported by AZL.
5+
6+
---
7+
.../src/harness/tests/test_tls_server_context.cc | 15 ++++++++-------
8+
1 file changed, 8 insertions(+), 7 deletions(-)
9+
10+
diff --git a/router/src/harness/tests/test_tls_server_context.cc b/router/src/harness/tests/test_tls_server_context.cc
11+
index 57859357..e7edb4fa 100644
12+
--- a/router/src/harness/tests/test_tls_server_context.cc
13+
+++ b/router/src/harness/tests/test_tls_server_context.cc
14+
@@ -93,7 +93,6 @@ static const std::string acceptable_ciphers_test_data[] = {
15+
// TLSv1.3
16+
{"TLS_AES_128_GCM_SHA256"},
17+
{"TLS_AES_256_GCM_SHA384"},
18+
- {"TLS_CHACHA20_POLY1305_SHA256"},
19+
#if 0 // embedded
20+
{"TLS_AES_128_CCM_SHA256"},
21+
#endif
22+
@@ -102,11 +101,6 @@ static const std::string acceptable_ciphers_test_data[] = {
23+
{"ECDHE-RSA-AES256-GCM-SHA384"},
24+
{"DHE-RSA-AES128-GCM-SHA256"},
25+
{"DHE-RSA-AES256-GCM-SHA384"},
26+
-#if OPENSSL_VERSION_NUMBER >= ROUTER_OPENSSL_VERSION(1, 1, 0)
27+
- {"ECDHE-ECDSA-CHACHA20-POLY1305"},
28+
- {"ECDHE-RSA-CHACHA20-POLY1305"},
29+
- {"DHE-RSA-CHACHA20-POLY1305"},
30+
-#endif
31+
#if 0 // embedded
32+
{"ECDHE-ECDSA-AES256-CCM"},
33+
{"ECDHE-ECDSA-AES128-CCM"},
34+
@@ -336,7 +330,14 @@ static const std::string unacceptable_ciphers_test_data[] = {
35+
{"ECDH-ECDSA-DES-CBC3-SHA"},
36+
{"ECDHE-RSA-DES-CBC3-SHA"},
37+
{"ECDHE-ECDSA-DES-CBC3-SHA"},
38+
- {"DES-CBC3-SHA"},
39+
+#if OPENSSL_VERSION_NUMBER >= ROUTER_OPENSSL_VERSION(1, 1, 1)
40+
+ {"TLS_CHACHA20_POLY1305_SHA256"},
41+
+#endif
42+
+#if OPENSSL_VERSION_NUMBER >= ROUTER_OPENSSL_VERSION(1, 1, 0)
43+
+ {"ECDHE-ECDSA-CHACHA20-POLY1305"},
44+
+ {"ECDHE-RSA-CHACHA20-POLY1305"},
45+
+ {"DHE-RSA-CHACHA20-POLY1305"},
46+
+#endif
47+
};
48+
49+
INSTANTIATE_TEST_SUITE_P(CiphersUnacceptableParam, CiphersUnacceptable,
50+
--
51+
2.34.1
52+

SPECS/mysql/mysql.spec

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,29 @@
1+
%define majmin %(echo %{version} | cut -d. -f1-2)
2+
13
Summary: MySQL.
24
Name: mysql
35
Version: 8.0.40
4-
Release: 1%{?dist}
6+
Release: 2%{?dist}
57
License: GPLv2 with exceptions AND LGPLv2 AND BSD
68
Vendor: Microsoft Corporation
79
Distribution: Azure Linux
810
Group: Applications/Databases
911
URL: https://www.mysql.com
10-
Source0: https://dev.mysql.com/get/Downloads/MySQL-8.0/%{name}-boost-%{version}.tar.gz
12+
Source0: https://dev.mysql.com/get/Downloads/MySQL-%{majmin}/%{name}-boost-%{version}.tar.gz
1113
Patch0: CVE-2012-5627.nopatch
14+
# AZL's OpenSSL builds with the "no-chacha" option making all ChaCha
15+
# ciphers unavailable.
16+
Patch1: fix-tests-for-unsupported-chacha-ciphers.patch
1217
BuildRequires: cmake
1318
BuildRequires: libtirpc-devel
1419
BuildRequires: openssl-devel
20+
BuildRequires: protobuf-devel
1521
BuildRequires: rpcsvc-proto-devel
1622
BuildRequires: zlib-devel
23+
%if 0%{?with_check}
24+
BuildRequires: shadow-utils
25+
BuildRequires: sudo
26+
%endif
1727

1828
%description
1929
MySQL is a free, widely used SQL engine. It can be used as a fast database as well as a rock-solid DBMS using a modular engine architecture.
@@ -28,10 +38,15 @@ Development headers for developing applications linking to maridb
2838
%prep
2939
%autosetup -p1
3040

41+
# Remove unused, bundled version of protobuf.
42+
# We're building with the '-DWITH_PROTOBUF=system' option.
43+
rm -r extra/protobuf
44+
3145
%build
3246
cmake . \
3347
-DCMAKE_INSTALL_PREFIX=%{_prefix} \
3448
-DWITH_BOOST=boost/boost_1_77_0 \
49+
-DWITH_PROTOBUF=system \
3550
-DINSTALL_MANDIR=share/man \
3651
-DINSTALL_DOCDIR=share/doc \
3752
-DINSTALL_DOCREADMEDIR=share/doc \
@@ -48,7 +63,13 @@ make %{?_smp_mflags}
4863
make DESTDIR=%{buildroot} install
4964

5065
%check
51-
make test
66+
# Tests expect to be run as a non-root user.
67+
groupadd test
68+
useradd test -g test -m
69+
chown -R test:test .
70+
71+
# In case of failure, print the test log.
72+
sudo -u test make test || { cat Testing/Temporary/LastTest.log; false; }
5273

5374
%files
5475
%defattr(-,root,root)
@@ -58,7 +79,6 @@ make test
5879
%{_libdir}/*.so.*
5980
%{_libdir}/mysqlrouter/*.so*
6081
%{_libdir}/mysqlrouter/private/*.so*
61-
%{_libdir}/private/*.so*
6282
%{_bindir}/*
6383
%{_mandir}/man1/*
6484
%{_mandir}/man8/*
@@ -83,6 +103,9 @@ make test
83103
%{_libdir}/pkgconfig/mysqlclient.pc
84104

85105
%changelog
106+
* Mon Oct 28 2024 Pawel Winogrodzki <pawelwi@microsoft.com> - 8.0.40-2
107+
- Switch to ALZ version of protobuf instead of using the bundled one.
108+
86109
* Fri Oct 18 2024 CBL-Mariner Servicing Account <cblmargh@microsoft.com> - 8.0.40-1
87110
- Auto-upgrade to 8.0.40 - Fix multiple CVEs -- CVE-2024-21193, CVE-2024-21194, CVE-2024-21162, CVE-2024-21157, CVE-2024-21130,
88111
CVE-2024-20996, CVE-2024-21129, CVE-2024-21159, CVE-2024-21135, CVE-2024-21173, CVE-2024-21160, CVE-2024-21125, CVE-2024-21134,

0 commit comments

Comments
 (0)