已合并
fix testcase read #26
AtomGit-Bot创建于 2022年3月4日
fix testcase read #26
已合并
从refs/pull/26/head合入到openEuler-20.03-LTS-SP2
共 6 个文件变更+147-2
| @@ -0,0 +1,31 @@ | |||
| 1 | +From 8615575144e6fd3d708a30983ed2415db479ef4c Mon Sep 17 00:00:00 2001 | ||
| 2 | +From: Jaroslav Rohel <jrohel@redhat.com> | ||
| 3 | +Date: Thu, 8 Apr 2021 12:17:09 +0200 | ||
| 4 | +Subject: [PATCH] Fix: Memory leaks in SWIG generated code (for Python) | ||
| 5 | + | ||
| 6 | +There were memory leaks in the `Chksum_from_bin`, `Chksum_add`, | ||
| 7 | +`SolvFp_write` functions wrapper for Python. | ||
| 8 | + | ||
| 9 | +The problem was in "freearg" typemap argument defined in "solv.i". | ||
| 10 | +Therefore, the typemap was not applied. | ||
| 11 | + | ||
| 12 | +Conflict: NA | ||
| 13 | +Reference: https://github.com/openSUSE/libsolv/commit/8615575144e6fd3d708a30983ed2415db479ef4c | ||
| 14 | + | ||
| 15 | +--- | ||
| 16 | + bindings/solv.i | 2 +- | ||
| 17 | + 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 18 | + | ||
| 19 | +diff --git a/bindings/solv.i b/bindings/solv.i | ||
| 20 | +index 1882b135..3bbeca04 100644 | ||
| 21 | +--- a/bindings/solv.i | ||
| 22 | ++++ b/bindings/solv.i | ||
| 23 | +@@ -63,7 +63,7 @@ typedef struct { | ||
| 24 | + $2 = size; | ||
| 25 | + } | ||
| 26 | + | ||
| 27 | +-%typemap(freearg,noblock=1,match="in") (const unsigned char *str, int len) { | ||
| 28 | ++%typemap(freearg,noblock=1,match="in") (const unsigned char *str, size_t len) { | ||
| 29 | + if (alloc$argnum == SWIG_NEWOBJ) %delete_array(buf$argnum); | ||
| 30 | + } | ||
| 31 | + | ||
| @@ -0,0 +1,42 @@ | |||
| 1 | +From 71c6b26096086926f48d8fced1a03ca52a1eb745 Mon Sep 17 00:00:00 2001 | ||
| 2 | +From: Jaroslav Rohel <jrohel@redhat.com> | ||
| 3 | +Date: Mon, 29 Mar 2021 12:46:31 +0200 | ||
| 4 | +Subject: [PATCH] Fix memory leaks | ||
| 5 | + | ||
| 6 | +Conflict: NA | ||
| 7 | +Reference: https://github.com/openSUSE/libsolv/commit/71c6b26096086926f48d8fced1a03ca52a1eb745 | ||
| 8 | + | ||
| 9 | +--- | ||
| 10 | + ext/repo_deb.c | 1 + | ||
| 11 | + ext/testcase.c | 4 ++-- | ||
| 12 | + 2 files changed, 3 insertions(+), 2 deletions(-) | ||
| 13 | + | ||
| 14 | +diff --git a/ext/repo_deb.c b/ext/repo_deb.c | ||
| 15 | +index 8f637567..34f40fa8 100644 | ||
| 16 | +--- a/ext/repo_deb.c | ||
| 17 | ++++ b/ext/repo_deb.c | ||
| 18 | +@@ -792,5 +792,6 @@ pool_deb_get_autoinstalled(Pool *pool, FILE *fp, Queue *q, int flags) | ||
| 19 | + break; | ||
| 20 | + } | ||
| 21 | + } | ||
| 22 | ++ solv_free(buf); | ||
| 23 | + } | ||
| 24 | + | ||
| 25 | +diff --git a/ext/testcase.c b/ext/testcase.c | ||
| 26 | +index 8fb6d793..4e9e3154 100644 | ||
| 27 | +--- a/ext/testcase.c | ||
| 28 | ++++ b/ext/testcase.c | ||
| 29 | +@@ -1477,11 +1477,11 @@ testcase_solverresult(Solver *solv, int resultflags) | ||
| 30 | + queue_init(&q); | ||
| 31 | + for (rid = 1; (rclass = solver_ruleclass(solv, rid)) != SOLVER_RULE_UNKNOWN; rid++) | ||
| 32 | + { | ||
| 33 | +- char *prefix = solv_dupjoin("rule ", testcase_rclass2str(rclass), " "); | ||
| 34 | +- prefix = solv_dupappend(prefix, testcase_ruleid(solv, rid), 0); | ||
| 35 | + solver_ruleliterals(solv, rid, &q); | ||
| 36 | + if (rclass == SOLVER_RULE_FEATURE && q.count == 1 && q.elements[0] == -SYSTEMSOLVABLE) | ||
| 37 | + continue; | ||
| 38 | ++ char *prefix = solv_dupjoin("rule ", testcase_rclass2str(rclass), " "); | ||
| 39 | ++ prefix = solv_dupappend(prefix, testcase_ruleid(solv, rid), 0); | ||
| 40 | + for (i = 0; i < q.count; i++) | ||
| 41 | + { | ||
| 42 | + Id p = q.elements[i]; | ||
| @@ -0,0 +1,28 @@ | |||
| 1 | +From 0ecd4f310318d9bd91db48e5c9dc7e749fbed82a Mon Sep 17 00:00:00 2001 | ||
| 2 | +From: Thomas Lam <79589038+tl-hbk@users.noreply.github.com> | ||
| 3 | +Date: Tue, 30 Mar 2021 05:33:52 -0700 | ||
| 4 | +Subject: [PATCH] Fix segfault in resolve_jobrules | ||
| 5 | + | ||
| 6 | +In selectandinstall sometimes rules are added and a realloc is required if there's | ||
| 7 | +no more memory available in the allocated block. r-- would just decrement the old | ||
| 8 | +pointer but the realloc could return a completely different block of memory | ||
| 9 | + | ||
| 10 | +Conflict: NA | ||
| 11 | +Reference: https://github.com/openSUSE/libsolv/commit/0ecd4f310318d9bd91db48e5c9dc7e749fbed82a | ||
| 12 | + | ||
| 13 | +--- | ||
| 14 | + src/solver.c | 1 + | ||
| 15 | + 1 file changed, 1 insertion(+) | ||
| 16 | + | ||
| 17 | +diff --git a/src/solver.c b/src/solver.c | ||
| 18 | +index 9c02cc76..89a2ed10 100644 | ||
| 19 | +--- a/src/solver.c | ||
| 20 | ++++ b/src/solver.c | ||
| 21 | +@@ -1629,6 +1629,7 @@ resolve_jobrules(Solver *solv, int level, int disablerules, Queue *dq) | ||
| 22 | + } | ||
| 23 | + olevel = level; | ||
| 24 | + level = selectandinstall(solv, level, dq, disablerules, i, SOLVER_REASON_RESOLVE_JOB); | ||
| 25 | ++ r = solv->rules + i; /* selectandinstall may have added more rules */ | ||
| 26 | + if (level <= olevel) | ||
| 27 | + { | ||
| 28 | + if (level == olevel) | ||
| @@ -15,13 +15,20 @@ | |||
| 15 | 15 | ||
| 16 | Name: libsolv | 16 | Name: libsolv |
| 17 | Version: 0.7.14 | 17 | Version: 0.7.14 |
| 18 | -Release: 4 | 18 | +Release: 6 |
| 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 | 23 | ||
| 24 | -Patch0: CVE-2021-3200.patch | 24 | +Patch0: Fix-memory-leaks.patch |
| 25 | +Patch1: Fix-segfault-in-resolve_jobrules.patch | ||
| 26 | +Patch2: Fix-Memory-leaks-in-SWIG-generated-code-for-Python.patch | ||
| 27 | +Patch3: use-memmove-for-overlapping-regions.patch | ||
| 28 | + | ||
| 29 | +#fix CVE-2021-3200,CVE-2021-44568,CVE-2021-44569,CVE-2021-44571,CVE-2021-44573,CVE-2021-44574,CVE-2021-44575,CVE-2021-44576,CVE-2021-44577,CVE-2021-33938,CVE-2021-33929,CVE-2021-33928,CVE-2021-33930 | ||
| 30 | + | ||
| 31 | +Patch6000: backport-testcase-read.patch | ||
| 25 | 32 | ||
| 26 | BuildRequires: cmake gcc-c++ ninja-build pkgconfig(rpm) zlib-devel | 33 | BuildRequires: cmake gcc-c++ ninja-build pkgconfig(rpm) zlib-devel |
| 27 | BuildRequires: libxml2-devel xz-devel bzip2-devel libzstd-devel | 34 | BuildRequires: libxml2-devel xz-devel bzip2-devel libzstd-devel |
| @@ -189,6 +196,18 @@ Python 3 version. | |||
| 189 | %{_mandir}/man3/%{name}*.3* | 196 | %{_mandir}/man3/%{name}*.3* |
| 190 | 197 | ||
| 191 | %changelog | 198 | %changelog |
| 199 | +* Fir Mar 04 2022 xingxing <xingxing9@h-partners.com> - 0.7.14-6 | ||
| 200 | +- Type:cves | ||
| 201 | +- CVE:CVE-2021-3200-CVE-2021-44568-CVE-2021-44569-CVE-2021-44571-CVE-2021-44573-CVE-2021-44574-CVE-2021-44575-CVE-2021-44576-CVE-2021-44577 | ||
| 202 | +- SUG:NA | ||
| 203 | +- DESC:fix CVE-2021-3200-CVE-2021-44568-CVE-2021-44569-CVE-2021-44571-CVE-2021-44573-CVE-2021-44574-CVE-2021-44575-CVE-2021-44576-CVE-2021-44577 | ||
| 204 | + | ||
| 205 | +* Fir Mar 04 2022 xingxing <xingxing9@h-partners.com> - 0.7.14-5 | ||
| 206 | +- Type:bugfix | ||
| 207 | +- CVE:NA | ||
| 208 | +- SUG:NA | ||
| 209 | +- DESC:backport patches | ||
| 210 | + | ||
| 192 | * Tue Aur 3 2021 Jianmin <jianmin@iscas.ac.cn> - 0.7.14-4 | 211 | * Tue Aur 3 2021 Jianmin <jianmin@iscas.ac.cn> - 0.7.14-4 |
| 193 | - Type:enhancement | 212 | - Type:enhancement |
| 194 | - ID:NA | 213 | - ID:NA |
| @@ -0,0 +1,25 @@ | |||
| 1 | +From ccc2ec885a81de137c30fd0deb8c5475440e5287 Mon Sep 17 00:00:00 2001 | ||
| 2 | +From: Wolf Vollprecht <w.vollprecht@gmail.com> | ||
| 3 | +Date: Thu, 8 Jul 2021 09:13:19 +0200 | ||
| 4 | +Subject: [PATCH] use memmove for overlapping regions | ||
| 5 | + | ||
| 6 | +Conflict:NA | ||
| 7 | +Reference:https://github.com/openSUSE/libsolv/commit/ccc2ec885a81de137c30fd0deb8c5475440e5287.patch | ||
| 8 | + | ||
| 9 | +--- | ||
| 10 | + src/conda.c | 2 +- | ||
| 11 | + 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 12 | + | ||
| 13 | +diff --git a/src/conda.c b/src/conda.c | ||
| 14 | +index 21ad6bfb..6f6a65a6 100644 | ||
| 15 | +--- a/src/conda.c | ||
| 16 | ++++ b/src/conda.c | ||
| 17 | +@@ -670,7 +670,7 @@ pool_conda_matchspec(Pool *pool, const char *name) | ||
| 18 | + if (build) | ||
| 19 | + { | ||
| 20 | + *p++ = ' '; | ||
| 21 | +- memcpy(p, build, buildend - build); | ||
| 22 | ++ memmove(p, build, buildend - build); | ||
| 23 | + p += buildend - build; | ||
| 24 | + } | ||
| 25 | + evrid = pool_strn2id(pool, version, p - version, 1); | ||