Merged
fix CVE-2021-3200 #10
eaglegaiAdd on May 28, 2021
fix CVE-2021-3200 #10
Merged
Merged fromrefs/pull/10/headintoopenEuler-20.03-LTS-SP2
Total: 2 files changed+73-1
| @@ -0,0 +1,63 @@ | |||
| 1 | +From 0077ef29eb46d2e1df2f230fc95a1d9748d49dec Mon Sep 17 00:00:00 2001 | ||
| 2 | +From: Michael Schroeder <mls@suse.de> | ||
| 3 | +Date: Mon, 14 Dec 2020 11:12:00 +0100 | ||
| 4 | +Subject: [PATCH] testcase_read: error out if repos are added or the system is | ||
| 5 | + changed too late | ||
| 6 | + | ||
| 7 | +We must not add new solvables after the considered map was created, the solver | ||
| 8 | +was created, or jobs were added. We may not changed the system after jobs have | ||
| 9 | +been added. | ||
| 10 | + | ||
| 11 | +(Jobs may point inside the whatproviedes array, so we must not invalidate this | ||
| 12 | +area.) | ||
| 13 | +--- | ||
| 14 | + ext/testcase.c | 21 +++++++++++++++++++++ | ||
| 15 | + 1 file changed, 21 insertions(+) | ||
| 16 | + | ||
| 17 | +diff --git a/ext/testcase.c b/ext/testcase.c | ||
| 18 | +index 0be7a213..8fb6d793 100644 | ||
| 19 | +--- a/ext/testcase.c | ||
| 20 | ++++ b/ext/testcase.c | ||
| 21 | +@@ -1991,6 +1991,7 @@ testcase_read(Pool *pool, FILE *fp, const char *testcase, Queue *job, char **res | ||
| 22 | + Id *genid = 0; | ||
| 23 | + int ngenid = 0; | ||
| 24 | + Queue autoinstq; | ||
| 25 | ++ int oldjobsize = job ? job->count : 0; | ||
| 26 | + | ||
| 27 | + if (resultp) | ||
| 28 | + *resultp = 0; | ||
| 29 | +@@ -2065,6 +2066,21 @@ testcase_read(Pool *pool, FILE *fp, const char *testcase, Queue *job, char **res | ||
| 30 | + int prio, subprio; | ||
| 31 | + const char *rdata; | ||
| 32 | + | ||
| 33 | ++ if (pool->considered) | ||
| 34 | ++ { | ||
| 35 | ++ pool_error(pool, 0, "testcase_read: cannot add repos after packages were disabled"); | ||
| 36 | ++ continue; | ||
| 37 | ++ } | ||
| 38 | ++ if (solv) | ||
| 39 | ++ { | ||
| 40 | ++ pool_error(pool, 0, "testcase_read: cannot add repos after the solver was created"); | ||
| 41 | ++ continue; | ||
| 42 | ++ } | ||
| 43 | ++ if (job && job->count != oldjobsize) | ||
| 44 | ++ { | ||
| 45 | ++ pool_error(pool, 0, "testcase_read: cannot add repos after jobs have been created"); | ||
| 46 | ++ continue; | ||
| 47 | ++ } | ||
| 48 | + prepared = 0; | ||
| 49 | + if (!poolflagsreset) | ||
| 50 | + { | ||
| 51 | +@@ -2125,6 +2141,11 @@ testcase_read(Pool *pool, FILE *fp, const char *testcase, Queue *job, char **res | ||
| 52 | + int i; | ||
| 53 | + | ||
| 54 | + /* must set the disttype before the arch */ | ||
| 55 | ++ if (job && job->count != oldjobsize) | ||
| 56 | ++ { | ||
| 57 | ++ pool_error(pool, 0, "testcase_read: cannot change the system after jobs have been created"); | ||
| 58 | ++ continue; | ||
| 59 | ++ } | ||
| 60 | + prepared = 0; | ||
| 61 | + if (strcmp(pieces[2], "*") != 0) | ||
| 62 | + { | ||
| 63 | + | ||
| @@ -15,11 +15,14 @@ | |||
| 15 | 15 | ||
| 16 | Name: libsolv | 16 | Name: libsolv |
| 17 | Version: 0.7.14 | 17 | Version: 0.7.14 |
| 18 | -Release: 2 | 18 | +Release: 3 |
| 19 | Summary: Package dependency solver | 19 | Summary: Package dependency solver |
| 20 | License: BSD | 20 | License: BSD |
| 21 | URL: https://github.com/openSUSE/libsolv | 21 | URL: https://github.com/openSUSE/libsolv |
| 22 | Source: https://github.com/openSUSE/libsolv/archive/%{version}/%{name}-%{version}.tar.gz | 22 | Source: https://github.com/openSUSE/libsolv/archive/%{version}/%{name}-%{version}.tar.gz |
| 23 | + | ||
| 24 | +Patch0: CVE-2021-3200.patch | ||
| 25 | + | ||
| 23 | BuildRequires: cmake gcc-c++ ninja-build pkgconfig(rpm) zlib-devel | 26 | BuildRequires: cmake gcc-c++ ninja-build pkgconfig(rpm) zlib-devel |
| 24 | BuildRequires: libxml2-devel xz-devel bzip2-devel libzstd-devel | 27 | BuildRequires: libxml2-devel xz-devel bzip2-devel libzstd-devel |
| 25 | Requires: %{_bindir}/find %{_bindir}/curl %{_bindir}/gpg2 %{name}-help | 28 | Requires: %{_bindir}/find %{_bindir}/curl %{_bindir}/gpg2 %{name}-help |
| @@ -186,6 +189,12 @@ Python 3 version. | |||
| 186 | %{_mandir}/man3/%{name}*.3* | 189 | %{_mandir}/man3/%{name}*.3* |
| 187 | 190 | ||
| 188 | %changelog | 191 | %changelog |
| 192 | +* Fri May 28 2021 gaihuiying <gaihuiying1@huawei.com> - 0.7.14-3 | ||
| 193 | +- Type:cves | ||
| 194 | +- CVE:CVE-2021-3200 | ||
| 195 | +- SUG:NA | ||
| 196 | +- DESC:fix CVE-2021-3200 | ||
| 197 | + | ||
| 189 | * Mon Nov 09 2020 xihaochen <xihaochen@huawei.com> - 0.7.14-2 | 198 | * Mon Nov 09 2020 xihaochen <xihaochen@huawei.com> - 0.7.14-2 |
| 190 | - Type:requirement | 199 | - Type:requirement |
| 191 | - CVE:NA | 200 | - CVE:NA |