Patch review
cover Patch review
Please review this set of changes for kirkstone and have comments back by end of day Thursday, August 7
Passed a-full on autobuilder:
https://autobuilder.yoctoproject.org/valkyrie/#/builders/29/builds/2150
The following changes since commit b4a2f74ba0b40abcdf56c4b58cae5f7ce145d511:
sqlite3: Fix CVE-2025-6965 (2025-07-29 06:39:06 -0700)
are available in the Git repository at:
https://git.openembedded.org/openembedded-core-contrib stable/kirkstone-nut
https://git.openembedded.org/openembedded-core-contrib/log/?h=stable/kirkstone-nut
Peter Marko (3):
sqlite3: patch CVE-2025-7458
sqlite3: ignore CVE-2025-3277
glibc: stable 2.35 branch updates
Zhang Peng (1):
avahi: fix CVE-2024-52615
meta/recipes-connectivity/avahi/avahi_0.8.bb | 1 + .../avahi/files/CVE-2024-52615.patch | 228 ++++++++++++++++ meta/recipes-core/glibc/glibc-version.inc | 2 +- .../glibc/glibc/0025-CVE-2025-4802.patch | 250 ------------------ meta/recipes-core/glibc/glibc_2.35.bb | 2 +- ...mpts-to-improve-the-detection-of-cov.patch | 91 +++++++ .../sqlite/files/CVE-2025-7458.patch | 32 +++ meta/recipes-support/sqlite/sqlite3_3.38.5.bb | 4 + 8 files changed, 358 insertions(+), 252 deletions(-) create mode 100644 meta/recipes-connectivity/avahi/files/CVE-2024-52615.patch delete mode 100644 meta/recipes-core/glibc/glibc/0025-CVE-2025-4802.patch create mode 100644 meta/recipes-support/sqlite/files/0001-This-branch-attempts-to-improve-the-detection-of-cov.patch create mode 100644 meta/recipes-support/sqlite/files/CVE-2025-7458.patch
Signature · 1 line
2.43.0
PATCH 1/4 avahi: fix CVE-2024-52615
From: Zhang Peng <[email protected]>
CVE-2024-52615:
A flaw was found in Avahi-daemon, which relies on fixed source ports for wide-area DNS queries. This issue simplifies attacks where malicious DNS responses are injected.
Reference:
[https://nvd.nist.gov/vuln/detail/CVE-2024-52615]
[https://github.com/avahi/avahi/security/advisories/GHSA-x6vp-f33h-h32g]
Upstream patches:
[https://github.com/avahi/avahi/commit/4e2e1ea0908d7e6ad7f38ae04fdcdf2411f8b942]
--- meta/recipes-connectivity/avahi/avahi_0.8.bb | 1 + .../avahi/files/CVE-2024-52615.patch | 228 ++++++++++++++++++ 2 files changed, 229 insertions(+) create mode 100644 meta/recipes-connectivity/avahi/files/CVE-2024-52615.patch
meta/recipes-connectivity/avahi/avahi_0.8.bb +1 -0
@@ -36,6 +36,7 @@ SRC_URI = "https://github.com/lathiat/avahi/releases/download/v${PV}/avahi-${PV} file://CVE-2023-38472.patch \ file://CVE-2023-38473.patch \ file://CVE-2024-52616.patch \ + file://CVE-2024-52615.patch \ " UPSTREAM_CHECK_URI = "https://github.com/lathiat/avahi/releases/"
meta/recipes-connectivity/avahi/files/CVE-2024-52615.patch new file +228 -0
228 lines not on this page · raw message
Signature · 1 line
2.43.0
PATCH 2/4 sqlite3: patch CVE-2025-7458
In reply to Steve SakomanFrom: Peter Marko <[email protected]>
Pick patch [1] listed in [2].
Also pick another patch which is precondition to this one introducing variable needed for the check.
[1] https://sqlite.org/src/info/12ad822d9b827777
[2] https://nvd.nist.gov/vuln/detail/CVE-2025-7458
--- ...mpts-to-improve-the-detection-of-cov.patch | 91 +++++++++++++++++++ .../sqlite/files/CVE-2025-7458.patch | 32 +++++++ meta/recipes-support/sqlite/sqlite3_3.38.5.bb | 2 + 3 files changed, 125 insertions(+) create mode 100644 meta/recipes-support/sqlite/files/0001-This-branch-attempts-to-improve-the-detection-of-cov.patch create mode 100644 meta/recipes-support/sqlite/files/CVE-2025-7458.patch
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to-improve-the-detection-of-cov.patch new file +91 -0
@@ -0,0 +1,91 @@ +From f55a7dad195994f2bb24db7df0a0515502386fe2 Mon Sep 17 00:00:00 2001 +From: drh <> +Date: Sat, 22 Oct 2022 14:16:02 +0000 +Subject: [PATCH] This branch attempts to improve the detection of covering + indexes. This first check-in merely improves a parameter name to + sqlite3WhereBegin() to be more descriptive of what it contains, and ensures + that a subroutine is not inlines so that sqlite3WhereBegin() runs slightly + faster. + +FossilOrigin-Name: cadf5f6bb1ce0492ef858ada476288e8057afd3609caa18b09c818d3845d7244 + +Upstream-Status: Backport [https://github.com/sqlite/sqlite/commit/f55a7dad195994f2bb24db7df0a0515502386fe2] +Signed-off-by: Peter Marko <[email protected]> +--- + sqlite3.c | 28 +++++++++++++--------------- + 1 file changed, 13 insertions(+), 15 deletions(-) + +diff --git a/sqlite3.c b/sqlite3.c +index 4cbc2d0..b7ed991 100644 +--- a/sqlite3.c ++++ b/sqlite3.c +@@ -147371,9 +147371,7 @@ struct WhereInfo { + ExprList *pOrderBy; /* The ORDER BY clause or NULL */ + ExprList *pResultSet; /* Result set of the query */ + Expr *pWhere; /* The complete WHERE clause */ +-#ifndef SQLITE_OMIT_VIRTUALTABLE +- Select *pLimit; /* Used to access LIMIT expr/registers for vtabs */ +-#endif ++ Select *pSelect; /* The entire SELECT statement containing WHERE */ + int aiCurOnePass[2]; /* OP_OpenWrite cursors for the ONEPASS opt */ + int iContinue; /* Jump here to continue with next record */ + int iBreak; /* Jump here to break out of the loop */ +@@ -149070,9 +149068,9 @@ SQLITE_PRIVATE Bitmask sqlite3WhereCodeOneLoopStart( + && pLoop->u.vtab.bOmitOffset + ){ + assert( pTerm->eOperator==WO_AUX ); +- assert( pWInfo->pLimit!=0 ); +- assert( pWInfo->pLimit->iOffset>0 ); +- sqlite3VdbeAddOp2(v, OP_Integer, 0, pWInfo->pLimit->iOffset); ++ assert( pWInfo->pSelect!=0 ); ++ assert( pWInfo->pSelect->iOffset>0 ); ++ sqlite3VdbeAddOp2(v, OP_Integer, 0, pWInfo->pSelect->iOffset); + VdbeComment((v,"Zero OFFSET counter")); + } + } +@@ -151830,10 +151828,10 @@ static void whereAddLimitExpr( + ** exist only so that they may be passed to the xBestIndex method of the + ** single virtual table in the FROM clause of the SELECT. + */ +-SQLITE_PRIVATE void sqlite3WhereAddLimit(WhereClause *pWC, Select *p){ +- assert( p==0 || (p->pGroupBy==0 && (p->selFlags & SF_Aggregate)==0) ); +- if( (p && p->pLimit) /* 1 */ +- && (p->selFlags & (SF_Distinct|SF_Aggregate))==0 /* 2 */ ++SQLITE_PRIVATE void SQLITE_NOINLINE sqlite3WhereAddLimit(WhereClause *pWC, Select *p){ ++ assert( p!=0 && p->pLimit!=0 ); /* 1 -- checked by caller */ ++ assert( p->pGroupBy==0 && (p->selFlags & SF_Aggregate)==0 ); ++ if( (p->selFlags & (SF_Distinct|SF_Aggregate))==0 /* 2 */ + && (p->pSrc->nSrc==1 && IsVirtual(p->pSrc->a[0].pTab)) /* 3 */ + ){ + ExprList *pOrderBy = p->pOrderBy; +@@ -157427,7 +157425,7 @@ SQLITE_PRIVATE WhereInfo *sqlite3WhereBegin( + Expr *pWhere, /* The WHERE clause */ + ExprList *pOrderBy, /* An ORDER BY (or GROUP BY) clause, or NULL */ + ExprList *pResultSet, /* Query result set. Req'd for DISTINCT */ +- Select *pLimit, /* Use this LIMIT/OFFSET clause, if any */ ++ Select *pSelect, /* The entire SELECT statement */ + u16 wctrlFlags, /* The WHERE_* flags defined in sqliteInt.h */ + int iAuxArg /* If WHERE_OR_SUBCLAUSE is set, index cursor number + ** If WHERE_USE_LIMIT, then the limit amount */ +@@ -157504,9 +157502,7 @@ SQLITE_PRIVATE WhereInfo *sqlite3WhereBegin( + pWInfo->wctrlFlags = wctrlFlags; + pWInfo->iLimit = iAuxArg; + pWInfo->savedNQueryLoop = pParse->nQueryLoop; +-#ifndef SQLITE_OMIT_VIRTUALTABLE +- pWInfo->pLimit = pLimit; +-#endif ++ pWInfo->pSelect = pSelect; + memset(&pWInfo->nOBSat, 0, + offsetof(WhereInfo,sWC) - offsetof(WhereInfo,nOBSat)); + memset(&pWInfo->a[0], 0, sizeof(WhereLoop)+nTabList*sizeof(WhereLevel)); +@@ -157575,7 +157571,9 @@ SQLITE_PRIVATE WhereInfo *sqlite3WhereBegin( + + /* Analyze all of the subexpressions. */ + sqlite3WhereExprAnalyze(pTabList, &pWInfo->sWC); +- sqlite3WhereAddLimit(&pWInfo->sWC, pLimit); ++ if( pSelect && pSelect->pLimit ){ ++ sqlite3WhereAddLimit(&pWInfo->sWC, pSelect); ++ } + if( db->mallocFailed ) goto whereBeginError; + + /* Special case: WHERE terms that do not refer to any tables in the join
meta/recipes-support/sqlite/files/CVE-2025-7458.patch new file +32 -0
@@ -0,0 +1,32 @@ +From b816ca9994e03a8bc829b49452b8158a731e81a9 Mon Sep 17 00:00:00 2001 +From: drh <> +Date: Thu, 16 Mar 2023 20:54:29 +0000 +Subject: [PATCH] Correctly handle SELECT DISTINCT ... ORDER BY when all of the + result set terms are constant and there are more result set terms than ORDER + BY terms. Fix for these tickets: [c36cdb4afd504dc1], [4051a7f931d9ba24], + [d6fd512f50513ab7]. + +FossilOrigin-Name: 12ad822d9b827777526ca5ed5bf3e678d600294fc9b5c25482dfff2a021328a4 + +CVE: CVE-2025-7458 +Upstream-Status: Backport [github.com/sqlite/sqlite/commit/b816ca9994e03a8bc829b49452b8158a731e81a9] +Signed-off-by: Peter Marko <[email protected]> +--- + sqlite3.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/sqlite3.c b/sqlite3.c +index 19d0438..6d92184 100644 +--- a/sqlite3.c ++++ b/sqlite3.c +@@ -156989,6 +156989,10 @@ static int wherePathSolver(WhereInfo *pWInfo, LogEst nRowEst){ + if( pFrom->isOrdered==pWInfo->pOrderBy->nExpr ){ + pWInfo->eDistinct = WHERE_DISTINCT_ORDERED; + } ++ if( pWInfo->pSelect->pOrderBy ++ && pWInfo->nOBSat > pWInfo->pSelect->pOrderBy->nExpr ){ ++ pWInfo->nOBSat = pWInfo->pSelect->pOrderBy->nExpr; ++ } + }else{ + pWInfo->nOBSat = pFrom->isOrdered; + pWInfo->revMask = pFrom->revLoop;
meta/recipes-support/sqlite/sqlite3_3.38.5.bb +2 -0
@@ -10,6 +10,8 @@ SRC_URI = "http://www.sqlite.org/2022/sqlite-autoconf-${SQLITE_PV}.tar.gz \ file://CVE-2023-7104.patch \ file://CVE-2025-29088.patch \ file://CVE-2025-6965.patch \ + file://0001-This-branch-attempts-to-improve-the-detection-of-cov.patch \ + file://CVE-2025-7458.patch \ " SRC_URI[sha256sum] = "5af07de982ba658fd91a03170c945f99c971f6955bc79df3266544373e39869c"
Signature · 1 line
2.43.0
PATCH 3/4 sqlite3: ignore CVE-2025-3277
In reply to Steve SakomanFrom: Peter Marko <[email protected]>
The vulnerable code was introduced in 3.44.0 via [1]. (See fix commit [2])
Also Debian says "not vulnerabele yet for 3.40.1 in [3]
[1] https://github.com/sqlite/sqlite/commit/e1e67abc5cf67f931aab1e471eda23d73f51d456
[2] https://sqlite.org/src/info/498e3f1cf57f164f
[3] https://security-tracker.debian.org/tracker/CVE-2025-3277
--- meta/recipes-support/sqlite/sqlite3_3.38.5.bb | 2 ++ 1 file changed, 2 insertions(+)
meta/recipes-support/sqlite/sqlite3_3.38.5.bb +2 -0
@@ -21,3 +21,5 @@ CVE_CHECK_IGNORE += "CVE-2019-19242" CVE_CHECK_IGNORE += "CVE-2015-3717" # Issue in an experimental extension we don't have/use. Fixed by https://sqlite.org/src/info/b1e0c22ec981cf5f CVE_CHECK_IGNORE += "CVE-2021-36690" +# Issue was introduced in 3.44.0 +CVE_CHECK_IGNORE += "CVE-2025-3277"
Signature · 1 line
2.43.0
PATCH 4/4 glibc: stable 2.35 branch updates
In reply to Steve SakomanFrom: Peter Marko <[email protected]>
This is a single commit bump containing only CVE fix
$ git log --oneline d80401002011f470d9c6eb604bf734715e9b3a8c..a66bc3941ff298e474d5f02d0c3303401951141f a66bc3941f posix: Fix double-free after allocation failure in regcomp (bug 33185)
Test results didn't change except newly added test succeeding. (tst-regcomp-bracket-free)
Also add CVE-2025-0395 ignore which was already included in previous hash bumps.
Also drop an unreferenced patch.
--- meta/recipes-core/glibc/glibc-version.inc | 2 +- .../glibc/glibc/0025-CVE-2025-4802.patch | 250 ------------------ meta/recipes-core/glibc/glibc_2.35.bb | 2 +- 3 files changed, 2 insertions(+), 252 deletions(-) delete mode 100644 meta/recipes-core/glibc/glibc/0025-CVE-2025-4802.patch
meta/recipes-core/glibc/glibc-version.inc +1 -1
@@ -1,6 +1,6 @@ SRCBRANCH ?= "release/2.35/master" PV = "2.35" -SRCREV_glibc ?= "80401002011f470d9c6eb604bf734715e9b3a8c2" +SRCREV_glibc ?= "a66bc3941ff298e474d5f02d0c3303401951141f" SRCREV_localedef ?= "794da69788cbf9bf57b59a852f9f11307663fa87" GLIBC_GIT_URI ?= "git://sourceware.org/git/glibc.git"
meta/recipes-core/glibc/glibc/0025-CVE-2025-4802.patch deleted +0 -250
250 lines not on this page · raw message
meta/recipes-core/glibc/glibc_2.35.bb +1 -1
@@ -27,7 +27,7 @@ CVE_CHECK_IGNORE += "CVE-2023-4527" CVE_CHECK_IGNORE += " \ CVE-2023-0687 CVE-2023-4813 CVE-2023-4806 CVE-2023-4911 CVE-2023-5156 \ CVE-2024-2961 CVE-2024-33599 CVE-2024-33600 CVE-2024-33601 CVE-2024-33602 \ - CVE-2025-4802 \ + CVE-2025-0395 CVE-2025-4802 CVE-2025-8058 \ " DEPENDS += "gperf-native bison-native"
Signature · 1 line
2.43.0
Re: [OE-core][kirkstone 2/4] sqlite3: patch CVE-2025-7458
In reply to Steve SakomanWe have found that since this patch SELECT queries with COUNT(DISTINCT(column)) seem to cause sqlite to segfault. E.g.
# sqlite3 :memory: 'create table foo (x int); select count(distinct(x)) from foo;' Segmentation fault (core dumped)
-Niko
Quoted 178 lines · Steve Sakoman via lists.openembedded.org
From: Peter Marko <[email protected]>
Pick patch [1] listed in [2].
Also pick another patch which is precondition to this one introducing variable needed for the check.[1] https://sqlite.org/src/info/12ad822d9b827777
[2] https://nvd.nist.gov/vuln/detail/CVE-2025-7458Signed-off-by Peter Marko <[email protected]>Signed-off-by Steve Sakoman <[email protected]>--- ...mpts-to-improve-the-detection-of-cov.patch | 91 +++++++++++++++++++ .../sqlite/files/CVE-2025-7458.patch | 32 +++++++ meta/recipes-support/sqlite/sqlite3_3.38.5.bb | 2 + 3 files changed, 125 insertions(+)create mode 100644
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to-improve-the-detection-of-cov.patchcreate mode 100644meta/recipes-support/sqlite/files/CVE-2025-7458.patchmeta/recipes-support/sqlite/files/0001-This-branch-attempts-to-improve-the-detection-of-cov.patch new file +91
-0@@ -0,0 +1,91 @@ +From f55a7dad195994f2bb24db7df0a0515502386fe2 Mon Sep 17 00:00:00 2001 +From: drh <> +Date: Sat, 22 Oct 2022 14:16:02 +0000 +Subject: [PATCH] This branch attempts to improve the detection of covering + indexes. This first check-in merely improves a parameter name to + sqlite3WhereBegin() to be more descriptive of what it contains, and ensures + that a subroutine is not inlines so that sqlite3WhereBegin() runs slightly + faster. + +FossilOrigin-Name: cadf5f6bb1ce0492ef858ada476288e8057afd3609caa18b09c818d3845d7244 + +Upstream-Status: Backport [https://github.com/sqlite/sqlite/commit/f55a7dad195994f2bb24db7df0a0515502386fe2] +Signed-off-by: Peter Marko <[email protected]> +--- + sqlite3.c | 28 +++++++++++++--------------- + 1 file changed, 13 insertions(+), 15 deletions(-) + +diff --git a/sqlite3.c b/sqlite3.c +index 4cbc2d0..b7ed991 100644 +--- a/sqlite3.c ++++ b/sqlite3.c +@@ -147371,9 +147371,7 @@ struct WhereInfo { + ExprList *pOrderBy; /* The ORDER BY clause or NULL */ + ExprList *pResultSet; /* Result set of the query */ + Expr *pWhere; /* The complete WHERE clause */ +-#ifndef SQLITE_OMIT_VIRTUALTABLE +- Select *pLimit; /* Used to access LIMIT expr/registers for vtabs */ +-#endif ++ Select *pSelect; /* The entire SELECT statement containing WHERE */ + int aiCurOnePass[2]; /* OP_OpenWrite cursors for the ONEPASS opt */ + int iContinue; /* Jump here to continue with next record */ + int iBreak; /* Jump here to break out of the loop */ +@@ -149070,9 +149068,9 @@ SQLITE_PRIVATE Bitmask sqlite3WhereCodeOneLoopStart( + && pLoop->u.vtab.bOmitOffset + ){ + assert( pTerm->eOperator==WO_AUX ); +- assert( pWInfo->pLimit!=0 ); +- assert( pWInfo->pLimit->iOffset>0 ); +- sqlite3VdbeAddOp2(v, OP_Integer, 0, pWInfo->pLimit->iOffset); ++ assert( pWInfo->pSelect!=0 ); ++ assert( pWInfo->pSelect->iOffset>0 ); ++ sqlite3VdbeAddOp2(v, OP_Integer, 0, pWInfo->pSelect->iOffset); + VdbeComment((v,"Zero OFFSET counter")); + } + } +@@ -151830,10 +151828,10 @@ static void whereAddLimitExpr( + ** exist only so that they may be passed to the xBestIndex method of the + ** single virtual table in the FROM clause of the SELECT. + */ +-SQLITE_PRIVATE void sqlite3WhereAddLimit(WhereClause *pWC, Select *p){ +- assert( p==0 || (p->pGroupBy==0 && (p->selFlags & SF_Aggregate)==0) ); +- if( (p && p->pLimit) /* 1 */ +- && (p->selFlags & (SF_Distinct|SF_Aggregate))==0 /* 2 */ ++SQLITE_PRIVATE void SQLITE_NOINLINE sqlite3WhereAddLimit(WhereClause *pWC, Select *p){ ++ assert( p!=0 && p->pLimit!=0 ); /* 1 -- checked by caller */ ++ assert( p->pGroupBy==0 && (p->selFlags & SF_Aggregate)==0 ); ++ if( (p->selFlags & (SF_Distinct|SF_Aggregate))==0 /* 2 */ + && (p->pSrc->nSrc==1 && IsVirtual(p->pSrc->a[0].pTab)) /* 3 */ + ){ + ExprList *pOrderBy = p->pOrderBy; +@@ -157427,7 +157425,7 @@ SQLITE_PRIVATE WhereInfo *sqlite3WhereBegin( + Expr *pWhere, /* The WHERE clause */ + ExprList *pOrderBy, /* An ORDER BY (or GROUP BY) clause, or NULL */ + ExprList *pResultSet, /* Query result set. Req'd for DISTINCT */ +- Select *pLimit, /* Use this LIMIT/OFFSET clause, if any */ ++ Select *pSelect, /* The entire SELECT statement */ + u16 wctrlFlags, /* The WHERE_* flags defined in sqliteInt.h */ + int iAuxArg /* If WHERE_OR_SUBCLAUSE is set, index cursor number + ** If WHERE_USE_LIMIT, then the limit amount */ +@@ -157504,9 +157502,7 @@ SQLITE_PRIVATE WhereInfo *sqlite3WhereBegin( + pWInfo->wctrlFlags = wctrlFlags; + pWInfo->iLimit = iAuxArg; + pWInfo->savedNQueryLoop = pParse->nQueryLoop; +-#ifndef SQLITE_OMIT_VIRTUALTABLE +- pWInfo->pLimit = pLimit; +-#endif ++ pWInfo->pSelect = pSelect; + memset(&pWInfo->nOBSat, 0, + offsetof(WhereInfo,sWC) - offsetof(WhereInfo,nOBSat)); + memset(&pWInfo->a[0], 0, sizeof(WhereLoop)+nTabList*sizeof(WhereLevel)); +@@ -157575,7 +157571,9 @@ SQLITE_PRIVATE WhereInfo *sqlite3WhereBegin( + + /* Analyze all of the subexpressions. */ + sqlite3WhereExprAnalyze(pTabList, &pWInfo->sWC); +- sqlite3WhereAddLimit(&pWInfo->sWC, pLimit); ++ if( pSelect && pSelect->pLimit ){ ++ sqlite3WhereAddLimit(&pWInfo->sWC, pSelect); ++ } + if( db->mallocFailed ) goto whereBeginError; + + /* Special case: WHERE terms that do not refer to any tables in the joinmeta/recipes-support/sqlite/files/CVE-2025-7458.patch new file +32
-0@@ -0,0 +1,32 @@ +From b816ca9994e03a8bc829b49452b8158a731e81a9 Mon Sep 17 00:00:00 2001 +From: drh <> +Date: Thu, 16 Mar 2023 20:54:29 +0000 +Subject: [PATCH] Correctly handle SELECT DISTINCT ... ORDER BY when all of the + result set terms are constant and there are more result set terms than ORDER + BY terms. Fix for these tickets: [c36cdb4afd504dc1], [4051a7f931d9ba24], + [d6fd512f50513ab7]. + +FossilOrigin-Name: 12ad822d9b827777526ca5ed5bf3e678d600294fc9b5c25482dfff2a021328a4 + +CVE: CVE-2025-7458 +Upstream-Status: Backport [github.com/sqlite/sqlite/commit/b816ca9994e03a8bc829b49452b8158a731e81a9] +Signed-off-by: Peter Marko <[email protected]> +--- + sqlite3.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/sqlite3.c b/sqlite3.c +index 19d0438..6d92184 100644 +--- a/sqlite3.c ++++ b/sqlite3.c +@@ -156989,6 +156989,10 @@ static int wherePathSolver(WhereInfo *pWInfo, LogEst nRowEst){ + if( pFrom->isOrdered==pWInfo->pOrderBy->nExpr ){ + pWInfo->eDistinct = WHERE_DISTINCT_ORDERED; + } ++ if( pWInfo->pSelect->pOrderBy ++ && pWInfo->nOBSat > pWInfo->pSelect->pOrderBy->nExpr ){ ++ pWInfo->nOBSat = pWInfo->pSelect->pOrderBy->nExpr; ++ } + }else{ + pWInfo->nOBSat = pFrom->isOrdered; + pWInfo->revMask = pFrom->revLoop;meta/recipes-support/sqlite/sqlite3_3.38.5.bb +2
-1@@ -10,6 +10,8 @@ SRC_URI = "http://www.sqlite.org/2022/sqlite-autoconf-${SQLITE_PV}.tar.gz \ file://CVE-2023-7104.patch \ file://CVE-2025-29088.patch \ file://CVE-2025-6965.patch \ + file://0001-This-branch-attempts-to-improve-the-detection-of-cov.patch \ + file://CVE-2025-7458.patch \ " SRC_URI[sha256sum] = "5af07de982ba658fd91a03170c945f99c971f6955bc79df3266544373e39869c" -=-=-=-=-=-=-=-=-=-=-=-Links: You receive all messages sent to this group.
View/Reply Online (#221481): https://lists.openembedded.org/g/openembedded-core/message/221481
Mute This Topic: https://lists.openembedded.org/mt/114551672/3618471
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [OE-core][kirkstone 2/4] sqlite3: patch CVE-2025-7458
Quoted 5 lines · Niko Mauno
We have found that since this patch SELECT queries with COUNT(DISTINCT(column)) seem to cause sqlite to segfault. E.g.
# sqlite3 :memory: 'create table foo (x int); select count(distinct(x)) from foo;' Segmentation fault (core dumped)
Hi Peter,
Could you check this to see if you can reproduce it?
If so, we should revert this patch.
Steve
Quoted 180 lines · Steve Sakoman via lists.openembedded.org
Quoted 178 lines
From: Peter Marko <[email protected]>
Pick patch [1] listed in [2].
Also pick another patch which is precondition to this one introducing variable needed for the check.[1] https://sqlite.org/src/info/12ad822d9b827777
[2] https://nvd.nist.gov/vuln/detail/CVE-2025-7458Signed-off-by Peter Marko <[email protected]>Signed-off-by Steve Sakoman <[email protected]>--- ...mpts-to-improve-the-detection-of-cov.patch | 91 +++++++++++++++++++ .../sqlite/files/CVE-2025-7458.patch | 32 +++++++ meta/recipes-support/sqlite/sqlite3_3.38.5.bb | 2 + 3 files changed, 125 insertions(+)create mode 100644
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to-improve-the-detection-of-cov.patchcreate mode 100644meta/recipes-support/sqlite/files/CVE-2025-7458.patchmeta/recipes-support/sqlite/files/0001-This-branch-attempts-to-improve-the-detection-of-cov.patch new file +91
-0@@ -0,0 +1,91 @@ +From f55a7dad195994f2bb24db7df0a0515502386fe2 Mon Sep 17 00:00:00 2001 +From: drh <> +Date: Sat, 22 Oct 2022 14:16:02 +0000 +Subject: [PATCH] This branch attempts to improve the detection of covering + indexes. This first check-in merely improves a parameter name to + sqlite3WhereBegin() to be more descriptive of what it contains, and ensures + that a subroutine is not inlines so that sqlite3WhereBegin() runs slightly + faster. + +FossilOrigin-Name: cadf5f6bb1ce0492ef858ada476288e8057afd3609caa18b09c818d3845d7244 + +Upstream-Status: Backport [https://github.com/sqlite/sqlite/commit/f55a7dad195994f2bb24db7df0a0515502386fe2] +Signed-off-by: Peter Marko <[email protected]> +--- + sqlite3.c | 28 +++++++++++++--------------- + 1 file changed, 13 insertions(+), 15 deletions(-) + +diff --git a/sqlite3.c b/sqlite3.c +index 4cbc2d0..b7ed991 100644 +--- a/sqlite3.c ++++ b/sqlite3.c +@@ -147371,9 +147371,7 @@ struct WhereInfo { + ExprList *pOrderBy; /* The ORDER BY clause or NULL */ + ExprList *pResultSet; /* Result set of the query */ + Expr *pWhere; /* The complete WHERE clause */ +-#ifndef SQLITE_OMIT_VIRTUALTABLE +- Select *pLimit; /* Used to access LIMIT expr/registers for vtabs */ +-#endif ++ Select *pSelect; /* The entire SELECT statement containing WHERE */ + int aiCurOnePass[2]; /* OP_OpenWrite cursors for the ONEPASS opt */ + int iContinue; /* Jump here to continue with next record */ + int iBreak; /* Jump here to break out of the loop */ +@@ -149070,9 +149068,9 @@ SQLITE_PRIVATE Bitmask sqlite3WhereCodeOneLoopStart( + && pLoop->u.vtab.bOmitOffset + ){ + assert( pTerm->eOperator==WO_AUX ); +- assert( pWInfo->pLimit!=0 ); +- assert( pWInfo->pLimit->iOffset>0 ); +- sqlite3VdbeAddOp2(v, OP_Integer, 0, pWInfo->pLimit->iOffset); ++ assert( pWInfo->pSelect!=0 ); ++ assert( pWInfo->pSelect->iOffset>0 ); ++ sqlite3VdbeAddOp2(v, OP_Integer, 0, pWInfo->pSelect->iOffset); + VdbeComment((v,"Zero OFFSET counter")); + } + } +@@ -151830,10 +151828,10 @@ static void whereAddLimitExpr( + ** exist only so that they may be passed to the xBestIndex method of the + ** single virtual table in the FROM clause of the SELECT. + */ +-SQLITE_PRIVATE void sqlite3WhereAddLimit(WhereClause *pWC, Select *p){ +- assert( p==0 || (p->pGroupBy==0 && (p->selFlags & SF_Aggregate)==0) ); +- if( (p && p->pLimit) /* 1 */ +- && (p->selFlags & (SF_Distinct|SF_Aggregate))==0 /* 2 */ ++SQLITE_PRIVATE void SQLITE_NOINLINE sqlite3WhereAddLimit(WhereClause *pWC, Select *p){ ++ assert( p!=0 && p->pLimit!=0 ); /* 1 -- checked by caller */ ++ assert( p->pGroupBy==0 && (p->selFlags & SF_Aggregate)==0 ); ++ if( (p->selFlags & (SF_Distinct|SF_Aggregate))==0 /* 2 */ + && (p->pSrc->nSrc==1 && IsVirtual(p->pSrc->a[0].pTab)) /* 3 */ + ){ + ExprList *pOrderBy = p->pOrderBy; +@@ -157427,7 +157425,7 @@ SQLITE_PRIVATE WhereInfo *sqlite3WhereBegin( + Expr *pWhere, /* The WHERE clause */ + ExprList *pOrderBy, /* An ORDER BY (or GROUP BY) clause, or NULL */ + ExprList *pResultSet, /* Query result set. Req'd for DISTINCT */ +- Select *pLimit, /* Use this LIMIT/OFFSET clause, if any */ ++ Select *pSelect, /* The entire SELECT statement */ + u16 wctrlFlags, /* The WHERE_* flags defined in sqliteInt.h */ + int iAuxArg /* If WHERE_OR_SUBCLAUSE is set, index cursor number + ** If WHERE_USE_LIMIT, then the limit amount */ +@@ -157504,9 +157502,7 @@ SQLITE_PRIVATE WhereInfo *sqlite3WhereBegin( + pWInfo->wctrlFlags = wctrlFlags; + pWInfo->iLimit = iAuxArg; + pWInfo->savedNQueryLoop = pParse->nQueryLoop; +-#ifndef SQLITE_OMIT_VIRTUALTABLE +- pWInfo->pLimit = pLimit; +-#endif ++ pWInfo->pSelect = pSelect; + memset(&pWInfo->nOBSat, 0, + offsetof(WhereInfo,sWC) - offsetof(WhereInfo,nOBSat)); + memset(&pWInfo->a[0], 0, sizeof(WhereLoop)+nTabList*sizeof(WhereLevel)); +@@ -157575,7 +157571,9 @@ SQLITE_PRIVATE WhereInfo *sqlite3WhereBegin( + + /* Analyze all of the subexpressions. */ + sqlite3WhereExprAnalyze(pTabList, &pWInfo->sWC); +- sqlite3WhereAddLimit(&pWInfo->sWC, pLimit); ++ if( pSelect && pSelect->pLimit ){ ++ sqlite3WhereAddLimit(&pWInfo->sWC, pSelect); ++ } + if( db->mallocFailed ) goto whereBeginError; + + /* Special case: WHERE terms that do not refer to any tables in the joinmeta/recipes-support/sqlite/files/CVE-2025-7458.patch new file +32
-0@@ -0,0 +1,32 @@ +From b816ca9994e03a8bc829b49452b8158a731e81a9 Mon Sep 17 00:00:00 2001 +From: drh <> +Date: Thu, 16 Mar 2023 20:54:29 +0000 +Subject: [PATCH] Correctly handle SELECT DISTINCT ... ORDER BY when all of the + result set terms are constant and there are more result set terms than ORDER + BY terms. Fix for these tickets: [c36cdb4afd504dc1], [4051a7f931d9ba24], + [d6fd512f50513ab7]. + +FossilOrigin-Name: 12ad822d9b827777526ca5ed5bf3e678d600294fc9b5c25482dfff2a021328a4 + +CVE: CVE-2025-7458 +Upstream-Status: Backport [github.com/sqlite/sqlite/commit/b816ca9994e03a8bc829b49452b8158a731e81a9] +Signed-off-by: Peter Marko <[email protected]> +--- + sqlite3.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/sqlite3.c b/sqlite3.c +index 19d0438..6d92184 100644 +--- a/sqlite3.c ++++ b/sqlite3.c +@@ -156989,6 +156989,10 @@ static int wherePathSolver(WhereInfo *pWInfo, LogEst nRowEst){ + if( pFrom->isOrdered==pWInfo->pOrderBy->nExpr ){ + pWInfo->eDistinct = WHERE_DISTINCT_ORDERED; + } ++ if( pWInfo->pSelect->pOrderBy ++ && pWInfo->nOBSat > pWInfo->pSelect->pOrderBy->nExpr ){ ++ pWInfo->nOBSat = pWInfo->pSelect->pOrderBy->nExpr; ++ } + }else{ + pWInfo->nOBSat = pFrom->isOrdered; + pWInfo->revMask = pFrom->revLoop;meta/recipes-support/sqlite/sqlite3_3.38.5.bb +2
-1@@ -10,6 +10,8 @@ SRC_URI = "http://www.sqlite.org/2022/sqlite-autoconf-${SQLITE_PV}.tar.gz \ file://CVE-2023-7104.patch \ file://CVE-2025-29088.patch \ file://CVE-2025-6965.patch \ + file://0001-This-branch-attempts-to-improve-the-detection-of-cov.patch \ + file://CVE-2025-7458.patch \ " SRC_URI[sha256sum] = "5af07de982ba658fd91a03170c945f99c971f6955bc79df3266544373e39869c" -=-=-=-=-=-=-=-=-=-=-=-Links: You receive all messages sent to this group.
View/Reply Online (#221481): https://lists.openembedded.org/g/openembedded-core/message/221481
Mute This Topic: https://lists.openembedded.org/mt/114551672/3618471
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
RE: [OE-core][kirkstone 2/4] sqlite3: patch CVE-2025-7458
Quoted 13 lines
-----Original Message-----
From: Steve Sakoman <[email protected]>
Sent: Friday, August 29, 2025 17:38
To: Marko, Peter (FT D EU SK BFS1) <[email protected]>
Cc: [email protected]; Niko Mauno <[email protected]>
Subject: Re: [OE-core][kirkstone 2/4] sqlite3: patch CVE-2025-7458Quoted 2 lines · Niko Mauno
We have found that since this patch SELECT queries with
Quoted 8 lines
COUNT(DISTINCT(column)) seem to cause sqlite to segfault. E.g.
Quoted 3 lines
# sqlite3 :memory: 'create table foo (x int); select count(distinct(x)) from foo;' Segmentation fault (core dumped)Hi Peter,
Could you check this to see if you can reproduce it?
I'll be offline for next two weeks, please revert and I'll check it when I'm back.
Quoted 217 lines
If so, we should revert this patch.
Steve
Quoted 10 lines · Steve Sakoman via lists.openembedded.org
Quoted 9 lines
From: Peter Marko <[email protected]>
Pick patch [1] listed in [2].
Also pick another patch which is precondition to this one introducing variable needed for the check.[1] https://sqlite.org/src/info/12ad822d9b827777
[2] https://nvd.nist.gov/vuln/detail/CVE-2025-7458Quoted 8 lines
Quoted 8 lines
Signed-off-by Peter Marko <[email protected]>Signed-off-by Steve Sakoman <[email protected]>--- ...mpts-to-improve-the-detection-of-cov.patch | 91 +++++++++++++++++++ .../sqlite/files/CVE-2025-7458.patch | 32 +++++++ meta/recipes-support/sqlite/sqlite3_3.38.5.bb | 2 + 3 files changed, 125 insertions(+)create mode 100644 meta/recipes-support/sqlite/files/0001-This-branch-
attempts-to-improve-the-detection-of-cov.patch
Quoted 3 lines
Review
Quoted 3 lines
create mode 100644
meta/recipes-support/sqlite/files/CVE-2025-7458.patch(quoted diff) +0
-0improve-the-detection-of-cov.patch b/meta/recipes-support/sqlite/files/0001-This- branch-attempts-to-improve-the-detection-of-cov.patch
Quoted 4 lines
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to-
Quoted 4 lines
new file mode 100644
index 0000000000..8fb037bb0fmeta/recipes-support/sqlite/files/0001-This-branch-attempts-to- new file +0
-0improve-the-detection-of-cov.patch
Quoted 2 lines
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to- line 1
Quoted 2 lines
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to- new file +1
-0@@ -0,0 +1,91 @@ +From f55a7dad195994f2bb24db7df0a0515502386fe2 Mon Sep 17 00:00:002001
Quoted 9 lines
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to- line 10
Quoted 9 lines
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to- new file +9
-0+From: drh <> +Date: Sat, 22 Oct 2022 14:16:02 +0000 +Subject: [PATCH] This branch attempts to improve the detection of covering + indexes. This first check-in merely improves a parameter name to + sqlite3WhereBegin() to be more descriptive of what it contains, and ensures + that a subroutine is not inlines so that sqlite3WhereBegin() runs slightly + faster. + +FossilOrigin-Name:
cadf5f6bb1ce0492ef858ada476288e8057afd3609caa18b09c818d3845d7244Quoted 2 lines
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to- line 12
Quoted 2 lines
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to- new file +2
-0+ +Upstream-Status: Backport[https://github.com/sqlite/sqlite/commit/f55a7dad195994f2bb24db7df0a051550238
6fe2]Quoted 9 lines
Quoted 9 lines
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to- new file +9
-0+Signed-off-by: Peter Marko <[email protected]> +--- + sqlite3.c | 28 +++++++++++++--------------- + 1 file changed, 13 insertions(+), 15 deletions(-) + +diff --git a/sqlite3.c b/sqlite3.c +index 4cbc2d0..b7ed991 100644 +--- a/sqlite3.c ++++ b/sqlite3.cQuoted 8 lines
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to- line 29
Quoted 8 lines
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to- new file +8
-0+@@ -147371,9 +147371,7 @@ struct WhereInfo { + ExprList *pOrderBy; /* The ORDER BY clause or NULL */ + ExprList *pResultSet; /* Result set of the query */ + Expr *pWhere; /* The complete WHERE clause */ +-#ifndef SQLITE_OMIT_VIRTUALTABLE +- Select *pLimit; /* Used to access LIMIT expr/registers for vtabs */ +-#endif ++ Select *pSelect; /* The entire SELECT statement containingWHERE */
Quoted 4 lines
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to- line 33
Quoted 4 lines
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to- new file +4
-0+ int aiCurOnePass[2]; /* OP_OpenWrite cursors for the ONEPASS opt */ + int iContinue; /* Jump here to continue with next record */ + int iBreak; /* Jump here to break out of the loop */ +@@ -149070,9 +149068,9 @@ SQLITE_PRIVATE Bitmasksqlite3WhereCodeOneLoopStart(
Quoted 9 lines
Quoted 9 lines
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to- new file +9
-0+ && pLoop->u.vtab.bOmitOffset + ){ + assert( pTerm->eOperator==WO_AUX ); +- assert( pWInfo->pLimit!=0 ); +- assert( pWInfo->pLimit->iOffset>0 ); +- sqlite3VdbeAddOp2(v, OP_Integer, 0, pWInfo->pLimit->iOffset); ++ assert( pWInfo->pSelect!=0 ); ++ assert( pWInfo->pSelect->iOffset>0 ); ++ sqlite3VdbeAddOp2(v, OP_Integer, 0, pWInfo->pSelect->iOffset);Quoted 8 lines
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to- line 50
Quoted 8 lines
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to- new file +8
-0+ VdbeComment((v,"Zero OFFSET counter")); + } + } +@@ -151830,10 +151828,10 @@ static void whereAddLimitExpr( + ** exist only so that they may be passed to the xBestIndex method of the + ** single virtual table in the FROM clause of the SELECT. + */ +-SQLITE_PRIVATE void sqlite3WhereAddLimit(WhereClause *pWC, Select*p){
Quoted 1 line
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to- line 51
Quoted 1 line
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to- new file +1
-0+- assert( p==0 || (p->pGroupBy==0 && (p->selFlags & SF_Aggregate)==0));
Quoted 3 lines
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to- line 54
Quoted 3 lines
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to- new file +3
-0+- if( (p && p->pLimit) /* 1 */ +- && (p->selFlags & (SF_Distinct|SF_Aggregate))==0 /* 2 */ ++SQLITE_PRIVATE void SQLITE_NOINLINE
sqlite3WhereAddLimit(WhereClause *pWC, Select *p){Quoted 7 lines
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to- line 61
Quoted 7 lines
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to- new file +7
-0++ assert( p!=0 && p->pLimit!=0 ); /* 1 -- checked by caller */ ++ assert( p->pGroupBy==0 && (p->selFlags & SF_Aggregate)==0 ); ++ if( (p->selFlags & (SF_Distinct|SF_Aggregate))==0 /* 2 */ + && (p->pSrc->nSrc==1 && IsVirtual(p->pSrc->a[0].pTab)) /* 3 */ + ){ + ExprList *pOrderBy = p->pOrderBy; +@@ -157427,7 +157425,7 @@ SQLITE_PRIVATE WhereInfo*sqlite3WhereBegin(
Quoted 2 lines
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to- line 63
Quoted 2 lines
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to- new file +2
-0+ Expr *pWhere, /* The WHERE clause */ + ExprList *pOrderBy, /* An ORDER BY (or GROUP BY) clause, or NULL*/
Quoted 5 lines
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to- line 68
Quoted 5 lines
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to- new file +5
-0+ ExprList *pResultSet, /* Query result set. Req'd for DISTINCT */ +- Select *pLimit, /* Use this LIMIT/OFFSET clause, if any */ ++ Select *pSelect, /* The entire SELECT statement */ + u16 wctrlFlags, /* The WHERE_* flags defined in sqliteInt.h */ + int iAuxArg /* If WHERE_OR_SUBCLAUSE is set, index cursornumber
Quoted 2 lines
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to- line 70
Quoted 2 lines
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to- new file +2
-0+ ** If WHERE_USE_LIMIT, then the limit amount */ +@@ -157504,9 +157502,7 @@ SQLITE_PRIVATE WhereInfo*sqlite3WhereBegin(
Quoted 10 lines
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to- line 80
Quoted 10 lines
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to- new file +10
-0+ pWInfo->wctrlFlags = wctrlFlags; + pWInfo->iLimit = iAuxArg; + pWInfo->savedNQueryLoop = pParse->nQueryLoop; +-#ifndef SQLITE_OMIT_VIRTUALTABLE +- pWInfo->pLimit = pLimit; +-#endif ++ pWInfo->pSelect = pSelect; + memset(&pWInfo->nOBSat, 0, + offsetof(WhereInfo,sWC) - offsetof(WhereInfo,nOBSat)); + memset(&pWInfo->a[0], 0,sizeof(WhereLoop)+nTabList*sizeof(WhereLevel));
Quoted 1 line
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to- line 81
Quoted 1 line
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to- new file +1
-0+@@ -157575,7 +157571,9 @@ SQLITE_PRIVATE WhereInfo*sqlite3WhereBegin(
Quoted 11 lines
Review
Quoted 11 lines
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to- new file +10
-0+ + /* Analyze all of the subexpressions. */ + sqlite3WhereExprAnalyze(pTabList, &pWInfo->sWC); +- sqlite3WhereAddLimit(&pWInfo->sWC, pLimit); ++ if( pSelect && pSelect->pLimit ){ ++ sqlite3WhereAddLimit(&pWInfo->sWC, pSelect); ++ } + if( db->mallocFailed ) goto whereBeginError; + + /* Special case: WHERE terms that do not refer to any tables in the join(quoted diff) +0
-0
b/meta/recipes-support/sqlite/files/CVE-2025-7458.patchQuoted 6 lines
meta/recipes-support/sqlite/files/CVE-2025-7458.patch line 1
Quoted 6 lines
new file mode 100644
index 0000000000..6b041d9332meta/recipes-support/sqlite/files/CVE-2025-7458.patch new file +1
-0@@ -0,0 +1,32 @@ +From b816ca9994e03a8bc829b49452b8158a731e81a9 Mon Sep 17 00:00:002001
Quoted 3 lines
meta/recipes-support/sqlite/files/CVE-2025-7458.patch
Quoted 3 lines
meta/recipes-support/sqlite/files/CVE-2025-7458.patch new file +3
-0+From: drh <> +Date: Thu, 16 Mar 2023 20:54:29 +0000 +Subject: [PATCH] Correctly handle SELECT DISTINCT ... ORDER BY whenall of the
Quoted 1 line
meta/recipes-support/sqlite/files/CVE-2025-7458.patch line 5
Quoted 1 line
meta/recipes-support/sqlite/files/CVE-2025-7458.patch new file +1
-0+ result set terms are constant and there are more result set terms thanORDER
Quoted 4 lines
meta/recipes-support/sqlite/files/CVE-2025-7458.patch
Quoted 4 lines
meta/recipes-support/sqlite/files/CVE-2025-7458.patch new file +4
-0+ BY terms. Fix for these tickets: [c36cdb4afd504dc1], [4051a7f931d9ba24], + [d6fd512f50513ab7]. + +FossilOrigin-Name:
12ad822d9b827777526ca5ed5bf3e678d600294fc9b5c25482dfff2a021328a4Quoted 3 lines
meta/recipes-support/sqlite/files/CVE-2025-7458.patch
Quoted 3 lines
meta/recipes-support/sqlite/files/CVE-2025-7458.patch new file +3
-0+ +CVE: CVE-2025-7458 +Upstream-Status: Backport[github.com/sqlite/sqlite/commit/b816ca9994e03a8bc829b49452b8158a731e81a9]
Quoted 10 lines
meta/recipes-support/sqlite/files/CVE-2025-7458.patch
Quoted 10 lines
meta/recipes-support/sqlite/files/CVE-2025-7458.patch new file +10
-0+Signed-off-by: Peter Marko <[email protected]> +--- + sqlite3.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/sqlite3.c b/sqlite3.c +index 19d0438..6d92184 100644 +--- a/sqlite3.c ++++ b/sqlite3.c +@@ -156989,6 +156989,10 @@ static int wherePathSolver(WhereInfo*pWInfo, LogEst nRowEst){
Quoted 11 lines
meta/recipes-
Quoted 11 lines
meta/recipes-support/sqlite/files/CVE-2025-7458.patch new file +10
-0+ if( pFrom->isOrdered==pWInfo->pOrderBy->nExpr ){ + pWInfo->eDistinct = WHERE_DISTINCT_ORDERED; + } ++ if( pWInfo->pSelect->pOrderBy ++ && pWInfo->nOBSat > pWInfo->pSelect->pOrderBy->nExpr ){ ++ pWInfo->nOBSat = pWInfo->pSelect->pOrderBy->nExpr; ++ } + }else{ + pWInfo->nOBSat = pFrom->isOrdered; + pWInfo->revMask = pFrom->revLoop;meta/recipes- renamed from meta/recipes-support/sqlite/sqlite3_3.38.5.bb +0
-0support/sqlite/sqlite3_3.38.5.bb
Quoted 4 lines
meta/recipes-support/sqlite/sqlite3_3.38.5.bb SRC_URI = "http://www.sqlite.org/2022/sqlite-autoconf-
Quoted 4 lines
index
656e2d8bd8..86d9b4b33b100644meta/recipes-support/sqlite/sqlite3_3.38.5.bb +0
-0@@ -10,6 +10,8 @@ SRC_URI = "http://www.sqlite.org/2022/sqlite-autoconf-${SQLITE_PV}.tar.gz \
Quoted 4 lines
meta/recipes-support/sqlite/sqlite3_3.38.5.bb SRC_URI = "http://www.sqlite.org/2022/sqlite-autoconf-${SQLITE_PV}.tar.gz \
Quoted 4 lines
meta/recipes-support/sqlite/sqlite3_3.38.5.bb +1
-0file://CVE-2023-7104.patch \ file://CVE-2025-29088.patch \ file://CVE-2025-6965.patch \ + file://0001-This-branch-attempts-to-improve-the-detection-of-cov.patch \
Quoted 3 lines
meta/recipes-support/sqlite/sqlite3_3.38.5.bb SRC_URI = "http://www.sqlite.org/2022/sqlite-autoconf-${SQLITE_PV}.tar.gz \
Quoted 3 lines
meta/recipes-support/sqlite/sqlite3_3.38.5.bb +1
-0+ file://CVE-2025-7458.patch \ " SRC_URI[sha256sum] ="
5af07de982ba658fd91a03170c945f99c971f6955bc79df3266544373e39869c"Quoted 7 lines
Quoted 7 lines
meta/recipes-support/sqlite/sqlite3_3.38.5.bb +0
-1-=-=-=-=-=-=-=-=-=-=-=-Links: You receive all messages sent to this group. View/Reply Online (#221481):
https://lists.openembedded.org/g/openembedded-core/message/221481
Quoted 3 lines
Quoted 3 lines
Mute This Topic: https://lists.openembedded.org/mt/114551672/3618471
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsubQuoted 3 lines
Quoted 2 lines
-=-=-=-=-=-=-=-=-=-=-=-
RE: [OE-core][kirkstone 2/4] sqlite3: patch CVE-2025-7458
I have looked at the problem and reverting was the correct action.
Trying to identify missing patch I realized that the CVE does not affect our version, so I'd have to backport additional patches which would first introduce the CVE and then fix it.
Sorry for this inconvenience.
Peter
Quoted 264 lines
-----Original Message-----
From: Marko, Peter (FT D EU SK BFS1)
Sent: Sunday, August 31, 2025 23:12
To: Steve Sakoman <[email protected]>
Cc: [email protected]; Niko Mauno <[email protected]>
Subject: RE: [OE-core][kirkstone 2/4] sqlite3: patch CVE-2025-7458Quoted 9 lines
-----Original Message-----
From: Steve Sakoman <[email protected]>
Sent: Friday, August 29, 2025 17:38
To: Marko, Peter (FT D EU SK BFS1) <[email protected]>
Cc: [email protected]; Niko Mauno <[email protected]>
Subject: Re: [OE-core][kirkstone 2/4] sqlite3: patch CVE-2025-7458On Fri, Aug 29, 2025 at 4:25 AM Niko Mauno <[email protected]>
Quoted 10 lines · wrote:
Quoted 2 lines
We have found that since this patch SELECT queries with
COUNT(DISTINCT(column)) seem to cause sqlite to segfault. E.g.
Quoted 3 lines
# sqlite3 :memory: 'create table foo (x int); select count(distinct(x)) from foo;' Segmentation fault (core dumped)Hi Peter,
Could you check this to see if you can reproduce it?
I'll be offline for next two weeks, please revert and I'll check it when I'm back.
Quoted 19 lines
If so, we should revert this patch.
Steve
Quoted 14 lines · Steve Sakoman via lists.openembedded.org
Quoted 13 lines
From: Peter Marko <[email protected]>
Pick patch [1] listed in [2].
Also pick another patch which is precondition to this one introducing variable needed for the check.[1] https://sqlite.org/src/info/12ad822d9b827777
[2] https://nvd.nist.gov/vuln/detail/CVE-2025-7458Signed-off-by Peter Marko <[email protected]>Signed-off-by Steve Sakoman <[email protected]>--- ...mpts-to-improve-the-detection-of-cov.patch | 91+++++++++++++++++++
Quoted 6 lines
Quoted 4 lines
Quoted 4 lines
.../sqlite/files/CVE-2025-7458.patch | 32 +++++++ meta/recipes-support/sqlite/sqlite3_3.38.5.bb | 2 + 3 files changed, 125 insertions(+)create mode 100644 meta/recipes-support/sqlite/files/0001-This-branch-
attempts-to-improve-the-detection-of-cov.patch
Quoted 1 line
Quoted 1 line
create mode 100644 meta/recipes-support/sqlite/files/CVE-2025-
7458.patch
Quoted 3 lines
Quoted 2 lines
Review
Quoted 2 lines
(quoted diff) +0
-0improve-the-detection-of-cov.patch b/meta/recipes-support/sqlite/files/0001-
This-
Quoted 6 lines
branch-attempts-to-improve-the-detection-of-cov.patch
Quoted 4 lines
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to-
Quoted 4 lines
new file mode 100644
index 0000000000..8fb037bb0fmeta/recipes-support/sqlite/files/0001-This-branch-attempts-to- new file +0
-0improve-the-detection-of-cov.patch
Quoted 6 lines
Quoted 2 lines
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to- line 1
Quoted 2 lines
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to- new file +1
-0@@ -0,0 +1,91 @@ +From f55a7dad195994f2bb24db7df0a0515502386fe2 Mon Sep 17 00:00:002001
Quoted 3 lines
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to- line 4
Quoted 3 lines
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to- new file +3
-0+From: drh <> +Date: Sat, 22 Oct 2022 14:16:02 +0000 +Subject: [PATCH] This branch attempts to improve the detection ofcovering
Quoted 2 lines
Quoted 2 lines
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to- line 6
Quoted 2 lines
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to- new file +2
-0+ indexes. This first check-in merely improves a parameter name to + sqlite3WhereBegin() to be more descriptive of what it contains, andensures
Quoted 8 lines
Quoted 4 lines
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to- line 10
Quoted 4 lines
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to- new file +4
-0+ that a subroutine is not inlines so that sqlite3WhereBegin() runs slightly + faster. + +FossilOrigin-Name:
cadf5f6bb1ce0492ef858ada476288e8057afd3609caa18b09c818d3845d7244Quoted 2 lines
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to- line 12
Quoted 2 lines
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to- new file +2
-0+ +Upstream-Status: Backport[https://github.com/sqlite/sqlite/commit/f55a7dad195994f2bb24db7df0a051550238
Quoted 11 lines
6fe2]
Quoted 10 lines
Quoted 10 lines
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to- new file +10
-0+Signed-off-by: Peter Marko <[email protected]> +--- + sqlite3.c | 28 +++++++++++++--------------- + 1 file changed, 13 insertions(+), 15 deletions(-) + +diff --git a/sqlite3.c b/sqlite3.c +index 4cbc2d0..b7ed991 100644 +--- a/sqlite3.c ++++ b/sqlite3.c +@@ -147371,9 +147371,7 @@ struct WhereInfo {Quoted 9 lines
Quoted 7 lines
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to- line 29
Quoted 7 lines
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to- new file +7
-0+ ExprList *pOrderBy; /* The ORDER BY clause or NULL */ + ExprList *pResultSet; /* Result set of the query */ + Expr *pWhere; /* The complete WHERE clause */ +-#ifndef SQLITE_OMIT_VIRTUALTABLE +- Select *pLimit; /* Used to access LIMIT expr/registers for vtabs */ +-#endif ++ Select *pSelect; /* The entire SELECT statement containingWHERE */
Quoted 1 line
Quoted 1 line
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to- new file +1
-0+ int aiCurOnePass[2]; /* OP_OpenWrite cursors for the ONEPASS opt*/
Quoted 21 lines
Quoted 3 lines
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to- line 33
Quoted 3 lines
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to- new file +3
-0+ int iContinue; /* Jump here to continue with next record */ + int iBreak; /* Jump here to break out of the loop */ +@@ -149070,9 +149068,9 @@ SQLITE_PRIVATE Bitmasksqlite3WhereCodeOneLoopStart(
Quoted 17 lines
Quoted 17 lines
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to- new file +17
-0+ && pLoop->u.vtab.bOmitOffset + ){ + assert( pTerm->eOperator==WO_AUX ); +- assert( pWInfo->pLimit!=0 ); +- assert( pWInfo->pLimit->iOffset>0 ); +- sqlite3VdbeAddOp2(v, OP_Integer, 0, pWInfo->pLimit->iOffset); ++ assert( pWInfo->pSelect!=0 ); ++ assert( pWInfo->pSelect->iOffset>0 ); ++ sqlite3VdbeAddOp2(v, OP_Integer, 0, pWInfo->pSelect->iOffset); + VdbeComment((v,"Zero OFFSET counter")); + } + } +@@ -151830,10 +151828,10 @@ static void whereAddLimitExpr( + ** exist only so that they may be passed to the xBestIndex method of the + ** single virtual table in the FROM clause of the SELECT. + */ +-SQLITE_PRIVATE void sqlite3WhereAddLimit(WhereClause *pWC,Select
Quoted 2 lines
*p){
Quoted 1 line
Quoted 1 line
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to- new file +1
-0+- assert( p==0 || (p->pGroupBy==0 && (p->selFlags &SF_Aggregate)==0)
Quoted 5 lines
);
Quoted 3 lines
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to- line 54
Quoted 3 lines
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to- new file +3
-0+- if( (p && p->pLimit) /* 1 */ +- && (p->selFlags & (SF_Distinct|SF_Aggregate))==0 /* 2 */ ++SQLITE_PRIVATE void SQLITE_NOINLINE
sqlite3WhereAddLimit(WhereClause *pWC, Select *p){Quoted 10 lines
Quoted 7 lines
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to- line 61
Quoted 7 lines
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to- new file +7
-0++ assert( p!=0 && p->pLimit!=0 ); /* 1 -- checked by caller */ ++ assert( p->pGroupBy==0 && (p->selFlags & SF_Aggregate)==0 ); ++ if( (p->selFlags & (SF_Distinct|SF_Aggregate))==0 /* 2 */ + && (p->pSrc->nSrc==1 && IsVirtual(p->pSrc->a[0].pTab)) /* 3 */ + ){ + ExprList *pOrderBy = p->pOrderBy; +@@ -157427,7 +157425,7 @@ SQLITE_PRIVATE WhereInfo*sqlite3WhereBegin(
Quoted 2 lines
Quoted 2 lines
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to- new file +2
-0+ Expr *pWhere, /* The WHERE clause */ + ExprList *pOrderBy, /* An ORDER BY (or GROUP BY) clause, orNULL
Quoted 35 lines
*/
Quoted 5 lines
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to- line 68
Quoted 5 lines
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to- new file +5
-0+ ExprList *pResultSet, /* Query result set. Req'd for DISTINCT */ +- Select *pLimit, /* Use this LIMIT/OFFSET clause, if any */ ++ Select *pSelect, /* The entire SELECT statement */ + u16 wctrlFlags, /* The WHERE_* flags defined in sqliteInt.h */ + int iAuxArg /* If WHERE_OR_SUBCLAUSE is set, index cursornumber
Quoted 2 lines
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to- line 70
Quoted 2 lines
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to- new file +2
-0+ ** If WHERE_USE_LIMIT, then the limit amount */ +@@ -157504,9 +157502,7 @@ SQLITE_PRIVATE WhereInfo*sqlite3WhereBegin(
Quoted 10 lines
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to- line 80
Quoted 10 lines
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to- new file +10
-0+ pWInfo->wctrlFlags = wctrlFlags; + pWInfo->iLimit = iAuxArg; + pWInfo->savedNQueryLoop = pParse->nQueryLoop; +-#ifndef SQLITE_OMIT_VIRTUALTABLE +- pWInfo->pLimit = pLimit; +-#endif ++ pWInfo->pSelect = pSelect; + memset(&pWInfo->nOBSat, 0, + offsetof(WhereInfo,sWC) - offsetof(WhereInfo,nOBSat)); + memset(&pWInfo->a[0], 0,sizeof(WhereLoop)+nTabList*sizeof(WhereLevel));
Quoted 1 line
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to- line 81
Quoted 1 line
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to- new file +1
-0+@@ -157575,7 +157571,9 @@ SQLITE_PRIVATE WhereInfo*sqlite3WhereBegin(
Quoted 11 lines
Review
Quoted 11 lines
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to- new file +10
-0+ + /* Analyze all of the subexpressions. */ + sqlite3WhereExprAnalyze(pTabList, &pWInfo->sWC); +- sqlite3WhereAddLimit(&pWInfo->sWC, pLimit); ++ if( pSelect && pSelect->pLimit ){ ++ sqlite3WhereAddLimit(&pWInfo->sWC, pSelect); ++ } + if( db->mallocFailed ) goto whereBeginError; + + /* Special case: WHERE terms that do not refer to any tables in the join(quoted diff) +0
-0
b/meta/recipes-support/sqlite/files/CVE-2025-7458.patchQuoted 6 lines
Quoted 6 lines
meta/recipes-support/sqlite/files/CVE-2025-7458.patch line 1
Quoted 6 lines
new file mode 100644
index 0000000000..6b041d9332meta/recipes-support/sqlite/files/CVE-2025-7458.patch new file +1
-0@@ -0,0 +1,32 @@ +From b816ca9994e03a8bc829b49452b8158a731e81a9 Mon Sep 1700:00:00
Quoted 4 lines
2001
Quoted 3 lines
meta/recipes-support/sqlite/files/CVE-2025-7458.patch
Quoted 3 lines
meta/recipes-support/sqlite/files/CVE-2025-7458.patch new file +3
-0+From: drh <> +Date: Thu, 16 Mar 2023 20:54:29 +0000 +Subject: [PATCH] Correctly handle SELECT DISTINCT ... ORDER BYwhen
Quoted 12 lines
all of the
Quoted 1 line
meta/recipes-support/sqlite/files/CVE-2025-7458.patch line 5
Quoted 1 line
meta/recipes-support/sqlite/files/CVE-2025-7458.patch new file +1
-0+ result set terms are constant and there are more result set terms thanORDER
Quoted 4 lines
meta/recipes-support/sqlite/files/CVE-2025-7458.patch
Quoted 4 lines
meta/recipes-support/sqlite/files/CVE-2025-7458.patch new file +4
-0+ BY terms. Fix for these tickets: [c36cdb4afd504dc1], [4051a7f931d9ba24], + [d6fd512f50513ab7]. + +FossilOrigin-Name:
12ad822d9b827777526ca5ed5bf3e678d600294fc9b5c25482dfff2a021328a4Quoted 3 lines
meta/recipes-support/sqlite/files/CVE-2025-7458.patch
Quoted 3 lines
meta/recipes-support/sqlite/files/CVE-2025-7458.patch new file +3
-0+ +CVE: CVE-2025-7458 +Upstream-Status: Backport[github.com/sqlite/sqlite/commit/b816ca9994e03a8bc829b49452b8158a731e81a9]
Quoted 23 lines
Quoted 10 lines
meta/recipes-support/sqlite/files/CVE-2025-7458.patch
Quoted 10 lines
meta/recipes-support/sqlite/files/CVE-2025-7458.patch new file +10
-0+Signed-off-by: Peter Marko <[email protected]> +--- + sqlite3.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/sqlite3.c b/sqlite3.c +index 19d0438..6d92184 100644 +--- a/sqlite3.c ++++ b/sqlite3.c +@@ -156989,6 +156989,10 @@ static int wherePathSolver(WhereInfo*pWInfo, LogEst nRowEst){
Quoted 11 lines
meta/recipes-
Quoted 11 lines
meta/recipes-support/sqlite/files/CVE-2025-7458.patch new file +10
-0+ if( pFrom->isOrdered==pWInfo->pOrderBy->nExpr ){ + pWInfo->eDistinct = WHERE_DISTINCT_ORDERED; + } ++ if( pWInfo->pSelect->pOrderBy ++ && pWInfo->nOBSat > pWInfo->pSelect->pOrderBy->nExpr ){ ++ pWInfo->nOBSat = pWInfo->pSelect->pOrderBy->nExpr; ++ } + }else{ + pWInfo->nOBSat = pFrom->isOrdered; + pWInfo->revMask = pFrom->revLoop;meta/recipes- renamed from meta/recipes-support/sqlite/sqlite3_3.38.5.bb +0
-0support/sqlite/sqlite3_3.38.5.bb
Quoted 4 lines
Quoted 4 lines
meta/recipes-support/sqlite/sqlite3_3.38.5.bb SRC_URI = "http://www.sqlite.org/2022/sqlite-
Quoted 4 lines
index
656e2d8bd8..86d9b4b33b100644meta/recipes-support/sqlite/sqlite3_3.38.5.bb +0
-0@@ -10,6 +10,8 @@ SRC_URI = "http://www.sqlite.org/2022/sqlite-autoconf-
Quoted 25 lines
${SQLITE_PV}.tar.gz \
Quoted 4 lines
meta/recipes-support/sqlite/sqlite3_3.38.5.bb SRC_URI = "http://www.sqlite.org/2022/sqlite-autoconf-${SQLITE_PV}.tar.gz \
Quoted 4 lines
meta/recipes-support/sqlite/sqlite3_3.38.5.bb +1
-0file://CVE-2023-7104.patch \ file://CVE-2025-29088.patch \ file://CVE-2025-6965.patch \ + file://0001-This-branch-attempts-to-improve-the-detection-of-cov.patch \
Quoted 3 lines
meta/recipes-support/sqlite/sqlite3_3.38.5.bb SRC_URI = "http://www.sqlite.org/2022/sqlite-autoconf-${SQLITE_PV}.tar.gz \
Quoted 3 lines
meta/recipes-support/sqlite/sqlite3_3.38.5.bb +1
-0+ file://CVE-2025-7458.patch \ " SRC_URI[sha256sum] ="
5af07de982ba658fd91a03170c945f99c971f6955bc79df3266544373e39869c"Quoted 7 lines
Quoted 7 lines
meta/recipes-support/sqlite/sqlite3_3.38.5.bb +0
-1-=-=-=-=-=-=-=-=-=-=-=-Links: You receive all messages sent to this group. View/Reply Online (#221481):
https://lists.openembedded.org/g/openembedded-core/message/221481
Quoted 3 lines
Quoted 3 lines
Mute This Topic: https://lists.openembedded.org/mt/114551672/3618471
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsubQuoted 3 lines
Quoted 2 lines
-=-=-=-=-=-=-=-=-=-=-=-
Re: [OE-core][kirkstone 2/4] sqlite3: patch CVE-2025-7458
Quoted 6 lines · Peter
I have looked at the problem and reverting was the correct action. Trying to identify missing patch I realized that the CVE does not affect our version,
so I'd have to backport additional patches which would first introduce the CVE and then fix it
Thanks for investigating!
Steve
Quoted 305 lines
Sorry for this inconvenience.
Peter
Quoted 18 lines
-----Original Message-----
From: Marko, Peter (FT D EU SK BFS1)
Sent: Sunday, August 31, 2025 23:12
To: Steve Sakoman <[email protected]>
Cc: [email protected]; Niko Mauno <[email protected]>
Subject: RE: [OE-core][kirkstone 2/4] sqlite3: patch CVE-2025-7458Quoted 8 lines
-----Original Message-----
From: Steve Sakoman <[email protected]>
Sent: Friday, August 29, 2025 17:38
To: Marko, Peter (FT D EU SK BFS1) <[email protected]>
Cc: [email protected]; Niko Mauno <[email protected]>
Subject: Re: [OE-core][kirkstone 2/4] sqlite3: patch CVE-2025-7458Quoted 7 lines
Quoted 1 line
On Fri, Aug 29, 2025 at 4:25 AM Niko Mauno <[email protected]>
Quoted 5 lines · wrote:
Quoted 2 lines
We have found that since this patch SELECT queries with
COUNT(DISTINCT(column)) seem to cause sqlite to segfault. E.g.
Quoted 2 lines
# sqlite3 :memory: 'create table foo (x int); selectcount(distinct(x)) from foo;'
Quoted 7 lines
Quoted 5 lines
Quoted 1 line
Segmentation fault (core dumped)
Hi Peter,
Could you check this to see if you can reproduce it?
I'll be offline for next two weeks, please revert and I'll check it when
I'm back.
Quoted 11 lines
Quoted 11 lines
If so, we should revert this patch.
Steve
Quoted 5 lines · Steve Sakoman via lists.openembedded.org
Quoted 4 lines
From: Peter Marko <[email protected]>
Pick patch [1] listed in [2].
Also pick another patch which is precondition to this oneintroducing
Quoted 14 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
variable needed for the check.
[1] https://sqlite.org/src/info/12ad822d9b827777
[2] https://nvd.nist.gov/vuln/detail/CVE-2025-7458Signed-off-by Peter Marko <[email protected]>Signed-off-by Steve Sakoman <[email protected]>--- ...mpts-to-improve-the-detection-of-cov.patch | 91+++++++++++++++++++
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
.../sqlite/files/CVE-2025-7458.patch | 32 +++++++ meta/recipes-support/sqlite/sqlite3_3.38.5.bb | 2 + 3 files changed, 125 insertions(+)create mode 100644
meta/recipes-support/sqlite/files/0001-This-branch-
Quoted 5 lines
Quoted 2 lines
attempts-to-improve-the-detection-of-cov.patch
Quoted 1 line
Quoted 1 line
create mode 100644 meta/recipes-support/sqlite/files/CVE-2025-
7458.patch
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
diff --git
a/meta/recipes-support/sqlite/files/0001-This-branch-attempts-to-
Quoted 1 line
Quoted 1 line
improve-the-detection-of-cov.patch
b/meta/recipes-support/sqlite/files/0001-
Quoted 6 lines
This-
Quoted 5 lines
branch-attempts-to-improve-the-detection-of-cov.patch
Quoted 4 lines
Quoted 4 lines
new file mode 100644
index 0000000000..8fb037bb0f
---/dev/null
+++b/meta/recipes-support/sqlite/files/0001-This-branch-attempts-to-
Quoted 10 lines
Quoted 7 lines
improve-the-detection-of-cov.patch
Quoted 2 lines
Review line 1
Quoted 2 lines
(quoted diff) +1
-0@@ -0,0 +1,91 @@ +From f55a7dad195994f2bb24db7df0a0515502386fe2 Mon Sep 17 00:00:002001
Quoted 3 lines
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to-improve-the-detection-of-cov.patch
Quoted 3 lines
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to-improve-the-detection-of-cov.patch new file +3
-0+From: drh <> +Date: Sat, 22 Oct 2022 14:16:02 +0000 +Subject: [PATCH] This branch attempts to improve the detection ofcovering
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
(quoted diff) +2
-0+ indexes. This first check-in merely improves a parameter name to + sqlite3WhereBegin() to be more descriptive of what it contains,and
Quoted 2 lines
ensures
Quoted 1 line
Quoted 1 line
Quoted 1 line
(quoted diff) +1
-0+ that a subroutine is not inlines so that sqlite3WhereBegin()runs slightly
Quoted 8 lines
Quoted 7 lines
Quoted 3 lines
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to-improve-the-detection-of-cov.patch
Quoted 3 lines
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to-improve-the-detection-of-cov.patch new file +3
-0+ faster. + +FossilOrigin-Name:
cadf5f6bb1ce0492ef858ada476288e8057afd3609caa18b09c818d3845d7244Quoted 2 lines
Review line 12
Quoted 2 lines
(quoted diff) +2
-0+ +Upstream-Status: Backport[
https://github.com/sqlite/sqlite/commit/f55a7dad195994f2bb24db7df0a051550238
Quoted 16 lines
Quoted 16 lines
6fe2]
Quoted 7 lines
Quoted 7 lines
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to-improve-the-detection-of-cov.patch new file +7
-0+Signed-off-by: Peter Marko <[email protected]> +--- + sqlite3.c | 28 +++++++++++++--------------- + 1 file changed, 13 insertions(+), 15 deletions(-) + +diff --git a/sqlite3.c b/sqlite3.c +index 4cbc2d0..b7ed991 100644Quoted 8 lines
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to-improve-the-detection-of-cov.patch
Quoted 8 lines
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to-improve-the-detection-of-cov.patch new file +8
-0+--- a/sqlite3.c ++++ b/sqlite3.c +@@ -147371,9 +147371,7 @@ struct WhereInfo { + ExprList *pOrderBy; /* The ORDER BY clause or NULL */ + ExprList *pResultSet; /* Result set of the query */ + Expr *pWhere; /* The complete WHERE clause */ +-#ifndef SQLITE_OMIT_VIRTUALTABLE +- Select *pLimit; /* Used to access LIMITexpr/registers for vtabs */
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Review line 29
Quoted 2 lines
(quoted diff) +2
-0+-#endif ++ Select *pSelect; /* The entire SELECT statementcontaining
Quoted 2 lines
Quoted 2 lines
WHERE */
Quoted 1 line
Quoted 1 line
(quoted diff) +1
-0+ int aiCurOnePass[2]; /* OP_OpenWrite cursors for theONEPASS opt
Quoted 2 lines
*/
Quoted 1 line
Quoted 1 line
Quoted 1 line
(quoted diff) +1
-0+ int iContinue; /* Jump here to continue with nextrecord */
Quoted 1 line
Quoted 1 line
Quoted 1 line
Review line 32
Quoted 1 line
(quoted diff) +1
-0+ int iBreak; /* Jump here to break out of theloop */
Quoted 8 lines
Quoted 8 lines
Quoted 1 line
Review line 33
Quoted 1 line
(quoted diff) +1
-0+@@ -149070,9 +149068,9 @@ SQLITE_PRIVATE Bitmasksqlite3WhereCodeOneLoopStart(
Quoted 6 lines
Quoted 6 lines
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to-improve-the-detection-of-cov.patch new file +6
-0+ && pLoop->u.vtab.bOmitOffset + ){ + assert( pTerm->eOperator==WO_AUX ); +- assert( pWInfo->pLimit!=0 ); +- assert( pWInfo->pLimit->iOffset>0 ); +- sqlite3VdbeAddOp2(v, OP_Integer, 0,
pWInfo->pLimit->iOffset);Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to-improve-the-detection-of-cov.patch
Quoted 3 lines
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to-improve-the-detection-of-cov.patch new file +3
-0++ assert( pWInfo->pSelect!=0 ); ++ assert( pWInfo->pSelect->iOffset>0 ); ++ sqlite3VdbeAddOp2(v, OP_Integer, 0,
pWInfo->pSelect->iOffset);Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to-improve-the-detection-of-cov.patch
Quoted 5 lines
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to-improve-the-detection-of-cov.patch new file +5
-0+ VdbeComment((v,"Zero OFFSET counter")); + } + } +@@ -151830,10 +151828,10 @@ static void whereAddLimitExpr( + ** exist only so that they may be passed to the xBestIndexmethod of the
Quoted 9 lines
Quoted 3 lines
Quoted 3 lines
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to-improve-the-detection-of-cov.patch
Quoted 3 lines
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to-improve-the-detection-of-cov.patch new file +3
-0+ ** single virtual table in the FROM clause of the SELECT. + */ +-SQLITE_PRIVATE void sqlite3WhereAddLimit(WhereClause *pWC,Select
Quoted 2 lines
*p){
Quoted 1 line
Quoted 1 line
(quoted diff) +1
-0+- assert( p==0 || (p->pGroupBy==0 && (p->selFlags &SF_Aggregate)==0)
Quoted 2 lines
);
Quoted 1 line
Quoted 1 line
(quoted diff) +1
-0+- if( (p && p->pLimit)/* 1 */
Quoted 1 line
Quoted 1 line
Quoted 1 line
Review line 53
Quoted 1 line
(quoted diff) +1
-0+- && (p->selFlags & (SF_Distinct|SF_Aggregate))==0/* 2 */
Quoted 3 lines
Quoted 3 lines
Quoted 1 line
Review line 54
Quoted 1 line
(quoted diff) +1
-0++SQLITE_PRIVATE void SQLITE_NOINLINE
sqlite3WhereAddLimit(WhereClause *pWC, Select *p){Quoted 1 line
Quoted 1 line
(quoted diff) +1
-0++ assert( p!=0 && p->pLimit!=0 ); /* 1 --checked by caller */
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Review line 57
Quoted 2 lines
(quoted diff) +2
-0++ assert( p->pGroupBy==0 && (p->selFlags & SF_Aggregate)==0 ); ++ if( (p->selFlags & (SF_Distinct|SF_Aggregate))==0/* 2 */
Quoted 1 line
Quoted 1 line
Quoted 1 line
Review line 58
Quoted 1 line
(quoted diff) +1
-0+ && (p->pSrc->nSrc==1 && IsVirtual(p->pSrc->a[0].pTab))/* 3 */
Quoted 9 lines
Quoted 6 lines
Quoted 3 lines
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to-improve-the-detection-of-cov.patch
Quoted 3 lines
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to-improve-the-detection-of-cov.patch new file +3
-0+ ){ + ExprList *pOrderBy = p->pOrderBy; +@@ -157427,7 +157425,7 @@ SQLITE_PRIVATE WhereInfo*sqlite3WhereBegin(
Quoted 2 lines
Quoted 2 lines
(quoted diff) +2
-0+ Expr *pWhere, /* The WHERE clause */ + ExprList *pOrderBy, /* An ORDER BY (or GROUP BY) clause, orNULL
Quoted 2 lines
*/
Quoted 1 line
Quoted 1 line
(quoted diff) +1
-0+ ExprList *pResultSet, /* Query result set. Req'd forDISTINCT */
Quoted 1 line
Quoted 1 line
Quoted 1 line
Review line 65
Quoted 1 line
(quoted diff) +1
-0+- Select *pLimit, /* Use this LIMIT/OFFSET clause, ifany */
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Review line 67
Quoted 2 lines
(quoted diff) +2
-0++ Select *pSelect, /* The entire SELECT statement */ + u16 wctrlFlags, /* The WHERE_* flags defined in
sqliteInt.h*/Quoted 1 line
Quoted 1 line
Quoted 1 line
Review line 68
Quoted 1 line
(quoted diff) +1
-0+ int iAuxArg /* If WHERE_OR_SUBCLAUSE is set, indexcursor
Quoted 2 lines
Quoted 2 lines
number
Quoted 1 line
Quoted 1 line
(quoted diff) +1
-0+ ** If WHERE_USE_LIMIT, then the limitamount */
Quoted 15 lines
Quoted 15 lines
Quoted 1 line
Review line 70
Quoted 1 line
(quoted diff) +1
-0+@@ -157504,9 +157502,7 @@ SQLITE_PRIVATE WhereInfo*sqlite3WhereBegin(
Quoted 10 lines
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to-improve-the-detection-of-cov.patch
Quoted 10 lines
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to-improve-the-detection-of-cov.patch new file +10
-0+ pWInfo->wctrlFlags = wctrlFlags; + pWInfo->iLimit = iAuxArg; + pWInfo->savedNQueryLoop = pParse->nQueryLoop; +-#ifndef SQLITE_OMIT_VIRTUALTABLE +- pWInfo->pLimit = pLimit; +-#endif ++ pWInfo->pSelect = pSelect; + memset(&pWInfo->nOBSat, 0, + offsetof(WhereInfo,sWC) - offsetof(WhereInfo,nOBSat)); + memset(&pWInfo->a[0], 0,sizeof(WhereLoop)+nTabList*sizeof(WhereLevel));
Quoted 1 line
Review line 81
Quoted 1 line
(quoted diff) +1
-0+@@ -157575,7 +157571,9 @@ SQLITE_PRIVATE WhereInfo*sqlite3WhereBegin(
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to-improve-the-detection-of-cov.patch
Quoted 10 lines
meta/recipes-support/sqlite/files/0001-This-branch-attempts-to-improve-the-detection-of-cov.patch new file +10
-0+ + /* Analyze all of the subexpressions. */ + sqlite3WhereExprAnalyze(pTabList, &pWInfo->sWC); +- sqlite3WhereAddLimit(&pWInfo->sWC, pLimit); ++ if( pSelect && pSelect->pLimit ){ ++ sqlite3WhereAddLimit(&pWInfo->sWC, pSelect); ++ } + if( db->mallocFailed ) goto whereBeginError; + + /* Special case: WHERE terms that do not refer to any tablesin the join
Quoted 9 lines
Quoted 8 lines
Quoted 1 line
Review
Quoted 1 line
(quoted diff) +0
-0
b/meta/recipes-support/sqlite/files/CVE-2025-7458.patchQuoted 6 lines
meta/recipes-support/sqlite/files/CVE-2025-7458.patch line 1
Quoted 6 lines
new file mode 100644
index 0000000000..6b041d9332meta/recipes-support/sqlite/files/CVE-2025-7458.patch new file +1
-0@@ -0,0 +1,32 @@ +From b816ca9994e03a8bc829b49452b8158a731e81a9 Mon Sep 1700:00:00
Quoted 7 lines
Quoted 4 lines
2001
Quoted 3 lines
meta/recipes-support/sqlite/files/CVE-2025-7458.patch
Quoted 3 lines
meta/recipes-support/sqlite/files/CVE-2025-7458.patch new file +3
-0+From: drh <> +Date: Thu, 16 Mar 2023 20:54:29 +0000 +Subject: [PATCH] Correctly handle SELECT DISTINCT ... ORDER BYwhen
Quoted 2 lines
all of the
Quoted 1 line
Quoted 1 line
meta/recipes-support/sqlite/files/CVE-2025-7458.patch new file +1
-0+ result set terms are constant and there are more result setterms than
Quoted 2 lines
Quoted 2 lines
ORDER
Quoted 1 line
Quoted 1 line
meta/recipes-support/sqlite/files/CVE-2025-7458.patch new file +1
-0+ BY terms. Fix for these tickets: [c36cdb4afd504dc1],[
4051a7f931d9ba24],Quoted 9 lines
Quoted 8 lines
Quoted 3 lines
meta/recipes-support/sqlite/files/CVE-2025-7458.patch
Quoted 3 lines
meta/recipes-support/sqlite/files/CVE-2025-7458.patch new file +3
-0+ [d6fd512f50513ab7]. + +FossilOrigin-Name:
12ad822d9b827777526ca5ed5bf3e678d600294fc9b5c25482dfff2a021328a4Quoted 3 lines
meta/recipes-support/sqlite/files/CVE-2025-7458.patch
Quoted 3 lines
meta/recipes-support/sqlite/files/CVE-2025-7458.patch new file +3
-0+ +CVE: CVE-2025-7458 +Upstream-Status: Backport[
github.com/sqlite/sqlite/commit/b816ca9994e03a8bc829b49452b8158a731e81a9]
Quoted 11 lines
Quoted 11 lines
Quoted 10 lines
meta/recipes-support/sqlite/files/CVE-2025-7458.patch
Quoted 10 lines
meta/recipes-support/sqlite/files/CVE-2025-7458.patch new file +10
-0+Signed-off-by: Peter Marko <[email protected]> +--- + sqlite3.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/sqlite3.c b/sqlite3.c +index 19d0438..6d92184 100644 +--- a/sqlite3.c ++++ b/sqlite3.c +@@ -156989,6 +156989,10 @@ static int wherePathSolver(WhereInfo*pWInfo, LogEst nRowEst){
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Review
Quoted 11 lines
meta/recipes-support/sqlite/files/CVE-2025-7458.patch new file +10
-0+ if( pFrom->isOrdered==pWInfo->pOrderBy->nExpr ){ + pWInfo->eDistinct = WHERE_DISTINCT_ORDERED; + } ++ if( pWInfo->pSelect->pOrderBy ++ && pWInfo->nOBSat > pWInfo->pSelect->pOrderBy->nExpr ){ ++ pWInfo->nOBSat = pWInfo->pSelect->pOrderBy->nExpr; ++ } + }else{ + pWInfo->nOBSat = pFrom->isOrdered; + pWInfo->revMask = pFrom->revLoop;(quoted diff) +0
-0b/meta/recipes-
Quoted 11 lines
Quoted 5 lines
support/sqlite/sqlite3_3.38.5.bb
Quoted 4 lines
meta/recipes-support/sqlite/sqlite3_3.38.5.bb SRC_URI = "http://www.sqlite.org/2022/sqlite-
Quoted 4 lines
index
656e2d8bd8..86d9b4b33b100644meta/recipes-support/sqlite/sqlite3_3.38.5.bb +0
-0@@ -10,6 +10,8 @@ SRC_URI = "http://www.sqlite.org/2022/sqlite-autoconf-
Quoted 5 lines
${SQLITE_PV}.tar.gz \
Quoted 4 lines
Quoted 4 lines
meta/recipes-support/sqlite/sqlite3_3.38.5.bb +1
-0file://CVE-2023-7104.patch \ file://CVE-2025-29088.patch \ file://CVE-2025-6965.patch \ +file://0001-This-branch-attempts-to-improve-the-detection-of-
Quoted 9 lines
Quoted 9 lines
cov.patch \
Quoted 3 lines
meta/recipes-support/sqlite/sqlite3_3.38.5.bb SRC_URI = "http://www.sqlite.org/2022/sqlite-autoconf-${SQLITE_PV}.tar.gz \
Quoted 3 lines
meta/recipes-support/sqlite/sqlite3_3.38.5.bb +1
-0+ file://CVE-2025-7458.patch \ " SRC_URI[sha256sum] ="
5af07de982ba658fd91a03170c945f99c971f6955bc79df3266544373e39869c"Quoted 4 lines
Quoted 4 lines
Quoted 5 lines
Quoted 5 lines
Quoted 3 lines
Quoted 3 lines
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#221481):https://lists.openembedded.org/g/openembedded-core/message/221481
Quoted 1 line
Quoted 1 line
Mute This Topic:
https://lists.openembedded.org/mt/114551672/3618471
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Group Owner: [email protected] Unsubscribe:
https://lists.openembedded.org/g/openembedded-core/unsub
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines
Quoted 2 lines
-=-=-=-=-=-=-=-=-=-=-=-