Gentoo Archives: gentoo-commits

From: Thomas Deutschmann <whissi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-db/mariadb/, dev-db/mariadb/files/
Date: Wed, 07 Oct 2020 22:30:34
Message-Id: 1602109808.90ad011695b84e10ea33b8914f645181735c1376.whissi@gentoo
1 commit: 90ad011695b84e10ea33b8914f645181735c1376
2 Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
3 AuthorDate: Wed Oct 7 21:30:40 2020 +0000
4 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
5 CommitDate: Wed Oct 7 22:30:08 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=90ad0116
7
8 dev-db/mariadb: 10.4.x rev bump for CVE-2020-15180
9
10 Bug: https://bugs.gentoo.org/747166
11 Package-Manager: Portage-3.0.8, Repoman-3.0.1
12 Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>
13
14 .../files/mariadb-10.4-CVE-2020-15180.patch | 62 ++++++++++++++++++++++
15 ...10.4.13-r2.ebuild => mariadb-10.4.13-r3.ebuild} | 1 +
16 2 files changed, 63 insertions(+)
17
18 diff --git a/dev-db/mariadb/files/mariadb-10.4-CVE-2020-15180.patch b/dev-db/mariadb/files/mariadb-10.4-CVE-2020-15180.patch
19 new file mode 100644
20 index 00000000000..9658669c6e6
21 --- /dev/null
22 +++ b/dev-db/mariadb/files/mariadb-10.4-CVE-2020-15180.patch
23 @@ -0,0 +1,62 @@
24 +https://github.com/MariaDB/server/commit/418850b2df4256da5a722288c2657650dc228842
25 +
26 +--- a/sql/wsrep_sst.cc
27 ++++ b/sql/wsrep_sst.cc
28 +@@ -1822,6 +1822,35 @@ static int sst_donate_other (const char* method,
29 + return arg.err;
30 + }
31 +
32 ++/* return true if character can be a part of a filename */
33 ++static bool filename_char(int const c)
34 ++{
35 ++ return isalnum(c) || (c == '-') || (c == '_') || (c == '.');
36 ++}
37 ++
38 ++/* return true if character can be a part of an address string */
39 ++static bool address_char(int const c)
40 ++{
41 ++ return filename_char(c) ||
42 ++ (c == ':') || (c == '[') || (c == ']') || (c == '/');
43 ++}
44 ++
45 ++static bool check_request_str(const char* const str,
46 ++ bool (*check) (int c))
47 ++{
48 ++ for (size_t i(0); str[i] != '\0'; ++i)
49 ++ {
50 ++ if (!check(str[i]))
51 ++ {
52 ++ WSREP_WARN("Illegal character in state transfer request: %i (%c).",
53 ++ str[i], str[i]);
54 ++ return true;
55 ++ }
56 ++ }
57 ++
58 ++ return false;
59 ++}
60 ++
61 + int wsrep_sst_donate(const std::string& msg,
62 + const wsrep::gtid& current_gtid,
63 + const bool bypass)
64 +@@ -1833,8 +1862,21 @@ int wsrep_sst_donate(const std::string& msg,
65 +
66 + const char* method= msg.data();
67 + size_t method_len= strlen (method);
68 ++
69 ++ if (check_request_str(method, filename_char))
70 ++ {
71 ++ WSREP_ERROR("Bad SST method name. SST canceled.");
72 ++ return WSREP_CB_FAILURE;
73 ++ }
74 ++
75 + const char* data= method + method_len + 1;
76 +
77 ++ if (check_request_str(data, address_char))
78 ++ {
79 ++ WSREP_ERROR("Bad SST address string. SST canceled.");
80 ++ return WSREP_CB_FAILURE;
81 ++ }
82 ++
83 + wsp::env env(NULL);
84 + if (env.error())
85 + {
86
87 diff --git a/dev-db/mariadb/mariadb-10.4.13-r2.ebuild b/dev-db/mariadb/mariadb-10.4.13-r3.ebuild
88 similarity index 99%
89 rename from dev-db/mariadb/mariadb-10.4.13-r2.ebuild
90 rename to dev-db/mariadb/mariadb-10.4.13-r3.ebuild
91 index f879d6f9a0e..d87c5a8beba 100644
92 --- a/dev-db/mariadb/mariadb-10.4.13-r2.ebuild
93 +++ b/dev-db/mariadb/mariadb-10.4.13-r3.ebuild
94 @@ -223,6 +223,7 @@ src_unpack() {
95
96 src_prepare() {
97 eapply "${WORKDIR}"/mariadb-patches
98 + eapply "${FILESDIR}"/mariadb-10.4-CVE-2020-15180.patch
99
100 eapply_user