Skip to content

Commit 6c66789

Browse files
CBL-Mariner-Botkgodara912Kshitiz Godara
authored
[AUTO-CHERRYPICK] Patch sqlite for CVE-2025-6965[HIGH], CVE-2025-7458[MEDIUM] - branch main (#14496)
Co-authored-by: kgodara912 <[email protected]> Co-authored-by: Kshitiz Godara <[email protected]>
1 parent 31ef6cc commit 6c66789

File tree

7 files changed

+85
-15
lines changed

7 files changed

+85
-15
lines changed

SPECS/sqlite/CVE-2025-6965.patch

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
From 21fd260b719da5aa881c760f2d11997ec0d7d28a Mon Sep 17 00:00:00 2001
2+
From: Kshitiz Godara <[email protected]>
3+
Date: Mon, 4 Aug 2025 06:48:07 +0000
4+
Subject: [PATCH 2/2] Fix for CVE-2025-6965 [HIGH]
5+
6+
Upstream reference:
7+
https://www.sqlite.org/src/info/642be27a38018649
8+
---
9+
sqlite3.c | 4 ++--
10+
1 file changed, 2 insertions(+), 2 deletions(-)
11+
12+
diff --git a/sqlite3.c b/sqlite3.c
13+
index 70c9b45..003961a 100644
14+
--- a/sqlite3.c
15+
+++ b/sqlite3.c
16+
@@ -109837,7 +109837,7 @@ static int analyzeAggregate(Walker *pWalker, Expr *pExpr){
17+
ExprSetVVAProperty(pExpr, EP_NoReduce);
18+
pExpr->pAggInfo = pAggInfo;
19+
pExpr->op = TK_AGG_COLUMN;
20+
- pExpr->iAgg = (i16)k;
21+
+ pExpr->iAgg = (i16)(k&0x7fff);
22+
break;
23+
} /* endif pExpr->iTable==pItem->iCursor */
24+
} /* end loop over pSrcList */
25+
@@ -109883,7 +109883,7 @@ static int analyzeAggregate(Walker *pWalker, Expr *pExpr){
26+
*/
27+
assert( !ExprHasProperty(pExpr, EP_TokenOnly|EP_Reduced) );
28+
ExprSetVVAProperty(pExpr, EP_NoReduce);
29+
- pExpr->iAgg = (i16)i;
30+
+ pExpr->iAgg = (i16)(i&0x7fff);
31+
pExpr->pAggInfo = pAggInfo;
32+
return WRC_Prune;
33+
}else{
34+
--
35+
2.45.4
36+

SPECS/sqlite/CVE-2025-7458.patch

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
From 7b06377c3e3ec165a0024b3950ae71b39e7bfcc7 Mon Sep 17 00:00:00 2001
2+
From: Kshitiz Godara <[email protected]>
3+
Date: Sun, 3 Aug 2025 16:51:50 +0000
4+
Subject: [PATCH 1/2] Fix for CVE-2025-7458 [MEDIUM]
5+
6+
Upstream reference:
7+
https://sqlite.org/src/info/12ad822d9b827777
8+
---
9+
sqlite3.c | 4 ++++
10+
1 file changed, 4 insertions(+)
11+
12+
diff --git a/sqlite3.c b/sqlite3.c
13+
index 158d416..70c9b45 100644
14+
--- a/sqlite3.c
15+
+++ b/sqlite3.c
16+
@@ -158940,6 +158940,10 @@ static int wherePathSolver(WhereInfo *pWInfo, LogEst nRowEst){
17+
if( pFrom->isOrdered==pWInfo->pOrderBy->nExpr ){
18+
pWInfo->eDistinct = WHERE_DISTINCT_ORDERED;
19+
}
20+
+ if( pWInfo->pOrderBy
21+
+ && pWInfo->nOBSat > pWInfo->pOrderBy->nExpr ){
22+
+ pWInfo->nOBSat = pWInfo->pOrderBy->nExpr;
23+
+ }
24+
}else{
25+
pWInfo->revMask = pFrom->revLoop;
26+
if( pWInfo->nOBSat<=0 ){
27+
--
28+
2.45.4
29+

SPECS/sqlite/sqlite.spec

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Summary: A portable, high level programming interface to various calling conventions
33
Name: sqlite
44
Version: 3.39.2
5-
Release: 3%{?dist}
5+
Release: 4%{?dist}
66
License: Public Domain
77
Vendor: Microsoft Corporation
88
Distribution: Mariner
@@ -13,6 +13,8 @@ Source0: https://www.sqlite.org/2022/%{name}-autoconf-%{sourcever}.tar.gz
1313
Patch0: CVE-2015-3717.nopatch
1414
Patch1: CVE-2022-46908.patch
1515
Patch2: CVE-2023-7104.patch
16+
Patch3: CVE-2025-7458.patch
17+
Patch4: CVE-2025-6965.patch
1618
Requires: sqlite-libs = %{version}-%{release}
1719
Provides: sqlite3
1820

@@ -83,6 +85,9 @@ make %{?_smp_mflags} check
8385
%{_libdir}/libsqlite3.so.0.8.6
8486

8587
%changelog
88+
* Mon Aug 04 2025 Kshitiz Godara <[email protected]> - 3.39.2-4
89+
- Address CVE-2025-6965 and CVE-2025-7458
90+
8691
* Tue Jan 09 2024 Henry Li <[email protected]> - 3.39.2-3
8792
- Address CVE-2023-7104
8893

toolkit/resources/manifests/package/pkggen_core_aarch64.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ bison-3.7.6-2.cm2.aarch64.rpm
8484
popt-1.18-1.cm2.aarch64.rpm
8585
popt-devel-1.18-1.cm2.aarch64.rpm
8686
popt-lang-1.18-1.cm2.aarch64.rpm
87-
sqlite-3.39.2-3.cm2.aarch64.rpm
88-
sqlite-devel-3.39.2-3.cm2.aarch64.rpm
89-
sqlite-libs-3.39.2-3.cm2.aarch64.rpm
87+
sqlite-3.39.2-4.cm2.aarch64.rpm
88+
sqlite-devel-3.39.2-4.cm2.aarch64.rpm
89+
sqlite-libs-3.39.2-4.cm2.aarch64.rpm
9090
elfutils-0.186-2.cm2.aarch64.rpm
9191
elfutils-default-yama-scope-0.186-2.cm2.noarch.rpm
9292
elfutils-devel-0.186-2.cm2.aarch64.rpm

toolkit/resources/manifests/package/pkggen_core_x86_64.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ bison-3.7.6-2.cm2.x86_64.rpm
8484
popt-1.18-1.cm2.x86_64.rpm
8585
popt-devel-1.18-1.cm2.x86_64.rpm
8686
popt-lang-1.18-1.cm2.x86_64.rpm
87-
sqlite-3.39.2-3.cm2.x86_64.rpm
88-
sqlite-devel-3.39.2-3.cm2.x86_64.rpm
89-
sqlite-libs-3.39.2-3.cm2.x86_64.rpm
87+
sqlite-3.39.2-4.cm2.x86_64.rpm
88+
sqlite-devel-3.39.2-4.cm2.x86_64.rpm
89+
sqlite-libs-3.39.2-4.cm2.x86_64.rpm
9090
elfutils-0.186-2.cm2.x86_64.rpm
9191
elfutils-default-yama-scope-0.186-2.cm2.noarch.rpm
9292
elfutils-devel-0.186-2.cm2.x86_64.rpm

toolkit/resources/manifests/package/toolchain_aarch64.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -548,10 +548,10 @@ sed-lang-4.8-3.cm2.aarch64.rpm
548548
slang-2.3.2-4.cm2.aarch64.rpm
549549
slang-debuginfo-2.3.2-4.cm2.aarch64.rpm
550550
slang-devel-2.3.2-4.cm2.aarch64.rpm
551-
sqlite-3.39.2-3.cm2.aarch64.rpm
552-
sqlite-debuginfo-3.39.2-3.cm2.aarch64.rpm
553-
sqlite-devel-3.39.2-3.cm2.aarch64.rpm
554-
sqlite-libs-3.39.2-3.cm2.aarch64.rpm
551+
sqlite-3.39.2-4.cm2.aarch64.rpm
552+
sqlite-debuginfo-3.39.2-4.cm2.aarch64.rpm
553+
sqlite-devel-3.39.2-4.cm2.aarch64.rpm
554+
sqlite-libs-3.39.2-4.cm2.aarch64.rpm
555555
swig-4.0.2-3.cm2.aarch64.rpm
556556
swig-debuginfo-4.0.2-3.cm2.aarch64.rpm
557557
systemd-bootstrap-250.3-13.cm2.aarch64.rpm

toolkit/resources/manifests/package/toolchain_x86_64.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -554,10 +554,10 @@ sed-lang-4.8-3.cm2.x86_64.rpm
554554
slang-2.3.2-4.cm2.x86_64.rpm
555555
slang-debuginfo-2.3.2-4.cm2.x86_64.rpm
556556
slang-devel-2.3.2-4.cm2.x86_64.rpm
557-
sqlite-3.39.2-3.cm2.x86_64.rpm
558-
sqlite-debuginfo-3.39.2-3.cm2.x86_64.rpm
559-
sqlite-devel-3.39.2-3.cm2.x86_64.rpm
560-
sqlite-libs-3.39.2-3.cm2.x86_64.rpm
557+
sqlite-3.39.2-4.cm2.x86_64.rpm
558+
sqlite-debuginfo-3.39.2-4.cm2.x86_64.rpm
559+
sqlite-devel-3.39.2-4.cm2.x86_64.rpm
560+
sqlite-libs-3.39.2-4.cm2.x86_64.rpm
561561
swig-4.0.2-3.cm2.x86_64.rpm
562562
swig-debuginfo-4.0.2-3.cm2.x86_64.rpm
563563
systemd-bootstrap-250.3-13.cm2.x86_64.rpm

0 commit comments

Comments
 (0)