diff options
| author | Peter Marko <peter.marko@siemens.com> | 2024-01-13 19:54:12 +0100 |
|---|---|---|
| committer | Steve Sakoman <steve@sakoman.com> | 2024-01-21 08:50:38 -1000 |
| commit | 76d570000e568e702cefcd5b5219f12883627200 (patch) | |
| tree | 11b6a82671f727db80c3ce9b32403188da060030 /meta/recipes-support/sqlite | |
| parent | 33faa4d392e70d417198e4d6a38b1b12531fdd17 (diff) | |
| download | poky-76d570000e568e702cefcd5b5219f12883627200.tar.gz | |
sqlite3: backport patch for CVE-2023-7104
Backport https://sqlite.org/src/info/0e4e7a05c4204b47
(From OE-Core rev: 31fb83ac3dcd2dd55b184de22a296ab4dc150d2e)
Signed-off-by: Peter Marko <peter.marko@siemens.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'meta/recipes-support/sqlite')
| -rw-r--r-- | meta/recipes-support/sqlite/files/CVE-2023-7104.patch | 44 | ||||
| -rw-r--r-- | meta/recipes-support/sqlite/sqlite3_3.38.5.bb | 1 |
2 files changed, 45 insertions, 0 deletions
diff --git a/meta/recipes-support/sqlite/files/CVE-2023-7104.patch b/meta/recipes-support/sqlite/files/CVE-2023-7104.patch new file mode 100644 index 0000000000..25c6ba017c --- /dev/null +++ b/meta/recipes-support/sqlite/files/CVE-2023-7104.patch | |||
| @@ -0,0 +1,44 @@ | |||
| 1 | From 09f1652f36c5c4e8a6a640ce887f9ea0f48a7958 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: dan <Dan Kennedy> | ||
| 3 | Date: Thu, 7 Sep 2023 13:53:09 +0000 | ||
| 4 | Subject: [PATCH] Fix a buffer overread in the sessions extension that could | ||
| 5 | occur when processing a corrupt changeset. | ||
| 6 | |||
| 7 | Upstream-Status: Backport [https://sqlite.org/src/info/0e4e7a05c4204b47] | ||
| 8 | CVE: CVE-2022-46908 | ||
| 9 | Signed-off-by: Peter Marko <peter.marko@siemens.com> | ||
| 10 | --- | ||
| 11 | sqlite3.c | 18 +++++++++++------- | ||
| 12 | 1 file changed, 11 insertions(+), 7 deletions(-) | ||
| 13 | |||
| 14 | diff --git a/ext/session/sqlite3session.c b/ext/session/sqlite3session.c | ||
| 15 | index 9f862f2465..0491549231 100644 | ||
| 16 | --- a/sqlite3.c | ||
| 17 | +++ b/sqlite3.c | ||
| 18 | @@ -213482,15 +213482,19 @@ static int sessionReadRecord( | ||
| 19 | } | ||
| 20 | } | ||
| 21 | if( eType==SQLITE_INTEGER || eType==SQLITE_FLOAT ){ | ||
| 22 | - sqlite3_int64 v = sessionGetI64(aVal); | ||
| 23 | - if( eType==SQLITE_INTEGER ){ | ||
| 24 | - sqlite3VdbeMemSetInt64(apOut[i], v); | ||
| 25 | + if( (pIn->nData-pIn->iNext)<8 ){ | ||
| 26 | + rc = SQLITE_CORRUPT_BKPT; | ||
| 27 | }else{ | ||
| 28 | - double d; | ||
| 29 | - memcpy(&d, &v, 8); | ||
| 30 | - sqlite3VdbeMemSetDouble(apOut[i], d); | ||
| 31 | + sqlite3_int64 v = sessionGetI64(aVal); | ||
| 32 | + if( eType==SQLITE_INTEGER ){ | ||
| 33 | + sqlite3VdbeMemSetInt64(apOut[i], v); | ||
| 34 | + }else{ | ||
| 35 | + double d; | ||
| 36 | + memcpy(&d, &v, 8); | ||
| 37 | + sqlite3VdbeMemSetDouble(apOut[i], d); | ||
| 38 | + } | ||
| 39 | + pIn->iNext += 8; | ||
| 40 | } | ||
| 41 | - pIn->iNext += 8; | ||
| 42 | } | ||
| 43 | } | ||
| 44 | } | ||
diff --git a/meta/recipes-support/sqlite/sqlite3_3.38.5.bb b/meta/recipes-support/sqlite/sqlite3_3.38.5.bb index 55cc514412..cece207eae 100644 --- a/meta/recipes-support/sqlite/sqlite3_3.38.5.bb +++ b/meta/recipes-support/sqlite/sqlite3_3.38.5.bb | |||
| @@ -7,6 +7,7 @@ SRC_URI = "http://www.sqlite.org/2022/sqlite-autoconf-${SQLITE_PV}.tar.gz \ | |||
| 7 | file://0001-sqlite-Increased-the-size-of-loop-variables-in-the-printf-implementation.patch \ | 7 | file://0001-sqlite-Increased-the-size-of-loop-variables-in-the-printf-implementation.patch \ |
| 8 | file://CVE-2022-46908.patch \ | 8 | file://CVE-2022-46908.patch \ |
| 9 | file://CVE-2023-36191.patch \ | 9 | file://CVE-2023-36191.patch \ |
| 10 | file://CVE-2023-7104.patch \ | ||
| 10 | " | 11 | " |
| 11 | SRC_URI[sha256sum] = "5af07de982ba658fd91a03170c945f99c971f6955bc79df3266544373e39869c" | 12 | SRC_URI[sha256sum] = "5af07de982ba658fd91a03170c945f99c971f6955bc79df3266544373e39869c" |
| 12 | 13 | ||
