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/files/, dev-db/mariadb/
Date: Wed, 07 Oct 2020 22:30:35
Message-Id: 1602109809.0f20dcf0f023c32af2dfe4994d3bc9aef11e61d4.whissi@gentoo
1 commit: 0f20dcf0f023c32af2dfe4994d3bc9aef11e61d4
2 Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
3 AuthorDate: Wed Oct 7 22:16:25 2020 +0000
4 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
5 CommitDate: Wed Oct 7 22:30:09 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0f20dcf0
7
8 dev-db/mariadb: 10.3.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.3-CVE-2020-15180.patch | 75 ++++++++++++++++++++++
15 ...10.3.23-r2.ebuild => mariadb-10.3.23-r3.ebuild} | 1 +
16 2 files changed, 76 insertions(+)
17
18 diff --git a/dev-db/mariadb/files/mariadb-10.3-CVE-2020-15180.patch b/dev-db/mariadb/files/mariadb-10.3-CVE-2020-15180.patch
19 new file mode 100644
20 index 00000000000..85d378f8232
21 --- /dev/null
22 +++ b/dev-db/mariadb/files/mariadb-10.3-CVE-2020-15180.patch
23 @@ -0,0 +1,75 @@
24 +https://github.com/MariaDB/server/commit/418850b2df4256da5a722288c2657650dc228842
25 +
26 +--- a/sql/wsrep_sst.cc
27 ++++ b/sql/wsrep_sst.cc
28 +@@ -1726,24 +1726,65 @@ 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 + wsrep_cb_status_t wsrep_sst_donate_cb (void* app_ctx, void* recv_ctx,
62 + const void* msg, size_t msg_len,
63 + const wsrep_gtid_t* current_gtid,
64 + const char* state, size_t state_len,
65 + bool bypass)
66 + {
67 +- /* This will be reset when sync callback is called.
68 +- * Should we set wsrep_ready to FALSE here too? */
69 +-
70 +- wsrep_config_state->set(WSREP_MEMBER_DONOR);
71 +-
72 + const char* method = (char*)msg;
73 + size_t method_len = strlen (method);
74 ++
75 ++ if (check_request_str(method, filename_char))
76 ++ {
77 ++ WSREP_ERROR("Bad SST method name. SST canceled.");
78 ++ return WSREP_CB_FAILURE;
79 ++ }
80 ++
81 + const char* data = method + method_len + 1;
82 +
83 ++ if (check_request_str(data, address_char))
84 ++ {
85 ++ WSREP_ERROR("Bad SST address string. SST canceled.");
86 ++ return WSREP_CB_FAILURE;
87 ++ }
88 ++
89 + char uuid_str[37];
90 + wsrep_uuid_print (&current_gtid->uuid, uuid_str, sizeof(uuid_str));
91 +
92 ++ /* This will be reset when sync callback is called.
93 ++ * Should we set wsrep_ready to FALSE here too? */
94 ++ wsrep_config_state->set(WSREP_MEMBER_DONOR);
95 ++
96 + wsp::env env(NULL);
97 + if (env.error())
98 + {
99
100 diff --git a/dev-db/mariadb/mariadb-10.3.23-r2.ebuild b/dev-db/mariadb/mariadb-10.3.23-r3.ebuild
101 similarity index 99%
102 rename from dev-db/mariadb/mariadb-10.3.23-r2.ebuild
103 rename to dev-db/mariadb/mariadb-10.3.23-r3.ebuild
104 index 815d86f66db..fdadccc6415 100644
105 --- a/dev-db/mariadb/mariadb-10.3.23-r2.ebuild
106 +++ b/dev-db/mariadb/mariadb-10.3.23-r3.ebuild
107 @@ -238,6 +238,7 @@ src_unpack() {
108
109 src_prepare() {
110 eapply "${WORKDIR}"/mariadb-patches
111 + eapply "${FILESDIR}"/mariadb-10.3-CVE-2020-15180.patch
112
113 eapply_user