summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta-oe/recipes-dbs/mysql/mariadb.inc1
-rw-r--r--meta-oe/recipes-dbs/mysql/mariadb/CVE-2025-21490.patch96
2 files changed, 97 insertions, 0 deletions
diff --git a/meta-oe/recipes-dbs/mysql/mariadb.inc b/meta-oe/recipes-dbs/mysql/mariadb.inc
index fde5fefd6a..27b5c46fa1 100644
--- a/meta-oe/recipes-dbs/mysql/mariadb.inc
+++ b/meta-oe/recipes-dbs/mysql/mariadb.inc
@@ -33,6 +33,7 @@ SRC_URI = "https://archive.mariadb.org/${BP}/source/${BP}.tar.gz \
33 file://CVE-2024-21096-0003.patch \ 33 file://CVE-2024-21096-0003.patch \
34 file://CVE-2024-21096-0004.patch \ 34 file://CVE-2024-21096-0004.patch \
35 file://CVE-2024-21096-0005.patch \ 35 file://CVE-2024-21096-0005.patch \
36 file://CVE-2025-21490.patch \
36 " 37 "
37SRC_URI:append:libc-musl = " file://ppc-remove-glibc-dep.patch" 38SRC_URI:append:libc-musl = " file://ppc-remove-glibc-dep.patch"
38 39
diff --git a/meta-oe/recipes-dbs/mysql/mariadb/CVE-2025-21490.patch b/meta-oe/recipes-dbs/mysql/mariadb/CVE-2025-21490.patch
new file mode 100644
index 0000000000..9c96f70313
--- /dev/null
+++ b/meta-oe/recipes-dbs/mysql/mariadb/CVE-2025-21490.patch
@@ -0,0 +1,96 @@
1From 82310f926b7c6547f25dd80e4edf3f38b22913e5 Mon Sep 17 00:00:00 2001
2From: Marko Mäkelä <marko.makela@mariadb.com>
3Date: Wed, 22 Jan 2025 17:22:07 +0200
4Subject: [PATCH] MDEV-29182 Assertion fld->field_no < table->n_v_def failed on
5 cascade
6
7row_ins_cascade_calc_update_vec(): Skip any virtual columns in the
8update vector of the parent table.
9
10Based on mysql/mysql-server@0ac176453bfef7fb1fdfa70af74618c32910181c
11
12Reviewed by: Debarun Banerjee
13
14CVE: CVE-2025-21490
15
16Upstream-Status: Backport [https://github.com/MariaDB/server/commit/82310f926b7c6547f25dd80e4edf3f38b22913e5]
17
18Signed-off-by: Divya Chellam <divya.chellam@windriver.com>
19---
20 mysql-test/suite/innodb/r/foreign_key.result | 17 +++++++++++++++++
21 mysql-test/suite/innodb/t/foreign_key.test | 15 +++++++++++++++
22 storage/innobase/row/row0ins.cc | 4 +++-
23 3 files changed, 35 insertions(+), 1 deletion(-)
24
25diff --git a/mysql-test/suite/innodb/r/foreign_key.result b/mysql-test/suite/innodb/r/foreign_key.result
26index acf021db..6348e7a1 100644
27--- a/mysql-test/suite/innodb/r/foreign_key.result
28+++ b/mysql-test/suite/innodb/r/foreign_key.result
29@@ -982,6 +982,23 @@ t2 CREATE TABLE `t2` (
30 CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`a`) REFERENCES `t1` (`a`)
31 ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
32 drop tables t2, t1;
33+#
34+# MDEV-29182 Assertion fld->field_no < table->n_v_def failed on cascade
35+#
36+CREATE TABLE t1(a INT PRIMARY KEY, b VARCHAR(3), c INT AS (LENGTH(b)) VIRTUAL,
37+INDEX(c)) ENGINE=InnoDB;
38+CREATE TABLE t2(a INT REFERENCES t1(a) ON UPDATE CASCADE,
39+b INT GENERATED ALWAYS AS(a) VIRTUAL, INDEX(b)) ENGINE=InnoDB;
40+INSERT INTO t1 SET a=1,b='fu';
41+INSERT INTO t2 SET a=1;
42+UPDATE t1 SET a=2,b='bar';
43+SELECT * FROM t1;
44+a b c
45+2 bar 3
46+SELECT * FROM t2;
47+a b
48+2 2
49+DROP TABLE t2,t1;
50 # End of 10.5 tests
51 #
52 # MDEV-26554 Table-rebuilding DDL on parent table causes crash
53diff --git a/mysql-test/suite/innodb/t/foreign_key.test b/mysql-test/suite/innodb/t/foreign_key.test
54index 4b047ea4..45205cce 100644
55--- a/mysql-test/suite/innodb/t/foreign_key.test
56+++ b/mysql-test/suite/innodb/t/foreign_key.test
57@@ -1007,6 +1007,21 @@ alter table t2 add foreign key(a) references t1;
58 show create table t2;
59 drop tables t2, t1;
60
61+
62+--echo #
63+--echo # MDEV-29182 Assertion fld->field_no < table->n_v_def failed on cascade
64+--echo #
65+CREATE TABLE t1(a INT PRIMARY KEY, b VARCHAR(3), c INT AS (LENGTH(b)) VIRTUAL,
66+ INDEX(c)) ENGINE=InnoDB;
67+CREATE TABLE t2(a INT REFERENCES t1(a) ON UPDATE CASCADE,
68+ b INT GENERATED ALWAYS AS(a) VIRTUAL, INDEX(b)) ENGINE=InnoDB;
69+INSERT INTO t1 SET a=1,b='fu';
70+INSERT INTO t2 SET a=1;
71+UPDATE t1 SET a=2,b='bar';
72+SELECT * FROM t1;
73+SELECT * FROM t2;
74+DROP TABLE t2,t1;
75+
76 --echo # End of 10.5 tests
77
78 --echo #
79diff --git a/storage/innobase/row/row0ins.cc b/storage/innobase/row/row0ins.cc
80index 8385bcae..0d8ae8aa 100644
81--- a/storage/innobase/row/row0ins.cc
82+++ b/storage/innobase/row/row0ins.cc
83@@ -483,7 +483,9 @@ row_ins_cascade_calc_update_vec(
84 const upd_field_t* parent_ufield
85 = &parent_update->fields[j];
86
87- if (parent_ufield->field_no == parent_field_no) {
88+ if (parent_ufield->field_no == parent_field_no
89+ && !(parent_ufield->new_val.type.prtype
90+ & DATA_VIRTUAL)) {
91
92 ulint min_size;
93 const dict_col_t* col;
94--
952.40.0
96