mirror of
https://git.yoctoproject.org/poky
synced 2026-02-22 01:19:41 +01:00
Compare commits
66 Commits
dunfell-23
...
yocto-3.1.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7f9b7f912e | ||
|
|
9ae9138497 | ||
|
|
8cf3492f4c | ||
|
|
d7019b183d | ||
|
|
4d8f22bc23 | ||
|
|
028971709f | ||
|
|
aa449287a0 | ||
|
|
95ba88b935 | ||
|
|
f50439feb5 | ||
|
|
e9ad2aab5c | ||
|
|
fb7acc1b21 | ||
|
|
1956baac10 | ||
|
|
ca1c4e7a76 | ||
|
|
35aaf7eadd | ||
|
|
483ab0979f | ||
|
|
243a95b193 | ||
|
|
d7194226b1 | ||
|
|
134ac61730 | ||
|
|
2fef664dd9 | ||
|
|
915a752d37 | ||
|
|
a8ee7ba022 | ||
|
|
f9a63709b0 | ||
|
|
9cc9232e31 | ||
|
|
b44d209043 | ||
|
|
20087e04b3 | ||
|
|
10c6b704c0 | ||
|
|
8b52687223 | ||
|
|
65cf3249fa | ||
|
|
537de1798b | ||
|
|
2fa8edea5a | ||
|
|
e49990f01e | ||
|
|
aa19c8c35e | ||
|
|
a69227932f | ||
|
|
a14af03441 | ||
|
|
0781ad69b8 | ||
|
|
9ca32cf9ab | ||
|
|
459d081bf8 | ||
|
|
5e7c237200 | ||
|
|
a98b309fe2 | ||
|
|
b9c73d6591 | ||
|
|
0566db5c82 | ||
|
|
0bee2e95b7 | ||
|
|
7ba4ed6f5f | ||
|
|
85637f30f3 | ||
|
|
a5de603a1b | ||
|
|
8f4bbd9359 | ||
|
|
d24759196a | ||
|
|
a884e8bdbf | ||
|
|
e576212d25 | ||
|
|
b16301db9a | ||
|
|
beda483705 | ||
|
|
3d435421bc | ||
|
|
c4692956ea | ||
|
|
1cf135da98 | ||
|
|
fb9e6d51d4 | ||
|
|
211a3fd4db | ||
|
|
964b78a02d | ||
|
|
1a1eceee49 | ||
|
|
7d67a61029 | ||
|
|
8bc3443c08 | ||
|
|
dea6f2c847 | ||
|
|
87377eacc0 | ||
|
|
bc294f9573 | ||
|
|
adc49cb960 | ||
|
|
afd213cc8e | ||
|
|
eaf8d5efa0 |
@@ -24,6 +24,7 @@ import pickle
|
||||
from multiprocessing import Process
|
||||
import shlex
|
||||
import pprint
|
||||
import time
|
||||
|
||||
bblogger = logging.getLogger("BitBake")
|
||||
logger = logging.getLogger("BitBake.RunQueue")
|
||||
@@ -142,6 +143,55 @@ class RunQueueScheduler(object):
|
||||
self.buildable.append(tid)
|
||||
|
||||
self.rev_prio_map = None
|
||||
self.is_pressure_usable()
|
||||
|
||||
def is_pressure_usable(self):
|
||||
"""
|
||||
If monitoring pressure, return True if pressure files can be open and read. For example
|
||||
openSUSE /proc/pressure/* files have readable file permissions but when read the error EOPNOTSUPP (Operation not supported)
|
||||
is returned.
|
||||
"""
|
||||
if self.rq.max_cpu_pressure or self.rq.max_io_pressure or self.rq.max_memory_pressure:
|
||||
try:
|
||||
with open("/proc/pressure/cpu") as cpu_pressure_fds, \
|
||||
open("/proc/pressure/io") as io_pressure_fds, \
|
||||
open("/proc/pressure/memory") as memory_pressure_fds:
|
||||
|
||||
self.prev_cpu_pressure = cpu_pressure_fds.readline().split()[4].split("=")[1]
|
||||
self.prev_io_pressure = io_pressure_fds.readline().split()[4].split("=")[1]
|
||||
self.prev_memory_pressure = memory_pressure_fds.readline().split()[4].split("=")[1]
|
||||
self.prev_pressure_time = time.time()
|
||||
self.check_pressure = True
|
||||
except:
|
||||
bb.note("The /proc/pressure files can't be read. Continuing build without monitoring pressure")
|
||||
self.check_pressure = False
|
||||
else:
|
||||
self.check_pressure = False
|
||||
|
||||
def exceeds_max_pressure(self):
|
||||
"""
|
||||
Monitor the difference in total pressure at least once per second, if
|
||||
BB_PRESSURE_MAX_{CPU|IO|MEMORY} are set, return True if above threshold.
|
||||
"""
|
||||
if self.check_pressure:
|
||||
with open("/proc/pressure/cpu") as cpu_pressure_fds, \
|
||||
open("/proc/pressure/io") as io_pressure_fds, \
|
||||
open("/proc/pressure/memory") as memory_pressure_fds:
|
||||
# extract "total" from /proc/pressure/{cpu|io}
|
||||
curr_cpu_pressure = cpu_pressure_fds.readline().split()[4].split("=")[1]
|
||||
curr_io_pressure = io_pressure_fds.readline().split()[4].split("=")[1]
|
||||
curr_memory_pressure = memory_pressure_fds.readline().split()[4].split("=")[1]
|
||||
exceeds_cpu_pressure = self.rq.max_cpu_pressure and (float(curr_cpu_pressure) - float(self.prev_cpu_pressure)) > self.rq.max_cpu_pressure
|
||||
exceeds_io_pressure = self.rq.max_io_pressure and (float(curr_io_pressure) - float(self.prev_io_pressure)) > self.rq.max_io_pressure
|
||||
exceeds_memory_pressure = self.rq.max_memory_pressure and (float(curr_memory_pressure) - float(self.prev_memory_pressure)) > self.rq.max_memory_pressure
|
||||
now = time.time()
|
||||
if now - self.prev_pressure_time > 1.0:
|
||||
self.prev_cpu_pressure = curr_cpu_pressure
|
||||
self.prev_io_pressure = curr_io_pressure
|
||||
self.prev_memory_pressure = curr_memory_pressure
|
||||
self.prev_pressure_time = now
|
||||
return (exceeds_cpu_pressure or exceeds_io_pressure or exceeds_memory_pressure)
|
||||
return False
|
||||
|
||||
def next_buildable_task(self):
|
||||
"""
|
||||
@@ -155,6 +205,12 @@ class RunQueueScheduler(object):
|
||||
if not buildable:
|
||||
return None
|
||||
|
||||
# Bitbake requires that at least one task be active. Only check for pressure if
|
||||
# this is the case, otherwise the pressure limitation could result in no tasks
|
||||
# being active and no new tasks started thereby, at times, breaking the scheduler.
|
||||
if self.rq.stats.active and self.exceeds_max_pressure():
|
||||
return None
|
||||
|
||||
# Filter out tasks that have a max number of threads that have been exceeded
|
||||
skip_buildable = {}
|
||||
for running in self.rq.runq_running.difference(self.rq.runq_complete):
|
||||
@@ -1700,6 +1756,9 @@ class RunQueueExecute:
|
||||
|
||||
self.number_tasks = int(self.cfgData.getVar("BB_NUMBER_THREADS") or 1)
|
||||
self.scheduler = self.cfgData.getVar("BB_SCHEDULER") or "speed"
|
||||
self.max_cpu_pressure = self.cfgData.getVar("BB_PRESSURE_MAX_CPU")
|
||||
self.max_io_pressure = self.cfgData.getVar("BB_PRESSURE_MAX_IO")
|
||||
self.max_memory_pressure = self.cfgData.getVar("BB_PRESSURE_MAX_MEMORY")
|
||||
|
||||
self.sq_buildable = set()
|
||||
self.sq_running = set()
|
||||
@@ -1735,6 +1794,29 @@ class RunQueueExecute:
|
||||
if self.number_tasks <= 0:
|
||||
bb.fatal("Invalid BB_NUMBER_THREADS %s" % self.number_tasks)
|
||||
|
||||
lower_limit = 1.0
|
||||
upper_limit = 1000000.0
|
||||
if self.max_cpu_pressure:
|
||||
self.max_cpu_pressure = float(self.max_cpu_pressure)
|
||||
if self.max_cpu_pressure < lower_limit:
|
||||
bb.fatal("Invalid BB_PRESSURE_MAX_CPU %s, minimum value is %s." % (self.max_cpu_pressure, lower_limit))
|
||||
if self.max_cpu_pressure > upper_limit:
|
||||
bb.warn("Your build will be largely unregulated since BB_PRESSURE_MAX_CPU is set to %s. It is very unlikely that such high pressure will be experienced." % (self.max_cpu_pressure))
|
||||
|
||||
if self.max_io_pressure:
|
||||
self.max_io_pressure = float(self.max_io_pressure)
|
||||
if self.max_io_pressure < lower_limit:
|
||||
bb.fatal("Invalid BB_PRESSURE_MAX_IO %s, minimum value is %s." % (self.max_io_pressure, lower_limit))
|
||||
if self.max_io_pressure > upper_limit:
|
||||
bb.warn("Your build will be largely unregulated since BB_PRESSURE_MAX_IO is set to %s. It is very unlikely that such high pressure will be experienced." % (self.max_io_pressure))
|
||||
|
||||
if self.max_memory_pressure:
|
||||
self.max_memory_pressure = float(self.max_memory_pressure)
|
||||
if self.max_memory_pressure < lower_limit:
|
||||
bb.fatal("Invalid BB_PRESSURE_MAX_MEMORY %s, minimum value is %s." % (self.max_memory_pressure, lower_limit))
|
||||
if self.max_memory_pressure > upper_limit:
|
||||
bb.warn("Your build will be largely unregulated since BB_PRESSURE_MAX_MEMORY is set to %s. It is very unlikely that such high pressure will be experienced." % (self.max_io_pressure))
|
||||
|
||||
# List of setscene tasks which we've covered
|
||||
self.scenequeue_covered = set()
|
||||
# List of tasks which are covered (including setscene ones)
|
||||
|
||||
@@ -421,12 +421,14 @@ def better_eval(source, locals, extraglobals = None):
|
||||
return eval(source, ctx, locals)
|
||||
|
||||
@contextmanager
|
||||
def fileslocked(files):
|
||||
def fileslocked(files, *args, **kwargs):
|
||||
"""Context manager for locking and unlocking file locks."""
|
||||
locks = []
|
||||
if files:
|
||||
for lockfile in files:
|
||||
locks.append(bb.utils.lockfile(lockfile))
|
||||
l = bb.utils.lockfile(lockfile, *args, **kwargs)
|
||||
if l is not None:
|
||||
locks.append(l)
|
||||
|
||||
try:
|
||||
yield
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
DISTRO : "3.1.19"
|
||||
DISTRO : "3.1.20"
|
||||
DISTRO_NAME_NO_CAP : "dunfell"
|
||||
DISTRO_NAME : "Dunfell"
|
||||
DISTRO_NAME_NO_CAP_MINUS_ONE : "zeus"
|
||||
YOCTO_DOC_VERSION : "3.1.19"
|
||||
YOCTO_DOC_VERSION : "3.1.20"
|
||||
YOCTO_DOC_VERSION_MINUS_ONE : "3.0.4"
|
||||
DISTRO_REL_TAG : "yocto-3.1.19"
|
||||
DOCCONF_VERSION : "3.1.19"
|
||||
DISTRO_REL_TAG : "yocto-3.1.20"
|
||||
DOCCONF_VERSION : "3.1.20"
|
||||
BITBAKE_SERIES : "1.46"
|
||||
POKYVERSION : "23.0.19"
|
||||
POKYVERSION : "23.0.20"
|
||||
YOCTO_POKY : "poky-&DISTRO_NAME_NO_CAP;-&POKYVERSION;"
|
||||
YOCTO_DL_URL : "https://downloads.yoctoproject.org"
|
||||
YOCTO_AB_URL : "https://autobuilder.yoctoproject.org"
|
||||
|
||||
@@ -63,6 +63,8 @@ Project metadata:
|
||||
|
||||
- *keyboard:* Hardware has a keyboard
|
||||
|
||||
- *numa:* Hardware has non-uniform memory access
|
||||
|
||||
- *pcbios:* Support for booting through BIOS
|
||||
|
||||
- *pci:* Hardware has a PCI bus
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
DISTRO = "poky"
|
||||
DISTRO_NAME = "Poky (Yocto Project Reference Distro)"
|
||||
DISTRO_VERSION = "3.1.19"
|
||||
DISTRO_VERSION = "3.1.20"
|
||||
DISTRO_CODENAME = "dunfell"
|
||||
SDK_VENDOR = "-pokysdk"
|
||||
SDK_VERSION = "${@d.getVar('DISTRO_VERSION').replace('snapshot-${DATE}', 'snapshot')}"
|
||||
|
||||
@@ -7,8 +7,8 @@ KMACHINE_genericx86 ?= "common-pc"
|
||||
KMACHINE_genericx86-64 ?= "common-pc-64"
|
||||
KMACHINE_beaglebone-yocto ?= "beaglebone"
|
||||
|
||||
SRCREV_machine_genericx86 ?= "e2020dbe2ccaef50d7e8f37a5bf08c68a006a064"
|
||||
SRCREV_machine_genericx86-64 ?= "e2020dbe2ccaef50d7e8f37a5bf08c68a006a064"
|
||||
SRCREV_machine_genericx86 ?= "8a59dfded81659402005acfb06fbb00b71c8ce86"
|
||||
SRCREV_machine_genericx86-64 ?= "8a59dfded81659402005acfb06fbb00b71c8ce86"
|
||||
SRCREV_machine_edgerouter ?= "706efec4c1e270ec5dda92275898cd465dfdc7dd"
|
||||
SRCREV_machine_beaglebone-yocto ?= "706efec4c1e270ec5dda92275898cd465dfdc7dd"
|
||||
|
||||
@@ -17,7 +17,7 @@ COMPATIBLE_MACHINE_genericx86-64 = "genericx86-64"
|
||||
COMPATIBLE_MACHINE_edgerouter = "edgerouter"
|
||||
COMPATIBLE_MACHINE_beaglebone-yocto = "beaglebone-yocto"
|
||||
|
||||
LINUX_VERSION_genericx86 = "5.4.178"
|
||||
LINUX_VERSION_genericx86-64 = "5.4.178"
|
||||
LINUX_VERSION_genericx86 = "5.4.205"
|
||||
LINUX_VERSION_genericx86-64 = "5.4.205"
|
||||
LINUX_VERSION_edgerouter = "5.4.58"
|
||||
LINUX_VERSION_beaglebone-yocto = "5.4.58"
|
||||
|
||||
@@ -138,17 +138,18 @@ python do_cve_check () {
|
||||
"""
|
||||
from oe.cve_check import get_patched_cves
|
||||
|
||||
if os.path.exists(d.getVar("CVE_CHECK_DB_FILE")):
|
||||
try:
|
||||
patched_cves = get_patched_cves(d)
|
||||
except FileNotFoundError:
|
||||
bb.fatal("Failure in searching patches")
|
||||
whitelisted, patched, unpatched, status = check_cves(d, patched_cves)
|
||||
if patched or unpatched or (d.getVar("CVE_CHECK_COVERAGE") == "1" and status):
|
||||
cve_data = get_cve_info(d, patched + unpatched + whitelisted)
|
||||
cve_write_data(d, patched, unpatched, whitelisted, cve_data, status)
|
||||
else:
|
||||
bb.note("No CVE database found, skipping CVE check")
|
||||
with bb.utils.fileslocked([d.getVar("CVE_CHECK_DB_FILE_LOCK")], shared=True):
|
||||
if os.path.exists(d.getVar("CVE_CHECK_DB_FILE")):
|
||||
try:
|
||||
patched_cves = get_patched_cves(d)
|
||||
except FileNotFoundError:
|
||||
bb.fatal("Failure in searching patches")
|
||||
ignored, patched, unpatched, status = check_cves(d, patched_cves)
|
||||
if patched or unpatched or (d.getVar("CVE_CHECK_COVERAGE") == "1" and status):
|
||||
cve_data = get_cve_info(d, patched + unpatched + ignored)
|
||||
cve_write_data(d, patched, unpatched, ignored, cve_data, status)
|
||||
else:
|
||||
bb.note("No CVE database found, skipping CVE check")
|
||||
|
||||
}
|
||||
|
||||
@@ -289,7 +290,8 @@ def check_cves(d, patched_cves):
|
||||
vendor = "%"
|
||||
|
||||
# Find all relevant CVE IDs.
|
||||
for cverow in conn.execute("SELECT DISTINCT ID FROM PRODUCTS WHERE PRODUCT IS ? AND VENDOR LIKE ?", (product, vendor)):
|
||||
cve_cursor = conn.execute("SELECT DISTINCT ID FROM PRODUCTS WHERE PRODUCT IS ? AND VENDOR LIKE ?", (product, vendor))
|
||||
for cverow in cve_cursor:
|
||||
cve = cverow[0]
|
||||
|
||||
if cve in cve_whitelist:
|
||||
@@ -308,7 +310,8 @@ def check_cves(d, patched_cves):
|
||||
vulnerable = False
|
||||
ignored = False
|
||||
|
||||
for row in conn.execute("SELECT * FROM PRODUCTS WHERE ID IS ? AND PRODUCT IS ? AND VENDOR LIKE ?", (cve, product, vendor)):
|
||||
product_cursor = conn.execute("SELECT * FROM PRODUCTS WHERE ID IS ? AND PRODUCT IS ? AND VENDOR LIKE ?", (cve, product, vendor))
|
||||
for row in product_cursor:
|
||||
(_, _, _, version_start, operator_start, version_end, operator_end) = row
|
||||
#bb.debug(2, "Evaluating row " + str(row))
|
||||
if cve in cve_whitelist:
|
||||
@@ -352,10 +355,12 @@ def check_cves(d, patched_cves):
|
||||
bb.note("%s-%s is vulnerable to %s" % (pn, real_pv, cve))
|
||||
cves_unpatched.append(cve)
|
||||
break
|
||||
product_cursor.close()
|
||||
|
||||
if not vulnerable:
|
||||
bb.note("%s-%s is not vulnerable to %s" % (pn, real_pv, cve))
|
||||
patched_cves.add(cve)
|
||||
cve_cursor.close()
|
||||
|
||||
if not cves_in_product:
|
||||
bb.note("No CVE records found for product %s, pn %s" % (product, pn))
|
||||
@@ -377,14 +382,15 @@ def get_cve_info(d, cves):
|
||||
conn = sqlite3.connect(db_file, uri=True)
|
||||
|
||||
for cve in cves:
|
||||
for row in conn.execute("SELECT * FROM NVD WHERE ID IS ?", (cve,)):
|
||||
cursor = conn.execute("SELECT * FROM NVD WHERE ID IS ?", (cve,))
|
||||
for row in cursor:
|
||||
cve_data[row[0]] = {}
|
||||
cve_data[row[0]]["summary"] = row[1]
|
||||
cve_data[row[0]]["scorev2"] = row[2]
|
||||
cve_data[row[0]]["scorev3"] = row[3]
|
||||
cve_data[row[0]]["modified"] = row[4]
|
||||
cve_data[row[0]]["vector"] = row[5]
|
||||
|
||||
cursor.close()
|
||||
conn.close()
|
||||
return cve_data
|
||||
|
||||
|
||||
@@ -13,24 +13,31 @@
|
||||
SPDXLICENSEMAP[AGPL-3] = "AGPL-3.0"
|
||||
SPDXLICENSEMAP[AGPLv3] = "AGPL-3.0"
|
||||
SPDXLICENSEMAP[AGPLv3.0] = "AGPL-3.0"
|
||||
SPDXLICENSEMAP[AGPL-3.0-only] = "AGPL-3.0"
|
||||
|
||||
# GPL variations
|
||||
SPDXLICENSEMAP[GPL-1] = "GPL-1.0"
|
||||
SPDXLICENSEMAP[GPLv1] = "GPL-1.0"
|
||||
SPDXLICENSEMAP[GPLv1.0] = "GPL-1.0"
|
||||
SPDXLICENSEMAP[GPL-1.0-only] = "GPL-1.0"
|
||||
SPDXLICENSEMAP[GPL-2] = "GPL-2.0"
|
||||
SPDXLICENSEMAP[GPLv2] = "GPL-2.0"
|
||||
SPDXLICENSEMAP[GPLv2.0] = "GPL-2.0"
|
||||
SPDXLICENSEMAP[GPL-2.0-only] = "GPL-2.0"
|
||||
SPDXLICENSEMAP[GPL-3] = "GPL-3.0"
|
||||
SPDXLICENSEMAP[GPLv3] = "GPL-3.0"
|
||||
SPDXLICENSEMAP[GPLv3.0] = "GPL-3.0"
|
||||
SPDXLICENSEMAP[GPL-3.0-only] = "GPL-3.0"
|
||||
|
||||
#LGPL variations
|
||||
SPDXLICENSEMAP[LGPLv2] = "LGPL-2.0"
|
||||
SPDXLICENSEMAP[LGPLv2.0] = "LGPL-2.0"
|
||||
SPDXLICENSEMAP[LGPL-2.0-only] = "LGPL-2.0"
|
||||
SPDXLICENSEMAP[LGPL2.1] = "LGPL-2.1"
|
||||
SPDXLICENSEMAP[LGPLv2.1] = "LGPL-2.1"
|
||||
SPDXLICENSEMAP[LGPL-2.1-only] = "LGPL-2.1"
|
||||
SPDXLICENSEMAP[LGPLv3] = "LGPL-3.0"
|
||||
SPDXLICENSEMAP[LGPL-3.0-only] = "LGPL-3.0"
|
||||
|
||||
#MPL variations
|
||||
SPDXLICENSEMAP[MPL-1] = "MPL-1.0"
|
||||
|
||||
@@ -168,7 +168,7 @@ def get_cpe_ids(cve_product, version):
|
||||
else:
|
||||
vendor = "*"
|
||||
|
||||
cpe_id = f'cpe:2.3:a:{vendor}:{product}:{version}:*:*:*:*:*:*:*'
|
||||
cpe_id = 'cpe:2.3:a:{}:{}:{}:*:*:*:*:*:*:*'.format(vendor, product, version)
|
||||
cpe_ids.append(cpe_id)
|
||||
|
||||
return cpe_ids
|
||||
|
||||
67
meta/recipes-connectivity/bind/bind/CVE-2022-2795.patch
Normal file
67
meta/recipes-connectivity/bind/bind/CVE-2022-2795.patch
Normal file
@@ -0,0 +1,67 @@
|
||||
From 36c878a0124973f29b7ca49e6bb18310f9b2601f Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Micha=C5=82=20K=C4=99pie=C5=84?= <michal@isc.org>
|
||||
Date: Thu, 8 Sep 2022 11:11:30 +0200
|
||||
Subject: [PATCH 1/3] Bound the amount of work performed for delegations
|
||||
|
||||
Limit the amount of database lookups that can be triggered in
|
||||
fctx_getaddresses() (i.e. when determining the name server addresses to
|
||||
query next) by setting a hard limit on the number of NS RRs processed
|
||||
for any delegation encountered. Without any limit in place, named can
|
||||
be forced to perform large amounts of database lookups per each query
|
||||
received, which severely impacts resolver performance.
|
||||
|
||||
The limit used (20) is an arbitrary value that is considered to be big
|
||||
enough for any sane DNS delegation.
|
||||
|
||||
(cherry picked from commit 3a44097fd6c6c260765b628cd1d2c9cb7efb0b2a)
|
||||
|
||||
Upstream-Status: Backport
|
||||
CVE: CVE-2022-2795
|
||||
Reference to upstream patch:
|
||||
https://gitlab.isc.org/isc-projects/bind9/-/commit/bf2ea6d8525bfd96a84dad221ba9e004adb710a8
|
||||
|
||||
Signed-off-by: Mathieu Dubois-Briand <mbriand@witekio.com>
|
||||
---
|
||||
lib/dns/resolver.c | 12 ++++++++++++
|
||||
1 file changed, 12 insertions(+)
|
||||
|
||||
diff --git a/lib/dns/resolver.c b/lib/dns/resolver.c
|
||||
index 8ae9a993bbd7..ac9a9ef5d009 100644
|
||||
--- a/lib/dns/resolver.c
|
||||
+++ b/lib/dns/resolver.c
|
||||
@@ -180,6 +180,12 @@
|
||||
*/
|
||||
#define NS_FAIL_LIMIT 4
|
||||
#define NS_RR_LIMIT 5
|
||||
+/*
|
||||
+ * IP address lookups are performed for at most NS_PROCESSING_LIMIT NS RRs in
|
||||
+ * any NS RRset encountered, to avoid excessive resource use while processing
|
||||
+ * large delegations.
|
||||
+ */
|
||||
+#define NS_PROCESSING_LIMIT 20
|
||||
|
||||
/* Number of hash buckets for zone counters */
|
||||
#ifndef RES_DOMAIN_BUCKETS
|
||||
@@ -3318,6 +3324,7 @@ fctx_getaddresses(fetchctx_t *fctx, bool badcache) {
|
||||
bool need_alternate = false;
|
||||
bool all_spilled = true;
|
||||
unsigned int no_addresses = 0;
|
||||
+ unsigned int ns_processed = 0;
|
||||
|
||||
FCTXTRACE5("getaddresses", "fctx->depth=", fctx->depth);
|
||||
|
||||
@@ -3504,6 +3511,11 @@ fctx_getaddresses(fetchctx_t *fctx, bool badcache) {
|
||||
|
||||
dns_rdata_reset(&rdata);
|
||||
dns_rdata_freestruct(&ns);
|
||||
+
|
||||
+ if (++ns_processed >= NS_PROCESSING_LIMIT) {
|
||||
+ result = ISC_R_NOMORE;
|
||||
+ break;
|
||||
+ }
|
||||
}
|
||||
if (result != ISC_R_NOMORE) {
|
||||
return (result);
|
||||
--
|
||||
2.34.1
|
||||
|
||||
31
meta/recipes-connectivity/bind/bind/CVE-2022-38177.patch
Normal file
31
meta/recipes-connectivity/bind/bind/CVE-2022-38177.patch
Normal file
@@ -0,0 +1,31 @@
|
||||
From ef3d1a84ff807eea27b4fef601a15932c5ffbfbf Mon Sep 17 00:00:00 2001
|
||||
From: Mark Andrews <marka@isc.org>
|
||||
Date: Thu, 11 Aug 2022 15:15:34 +1000
|
||||
Subject: [PATCH 2/3] Free eckey on siglen mismatch
|
||||
|
||||
Upstream-Status: Backport
|
||||
CVE: CVE-2022-38177
|
||||
Reference to upstream patch:
|
||||
https://gitlab.isc.org/isc-projects/bind9/-/commit/5b2282afff760b1ed3471f6666bdfe8e1d34e590
|
||||
|
||||
Signed-off-by: Mathieu Dubois-Briand <mbriand@witekio.com>
|
||||
---
|
||||
lib/dns/opensslecdsa_link.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/lib/dns/opensslecdsa_link.c b/lib/dns/opensslecdsa_link.c
|
||||
index 83b5b51cd78c..7576e04ac635 100644
|
||||
--- a/lib/dns/opensslecdsa_link.c
|
||||
+++ b/lib/dns/opensslecdsa_link.c
|
||||
@@ -224,7 +224,7 @@ opensslecdsa_verify(dst_context_t *dctx, const isc_region_t *sig) {
|
||||
siglen = DNS_SIG_ECDSA384SIZE;
|
||||
|
||||
if (sig->length != siglen)
|
||||
- return (DST_R_VERIFYFAILURE);
|
||||
+ DST_RET(DST_R_VERIFYFAILURE);
|
||||
|
||||
if (!EVP_DigestFinal_ex(evp_md_ctx, digest, &dgstlen))
|
||||
DST_RET (dst__openssl_toresult3(dctx->category,
|
||||
--
|
||||
2.34.1
|
||||
|
||||
33
meta/recipes-connectivity/bind/bind/CVE-2022-38178.patch
Normal file
33
meta/recipes-connectivity/bind/bind/CVE-2022-38178.patch
Normal file
@@ -0,0 +1,33 @@
|
||||
From 65f5b2f0162d5d2ab25f463aa14a8bae71ace3d9 Mon Sep 17 00:00:00 2001
|
||||
From: Mark Andrews <marka@isc.org>
|
||||
Date: Thu, 11 Aug 2022 15:28:13 +1000
|
||||
Subject: [PATCH 3/3] Free ctx on invalid siglen
|
||||
|
||||
(cherry picked from commit 6ddb480a84836641a0711768a94122972c166825)
|
||||
|
||||
Upstream-Status: Backport
|
||||
CVE: CVE-2022-38178
|
||||
Reference to upstream patch:
|
||||
https://gitlab.isc.org/isc-projects/bind9/-/commit/1af23378ebb11da2eb0f412e4563d6
|
||||
|
||||
Signed-off-by: Mathieu Dubois-Briand <mbriand@witekio.com>
|
||||
---
|
||||
lib/dns/openssleddsa_link.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/lib/dns/openssleddsa_link.c b/lib/dns/openssleddsa_link.c
|
||||
index 8b115ec283f0..b4fcd607c131 100644
|
||||
--- a/lib/dns/openssleddsa_link.c
|
||||
+++ b/lib/dns/openssleddsa_link.c
|
||||
@@ -325,7 +325,7 @@ openssleddsa_verify(dst_context_t *dctx, const isc_region_t *sig) {
|
||||
siglen = DNS_SIG_ED448SIZE;
|
||||
|
||||
if (sig->length != siglen)
|
||||
- return (DST_R_VERIFYFAILURE);
|
||||
+ DST_RET(ISC_R_NOTIMPLEMENTED);
|
||||
|
||||
isc_buffer_usedregion(buf, &tbsreg);
|
||||
|
||||
--
|
||||
2.34.1
|
||||
|
||||
@@ -19,6 +19,9 @@ SRC_URI = "https://ftp.isc.org/isc/bind9/${PV}/${BPN}-${PV}.tar.gz \
|
||||
file://0001-configure.in-remove-useless-L-use_openssl-lib.patch \
|
||||
file://0001-named-lwresd-V-and-start-log-hide-build-options.patch \
|
||||
file://0001-avoid-start-failure-with-bind-user.patch \
|
||||
file://CVE-2022-2795.patch \
|
||||
file://CVE-2022-38177.patch \
|
||||
file://CVE-2022-38178.patch \
|
||||
"
|
||||
|
||||
SRC_URI[sha256sum] = "0d8efbe7ec166ada90e46add4267b7e7c934790cba9bd5af6b8380a4fbfb5aff"
|
||||
|
||||
@@ -56,6 +56,7 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/bluetooth/bluez-${PV}.tar.xz \
|
||||
file://CVE-2021-3588.patch \
|
||||
file://CVE-2021-3658.patch \
|
||||
file://CVE-2022-0204.patch \
|
||||
file://CVE-2022-39176.patch \
|
||||
"
|
||||
S = "${WORKDIR}/bluez-${PV}"
|
||||
|
||||
|
||||
126
meta/recipes-connectivity/bluez5/bluez5/CVE-2022-39176.patch
Normal file
126
meta/recipes-connectivity/bluez5/bluez5/CVE-2022-39176.patch
Normal file
@@ -0,0 +1,126 @@
|
||||
From 752c7f707c3cc1eb12eadc13bc336a5c484d4bdf Mon Sep 17 00:00:00 2001
|
||||
From: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
Date: Wed, 28 Sep 2022 10:45:53 +0530
|
||||
Subject: [PATCH] CVE-2022-39176
|
||||
|
||||
Upstream-Status: Backport [https://launchpad.net/ubuntu/+source/bluez/5.53-0ubuntu3.6]
|
||||
CVE: CVE-2022-39176
|
||||
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
---
|
||||
profiles/audio/avdtp.c | 56 +++++++++++++++++++++++++++---------------
|
||||
profiles/audio/avrcp.c | 8 ++++++
|
||||
2 files changed, 44 insertions(+), 20 deletions(-)
|
||||
|
||||
diff --git a/profiles/audio/avdtp.c b/profiles/audio/avdtp.c
|
||||
index 782268c..0adf413 100644
|
||||
--- a/profiles/audio/avdtp.c
|
||||
+++ b/profiles/audio/avdtp.c
|
||||
@@ -1261,43 +1261,53 @@ struct avdtp_remote_sep *avdtp_find_remote_sep(struct avdtp *session,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
-static GSList *caps_to_list(uint8_t *data, int size,
|
||||
+static GSList *caps_to_list(uint8_t *data, size_t size,
|
||||
struct avdtp_service_capability **codec,
|
||||
gboolean *delay_reporting)
|
||||
{
|
||||
+ struct avdtp_service_capability *cap;
|
||||
GSList *caps;
|
||||
- int processed;
|
||||
|
||||
if (delay_reporting)
|
||||
*delay_reporting = FALSE;
|
||||
|
||||
- for (processed = 0, caps = NULL; processed + 2 <= size;) {
|
||||
- struct avdtp_service_capability *cap;
|
||||
- uint8_t length, category;
|
||||
+ if (size < sizeof(*cap))
|
||||
+ return NULL;
|
||||
+
|
||||
+ for (caps = NULL; size >= sizeof(*cap);) {
|
||||
+ struct avdtp_service_capability *cpy;
|
||||
|
||||
- category = data[0];
|
||||
- length = data[1];
|
||||
+ cap = (struct avdtp_service_capability *)data;
|
||||
|
||||
- if (processed + 2 + length > size) {
|
||||
+ if (sizeof(*cap) + cap->length > size) {
|
||||
error("Invalid capability data in getcap resp");
|
||||
break;
|
||||
}
|
||||
|
||||
- cap = g_malloc(sizeof(struct avdtp_service_capability) +
|
||||
- length);
|
||||
- memcpy(cap, data, 2 + length);
|
||||
+ if (cap->category == AVDTP_MEDIA_CODEC &&
|
||||
+ cap->length < sizeof(**codec)) {
|
||||
+ error("Invalid codec data in getcap resp");
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ cpy = btd_malloc(sizeof(*cpy) + cap->length);
|
||||
+ memcpy(cpy, cap, sizeof(*cap) + cap->length);
|
||||
|
||||
- processed += 2 + length;
|
||||
- data += 2 + length;
|
||||
+ size -= sizeof(*cap) + cap->length;
|
||||
+ data += sizeof(*cap) + cap->length;
|
||||
|
||||
- caps = g_slist_append(caps, cap);
|
||||
+ caps = g_slist_append(caps, cpy);
|
||||
|
||||
- if (category == AVDTP_MEDIA_CODEC &&
|
||||
- length >=
|
||||
- sizeof(struct avdtp_media_codec_capability))
|
||||
- *codec = cap;
|
||||
- else if (category == AVDTP_DELAY_REPORTING && delay_reporting)
|
||||
- *delay_reporting = TRUE;
|
||||
+ switch (cap->category) {
|
||||
+ case AVDTP_MEDIA_CODEC:
|
||||
+ if (codec)
|
||||
+ *codec = cpy;
|
||||
+ break;
|
||||
+ case AVDTP_DELAY_REPORTING:
|
||||
+ if (delay_reporting)
|
||||
+ *delay_reporting = TRUE;
|
||||
+ break;
|
||||
+ }
|
||||
}
|
||||
|
||||
return caps;
|
||||
@@ -1494,6 +1504,12 @@ static gboolean avdtp_setconf_cmd(struct avdtp *session, uint8_t transaction,
|
||||
&stream->codec,
|
||||
&stream->delay_reporting);
|
||||
|
||||
+ if (!stream->caps || !stream->codec) {
|
||||
+ err = AVDTP_UNSUPPORTED_CONFIGURATION;
|
||||
+ category = 0x00;
|
||||
+ goto failed_stream;
|
||||
+ }
|
||||
+
|
||||
/* Verify that the Media Transport capability's length = 0. Reject otherwise */
|
||||
for (l = stream->caps; l != NULL; l = g_slist_next(l)) {
|
||||
struct avdtp_service_capability *cap = l->data;
|
||||
diff --git a/profiles/audio/avrcp.c b/profiles/audio/avrcp.c
|
||||
index d9471c0..0233d53 100644
|
||||
--- a/profiles/audio/avrcp.c
|
||||
+++ b/profiles/audio/avrcp.c
|
||||
@@ -1916,6 +1916,14 @@ static size_t handle_vendordep_pdu(struct avctp *conn, uint8_t transaction,
|
||||
goto err_metadata;
|
||||
}
|
||||
|
||||
+ operands += sizeof(*pdu);
|
||||
+ operand_count -= sizeof(*pdu);
|
||||
+
|
||||
+ if (pdu->params_len != operand_count) {
|
||||
+ DBG("AVRCP PDU parameters length don't match");
|
||||
+ pdu->params_len = operand_count;
|
||||
+ }
|
||||
+
|
||||
for (handler = session->control_handlers; handler->pdu_id; handler++) {
|
||||
if (handler->pdu_id == pdu->pdu_id)
|
||||
break;
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
From d1a5ede5d255bde8ef707f8441b997563b9312bd Mon Sep 17 00:00:00 2001
|
||||
From: Nathan Crandall <ncrandall@tesla.com>
|
||||
Date: Tue, 12 Jul 2022 08:56:34 +0200
|
||||
Subject: gweb: Fix OOB write in received_data()
|
||||
|
||||
There is a mismatch of handling binary vs. C-string data with memchr
|
||||
and strlen, resulting in pos, count, and bytes_read to become out of
|
||||
sync and result in a heap overflow. Instead, do not treat the buffer
|
||||
as an ASCII C-string. We calculate the count based on the return value
|
||||
of memchr, instead of strlen.
|
||||
|
||||
Fixes: CVE-2022-32292
|
||||
|
||||
Upstream-Status: Backport
|
||||
https://git.kernel.org/pub/scm/network/connman/connman.git/commit/?id=d1a5ede5d255bde8ef707f8441b997563b9312b
|
||||
CVE: CVE-2022-32292
|
||||
Signed-off-by: Lee Chee Yang <chee.yang.lee@intel.com>
|
||||
---
|
||||
gweb/gweb.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/gweb/gweb.c b/gweb/gweb.c
|
||||
index 12fcb1d8..13c6c5f2 100644
|
||||
--- a/gweb/gweb.c
|
||||
+++ b/gweb/gweb.c
|
||||
@@ -918,7 +918,7 @@ static gboolean received_data(GIOChannel *channel, GIOCondition cond,
|
||||
}
|
||||
|
||||
*pos = '\0';
|
||||
- count = strlen((char *) ptr);
|
||||
+ count = pos - ptr;
|
||||
if (count > 0 && ptr[count - 1] == '\r') {
|
||||
ptr[--count] = '\0';
|
||||
bytes_read--;
|
||||
--
|
||||
cgit
|
||||
|
||||
266
meta/recipes-connectivity/connman/connman/CVE-2022-32293.patch
Normal file
266
meta/recipes-connectivity/connman/connman/CVE-2022-32293.patch
Normal file
@@ -0,0 +1,266 @@
|
||||
From 358a44b1442fae0f82846e10da0708b5c4e1ce27 Mon Sep 17 00:00:00 2001
|
||||
From: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
Date: Tue, 20 Sep 2022 17:58:19 +0530
|
||||
Subject: [PATCH] CVE-2022-32293
|
||||
|
||||
CVE: CVE-2022-32293
|
||||
Upstream-Status: Backport [https://git.kernel.org/pub/scm/network/connman/connman.git/commit/?id=72343929836de80727a27d6744c869dff045757c && https://git.kernel.org/pub/scm/network/connman/connman.git/commit/src/wispr.c?id=416bfaff988882c553c672e5bfc2d4f648d29e8a]
|
||||
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
---
|
||||
src/wispr.c | 83 ++++++++++++++++++++++++++++++++++++++++-------------
|
||||
1 file changed, 63 insertions(+), 20 deletions(-)
|
||||
|
||||
diff --git a/src/wispr.c b/src/wispr.c
|
||||
index 473c0e0..97e0242 100644
|
||||
--- a/src/wispr.c
|
||||
+++ b/src/wispr.c
|
||||
@@ -59,6 +59,7 @@ struct wispr_route {
|
||||
};
|
||||
|
||||
struct connman_wispr_portal_context {
|
||||
+ int refcount;
|
||||
struct connman_service *service;
|
||||
enum connman_ipconfig_type type;
|
||||
struct connman_wispr_portal *wispr_portal;
|
||||
@@ -96,10 +97,13 @@ static bool wispr_portal_web_result(GWebResult *result, gpointer user_data);
|
||||
|
||||
static GHashTable *wispr_portal_list = NULL;
|
||||
|
||||
+#define wispr_portal_context_ref(wp_context) \
|
||||
+ wispr_portal_context_ref_debug(wp_context, __FILE__, __LINE__, __func__)
|
||||
+#define wispr_portal_context_unref(wp_context) \
|
||||
+ wispr_portal_context_unref_debug(wp_context, __FILE__, __LINE__, __func__)
|
||||
+
|
||||
static void connman_wispr_message_init(struct connman_wispr_message *msg)
|
||||
{
|
||||
- DBG("");
|
||||
-
|
||||
msg->has_error = false;
|
||||
msg->current_element = NULL;
|
||||
|
||||
@@ -159,11 +163,6 @@ static void free_wispr_routes(struct connman_wispr_portal_context *wp_context)
|
||||
static void free_connman_wispr_portal_context(
|
||||
struct connman_wispr_portal_context *wp_context)
|
||||
{
|
||||
- DBG("context %p", wp_context);
|
||||
-
|
||||
- if (!wp_context)
|
||||
- return;
|
||||
-
|
||||
if (wp_context->wispr_portal) {
|
||||
if (wp_context->wispr_portal->ipv4_context == wp_context)
|
||||
wp_context->wispr_portal->ipv4_context = NULL;
|
||||
@@ -200,9 +199,38 @@ static void free_connman_wispr_portal_context(
|
||||
g_free(wp_context);
|
||||
}
|
||||
|
||||
+static struct connman_wispr_portal_context *
|
||||
+wispr_portal_context_ref_debug(struct connman_wispr_portal_context *wp_context,
|
||||
+ const char *file, int line, const char *caller)
|
||||
+{
|
||||
+ DBG("%p ref %d by %s:%d:%s()", wp_context,
|
||||
+ wp_context->refcount + 1, file, line, caller);
|
||||
+
|
||||
+ __sync_fetch_and_add(&wp_context->refcount, 1);
|
||||
+
|
||||
+ return wp_context;
|
||||
+}
|
||||
+
|
||||
+static void wispr_portal_context_unref_debug(
|
||||
+ struct connman_wispr_portal_context *wp_context,
|
||||
+ const char *file, int line, const char *caller)
|
||||
+{
|
||||
+ if (!wp_context)
|
||||
+ return;
|
||||
+
|
||||
+ DBG("%p ref %d by %s:%d:%s()", wp_context,
|
||||
+ wp_context->refcount - 1, file, line, caller);
|
||||
+
|
||||
+ if (__sync_fetch_and_sub(&wp_context->refcount, 1) != 1)
|
||||
+ return;
|
||||
+
|
||||
+ free_connman_wispr_portal_context(wp_context);
|
||||
+}
|
||||
+
|
||||
static struct connman_wispr_portal_context *create_wispr_portal_context(void)
|
||||
{
|
||||
- return g_try_new0(struct connman_wispr_portal_context, 1);
|
||||
+ return wispr_portal_context_ref(
|
||||
+ g_new0(struct connman_wispr_portal_context, 1));
|
||||
}
|
||||
|
||||
static void free_connman_wispr_portal(gpointer data)
|
||||
@@ -214,8 +242,8 @@ static void free_connman_wispr_portal(gpointer data)
|
||||
if (!wispr_portal)
|
||||
return;
|
||||
|
||||
- free_connman_wispr_portal_context(wispr_portal->ipv4_context);
|
||||
- free_connman_wispr_portal_context(wispr_portal->ipv6_context);
|
||||
+ wispr_portal_context_unref(wispr_portal->ipv4_context);
|
||||
+ wispr_portal_context_unref(wispr_portal->ipv6_context);
|
||||
|
||||
g_free(wispr_portal);
|
||||
}
|
||||
@@ -450,8 +478,6 @@ static void portal_manage_status(GWebResult *result,
|
||||
&str))
|
||||
connman_info("Client-Timezone: %s", str);
|
||||
|
||||
- free_connman_wispr_portal_context(wp_context);
|
||||
-
|
||||
__connman_service_ipconfig_indicate_state(service,
|
||||
CONNMAN_SERVICE_STATE_ONLINE, type);
|
||||
}
|
||||
@@ -509,14 +535,17 @@ static void wispr_portal_request_portal(
|
||||
{
|
||||
DBG("");
|
||||
|
||||
+ wispr_portal_context_ref(wp_context);
|
||||
wp_context->request_id = g_web_request_get(wp_context->web,
|
||||
wp_context->status_url,
|
||||
wispr_portal_web_result,
|
||||
wispr_route_request,
|
||||
wp_context);
|
||||
|
||||
- if (wp_context->request_id == 0)
|
||||
+ if (wp_context->request_id == 0) {
|
||||
wispr_portal_error(wp_context);
|
||||
+ wispr_portal_context_unref(wp_context);
|
||||
+ }
|
||||
}
|
||||
|
||||
static bool wispr_input(const guint8 **data, gsize *length,
|
||||
@@ -562,13 +591,15 @@ static void wispr_portal_browser_reply_cb(struct connman_service *service,
|
||||
return;
|
||||
|
||||
if (!authentication_done) {
|
||||
- wispr_portal_error(wp_context);
|
||||
free_wispr_routes(wp_context);
|
||||
+ wispr_portal_error(wp_context);
|
||||
+ wispr_portal_context_unref(wp_context);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Restarting the test */
|
||||
__connman_service_wispr_start(service, wp_context->type);
|
||||
+ wispr_portal_context_unref(wp_context);
|
||||
}
|
||||
|
||||
static void wispr_portal_request_wispr_login(struct connman_service *service,
|
||||
@@ -592,7 +623,7 @@ static void wispr_portal_request_wispr_login(struct connman_service *service,
|
||||
return;
|
||||
}
|
||||
|
||||
- free_connman_wispr_portal_context(wp_context);
|
||||
+ wispr_portal_context_unref(wp_context);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -644,11 +675,13 @@ static bool wispr_manage_message(GWebResult *result,
|
||||
|
||||
wp_context->wispr_result = CONNMAN_WISPR_RESULT_LOGIN;
|
||||
|
||||
+ wispr_portal_context_ref(wp_context);
|
||||
if (__connman_agent_request_login_input(wp_context->service,
|
||||
wispr_portal_request_wispr_login,
|
||||
- wp_context) != -EINPROGRESS)
|
||||
+ wp_context) != -EINPROGRESS) {
|
||||
wispr_portal_error(wp_context);
|
||||
- else
|
||||
+ wispr_portal_context_unref(wp_context);
|
||||
+ } else
|
||||
return true;
|
||||
|
||||
break;
|
||||
@@ -697,6 +730,7 @@ static bool wispr_portal_web_result(GWebResult *result, gpointer user_data)
|
||||
if (length > 0) {
|
||||
g_web_parser_feed_data(wp_context->wispr_parser,
|
||||
chunk, length);
|
||||
+ wispr_portal_context_unref(wp_context);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -714,6 +748,7 @@ static bool wispr_portal_web_result(GWebResult *result, gpointer user_data)
|
||||
|
||||
switch (status) {
|
||||
case 000:
|
||||
+ wispr_portal_context_ref(wp_context);
|
||||
__connman_agent_request_browser(wp_context->service,
|
||||
wispr_portal_browser_reply_cb,
|
||||
wp_context->status_url, wp_context);
|
||||
@@ -725,11 +760,14 @@ static bool wispr_portal_web_result(GWebResult *result, gpointer user_data)
|
||||
if (g_web_result_get_header(result, "X-ConnMan-Status",
|
||||
&str)) {
|
||||
portal_manage_status(result, wp_context);
|
||||
+ wispr_portal_context_unref(wp_context);
|
||||
return false;
|
||||
- } else
|
||||
+ } else {
|
||||
+ wispr_portal_context_ref(wp_context);
|
||||
__connman_agent_request_browser(wp_context->service,
|
||||
wispr_portal_browser_reply_cb,
|
||||
wp_context->redirect_url, wp_context);
|
||||
+ }
|
||||
|
||||
break;
|
||||
case 302:
|
||||
@@ -737,6 +775,7 @@ static bool wispr_portal_web_result(GWebResult *result, gpointer user_data)
|
||||
!g_web_result_get_header(result, "Location",
|
||||
&redirect)) {
|
||||
|
||||
+ wispr_portal_context_ref(wp_context);
|
||||
__connman_agent_request_browser(wp_context->service,
|
||||
wispr_portal_browser_reply_cb,
|
||||
wp_context->status_url, wp_context);
|
||||
@@ -747,6 +786,7 @@ static bool wispr_portal_web_result(GWebResult *result, gpointer user_data)
|
||||
|
||||
wp_context->redirect_url = g_strdup(redirect);
|
||||
|
||||
+ wispr_portal_context_ref(wp_context);
|
||||
wp_context->request_id = g_web_request_get(wp_context->web,
|
||||
redirect, wispr_portal_web_result,
|
||||
wispr_route_request, wp_context);
|
||||
@@ -763,6 +803,7 @@ static bool wispr_portal_web_result(GWebResult *result, gpointer user_data)
|
||||
|
||||
break;
|
||||
case 505:
|
||||
+ wispr_portal_context_ref(wp_context);
|
||||
__connman_agent_request_browser(wp_context->service,
|
||||
wispr_portal_browser_reply_cb,
|
||||
wp_context->status_url, wp_context);
|
||||
@@ -775,6 +816,7 @@ static bool wispr_portal_web_result(GWebResult *result, gpointer user_data)
|
||||
wp_context->request_id = 0;
|
||||
done:
|
||||
wp_context->wispr_msg.message_type = -1;
|
||||
+ wispr_portal_context_unref(wp_context);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -809,6 +851,7 @@ static void proxy_callback(const char *proxy, void *user_data)
|
||||
xml_wispr_parser_callback, wp_context);
|
||||
|
||||
wispr_portal_request_portal(wp_context);
|
||||
+ wispr_portal_context_unref(wp_context);
|
||||
}
|
||||
|
||||
static gboolean no_proxy_callback(gpointer user_data)
|
||||
@@ -903,7 +946,7 @@ static int wispr_portal_detect(struct connman_wispr_portal_context *wp_context)
|
||||
|
||||
if (wp_context->token == 0) {
|
||||
err = -EINVAL;
|
||||
- free_connman_wispr_portal_context(wp_context);
|
||||
+ wispr_portal_context_unref(wp_context);
|
||||
}
|
||||
} else if (wp_context->timeout == 0) {
|
||||
wp_context->timeout = g_idle_add(no_proxy_callback, wp_context);
|
||||
@@ -952,7 +995,7 @@ int __connman_wispr_start(struct connman_service *service,
|
||||
|
||||
/* If there is already an existing context, we wipe it */
|
||||
if (wp_context)
|
||||
- free_connman_wispr_portal_context(wp_context);
|
||||
+ wispr_portal_context_unref(wp_context);
|
||||
|
||||
wp_context = create_wispr_portal_context();
|
||||
if (!wp_context)
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@@ -12,6 +12,8 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/network/${BPN}/${BP}.tar.xz \
|
||||
file://CVE-2021-33833.patch \
|
||||
file://CVE-2022-23096-7.patch \
|
||||
file://CVE-2022-23098.patch \
|
||||
file://CVE-2022-32292.patch \
|
||||
file://CVE-2022-32293.patch \
|
||||
"
|
||||
|
||||
SRC_URI_append_libc-musl = " file://0002-resolve-musl-does-not-implement-res_ninit.patch"
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
From eaae65aac967f9628787dca4a2501ca860bb6598 Mon Sep 17 00:00:00 2001
|
||||
From: Minjae Kim <flowergom@gmail.com>
|
||||
Date: Mon, 26 Sep 2022 22:05:07 +0200
|
||||
Subject: [PATCH] telnetd: Handle early IAC EC or IAC EL receipt
|
||||
|
||||
Fix telnetd crash if the first two bytes of a new connection
|
||||
are 0xff 0xf7 (IAC EC) or 0xff 0xf8 (IAC EL).
|
||||
|
||||
The problem was reported in:
|
||||
<https://pierrekim.github.io/blog/2022-08-24-2-byte-dos-freebsd-netbsd-telnetd-netkit-telnetd-inetutils-telnetd-kerberos-telnetd.html>.
|
||||
|
||||
* NEWS: Mention fix.
|
||||
* telnetd/state.c (telrcv): Handle zero slctab[SLC_EC].sptr and
|
||||
zero slctab[SLC_EL].sptr.
|
||||
|
||||
CVE: CVE-2022-39028
|
||||
Upstream-Status: Backport [https://git.savannah.gnu.org/cgit/inetutils.git/commit/?id=fae8263e467380483c28513c0e5fac143e46f94f]
|
||||
Signed-off-by: Minjae Kim<flowergom@gmail.com>
|
||||
---
|
||||
telnetd/state.c | 12 +++++++++---
|
||||
1 file changed, 9 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/telnetd/state.c b/telnetd/state.c
|
||||
index 2184bca..7948503 100644
|
||||
--- a/telnetd/state.c
|
||||
+++ b/telnetd/state.c
|
||||
@@ -314,15 +314,21 @@ telrcv (void)
|
||||
case EC:
|
||||
case EL:
|
||||
{
|
||||
- cc_t ch;
|
||||
+ cc_t ch = (cc_t) (_POSIX_VDISABLE);
|
||||
|
||||
DEBUG (debug_options, 1, printoption ("td: recv IAC", c));
|
||||
ptyflush (); /* half-hearted */
|
||||
init_termbuf ();
|
||||
if (c == EC)
|
||||
- ch = *slctab[SLC_EC].sptr;
|
||||
+ {
|
||||
+ if (slctab[SLC_EC].sptr)
|
||||
+ ch = *slctab[SLC_EC].sptr;
|
||||
+ }
|
||||
else
|
||||
- ch = *slctab[SLC_EL].sptr;
|
||||
+ {
|
||||
+ if (slctab[SLC_EL].sptr)
|
||||
+ ch = *slctab[SLC_EL].sptr;
|
||||
+ }
|
||||
if (ch != (cc_t) (_POSIX_VDISABLE))
|
||||
pty_output_byte ((unsigned char) ch);
|
||||
break;
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@@ -24,6 +24,7 @@ SRC_URI = "${GNU_MIRROR}/inetutils/inetutils-${PV}.tar.gz \
|
||||
file://0001-rcp-fix-to-work-with-large-files.patch \
|
||||
file://fix-buffer-fortify-tfpt.patch \
|
||||
file://CVE-2021-40491.patch \
|
||||
file://CVE-2022-39028.patch \
|
||||
"
|
||||
|
||||
SRC_URI[md5sum] = "04852c26c47cc8c6b825f2b74f191f52"
|
||||
|
||||
@@ -5,8 +5,8 @@ SECTION = "network"
|
||||
LICENSE = "PD"
|
||||
LIC_FILES_CHKSUM = "file://COPYING;md5=87964579b2a8ece4bc6744d2dc9a8b04"
|
||||
|
||||
SRCREV = "3d5c8d0f7e0264768a2c000d0fd4b4d4a991e041"
|
||||
PV = "20220511"
|
||||
SRCREV = "fe19892a8168bf19d81e3bc4ee319bf7f9f058f5"
|
||||
PV = "20220725"
|
||||
PE = "1"
|
||||
|
||||
SRC_URI = "git://gitlab.gnome.org/GNOME/mobile-broadband-provider-info.git;protocol=https;branch=main"
|
||||
|
||||
53
meta/recipes-core/expat/expat/CVE-2022-40674.patch
Normal file
53
meta/recipes-core/expat/expat/CVE-2022-40674.patch
Normal file
@@ -0,0 +1,53 @@
|
||||
From 4a32da87e931ba54393d465bb77c40b5c33d343b Mon Sep 17 00:00:00 2001
|
||||
From: Rhodri James <rhodri@wildebeest.org.uk>
|
||||
Date: Wed, 17 Aug 2022 18:26:18 +0100
|
||||
Subject: [PATCH] Ensure raw tagnames are safe exiting internalEntityParser
|
||||
|
||||
It is possible to concoct a situation in which parsing is
|
||||
suspended while substituting in an internal entity, so that
|
||||
XML_ResumeParser directly uses internalEntityProcessor as
|
||||
its processor. If the subsequent parse includes some unclosed
|
||||
tags, this will return without calling storeRawNames to ensure
|
||||
that the raw versions of the tag names are stored in memory other
|
||||
than the parse buffer itself. If the parse buffer is then changed
|
||||
or reallocated (for example if processing a file line by line),
|
||||
badness will ensue.
|
||||
|
||||
This patch ensures storeRawNames is always called when needed
|
||||
after calling doContent. The earlier call do doContent does
|
||||
not need the same protection; it only deals with entity
|
||||
substitution, which cannot leave unbalanced tags, and in any
|
||||
case the raw names will be pointing into the stored entity
|
||||
value not the parse buffer.
|
||||
|
||||
Upstream-Status: Backport [https://github.com/libexpat/libexpat/commit/4a32da87e931ba54393d465bb77c40b5c33d343b]
|
||||
CVE: CVE-2022-40674
|
||||
Signed-off-by: Virendra Thakur <virendrak@kpit.com>
|
||||
---
|
||||
expat/lib/xmlparse.c | 13 +++++++++----
|
||||
1 file changed, 9 insertions(+), 4 deletions(-)
|
||||
|
||||
Index: expat/lib/xmlparse.c
|
||||
===================================================================
|
||||
--- a/lib/xmlparse.c
|
||||
+++ b/lib/xmlparse.c
|
||||
@@ -5657,10 +5657,15 @@ internalEntityProcessor(XML_Parser parse
|
||||
{
|
||||
parser->m_processor = contentProcessor;
|
||||
/* see externalEntityContentProcessor vs contentProcessor */
|
||||
- return doContent(parser, parser->m_parentParser ? 1 : 0, parser->m_encoding,
|
||||
- s, end, nextPtr,
|
||||
- (XML_Bool)! parser->m_parsingStatus.finalBuffer,
|
||||
- XML_ACCOUNT_DIRECT);
|
||||
+ result = doContent(parser, parser->m_parentParser ? 1 : 0,
|
||||
+ parser->m_encoding, s, end, nextPtr,
|
||||
+ (XML_Bool)! parser->m_parsingStatus.finalBuffer,
|
||||
+ XML_ACCOUNT_DIRECT);
|
||||
+ if (result == XML_ERROR_NONE) {
|
||||
+ if (! storeRawNames(parser))
|
||||
+ return XML_ERROR_NO_MEMORY;
|
||||
+ }
|
||||
+ return result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ SRC_URI = "git://github.com/libexpat/libexpat.git;protocol=https;branch=master \
|
||||
file://CVE-2022-25314.patch \
|
||||
file://CVE-2022-25315.patch \
|
||||
file://libtool-tag.patch \
|
||||
file://CVE-2022-40674.patch \
|
||||
"
|
||||
|
||||
SRCREV = "a7bc26b69768f7fb24f0c7976fae24b157b85b13"
|
||||
|
||||
@@ -24,7 +24,7 @@ IMAGE_FSTYPES = "wic.vmdk"
|
||||
|
||||
inherit core-image setuptools3
|
||||
|
||||
SRCREV ?= "23322786e02469c08e3db007043da1091bf0f466"
|
||||
SRCREV ?= "9ae91384970637cd8880c07071fb44b7f5574012"
|
||||
SRC_URI = "git://git.yoctoproject.org/poky;branch=dunfell \
|
||||
file://Yocto_Build_Appliance.vmx \
|
||||
file://Yocto_Build_Appliance.vmxf \
|
||||
|
||||
89
meta/recipes-core/libxml/libxml2/CVE-2016-3709.patch
Normal file
89
meta/recipes-core/libxml/libxml2/CVE-2016-3709.patch
Normal file
@@ -0,0 +1,89 @@
|
||||
From c1ba6f54d32b707ca6d91cb3257ce9de82876b6f Mon Sep 17 00:00:00 2001
|
||||
From: Nick Wellnhofer <wellnhofer@aevum.de>
|
||||
Date: Sat, 15 Aug 2020 18:32:29 +0200
|
||||
Subject: [PATCH] Revert "Do not URI escape in server side includes"
|
||||
|
||||
This reverts commit 960f0e275616cadc29671a218d7fb9b69eb35588.
|
||||
|
||||
This commit introduced
|
||||
|
||||
- an infinite loop, found by OSS-Fuzz, which could be easily fixed.
|
||||
- an algorithm with quadratic runtime
|
||||
- a security issue, see
|
||||
https://bugzilla.gnome.org/show_bug.cgi?id=769760
|
||||
|
||||
A better approach is to add an option not to escape URLs at all
|
||||
which libxml2 should have possibly done in the first place.
|
||||
|
||||
CVE: CVE-2016-3709
|
||||
Upstream-Status: Backport [https://github.com/GNOME/libxml2/commit/c1ba6f54d32b707ca6d91cb3257ce9de82876b6f]
|
||||
Signed-off-by: Pawan Badganchi <Pawan.Badganchi@kpit.com>
|
||||
---
|
||||
HTMLtree.c | 49 +++++++++++--------------------------------------
|
||||
1 file changed, 11 insertions(+), 38 deletions(-)
|
||||
|
||||
diff --git a/HTMLtree.c b/HTMLtree.c
|
||||
index 8d236bb35..cdb7f86a6 100644
|
||||
--- a/HTMLtree.c
|
||||
+++ b/HTMLtree.c
|
||||
@@ -706,49 +706,22 @@ htmlAttrDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr doc, xmlAttrPtr cur,
|
||||
(!xmlStrcasecmp(cur->name, BAD_CAST "src")) ||
|
||||
((!xmlStrcasecmp(cur->name, BAD_CAST "name")) &&
|
||||
(!xmlStrcasecmp(cur->parent->name, BAD_CAST "a"))))) {
|
||||
+ xmlChar *escaped;
|
||||
xmlChar *tmp = value;
|
||||
- /* xmlURIEscapeStr() escapes '"' so it can be safely used. */
|
||||
- xmlBufCCat(buf->buffer, "\"");
|
||||
|
||||
while (IS_BLANK_CH(*tmp)) tmp++;
|
||||
|
||||
- /* URI Escape everything, except server side includes. */
|
||||
- for ( ; ; ) {
|
||||
- xmlChar *escaped;
|
||||
- xmlChar endChar;
|
||||
- xmlChar *end = NULL;
|
||||
- xmlChar *start = (xmlChar *)xmlStrstr(tmp, BAD_CAST "<!--");
|
||||
- if (start != NULL) {
|
||||
- end = (xmlChar *)xmlStrstr(tmp, BAD_CAST "-->");
|
||||
- if (end != NULL) {
|
||||
- *start = '\0';
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- /* Escape the whole string, or until start (set to '\0'). */
|
||||
- escaped = xmlURIEscapeStr(tmp, BAD_CAST"@/:=?;#%&,+");
|
||||
- if (escaped != NULL) {
|
||||
- xmlBufCat(buf->buffer, escaped);
|
||||
- xmlFree(escaped);
|
||||
- } else {
|
||||
- xmlBufCat(buf->buffer, tmp);
|
||||
- }
|
||||
-
|
||||
- if (end == NULL) { /* Everything has been written. */
|
||||
- break;
|
||||
- }
|
||||
-
|
||||
- /* Do not escape anything within server side includes. */
|
||||
- *start = '<'; /* Restore the first character of "<!--". */
|
||||
- end += 3; /* strlen("-->") */
|
||||
- endChar = *end;
|
||||
- *end = '\0';
|
||||
- xmlBufCat(buf->buffer, start);
|
||||
- *end = endChar;
|
||||
- tmp = end;
|
||||
+ /*
|
||||
+ * the < and > have already been escaped at the entity level
|
||||
+ * And doing so here breaks server side includes
|
||||
+ */
|
||||
+ escaped = xmlURIEscapeStr(tmp, BAD_CAST"@/:=?;#%&,+<>");
|
||||
+ if (escaped != NULL) {
|
||||
+ xmlBufWriteQuotedString(buf->buffer, escaped);
|
||||
+ xmlFree(escaped);
|
||||
+ } else {
|
||||
+ xmlBufWriteQuotedString(buf->buffer, value);
|
||||
}
|
||||
-
|
||||
- xmlBufCCat(buf->buffer, "\"");
|
||||
} else {
|
||||
xmlBufWriteQuotedString(buf->buffer, value);
|
||||
}
|
||||
@@ -33,6 +33,7 @@ SRC_URI += "http://www.w3.org/XML/Test/xmlts20080827.tar.gz;subdir=${BP};name=te
|
||||
file://CVE-2022-29824-dependent.patch \
|
||||
file://CVE-2022-29824.patch \
|
||||
file://0001-Port-gentest.py-to-Python-3.patch \
|
||||
file://CVE-2016-3709.patch \
|
||||
"
|
||||
|
||||
SRC_URI[archive.sha256sum] = "593b7b751dd18c2d6abcd0c4bcb29efc203d0b4373a6df98e3a455ea74ae2813"
|
||||
|
||||
@@ -65,9 +65,7 @@ python do_fetch() {
|
||||
|
||||
# Connect to database
|
||||
conn = sqlite3.connect(db_file)
|
||||
c = conn.cursor()
|
||||
|
||||
initialize_db(c)
|
||||
initialize_db(conn)
|
||||
|
||||
with bb.progress.ProgressHandler(d) as ph, open(os.path.join(d.getVar("TMPDIR"), 'cve_check'), 'a') as cve_f:
|
||||
total_years = date.today().year + 1 - YEAR_START
|
||||
@@ -96,18 +94,20 @@ python do_fetch() {
|
||||
return
|
||||
|
||||
# Compare with current db last modified date
|
||||
c.execute("select DATE from META where YEAR = ?", (year,))
|
||||
meta = c.fetchone()
|
||||
cursor = conn.execute("select DATE from META where YEAR = ?", (year,))
|
||||
meta = cursor.fetchone()
|
||||
cursor.close()
|
||||
|
||||
if not meta or meta[0] != last_modified:
|
||||
# Clear products table entries corresponding to current year
|
||||
c.execute("delete from PRODUCTS where ID like ?", ('CVE-%d%%' % year,))
|
||||
conn.execute("delete from PRODUCTS where ID like ?", ('CVE-%d%%' % year,)).close()
|
||||
|
||||
# Update db with current year json file
|
||||
try:
|
||||
response = urllib.request.urlopen(json_url)
|
||||
if response:
|
||||
update_db(c, gzip.decompress(response.read()).decode('utf-8'))
|
||||
c.execute("insert or replace into META values (?, ?)", [year, last_modified])
|
||||
update_db(conn, gzip.decompress(response.read()).decode('utf-8'))
|
||||
conn.execute("insert or replace into META values (?, ?)", [year, last_modified]).close()
|
||||
except urllib.error.URLError as e:
|
||||
cve_f.write('Warning: CVE db update error, CVE data is outdated.\n\n')
|
||||
bb.warn("Cannot parse CVE data (%s), update failed" % e.reason)
|
||||
@@ -125,21 +125,26 @@ do_fetch[lockfiles] += "${CVE_CHECK_DB_FILE_LOCK}"
|
||||
do_fetch[file-checksums] = ""
|
||||
do_fetch[vardeps] = ""
|
||||
|
||||
def initialize_db(c):
|
||||
c.execute("CREATE TABLE IF NOT EXISTS META (YEAR INTEGER UNIQUE, DATE TEXT)")
|
||||
def initialize_db(conn):
|
||||
with conn:
|
||||
c = conn.cursor()
|
||||
|
||||
c.execute("CREATE TABLE IF NOT EXISTS NVD (ID TEXT UNIQUE, SUMMARY TEXT, \
|
||||
SCOREV2 TEXT, SCOREV3 TEXT, MODIFIED INTEGER, VECTOR TEXT)")
|
||||
c.execute("CREATE TABLE IF NOT EXISTS META (YEAR INTEGER UNIQUE, DATE TEXT)")
|
||||
|
||||
c.execute("CREATE TABLE IF NOT EXISTS PRODUCTS (ID TEXT, \
|
||||
VENDOR TEXT, PRODUCT TEXT, VERSION_START TEXT, OPERATOR_START TEXT, \
|
||||
VERSION_END TEXT, OPERATOR_END TEXT)")
|
||||
c.execute("CREATE INDEX IF NOT EXISTS PRODUCT_ID_IDX on PRODUCTS(ID);")
|
||||
c.execute("CREATE TABLE IF NOT EXISTS NVD (ID TEXT UNIQUE, SUMMARY TEXT, \
|
||||
SCOREV2 TEXT, SCOREV3 TEXT, MODIFIED INTEGER, VECTOR TEXT)")
|
||||
|
||||
def parse_node_and_insert(c, node, cveId):
|
||||
c.execute("CREATE TABLE IF NOT EXISTS PRODUCTS (ID TEXT, \
|
||||
VENDOR TEXT, PRODUCT TEXT, VERSION_START TEXT, OPERATOR_START TEXT, \
|
||||
VERSION_END TEXT, OPERATOR_END TEXT)")
|
||||
c.execute("CREATE INDEX IF NOT EXISTS PRODUCT_ID_IDX on PRODUCTS(ID);")
|
||||
|
||||
c.close()
|
||||
|
||||
def parse_node_and_insert(conn, node, cveId):
|
||||
# Parse children node if needed
|
||||
for child in node.get('children', ()):
|
||||
parse_node_and_insert(c, child, cveId)
|
||||
parse_node_and_insert(conn, child, cveId)
|
||||
|
||||
def cpe_generator():
|
||||
for cpe in node.get('cpe_match', ()):
|
||||
@@ -196,9 +201,9 @@ def parse_node_and_insert(c, node, cveId):
|
||||
# Save processing by representing as -.
|
||||
yield [cveId, vendor, product, '-', '', '', '']
|
||||
|
||||
c.executemany("insert into PRODUCTS values (?, ?, ?, ?, ?, ?, ?)", cpe_generator())
|
||||
conn.executemany("insert into PRODUCTS values (?, ?, ?, ?, ?, ?, ?)", cpe_generator()).close()
|
||||
|
||||
def update_db(c, jsondata):
|
||||
def update_db(conn, jsondata):
|
||||
import json
|
||||
root = json.loads(jsondata)
|
||||
|
||||
@@ -222,12 +227,12 @@ def update_db(c, jsondata):
|
||||
accessVector = accessVector or "UNKNOWN"
|
||||
cvssv3 = 0.0
|
||||
|
||||
c.execute("insert or replace into NVD values (?, ?, ?, ?, ?, ?)",
|
||||
[cveId, cveDesc, cvssv2, cvssv3, date, accessVector])
|
||||
conn.execute("insert or replace into NVD values (?, ?, ?, ?, ?, ?)",
|
||||
[cveId, cveDesc, cvssv2, cvssv3, date, accessVector]).close()
|
||||
|
||||
configurations = elt['configurations']['nodes']
|
||||
for config in configurations:
|
||||
parse_node_and_insert(c, config, cveId)
|
||||
parse_node_and_insert(conn, config, cveId)
|
||||
|
||||
|
||||
do_fetch[nostamp] = "1"
|
||||
|
||||
@@ -3,5 +3,6 @@
|
||||
# inside /var/log.
|
||||
|
||||
|
||||
d /run/lock 1777 - - -
|
||||
d /var/volatile/log - - - -
|
||||
d /var/volatile/tmp 1777 - -
|
||||
|
||||
@@ -162,6 +162,7 @@ PACKAGECONFIG[manpages] = "-Dman=true,-Dman=false,libxslt-native xmlto-native do
|
||||
PACKAGECONFIG[microhttpd] = "-Dmicrohttpd=true,-Dmicrohttpd=false,libmicrohttpd"
|
||||
PACKAGECONFIG[myhostname] = "-Dnss-myhostname=true,-Dnss-myhostname=false,,libnss-myhostname"
|
||||
PACKAGECONFIG[networkd] = "-Dnetworkd=true,-Dnetworkd=false"
|
||||
PACKAGECONFIG[no-dns-fallback] = "-Ddns-servers="
|
||||
PACKAGECONFIG[nss] = "-Dnss-systemd=true,-Dnss-systemd=false"
|
||||
PACKAGECONFIG[nss-mymachines] = "-Dnss-mymachines=true,-Dnss-mymachines=false"
|
||||
PACKAGECONFIG[nss-resolve] = "-Dnss-resolve=true,-Dnss-resolve=false"
|
||||
|
||||
@@ -52,5 +52,6 @@ SRC_URI = "\
|
||||
file://CVE-2021-3549.patch \
|
||||
file://CVE-2020-16593.patch \
|
||||
file://0001-CVE-2021-45078.patch \
|
||||
file://CVE-2022-38533.patch \
|
||||
"
|
||||
S = "${WORKDIR}/git"
|
||||
|
||||
37
meta/recipes-devtools/binutils/binutils/CVE-2022-38533.patch
Normal file
37
meta/recipes-devtools/binutils/binutils/CVE-2022-38533.patch
Normal file
@@ -0,0 +1,37 @@
|
||||
From ef186fe54aa6d281a3ff8a9528417e5cc614c797 Mon Sep 17 00:00:00 2001
|
||||
From: Alan Modra <amodra@gmail.com>
|
||||
Date: Sat, 13 Aug 2022 15:32:47 +0930
|
||||
Subject: [PATCH] PR29482 - strip: heap-buffer-overflow
|
||||
|
||||
PR 29482
|
||||
* coffcode.h (coff_set_section_contents): Sanity check _LIB.
|
||||
|
||||
CVE: CVE-2022-38533
|
||||
Upstream-Status: Backport [https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=ef186fe54aa6d281a3ff8a9528417e5cc614c797]
|
||||
|
||||
Signed-off-by: Florin Diaconescu <florin.diaconescu009@gmail.com>
|
||||
|
||||
---
|
||||
bfd/coffcode.h | 7 +++++--
|
||||
1 file changed, 5 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/bfd/coffcode.h b/bfd/coffcode.h
|
||||
index dec2e9c6370..75c18d88602 100644
|
||||
--- a/bfd/coffcode.h
|
||||
+++ b/bfd/coffcode.h
|
||||
@@ -4170,10 +4170,13 @@ coff_set_section_contents (bfd * abfd,
|
||||
|
||||
rec = (bfd_byte *) location;
|
||||
recend = rec + count;
|
||||
- while (rec < recend)
|
||||
+ while (recend - rec >= 4)
|
||||
{
|
||||
+ size_t len = bfd_get_32 (abfd, rec);
|
||||
+ if (len == 0 || len > (size_t) (recend - rec) / 4)
|
||||
+ break;
|
||||
+ rec += len * 4;
|
||||
++section->lma;
|
||||
- rec += bfd_get_32 (abfd, rec) * 4;
|
||||
}
|
||||
|
||||
BFD_ASSERT (rec == recend);
|
||||
@@ -25,6 +25,22 @@ SRC_URI += "\
|
||||
file://CVE-2021-44717.patch \
|
||||
file://CVE-2022-24675.patch \
|
||||
file://CVE-2021-31525.patch \
|
||||
file://CVE-2022-30629.patch \
|
||||
file://CVE-2022-30631.patch \
|
||||
file://CVE-2022-30632.patch \
|
||||
file://CVE-2022-30633.patch \
|
||||
file://CVE-2022-30635.patch \
|
||||
file://CVE-2022-32148.patch \
|
||||
file://CVE-2022-32189.patch \
|
||||
file://CVE-2021-27918.patch \
|
||||
file://CVE-2021-36221.patch \
|
||||
file://CVE-2021-39293.patch \
|
||||
file://CVE-2021-41771.patch \
|
||||
file://CVE-2022-27664.patch \
|
||||
file://0001-CVE-2022-32190.patch \
|
||||
file://0002-CVE-2022-32190.patch \
|
||||
file://0003-CVE-2022-32190.patch \
|
||||
file://0004-CVE-2022-32190.patch \
|
||||
"
|
||||
|
||||
SRC_URI_append_libc-musl = " file://0009-ld-replace-glibc-dynamic-linker-with-musl.patch"
|
||||
@@ -35,3 +51,9 @@ SRC_URI[main.sha256sum] = "7ed13b2209e54a451835997f78035530b331c5b6943cdcd68a3d8
|
||||
# https://github.com/golang/go/issues/30999#issuecomment-910470358
|
||||
CVE_CHECK_WHITELIST += "CVE-2021-29923"
|
||||
|
||||
# this issue affected go1.15 onwards
|
||||
# https://security-tracker.debian.org/tracker/CVE-2022-29526
|
||||
CVE_CHECK_WHITELIST += "CVE-2022-29526"
|
||||
|
||||
# Issue only on windows
|
||||
CVE_CHECK_WHITELIST += "CVE-2022-30634"
|
||||
|
||||
74
meta/recipes-devtools/go/go-1.14/0001-CVE-2022-32190.patch
Normal file
74
meta/recipes-devtools/go/go-1.14/0001-CVE-2022-32190.patch
Normal file
@@ -0,0 +1,74 @@
|
||||
From 755f2dc35a19e6806de3ecbf836fa06ad875c67a Mon Sep 17 00:00:00 2001
|
||||
From: Carl Johnson <me@carlmjohnson.net>
|
||||
Date: Fri, 4 Mar 2022 14:49:52 +0000
|
||||
Subject: [PATCH 1/4] net/url: add JoinPath, URL.JoinPath
|
||||
|
||||
Builds on CL 332209.
|
||||
|
||||
Fixes #47005
|
||||
|
||||
Change-Id: I82708dede05d79a196ca63f5a4e7cb5ac9a041ea
|
||||
GitHub-Last-Rev: 51b735066eef74f5e67c3e8899c58f44c0383c61
|
||||
GitHub-Pull-Request: golang/go#50383
|
||||
Reviewed-on: https://go-review.googlesource.com/c/go/+/374654
|
||||
Reviewed-by: Russ Cox <rsc@golang.org>
|
||||
Auto-Submit: Russ Cox <rsc@golang.org>
|
||||
Trust: Ian Lance Taylor <iant@golang.org>
|
||||
Reviewed-by: Damien Neil <dneil@google.com>
|
||||
Run-TryBot: Ian Lance Taylor <iant@golang.org>
|
||||
TryBot-Result: Gopher Robot <gobot@golang.org>
|
||||
|
||||
Upstream-Status: Backport [https://github.com/golang/go/commit/604140d93111f89911e17cb147dcf6a02d2700d0]
|
||||
CVE: CVE-2022-32190
|
||||
Signed-off-by: Shubham Kulkarni <skulkarni@mvista.com>
|
||||
---
|
||||
src/net/url/url.go | 23 +++++++++++++++++++++++
|
||||
1 file changed, 23 insertions(+)
|
||||
|
||||
diff --git a/src/net/url/url.go b/src/net/url/url.go
|
||||
index 2880e82..dea8bfe 100644
|
||||
--- a/src/net/url/url.go
|
||||
+++ b/src/net/url/url.go
|
||||
@@ -13,6 +13,7 @@ package url
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
+ "path"
|
||||
"sort"
|
||||
"strconv"
|
||||
"strings"
|
||||
@@ -1104,6 +1105,17 @@ func (u *URL) UnmarshalBinary(text []byte) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
+// JoinPath returns a new URL with the provided path elements joined to
|
||||
+// any existing path and the resulting path cleaned of any ./ or ../ elements.
|
||||
+func (u *URL) JoinPath(elem ...string) *URL {
|
||||
+ url := *u
|
||||
+ if len(elem) > 0 {
|
||||
+ elem = append([]string{u.Path}, elem...)
|
||||
+ url.setPath(path.Join(elem...))
|
||||
+ }
|
||||
+ return &url
|
||||
+}
|
||||
+
|
||||
// validUserinfo reports whether s is a valid userinfo string per RFC 3986
|
||||
// Section 3.2.1:
|
||||
// userinfo = *( unreserved / pct-encoded / sub-delims / ":" )
|
||||
@@ -1144,3 +1156,14 @@ func stringContainsCTLByte(s string) bool {
|
||||
}
|
||||
return false
|
||||
}
|
||||
+
|
||||
+// JoinPath returns a URL string with the provided path elements joined to
|
||||
+// the existing path of base and the resulting path cleaned of any ./ or ../ elements.
|
||||
+func JoinPath(base string, elem ...string) (result string, err error) {
|
||||
+ url, err := Parse(base)
|
||||
+ if err != nil {
|
||||
+ return
|
||||
+ }
|
||||
+ result = url.JoinPath(elem...).String()
|
||||
+ return
|
||||
+}
|
||||
--
|
||||
2.7.4
|
||||
48
meta/recipes-devtools/go/go-1.14/0002-CVE-2022-32190.patch
Normal file
48
meta/recipes-devtools/go/go-1.14/0002-CVE-2022-32190.patch
Normal file
@@ -0,0 +1,48 @@
|
||||
From 985108de87e7d2ecb2b28cb53b323d530387b884 Mon Sep 17 00:00:00 2001
|
||||
From: Ian Lance Taylor <iant@golang.org>
|
||||
Date: Thu, 31 Mar 2022 13:21:39 -0700
|
||||
Subject: [PATCH 2/4] net/url: preserve a trailing slash in JoinPath
|
||||
|
||||
Fixes #52074
|
||||
|
||||
Change-Id: I30897f32e70a6ca0c4e11aaf07088c27336efaba
|
||||
Reviewed-on: https://go-review.googlesource.com/c/go/+/397256
|
||||
Trust: Ian Lance Taylor <iant@golang.org>
|
||||
Run-TryBot: Ian Lance Taylor <iant@golang.org>
|
||||
TryBot-Result: Gopher Robot <gobot@golang.org>
|
||||
Reviewed-by: Matt Layher <mdlayher@gmail.com>
|
||||
Trust: Matt Layher <mdlayher@gmail.com>
|
||||
|
||||
Upstream-Status: Backport [https://github.com/golang/go/commit/dbb52cc9f3e83a3040f46c2ae7650c15ab342179]
|
||||
CVE: CVE-2022-32190
|
||||
Signed-off-by: Shubham Kulkarni <skulkarni@mvista.com>
|
||||
---
|
||||
src/net/url/url.go | 9 ++++++++-
|
||||
1 file changed, 8 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/net/url/url.go b/src/net/url/url.go
|
||||
index dea8bfe..3436707 100644
|
||||
--- a/src/net/url/url.go
|
||||
+++ b/src/net/url/url.go
|
||||
@@ -1107,11 +1107,18 @@ func (u *URL) UnmarshalBinary(text []byte) error {
|
||||
|
||||
// JoinPath returns a new URL with the provided path elements joined to
|
||||
// any existing path and the resulting path cleaned of any ./ or ../ elements.
|
||||
+// Any sequences of multiple / characters will be reduced to a single /.
|
||||
func (u *URL) JoinPath(elem ...string) *URL {
|
||||
url := *u
|
||||
if len(elem) > 0 {
|
||||
elem = append([]string{u.Path}, elem...)
|
||||
- url.setPath(path.Join(elem...))
|
||||
+ p := path.Join(elem...)
|
||||
+ // path.Join will remove any trailing slashes.
|
||||
+ // Preserve at least one.
|
||||
+ if strings.HasSuffix(elem[len(elem)-1], "/") && !strings.HasSuffix(p, "/") {
|
||||
+ p += "/"
|
||||
+ }
|
||||
+ url.setPath(p)
|
||||
}
|
||||
return &url
|
||||
}
|
||||
--
|
||||
2.7.4
|
||||
36
meta/recipes-devtools/go/go-1.14/0003-CVE-2022-32190.patch
Normal file
36
meta/recipes-devtools/go/go-1.14/0003-CVE-2022-32190.patch
Normal file
@@ -0,0 +1,36 @@
|
||||
From 2c632b883b0f11084cc247c8b50ad6c71fa7b447 Mon Sep 17 00:00:00 2001
|
||||
From: Sean Liao <sean@liao.dev>
|
||||
Date: Sat, 9 Jul 2022 18:38:45 +0100
|
||||
Subject: [PATCH 3/4] net/url: use EscapedPath for url.JoinPath
|
||||
|
||||
Fixes #53763
|
||||
|
||||
Change-Id: I08b53f159ebdce7907e8cc17316fd0c982363239
|
||||
Reviewed-on: https://go-review.googlesource.com/c/go/+/416774
|
||||
TryBot-Result: Gopher Robot <gobot@golang.org>
|
||||
Reviewed-by: Damien Neil <dneil@google.com>
|
||||
Reviewed-by: Bryan Mills <bcmills@google.com>
|
||||
Run-TryBot: Ian Lance Taylor <iant@golang.org>
|
||||
|
||||
Upstream-Status: Backport [https://github.com/golang/go/commit/bf5898ef53d1693aa572da0da746c05e9a6f15c5]
|
||||
CVE: CVE-2022-32190
|
||||
Signed-off-by: Shubham Kulkarni <skulkarni@mvista.com>
|
||||
---
|
||||
src/net/url/url.go | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/net/url/url.go b/src/net/url/url.go
|
||||
index 3436707..73079a5 100644
|
||||
--- a/src/net/url/url.go
|
||||
+++ b/src/net/url/url.go
|
||||
@@ -1111,7 +1111,7 @@ func (u *URL) UnmarshalBinary(text []byte) error {
|
||||
func (u *URL) JoinPath(elem ...string) *URL {
|
||||
url := *u
|
||||
if len(elem) > 0 {
|
||||
- elem = append([]string{u.Path}, elem...)
|
||||
+ elem = append([]string{u.EscapedPath()}, elem...)
|
||||
p := path.Join(elem...)
|
||||
// path.Join will remove any trailing slashes.
|
||||
// Preserve at least one.
|
||||
--
|
||||
2.7.4
|
||||
82
meta/recipes-devtools/go/go-1.14/0004-CVE-2022-32190.patch
Normal file
82
meta/recipes-devtools/go/go-1.14/0004-CVE-2022-32190.patch
Normal file
@@ -0,0 +1,82 @@
|
||||
From f61e428699cbb52bab31fe2c124f49d085a209fe Mon Sep 17 00:00:00 2001
|
||||
From: Damien Neil <dneil@google.com>
|
||||
Date: Fri, 12 Aug 2022 16:21:09 -0700
|
||||
Subject: [PATCH 4/4] net/url: consistently remove ../ elements in JoinPath
|
||||
|
||||
JoinPath would fail to remove relative elements from the start of
|
||||
the path when the first path element is "".
|
||||
|
||||
In addition, JoinPath would return the original path unmodified
|
||||
when provided with no elements to join, violating the documented
|
||||
behavior of always cleaning the resulting path.
|
||||
|
||||
Correct both these cases.
|
||||
|
||||
JoinPath("http://go.dev", "../go")
|
||||
// before: http://go.dev/../go
|
||||
// after: http://go.dev/go
|
||||
|
||||
JoinPath("http://go.dev/../go")
|
||||
// before: http://go.dev/../go
|
||||
// after: http://go.dev/go
|
||||
|
||||
For #54385.
|
||||
Fixes #54635.
|
||||
Fixes CVE-2022-32190.
|
||||
|
||||
Change-Id: I6d22cd160d097c50703dd96e4f453c6c118fd5d9
|
||||
Reviewed-on: https://go-review.googlesource.com/c/go/+/423514
|
||||
Reviewed-by: David Chase <drchase@google.com>
|
||||
Reviewed-by: Alan Donovan <adonovan@google.com>
|
||||
(cherry picked from commit 0765da5884adcc8b744979303a36a27092d8fc51)
|
||||
Reviewed-on: https://go-review.googlesource.com/c/go/+/425357
|
||||
Run-TryBot: Damien Neil <dneil@google.com>
|
||||
TryBot-Result: Gopher Robot <gobot@golang.org>
|
||||
|
||||
Upstream-Status: Backport [https://github.com/golang/go/commit/28335508913a46e05ef0c04a18e8a1a6beb775ec]
|
||||
CVE: CVE-2022-32190
|
||||
Signed-off-by: Shubham Kulkarni <skulkarni@mvista.com>
|
||||
---
|
||||
src/net/url/url.go | 26 ++++++++++++++++----------
|
||||
1 file changed, 16 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/src/net/url/url.go b/src/net/url/url.go
|
||||
index 73079a5..1e8baf9 100644
|
||||
--- a/src/net/url/url.go
|
||||
+++ b/src/net/url/url.go
|
||||
@@ -1109,17 +1109,23 @@ func (u *URL) UnmarshalBinary(text []byte) error {
|
||||
// any existing path and the resulting path cleaned of any ./ or ../ elements.
|
||||
// Any sequences of multiple / characters will be reduced to a single /.
|
||||
func (u *URL) JoinPath(elem ...string) *URL {
|
||||
- url := *u
|
||||
- if len(elem) > 0 {
|
||||
- elem = append([]string{u.EscapedPath()}, elem...)
|
||||
- p := path.Join(elem...)
|
||||
- // path.Join will remove any trailing slashes.
|
||||
- // Preserve at least one.
|
||||
- if strings.HasSuffix(elem[len(elem)-1], "/") && !strings.HasSuffix(p, "/") {
|
||||
- p += "/"
|
||||
- }
|
||||
- url.setPath(p)
|
||||
+ elem = append([]string{u.EscapedPath()}, elem...)
|
||||
+ var p string
|
||||
+ if !strings.HasPrefix(elem[0], "/") {
|
||||
+ // Return a relative path if u is relative,
|
||||
+ // but ensure that it contains no ../ elements.
|
||||
+ elem[0] = "/" + elem[0]
|
||||
+ p = path.Join(elem...)[1:]
|
||||
+ } else {
|
||||
+ p = path.Join(elem...)
|
||||
}
|
||||
+ // path.Join will remove any trailing slashes.
|
||||
+ // Preserve at least one.
|
||||
+ if strings.HasSuffix(elem[len(elem)-1], "/") && !strings.HasSuffix(p, "/") {
|
||||
+ p += "/"
|
||||
+ }
|
||||
+ url := *u
|
||||
+ url.setPath(p)
|
||||
return &url
|
||||
}
|
||||
|
||||
--
|
||||
2.7.4
|
||||
191
meta/recipes-devtools/go/go-1.14/CVE-2021-27918.patch
Normal file
191
meta/recipes-devtools/go/go-1.14/CVE-2021-27918.patch
Normal file
@@ -0,0 +1,191 @@
|
||||
From d0b79e3513a29628f3599dc8860666b6eed75372 Mon Sep 17 00:00:00 2001
|
||||
From: Katie Hockman <katie@golang.org>
|
||||
Date: Mon, 1 Mar 2021 09:54:00 -0500
|
||||
Subject: [PATCH] encoding/xml: prevent infinite loop while decoding
|
||||
|
||||
This change properly handles a TokenReader which
|
||||
returns an EOF in the middle of an open XML
|
||||
element.
|
||||
|
||||
Thanks to Sam Whited for reporting this.
|
||||
|
||||
Fixes CVE-2021-27918
|
||||
Fixes #44913
|
||||
|
||||
Change-Id: Id02a3f3def4a1b415fa2d9a8e3b373eb6cb0f433
|
||||
Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1004594
|
||||
Reviewed-by: Russ Cox <rsc@google.com>
|
||||
Reviewed-by: Roland Shoemaker <bracewell@google.com>
|
||||
Reviewed-by: Filippo Valsorda <valsorda@google.com>
|
||||
Reviewed-on: https://go-review.googlesource.com/c/go/+/300391
|
||||
Trust: Katie Hockman <katie@golang.org>
|
||||
Run-TryBot: Katie Hockman <katie@golang.org>
|
||||
TryBot-Result: Go Bot <gobot@golang.org>
|
||||
Reviewed-by: Alexander Rakoczy <alex@golang.org>
|
||||
Reviewed-by: Filippo Valsorda <filippo@golang.org>
|
||||
|
||||
https://github.com/golang/go/commit/d0b79e3513a29628f3599dc8860666b6eed75372
|
||||
CVE: CVE-2021-27918
|
||||
Upstream-Status: Backport
|
||||
Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com>
|
||||
---
|
||||
src/encoding/xml/xml.go | 19 ++++---
|
||||
src/encoding/xml/xml_test.go | 104 +++++++++++++++++++++++++++--------
|
||||
2 files changed, 92 insertions(+), 31 deletions(-)
|
||||
|
||||
diff --git a/src/encoding/xml/xml.go b/src/encoding/xml/xml.go
|
||||
index adaf4daf198b9..6f9594d7ba7a3 100644
|
||||
--- a/src/encoding/xml/xml.go
|
||||
+++ b/src/encoding/xml/xml.go
|
||||
@@ -271,7 +271,7 @@ func NewTokenDecoder(t TokenReader) *Decoder {
|
||||
// it will return an error.
|
||||
//
|
||||
// Token implements XML name spaces as described by
|
||||
-// https://www.w3.org/TR/REC-xml-names/. Each of the
|
||||
+// https://www.w3.org/TR/REC-xml-names/. Each of the
|
||||
// Name structures contained in the Token has the Space
|
||||
// set to the URL identifying its name space when known.
|
||||
// If Token encounters an unrecognized name space prefix,
|
||||
@@ -285,16 +285,17 @@ func (d *Decoder) Token() (Token, error) {
|
||||
if d.nextToken != nil {
|
||||
t = d.nextToken
|
||||
d.nextToken = nil
|
||||
- } else if t, err = d.rawToken(); err != nil {
|
||||
- switch {
|
||||
- case err == io.EOF && d.t != nil:
|
||||
- err = nil
|
||||
- case err == io.EOF && d.stk != nil && d.stk.kind != stkEOF:
|
||||
- err = d.syntaxError("unexpected EOF")
|
||||
+ } else {
|
||||
+ if t, err = d.rawToken(); t == nil && err != nil {
|
||||
+ if err == io.EOF && d.stk != nil && d.stk.kind != stkEOF {
|
||||
+ err = d.syntaxError("unexpected EOF")
|
||||
+ }
|
||||
+ return nil, err
|
||||
}
|
||||
- return t, err
|
||||
+ // We still have a token to process, so clear any
|
||||
+ // errors (e.g. EOF) and proceed.
|
||||
+ err = nil
|
||||
}
|
||||
-
|
||||
if !d.Strict {
|
||||
if t1, ok := d.autoClose(t); ok {
|
||||
d.nextToken = t
|
||||
diff --git a/src/encoding/xml/xml_test.go b/src/encoding/xml/xml_test.go
|
||||
index efddca43e9102..5672ebb375f0d 100644
|
||||
--- a/src/encoding/xml/xml_test.go
|
||||
+++ b/src/encoding/xml/xml_test.go
|
||||
@@ -33,30 +33,90 @@ func (t *toks) Token() (Token, error) {
|
||||
|
||||
func TestDecodeEOF(t *testing.T) {
|
||||
start := StartElement{Name: Name{Local: "test"}}
|
||||
- t.Run("EarlyEOF", func(t *testing.T) {
|
||||
- d := NewTokenDecoder(&toks{earlyEOF: true, t: []Token{
|
||||
- start,
|
||||
- start.End(),
|
||||
- }})
|
||||
- err := d.Decode(&struct {
|
||||
- XMLName Name `xml:"test"`
|
||||
- }{})
|
||||
- if err != nil {
|
||||
- t.Error(err)
|
||||
+ tests := []struct {
|
||||
+ name string
|
||||
+ tokens []Token
|
||||
+ ok bool
|
||||
+ }{
|
||||
+ {
|
||||
+ name: "OK",
|
||||
+ tokens: []Token{
|
||||
+ start,
|
||||
+ start.End(),
|
||||
+ },
|
||||
+ ok: true,
|
||||
+ },
|
||||
+ {
|
||||
+ name: "Malformed",
|
||||
+ tokens: []Token{
|
||||
+ start,
|
||||
+ StartElement{Name: Name{Local: "bad"}},
|
||||
+ start.End(),
|
||||
+ },
|
||||
+ ok: false,
|
||||
+ },
|
||||
+ }
|
||||
+ for _, tc := range tests {
|
||||
+ for _, eof := range []bool{true, false} {
|
||||
+ name := fmt.Sprintf("%s/earlyEOF=%v", tc.name, eof)
|
||||
+ t.Run(name, func(t *testing.T) {
|
||||
+ d := NewTokenDecoder(&toks{
|
||||
+ earlyEOF: eof,
|
||||
+ t: tc.tokens,
|
||||
+ })
|
||||
+ err := d.Decode(&struct {
|
||||
+ XMLName Name `xml:"test"`
|
||||
+ }{})
|
||||
+ if tc.ok && err != nil {
|
||||
+ t.Fatalf("d.Decode: expected nil error, got %v", err)
|
||||
+ }
|
||||
+ if _, ok := err.(*SyntaxError); !tc.ok && !ok {
|
||||
+ t.Errorf("d.Decode: expected syntax error, got %v", err)
|
||||
+ }
|
||||
+ })
|
||||
}
|
||||
- })
|
||||
- t.Run("LateEOF", func(t *testing.T) {
|
||||
- d := NewTokenDecoder(&toks{t: []Token{
|
||||
- start,
|
||||
- start.End(),
|
||||
- }})
|
||||
- err := d.Decode(&struct {
|
||||
- XMLName Name `xml:"test"`
|
||||
- }{})
|
||||
- if err != nil {
|
||||
- t.Error(err)
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+type toksNil struct {
|
||||
+ returnEOF bool
|
||||
+ t []Token
|
||||
+}
|
||||
+
|
||||
+func (t *toksNil) Token() (Token, error) {
|
||||
+ if len(t.t) == 0 {
|
||||
+ if !t.returnEOF {
|
||||
+ // Return nil, nil before returning an EOF. It's legal, but
|
||||
+ // discouraged.
|
||||
+ t.returnEOF = true
|
||||
+ return nil, nil
|
||||
}
|
||||
- })
|
||||
+ return nil, io.EOF
|
||||
+ }
|
||||
+ var tok Token
|
||||
+ tok, t.t = t.t[0], t.t[1:]
|
||||
+ return tok, nil
|
||||
+}
|
||||
+
|
||||
+func TestDecodeNilToken(t *testing.T) {
|
||||
+ for _, strict := range []bool{true, false} {
|
||||
+ name := fmt.Sprintf("Strict=%v", strict)
|
||||
+ t.Run(name, func(t *testing.T) {
|
||||
+ start := StartElement{Name: Name{Local: "test"}}
|
||||
+ bad := StartElement{Name: Name{Local: "bad"}}
|
||||
+ d := NewTokenDecoder(&toksNil{
|
||||
+ // Malformed
|
||||
+ t: []Token{start, bad, start.End()},
|
||||
+ })
|
||||
+ d.Strict = strict
|
||||
+ err := d.Decode(&struct {
|
||||
+ XMLName Name `xml:"test"`
|
||||
+ }{})
|
||||
+ if _, ok := err.(*SyntaxError); !ok {
|
||||
+ t.Errorf("d.Decode: expected syntax error, got %v", err)
|
||||
+ }
|
||||
+ })
|
||||
+ }
|
||||
}
|
||||
|
||||
const testInput = `
|
||||
101
meta/recipes-devtools/go/go-1.14/CVE-2021-36221.patch
Normal file
101
meta/recipes-devtools/go/go-1.14/CVE-2021-36221.patch
Normal file
@@ -0,0 +1,101 @@
|
||||
From b7a85e0003cedb1b48a1fd3ae5b746ec6330102e Mon Sep 17 00:00:00 2001
|
||||
From: Damien Neil <dneil@google.com>
|
||||
Date: Wed, 7 Jul 2021 16:34:34 -0700
|
||||
Subject: [PATCH] net/http/httputil: close incoming ReverseProxy request body
|
||||
|
||||
Reading from an incoming request body after the request handler aborts
|
||||
with a panic can cause a panic, becuse http.Server does not (contrary
|
||||
to its documentation) close the request body in this case.
|
||||
|
||||
Always close the incoming request body in ReverseProxy.ServeHTTP to
|
||||
ensure that any in-flight outgoing requests using the body do not
|
||||
read from it.
|
||||
|
||||
Updates #46866
|
||||
Fixes CVE-2021-36221
|
||||
|
||||
Change-Id: I310df269200ad8732c5d9f1a2b00de68725831df
|
||||
Reviewed-on: https://go-review.googlesource.com/c/go/+/333191
|
||||
Trust: Damien Neil <dneil@google.com>
|
||||
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
|
||||
Reviewed-by: Filippo Valsorda <filippo@golang.org>
|
||||
|
||||
https://github.com/golang/go/commit/b7a85e0003cedb1b48a1fd3ae5b746ec6330102e
|
||||
CVE: CVE-2021-36221
|
||||
Upstream-Status: Backport
|
||||
Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com>
|
||||
---
|
||||
src/net/http/httputil/reverseproxy.go | 9 +++++
|
||||
src/net/http/httputil/reverseproxy_test.go | 39 ++++++++++++++++++++++
|
||||
2 files changed, 48 insertions(+)
|
||||
|
||||
diff --git a/src/net/http/httputil/reverseproxy.go b/src/net/http/httputil/reverseproxy.go
|
||||
index 5d39955d62d15..8b63368386f43 100644
|
||||
--- a/src/net/http/httputil/reverseproxy.go
|
||||
+++ b/src/net/http/httputil/reverseproxy.go
|
||||
@@ -235,6 +235,15 @@ func (p *ReverseProxy) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
|
||||
if req.ContentLength == 0 {
|
||||
outreq.Body = nil // Issue 16036: nil Body for http.Transport retries
|
||||
}
|
||||
+ if outreq.Body != nil {
|
||||
+ // Reading from the request body after returning from a handler is not
|
||||
+ // allowed, and the RoundTrip goroutine that reads the Body can outlive
|
||||
+ // this handler. This can lead to a crash if the handler panics (see
|
||||
+ // Issue 46866). Although calling Close doesn't guarantee there isn't
|
||||
+ // any Read in flight after the handle returns, in practice it's safe to
|
||||
+ // read after closing it.
|
||||
+ defer outreq.Body.Close()
|
||||
+ }
|
||||
if outreq.Header == nil {
|
||||
outreq.Header = make(http.Header) // Issue 33142: historical behavior was to always allocate
|
||||
}
|
||||
diff --git a/src/net/http/httputil/reverseproxy_test.go b/src/net/http/httputil/reverseproxy_test.go
|
||||
index 1898ed8b8afde..4b6ad77a29466 100644
|
||||
--- a/src/net/http/httputil/reverseproxy_test.go
|
||||
+++ b/src/net/http/httputil/reverseproxy_test.go
|
||||
@@ -1122,6 +1122,45 @@ func TestReverseProxy_PanicBodyError(t *testing.T) {
|
||||
rproxy.ServeHTTP(httptest.NewRecorder(), req)
|
||||
}
|
||||
|
||||
+// Issue #46866: panic without closing incoming request body causes a panic
|
||||
+func TestReverseProxy_PanicClosesIncomingBody(t *testing.T) {
|
||||
+ backend := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
+ out := "this call was relayed by the reverse proxy"
|
||||
+ // Coerce a wrong content length to induce io.ErrUnexpectedEOF
|
||||
+ w.Header().Set("Content-Length", fmt.Sprintf("%d", len(out)*2))
|
||||
+ fmt.Fprintln(w, out)
|
||||
+ }))
|
||||
+ defer backend.Close()
|
||||
+ backendURL, err := url.Parse(backend.URL)
|
||||
+ if err != nil {
|
||||
+ t.Fatal(err)
|
||||
+ }
|
||||
+ proxyHandler := NewSingleHostReverseProxy(backendURL)
|
||||
+ proxyHandler.ErrorLog = log.New(io.Discard, "", 0) // quiet for tests
|
||||
+ frontend := httptest.NewServer(proxyHandler)
|
||||
+ defer frontend.Close()
|
||||
+ frontendClient := frontend.Client()
|
||||
+
|
||||
+ var wg sync.WaitGroup
|
||||
+ for i := 0; i < 2; i++ {
|
||||
+ wg.Add(1)
|
||||
+ go func() {
|
||||
+ defer wg.Done()
|
||||
+ for j := 0; j < 10; j++ {
|
||||
+ const reqLen = 6 * 1024 * 1024
|
||||
+ req, _ := http.NewRequest("POST", frontend.URL, &io.LimitedReader{R: neverEnding('x'), N: reqLen})
|
||||
+ req.ContentLength = reqLen
|
||||
+ resp, _ := frontendClient.Transport.RoundTrip(req)
|
||||
+ if resp != nil {
|
||||
+ io.Copy(io.Discard, resp.Body)
|
||||
+ resp.Body.Close()
|
||||
+ }
|
||||
+ }
|
||||
+ }()
|
||||
+ }
|
||||
+ wg.Wait()
|
||||
+}
|
||||
+
|
||||
func TestSelectFlushInterval(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
79
meta/recipes-devtools/go/go-1.14/CVE-2021-39293.patch
Normal file
79
meta/recipes-devtools/go/go-1.14/CVE-2021-39293.patch
Normal file
@@ -0,0 +1,79 @@
|
||||
From 6c480017ae600b2c90a264a922e041df04dfa785 Mon Sep 17 00:00:00 2001
|
||||
From: Roland Shoemaker <roland@golang.org>
|
||||
Date: Wed, 18 Aug 2021 11:49:29 -0700
|
||||
Subject: [PATCH] [release-branch.go1.16] archive/zip: prevent preallocation
|
||||
check from overflowing
|
||||
|
||||
If the indicated directory size in the archive header is so large that
|
||||
subtracting it from the archive size overflows a uint64, the check that
|
||||
the indicated number of files in the archive can be effectively
|
||||
bypassed. Prevent this from happening by checking that the indicated
|
||||
directory size is less than the size of the archive.
|
||||
|
||||
Thanks to the OSS-Fuzz project for discovering this issue and to
|
||||
Emmanuel Odeke for reporting it.
|
||||
|
||||
Fixes #47985
|
||||
Updates #47801
|
||||
Fixes CVE-2021-39293
|
||||
|
||||
Change-Id: Ifade26b98a40f3b37398ca86bd5252d12394dd24
|
||||
Reviewed-on: https://go-review.googlesource.com/c/go/+/343434
|
||||
Trust: Roland Shoemaker <roland@golang.org>
|
||||
Run-TryBot: Roland Shoemaker <roland@golang.org>
|
||||
TryBot-Result: Go Bot <gobot@golang.org>
|
||||
Reviewed-by: Russ Cox <rsc@golang.org>
|
||||
(cherry picked from commit bacbc33439b124ffd7392c91a5f5d96eca8c0c0b)
|
||||
Reviewed-on: https://go-review.googlesource.com/c/go/+/345409
|
||||
Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
|
||||
Run-TryBot: Emmanuel Odeke <emmanuel@orijtech.com>
|
||||
Trust: Cherry Mui <cherryyz@google.com>
|
||||
|
||||
https://github.com/golang/go/commit/6c480017ae600b2c90a264a922e041df04dfa785
|
||||
CVE: CVE-2021-39293
|
||||
Upstream-Status: Backport
|
||||
Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com>
|
||||
---
|
||||
src/archive/zip/reader.go | 2 +-
|
||||
src/archive/zip/reader_test.go | 18 ++++++++++++++++++
|
||||
2 files changed, 19 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/archive/zip/reader.go b/src/archive/zip/reader.go
|
||||
index ddef2b7b5a517..801d1313b6c32 100644
|
||||
--- a/src/archive/zip/reader.go
|
||||
+++ b/src/archive/zip/reader.go
|
||||
@@ -105,7 +105,7 @@ func (z *Reader) init(r io.ReaderAt, size int64) error {
|
||||
// indicate it contains up to 1 << 128 - 1 files. Since each file has a
|
||||
// header which will be _at least_ 30 bytes we can safely preallocate
|
||||
// if (data size / 30) >= end.directoryRecords.
|
||||
- if (uint64(size)-end.directorySize)/30 >= end.directoryRecords {
|
||||
+ if end.directorySize < uint64(size) && (uint64(size)-end.directorySize)/30 >= end.directoryRecords {
|
||||
z.File = make([]*File, 0, end.directoryRecords)
|
||||
}
|
||||
z.Comment = end.comment
|
||||
diff --git a/src/archive/zip/reader_test.go b/src/archive/zip/reader_test.go
|
||||
index 471be27bb1004..99f13345d8d06 100644
|
||||
--- a/src/archive/zip/reader_test.go
|
||||
+++ b/src/archive/zip/reader_test.go
|
||||
@@ -1225,3 +1225,21 @@ func TestCVE202133196(t *testing.T) {
|
||||
t.Errorf("Archive has unexpected number of files, got %d, want 5", len(r.File))
|
||||
}
|
||||
}
|
||||
+
|
||||
+func TestCVE202139293(t *testing.T) {
|
||||
+ // directory size is so large, that the check in Reader.init
|
||||
+ // overflows when subtracting from the archive size, causing
|
||||
+ // the pre-allocation check to be bypassed.
|
||||
+ data := []byte{
|
||||
+ 0x50, 0x4b, 0x06, 0x06, 0x05, 0x06, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x4b,
|
||||
+ 0x06, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
|
||||
+ 0x00, 0x00, 0x50, 0x4b, 0x05, 0x06, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x4b,
|
||||
+ 0x06, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
|
||||
+ 0x00, 0x00, 0x00, 0x50, 0x4b, 0x05, 0x06, 0x00, 0x31, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff,
|
||||
+ 0xff, 0x50, 0xfe, 0x00, 0xff, 0x00, 0x3a, 0x00, 0x00, 0x00, 0xff,
|
||||
+ }
|
||||
+ _, err := NewReader(bytes.NewReader(data), int64(len(data)))
|
||||
+ if err != ErrFormat {
|
||||
+ t.Fatalf("unexpected error, got: %v, want: %v", err, ErrFormat)
|
||||
+ }
|
||||
+}
|
||||
86
meta/recipes-devtools/go/go-1.14/CVE-2021-41771.patch
Normal file
86
meta/recipes-devtools/go/go-1.14/CVE-2021-41771.patch
Normal file
File diff suppressed because one or more lines are too long
68
meta/recipes-devtools/go/go-1.14/CVE-2022-27664.patch
Normal file
68
meta/recipes-devtools/go/go-1.14/CVE-2022-27664.patch
Normal file
@@ -0,0 +1,68 @@
|
||||
From 48c9076dcfc2dc894842ff758c8cfae7957c9565 Mon Sep 17 00:00:00 2001
|
||||
From: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
Date: Thu, 29 Sep 2022 17:06:18 +0530
|
||||
Subject: [PATCH] CVE-2022-27664
|
||||
|
||||
Upstream-Status: Backport [https://github.com/golang/go/commit/5bc9106458fc07851ac324a4157132a91b1f3479]
|
||||
CVE: CVE-2022-27664
|
||||
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
---
|
||||
src/net/http/h2_bundle.go | 21 +++++++++++++--------
|
||||
1 file changed, 13 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/src/net/http/h2_bundle.go b/src/net/http/h2_bundle.go
|
||||
index 65d851d..83f2a72 100644
|
||||
--- a/src/net/http/h2_bundle.go
|
||||
+++ b/src/net/http/h2_bundle.go
|
||||
@@ -3254,10 +3254,11 @@ var (
|
||||
// name (key). See httpguts.ValidHeaderName for the base rules.
|
||||
//
|
||||
// Further, http2 says:
|
||||
-// "Just as in HTTP/1.x, header field names are strings of ASCII
|
||||
-// characters that are compared in a case-insensitive
|
||||
-// fashion. However, header field names MUST be converted to
|
||||
-// lowercase prior to their encoding in HTTP/2. "
|
||||
+//
|
||||
+// "Just as in HTTP/1.x, header field names are strings of ASCII
|
||||
+// characters that are compared in a case-insensitive
|
||||
+// fashion. However, header field names MUST be converted to
|
||||
+// lowercase prior to their encoding in HTTP/2. "
|
||||
func http2validWireHeaderFieldName(v string) bool {
|
||||
if len(v) == 0 {
|
||||
return false
|
||||
@@ -3446,8 +3447,8 @@ func (s *http2sorter) SortStrings(ss []string) {
|
||||
// validPseudoPath reports whether v is a valid :path pseudo-header
|
||||
// value. It must be either:
|
||||
//
|
||||
-// *) a non-empty string starting with '/'
|
||||
-// *) the string '*', for OPTIONS requests.
|
||||
+// *) a non-empty string starting with '/'
|
||||
+// *) the string '*', for OPTIONS requests.
|
||||
//
|
||||
// For now this is only used a quick check for deciding when to clean
|
||||
// up Opaque URLs before sending requests from the Transport.
|
||||
@@ -4897,6 +4898,9 @@ func (sc *http2serverConn) startGracefulShutdownInternal() {
|
||||
func (sc *http2serverConn) goAway(code http2ErrCode) {
|
||||
sc.serveG.check()
|
||||
if sc.inGoAway {
|
||||
+ if sc.goAwayCode == http2ErrCodeNo {
|
||||
+ sc.goAwayCode = code
|
||||
+ }
|
||||
return
|
||||
}
|
||||
sc.inGoAway = true
|
||||
@@ -6091,8 +6095,9 @@ func (rws *http2responseWriterState) writeChunk(p []byte) (n int, err error) {
|
||||
// prior to the headers being written. If the set of trailers is fixed
|
||||
// or known before the header is written, the normal Go trailers mechanism
|
||||
// is preferred:
|
||||
-// https://golang.org/pkg/net/http/#ResponseWriter
|
||||
-// https://golang.org/pkg/net/http/#example_ResponseWriter_trailers
|
||||
+//
|
||||
+// https://golang.org/pkg/net/http/#ResponseWriter
|
||||
+// https://golang.org/pkg/net/http/#example_ResponseWriter_trailers
|
||||
const http2TrailerPrefix = "Trailer:"
|
||||
|
||||
// promoteUndeclaredTrailers permits http.Handlers to set trailers
|
||||
--
|
||||
2.25.1
|
||||
|
||||
47
meta/recipes-devtools/go/go-1.14/CVE-2022-30629.patch
Normal file
47
meta/recipes-devtools/go/go-1.14/CVE-2022-30629.patch
Normal file
@@ -0,0 +1,47 @@
|
||||
From 8d0bbb5a6280c2cf951241ec7f6579c90d38df57 Mon Sep 17 00:00:00 2001
|
||||
From: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
Date: Thu, 25 Aug 2022 10:55:08 +0530
|
||||
Subject: [PATCH] CVE-2022-30629
|
||||
|
||||
Upstream-Status: Backport [https://github.com/golang/go/commit/c15a8e2dbb5ac376a6ed890735341b812d6b965c]
|
||||
CVE: CVE-2022-30629
|
||||
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
---
|
||||
src/crypto/tls/handshake_server_tls13.go | 14 ++++++++++++++
|
||||
1 file changed, 14 insertions(+)
|
||||
|
||||
diff --git a/src/crypto/tls/handshake_server_tls13.go b/src/crypto/tls/handshake_server_tls13.go
|
||||
index 5432145..d91797e 100644
|
||||
--- a/src/crypto/tls/handshake_server_tls13.go
|
||||
+++ b/src/crypto/tls/handshake_server_tls13.go
|
||||
@@ -9,6 +9,7 @@ import (
|
||||
"crypto"
|
||||
"crypto/hmac"
|
||||
"crypto/rsa"
|
||||
+ "encoding/binary"
|
||||
"errors"
|
||||
"hash"
|
||||
"io"
|
||||
@@ -742,6 +743,19 @@ func (hs *serverHandshakeStateTLS13) sendSessionTickets() error {
|
||||
}
|
||||
m.lifetime = uint32(maxSessionTicketLifetime / time.Second)
|
||||
|
||||
+ // ticket_age_add is a random 32-bit value. See RFC 8446, section 4.6.1
|
||||
+ // The value is not stored anywhere; we never need to check the ticket age
|
||||
+ // because 0-RTT is not supported.
|
||||
+ ageAdd := make([]byte, 4)
|
||||
+ _, err = hs.c.config.rand().Read(ageAdd)
|
||||
+ if err != nil {
|
||||
+ return err
|
||||
+ }
|
||||
+ m.ageAdd = binary.LittleEndian.Uint32(ageAdd)
|
||||
+
|
||||
+ // ticket_nonce, which must be unique per connection, is always left at
|
||||
+ // zero because we only ever send one ticket per connection.
|
||||
+
|
||||
if _, err := c.writeRecord(recordTypeHandshake, m.marshal()); err != nil {
|
||||
return err
|
||||
}
|
||||
--
|
||||
2.25.1
|
||||
|
||||
116
meta/recipes-devtools/go/go-1.14/CVE-2022-30631.patch
Normal file
116
meta/recipes-devtools/go/go-1.14/CVE-2022-30631.patch
Normal file
@@ -0,0 +1,116 @@
|
||||
From d10fc3a84e3344f2421c1dd3046faa50709ab4d5 Mon Sep 17 00:00:00 2001
|
||||
From: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
Date: Thu, 25 Aug 2022 11:01:21 +0530
|
||||
Subject: [PATCH] CVE-2022-30631
|
||||
|
||||
Upstream-Status: Backport [https://github.com/golang/go/commit/0117dee7dccbbd7803d88f65a2ce8bd686219ad3]
|
||||
CVE: CVE-2022-30631
|
||||
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
---
|
||||
src/compress/gzip/gunzip.go | 60 +++++++++++++++-----------------
|
||||
src/compress/gzip/gunzip_test.go | 16 +++++++++
|
||||
2 files changed, 45 insertions(+), 31 deletions(-)
|
||||
|
||||
diff --git a/src/compress/gzip/gunzip.go b/src/compress/gzip/gunzip.go
|
||||
index 924bce1..237b2b9 100644
|
||||
--- a/src/compress/gzip/gunzip.go
|
||||
+++ b/src/compress/gzip/gunzip.go
|
||||
@@ -248,42 +248,40 @@ func (z *Reader) Read(p []byte) (n int, err error) {
|
||||
return 0, z.err
|
||||
}
|
||||
|
||||
- n, z.err = z.decompressor.Read(p)
|
||||
- z.digest = crc32.Update(z.digest, crc32.IEEETable, p[:n])
|
||||
- z.size += uint32(n)
|
||||
- if z.err != io.EOF {
|
||||
- // In the normal case we return here.
|
||||
- return n, z.err
|
||||
- }
|
||||
+ for n == 0 {
|
||||
+ n, z.err = z.decompressor.Read(p)
|
||||
+ z.digest = crc32.Update(z.digest, crc32.IEEETable, p[:n])
|
||||
+ z.size += uint32(n)
|
||||
+ if z.err != io.EOF {
|
||||
+ // In the normal case we return here.
|
||||
+ return n, z.err
|
||||
+ }
|
||||
|
||||
- // Finished file; check checksum and size.
|
||||
- if _, err := io.ReadFull(z.r, z.buf[:8]); err != nil {
|
||||
- z.err = noEOF(err)
|
||||
- return n, z.err
|
||||
- }
|
||||
- digest := le.Uint32(z.buf[:4])
|
||||
- size := le.Uint32(z.buf[4:8])
|
||||
- if digest != z.digest || size != z.size {
|
||||
- z.err = ErrChecksum
|
||||
- return n, z.err
|
||||
- }
|
||||
- z.digest, z.size = 0, 0
|
||||
+ // Finished file; check checksum and size.
|
||||
+ if _, err := io.ReadFull(z.r, z.buf[:8]); err != nil {
|
||||
+ z.err = noEOF(err)
|
||||
+ return n, z.err
|
||||
+ }
|
||||
+ digest := le.Uint32(z.buf[:4])
|
||||
+ size := le.Uint32(z.buf[4:8])
|
||||
+ if digest != z.digest || size != z.size {
|
||||
+ z.err = ErrChecksum
|
||||
+ return n, z.err
|
||||
+ }
|
||||
+ z.digest, z.size = 0, 0
|
||||
|
||||
- // File is ok; check if there is another.
|
||||
- if !z.multistream {
|
||||
- return n, io.EOF
|
||||
- }
|
||||
- z.err = nil // Remove io.EOF
|
||||
+ // File is ok; check if there is another.
|
||||
+ if !z.multistream {
|
||||
+ return n, io.EOF
|
||||
+ }
|
||||
+ z.err = nil // Remove io.EOF
|
||||
|
||||
- if _, z.err = z.readHeader(); z.err != nil {
|
||||
- return n, z.err
|
||||
+ if _, z.err = z.readHeader(); z.err != nil {
|
||||
+ return n, z.err
|
||||
+ }
|
||||
}
|
||||
|
||||
- // Read from next file, if necessary.
|
||||
- if n > 0 {
|
||||
- return n, nil
|
||||
- }
|
||||
- return z.Read(p)
|
||||
+ return n, nil
|
||||
}
|
||||
|
||||
// Close closes the Reader. It does not close the underlying io.Reader.
|
||||
diff --git a/src/compress/gzip/gunzip_test.go b/src/compress/gzip/gunzip_test.go
|
||||
index 1b01404..95220ae 100644
|
||||
--- a/src/compress/gzip/gunzip_test.go
|
||||
+++ b/src/compress/gzip/gunzip_test.go
|
||||
@@ -516,3 +516,19 @@ func TestTruncatedStreams(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
+
|
||||
+func TestCVE202230631(t *testing.T) {
|
||||
+ var empty = []byte{0x1f, 0x8b, 0x08, 0x00, 0xa7, 0x8f, 0x43, 0x62, 0x00,
|
||||
+ 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
|
||||
+ r := bytes.NewReader(bytes.Repeat(empty, 4e6))
|
||||
+ z, err := NewReader(r)
|
||||
+ if err != nil {
|
||||
+ t.Fatalf("NewReader: got %v, want nil", err)
|
||||
+ }
|
||||
+ // Prior to CVE-2022-30631 fix, this would cause an unrecoverable panic due
|
||||
+ // to stack exhaustion.
|
||||
+ _, err = z.Read(make([]byte, 10))
|
||||
+ if err != io.EOF {
|
||||
+ t.Errorf("Reader.Read: got %v, want %v", err, io.EOF)
|
||||
+ }
|
||||
+}
|
||||
--
|
||||
2.25.1
|
||||
|
||||
71
meta/recipes-devtools/go/go-1.14/CVE-2022-30632.patch
Normal file
71
meta/recipes-devtools/go/go-1.14/CVE-2022-30632.patch
Normal file
@@ -0,0 +1,71 @@
|
||||
From 35d1dfe9746029aea9027b405c75555d41ffd2f8 Mon Sep 17 00:00:00 2001
|
||||
From: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
Date: Thu, 25 Aug 2022 13:12:40 +0530
|
||||
Subject: [PATCH] CVE-2022-30632
|
||||
|
||||
Upstream-Status: Backport [https://github.com/golang/go/commit/76f8b7304d1f7c25834e2a0cc9e88c55276c47df]
|
||||
CVE: CVE-2022-30632
|
||||
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
---
|
||||
src/path/filepath/match.go | 16 +++++++++++++++-
|
||||
src/path/filepath/match_test.go | 10 ++++++++++
|
||||
2 files changed, 25 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/path/filepath/match.go b/src/path/filepath/match.go
|
||||
index 46badb5..ba68daa 100644
|
||||
--- a/src/path/filepath/match.go
|
||||
+++ b/src/path/filepath/match.go
|
||||
@@ -232,6 +232,20 @@ func getEsc(chunk string) (r rune, nchunk string, err error) {
|
||||
// The only possible returned error is ErrBadPattern, when pattern
|
||||
// is malformed.
|
||||
func Glob(pattern string) (matches []string, err error) {
|
||||
+ return globWithLimit(pattern, 0)
|
||||
+}
|
||||
+
|
||||
+func globWithLimit(pattern string, depth int) (matches []string, err error) {
|
||||
+ // This limit is used prevent stack exhaustion issues. See CVE-2022-30632.
|
||||
+ const pathSeparatorsLimit = 10000
|
||||
+ if depth == pathSeparatorsLimit {
|
||||
+ return nil, ErrBadPattern
|
||||
+ }
|
||||
+
|
||||
+ // Check pattern is well-formed.
|
||||
+ if _, err := Match(pattern, ""); err != nil {
|
||||
+ return nil, err
|
||||
+ }
|
||||
if !hasMeta(pattern) {
|
||||
if _, err = os.Lstat(pattern); err != nil {
|
||||
return nil, nil
|
||||
@@ -257,7 +271,7 @@ func Glob(pattern string) (matches []string, err error) {
|
||||
}
|
||||
|
||||
var m []string
|
||||
- m, err = Glob(dir)
|
||||
+ m, err = globWithLimit(dir, depth+1)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
diff --git a/src/path/filepath/match_test.go b/src/path/filepath/match_test.go
|
||||
index b865762..c37c812 100644
|
||||
--- a/src/path/filepath/match_test.go
|
||||
+++ b/src/path/filepath/match_test.go
|
||||
@@ -154,6 +154,16 @@ func TestGlob(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
+func TestCVE202230632(t *testing.T) {
|
||||
+ // Prior to CVE-2022-30632, this would cause a stack exhaustion given a
|
||||
+ // large number of separators (more than 4,000,000). There is now a limit
|
||||
+ // of 10,000.
|
||||
+ _, err := Glob("/*" + strings.Repeat("/", 10001))
|
||||
+ if err != ErrBadPattern {
|
||||
+ t.Fatalf("Glob returned err=%v, want ErrBadPattern", err)
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
func TestGlobError(t *testing.T) {
|
||||
_, err := Glob("[]")
|
||||
if err == nil {
|
||||
--
|
||||
2.25.1
|
||||
|
||||
131
meta/recipes-devtools/go/go-1.14/CVE-2022-30633.patch
Normal file
131
meta/recipes-devtools/go/go-1.14/CVE-2022-30633.patch
Normal file
@@ -0,0 +1,131 @@
|
||||
From ab6e2ffdcab0501bcc2de4b196c1c18ae2301d4b Mon Sep 17 00:00:00 2001
|
||||
From: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
Date: Thu, 25 Aug 2022 13:29:55 +0530
|
||||
Subject: [PATCH] CVE-2022-30633
|
||||
|
||||
Upstream-Status: Backport [https://github.com/golang/go/commit/2678d0c957193dceef336c969a9da74dd716a827]
|
||||
CVE: CVE-2022-30633
|
||||
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
---
|
||||
src/encoding/xml/read.go | 27 +++++++++++++++++++--------
|
||||
src/encoding/xml/read_test.go | 14 ++++++++++++++
|
||||
2 files changed, 33 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/src/encoding/xml/read.go b/src/encoding/xml/read.go
|
||||
index 10a60ee..4ffed80 100644
|
||||
--- a/src/encoding/xml/read.go
|
||||
+++ b/src/encoding/xml/read.go
|
||||
@@ -148,7 +148,7 @@ func (d *Decoder) DecodeElement(v interface{}, start *StartElement) error {
|
||||
if val.Kind() != reflect.Ptr {
|
||||
return errors.New("non-pointer passed to Unmarshal")
|
||||
}
|
||||
- return d.unmarshal(val.Elem(), start)
|
||||
+ return d.unmarshal(val.Elem(), start, 0)
|
||||
}
|
||||
|
||||
// An UnmarshalError represents an error in the unmarshaling process.
|
||||
@@ -304,8 +304,15 @@ var (
|
||||
textUnmarshalerType = reflect.TypeOf((*encoding.TextUnmarshaler)(nil)).Elem()
|
||||
)
|
||||
|
||||
+const maxUnmarshalDepth = 10000
|
||||
+
|
||||
+var errExeceededMaxUnmarshalDepth = errors.New("exceeded max depth")
|
||||
+
|
||||
// Unmarshal a single XML element into val.
|
||||
-func (d *Decoder) unmarshal(val reflect.Value, start *StartElement) error {
|
||||
+func (d *Decoder) unmarshal(val reflect.Value, start *StartElement, depth int) error {
|
||||
+ if depth >= maxUnmarshalDepth {
|
||||
+ return errExeceededMaxUnmarshalDepth
|
||||
+ }
|
||||
// Find start element if we need it.
|
||||
if start == nil {
|
||||
for {
|
||||
@@ -398,7 +405,7 @@ func (d *Decoder) unmarshal(val reflect.Value, start *StartElement) error {
|
||||
v.Set(reflect.Append(val, reflect.Zero(v.Type().Elem())))
|
||||
|
||||
// Recur to read element into slice.
|
||||
- if err := d.unmarshal(v.Index(n), start); err != nil {
|
||||
+ if err := d.unmarshal(v.Index(n), start, depth+1); err != nil {
|
||||
v.SetLen(n)
|
||||
return err
|
||||
}
|
||||
@@ -521,13 +528,15 @@ Loop:
|
||||
case StartElement:
|
||||
consumed := false
|
||||
if sv.IsValid() {
|
||||
- consumed, err = d.unmarshalPath(tinfo, sv, nil, &t)
|
||||
+ // unmarshalPath can call unmarshal, so we need to pass the depth through so that
|
||||
+ // we can continue to enforce the maximum recusion limit.
|
||||
+ consumed, err = d.unmarshalPath(tinfo, sv, nil, &t, depth)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if !consumed && saveAny.IsValid() {
|
||||
consumed = true
|
||||
- if err := d.unmarshal(saveAny, &t); err != nil {
|
||||
+ if err := d.unmarshal(saveAny, &t, depth+1); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
@@ -672,7 +681,7 @@ func copyValue(dst reflect.Value, src []byte) (err error) {
|
||||
// The consumed result tells whether XML elements have been consumed
|
||||
// from the Decoder until start's matching end element, or if it's
|
||||
// still untouched because start is uninteresting for sv's fields.
|
||||
-func (d *Decoder) unmarshalPath(tinfo *typeInfo, sv reflect.Value, parents []string, start *StartElement) (consumed bool, err error) {
|
||||
+func (d *Decoder) unmarshalPath(tinfo *typeInfo, sv reflect.Value, parents []string, start *StartElement, depth int) (consumed bool, err error) {
|
||||
recurse := false
|
||||
Loop:
|
||||
for i := range tinfo.fields {
|
||||
@@ -687,7 +696,7 @@ Loop:
|
||||
}
|
||||
if len(finfo.parents) == len(parents) && finfo.name == start.Name.Local {
|
||||
// It's a perfect match, unmarshal the field.
|
||||
- return true, d.unmarshal(finfo.value(sv), start)
|
||||
+ return true, d.unmarshal(finfo.value(sv), start, depth+1)
|
||||
}
|
||||
if len(finfo.parents) > len(parents) && finfo.parents[len(parents)] == start.Name.Local {
|
||||
// It's a prefix for the field. Break and recurse
|
||||
@@ -716,7 +725,9 @@ Loop:
|
||||
}
|
||||
switch t := tok.(type) {
|
||||
case StartElement:
|
||||
- consumed2, err := d.unmarshalPath(tinfo, sv, parents, &t)
|
||||
+ // the recursion depth of unmarshalPath is limited to the path length specified
|
||||
+ // by the struct field tag, so we don't increment the depth here.
|
||||
+ consumed2, err := d.unmarshalPath(tinfo, sv, parents, &t, depth)
|
||||
if err != nil {
|
||||
return true, err
|
||||
}
|
||||
diff --git a/src/encoding/xml/read_test.go b/src/encoding/xml/read_test.go
|
||||
index 8c2e70f..6a20b1a 100644
|
||||
--- a/src/encoding/xml/read_test.go
|
||||
+++ b/src/encoding/xml/read_test.go
|
||||
@@ -5,6 +5,7 @@
|
||||
package xml
|
||||
|
||||
import (
|
||||
+ "errors"
|
||||
"io"
|
||||
"reflect"
|
||||
"strings"
|
||||
@@ -1079,3 +1080,16 @@ func TestUnmarshalWhitespaceAttrs(t *testing.T) {
|
||||
t.Fatalf("whitespace attrs: Unmarshal:\nhave: %#+v\nwant: %#+v", v, want)
|
||||
}
|
||||
}
|
||||
+
|
||||
+func TestCVE202228131(t *testing.T) {
|
||||
+ type nested struct {
|
||||
+ Parent *nested `xml:",any"`
|
||||
+ }
|
||||
+ var n nested
|
||||
+ err := Unmarshal(bytes.Repeat([]byte("<a>"), maxUnmarshalDepth+1), &n)
|
||||
+ if err == nil {
|
||||
+ t.Fatal("Unmarshal did not fail")
|
||||
+ } else if !errors.Is(err, errExeceededMaxUnmarshalDepth) {
|
||||
+ t.Fatalf("Unmarshal unexpected error: got %q, want %q", err, errExeceededMaxUnmarshalDepth)
|
||||
+ }
|
||||
+}
|
||||
--
|
||||
2.25.1
|
||||
|
||||
120
meta/recipes-devtools/go/go-1.14/CVE-2022-30635.patch
Normal file
120
meta/recipes-devtools/go/go-1.14/CVE-2022-30635.patch
Normal file
@@ -0,0 +1,120 @@
|
||||
From fdd4316737ed5681689a1f40802ffa0805e5b11c Mon Sep 17 00:00:00 2001
|
||||
From: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
Date: Fri, 26 Aug 2022 12:17:05 +0530
|
||||
Subject: [PATCH] CVE-2022-30635
|
||||
|
||||
Upstream-Status: Backport [https://github.com/golang/go/commit/cd54600b866db0ad068ab8df06c7f5f6cb55c9b3]
|
||||
CVE-2022-30635
|
||||
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
---
|
||||
src/encoding/gob/decode.go | 19 ++++++++++++-------
|
||||
src/encoding/gob/gobencdec_test.go | 24 ++++++++++++++++++++++++
|
||||
2 files changed, 36 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/src/encoding/gob/decode.go b/src/encoding/gob/decode.go
|
||||
index d2f6c74..0e0ec75 100644
|
||||
--- a/src/encoding/gob/decode.go
|
||||
+++ b/src/encoding/gob/decode.go
|
||||
@@ -871,8 +871,13 @@ func (dec *Decoder) decOpFor(wireId typeId, rt reflect.Type, name string, inProg
|
||||
return &op
|
||||
}
|
||||
|
||||
+var maxIgnoreNestingDepth = 10000
|
||||
+
|
||||
// decIgnoreOpFor returns the decoding op for a field that has no destination.
|
||||
-func (dec *Decoder) decIgnoreOpFor(wireId typeId, inProgress map[typeId]*decOp) *decOp {
|
||||
+func (dec *Decoder) decIgnoreOpFor(wireId typeId, inProgress map[typeId]*decOp, depth int) *decOp {
|
||||
+ if depth > maxIgnoreNestingDepth {
|
||||
+ error_(errors.New("invalid nesting depth"))
|
||||
+ }
|
||||
// If this type is already in progress, it's a recursive type (e.g. map[string]*T).
|
||||
// Return the pointer to the op we're already building.
|
||||
if opPtr := inProgress[wireId]; opPtr != nil {
|
||||
@@ -896,7 +901,7 @@ func (dec *Decoder) decIgnoreOpFor(wireId typeId, inProgress map[typeId]*decOp)
|
||||
errorf("bad data: undefined type %s", wireId.string())
|
||||
case wire.ArrayT != nil:
|
||||
elemId := wire.ArrayT.Elem
|
||||
- elemOp := dec.decIgnoreOpFor(elemId, inProgress)
|
||||
+ elemOp := dec.decIgnoreOpFor(elemId, inProgress, depth+1)
|
||||
op = func(i *decInstr, state *decoderState, value reflect.Value) {
|
||||
state.dec.ignoreArray(state, *elemOp, wire.ArrayT.Len)
|
||||
}
|
||||
@@ -904,15 +909,15 @@ func (dec *Decoder) decIgnoreOpFor(wireId typeId, inProgress map[typeId]*decOp)
|
||||
case wire.MapT != nil:
|
||||
keyId := dec.wireType[wireId].MapT.Key
|
||||
elemId := dec.wireType[wireId].MapT.Elem
|
||||
- keyOp := dec.decIgnoreOpFor(keyId, inProgress)
|
||||
- elemOp := dec.decIgnoreOpFor(elemId, inProgress)
|
||||
+ keyOp := dec.decIgnoreOpFor(keyId, inProgress, depth+1)
|
||||
+ elemOp := dec.decIgnoreOpFor(elemId, inProgress, depth+1)
|
||||
op = func(i *decInstr, state *decoderState, value reflect.Value) {
|
||||
state.dec.ignoreMap(state, *keyOp, *elemOp)
|
||||
}
|
||||
|
||||
case wire.SliceT != nil:
|
||||
elemId := wire.SliceT.Elem
|
||||
- elemOp := dec.decIgnoreOpFor(elemId, inProgress)
|
||||
+ elemOp := dec.decIgnoreOpFor(elemId, inProgress, depth+1)
|
||||
op = func(i *decInstr, state *decoderState, value reflect.Value) {
|
||||
state.dec.ignoreSlice(state, *elemOp)
|
||||
}
|
||||
@@ -1073,7 +1078,7 @@ func (dec *Decoder) compileSingle(remoteId typeId, ut *userTypeInfo) (engine *de
|
||||
func (dec *Decoder) compileIgnoreSingle(remoteId typeId) *decEngine {
|
||||
engine := new(decEngine)
|
||||
engine.instr = make([]decInstr, 1) // one item
|
||||
- op := dec.decIgnoreOpFor(remoteId, make(map[typeId]*decOp))
|
||||
+ op := dec.decIgnoreOpFor(remoteId, make(map[typeId]*decOp), 0)
|
||||
ovfl := overflow(dec.typeString(remoteId))
|
||||
engine.instr[0] = decInstr{*op, 0, nil, ovfl}
|
||||
engine.numInstr = 1
|
||||
@@ -1118,7 +1123,7 @@ func (dec *Decoder) compileDec(remoteId typeId, ut *userTypeInfo) (engine *decEn
|
||||
localField, present := srt.FieldByName(wireField.Name)
|
||||
// TODO(r): anonymous names
|
||||
if !present || !isExported(wireField.Name) {
|
||||
- op := dec.decIgnoreOpFor(wireField.Id, make(map[typeId]*decOp))
|
||||
+ op := dec.decIgnoreOpFor(wireField.Id, make(map[typeId]*decOp), 0)
|
||||
engine.instr[fieldnum] = decInstr{*op, fieldnum, nil, ovfl}
|
||||
continue
|
||||
}
|
||||
diff --git a/src/encoding/gob/gobencdec_test.go b/src/encoding/gob/gobencdec_test.go
|
||||
index 6d2c8db..1b52ecc 100644
|
||||
--- a/src/encoding/gob/gobencdec_test.go
|
||||
+++ b/src/encoding/gob/gobencdec_test.go
|
||||
@@ -12,6 +12,7 @@ import (
|
||||
"fmt"
|
||||
"io"
|
||||
"net"
|
||||
+ "reflect"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
@@ -796,3 +797,26 @@ func TestNetIP(t *testing.T) {
|
||||
t.Errorf("decoded to %v, want 1.2.3.4", ip.String())
|
||||
}
|
||||
}
|
||||
+
|
||||
+func TestIngoreDepthLimit(t *testing.T) {
|
||||
+ // We don't test the actual depth limit because it requires building an
|
||||
+ // extremely large message, which takes quite a while.
|
||||
+ oldNestingDepth := maxIgnoreNestingDepth
|
||||
+ maxIgnoreNestingDepth = 100
|
||||
+ defer func() { maxIgnoreNestingDepth = oldNestingDepth }()
|
||||
+ b := new(bytes.Buffer)
|
||||
+ enc := NewEncoder(b)
|
||||
+ typ := reflect.TypeOf(int(0))
|
||||
+ nested := reflect.ArrayOf(1, typ)
|
||||
+ for i := 0; i < 100; i++ {
|
||||
+ nested = reflect.ArrayOf(1, nested)
|
||||
+ }
|
||||
+ badStruct := reflect.New(reflect.StructOf([]reflect.StructField{{Name: "F", Type: nested}}))
|
||||
+ enc.Encode(badStruct.Interface())
|
||||
+ dec := NewDecoder(b)
|
||||
+ var output struct{ Hello int }
|
||||
+ expectedErr := "invalid nesting depth"
|
||||
+ if err := dec.Decode(&output); err == nil || err.Error() != expectedErr {
|
||||
+ t.Errorf("Decode didn't fail with depth limit of 100: want %q, got %q", expectedErr, err)
|
||||
+ }
|
||||
+}
|
||||
--
|
||||
2.25.1
|
||||
|
||||
49
meta/recipes-devtools/go/go-1.14/CVE-2022-32148.patch
Normal file
49
meta/recipes-devtools/go/go-1.14/CVE-2022-32148.patch
Normal file
@@ -0,0 +1,49 @@
|
||||
From 0fe3adec199e8cd2c101933f75d8cd617de70350 Mon Sep 17 00:00:00 2001
|
||||
From: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
Date: Fri, 26 Aug 2022 12:48:13 +0530
|
||||
Subject: [PATCH] CVE-2022-32148
|
||||
|
||||
Upstream-Status: Backport [https://github.com/golang/go/commit/ed2f33e1a7e0d18f61bd56f7ee067331d612c27e]
|
||||
CVE: CVE-2022-32148
|
||||
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
---
|
||||
src/net/http/header.go | 6 ++++++
|
||||
src/net/http/header_test.go | 5 +++++
|
||||
2 files changed, 11 insertions(+)
|
||||
|
||||
diff --git a/src/net/http/header.go b/src/net/http/header.go
|
||||
index b9b5391..221f613 100644
|
||||
--- a/src/net/http/header.go
|
||||
+++ b/src/net/http/header.go
|
||||
@@ -100,6 +100,12 @@ func (h Header) Clone() Header {
|
||||
sv := make([]string, nv) // shared backing array for headers' values
|
||||
h2 := make(Header, len(h))
|
||||
for k, vv := range h {
|
||||
+ if vv == nil {
|
||||
+ // Preserve nil values. ReverseProxy distinguishes
|
||||
+ // between nil and zero-length header values.
|
||||
+ h2[k] = nil
|
||||
+ continue
|
||||
+ }
|
||||
n := copy(sv, vv)
|
||||
h2[k] = sv[:n:n]
|
||||
sv = sv[n:]
|
||||
diff --git a/src/net/http/header_test.go b/src/net/http/header_test.go
|
||||
index 4789362..80c0035 100644
|
||||
--- a/src/net/http/header_test.go
|
||||
+++ b/src/net/http/header_test.go
|
||||
@@ -235,6 +235,11 @@ func TestCloneOrMakeHeader(t *testing.T) {
|
||||
in: Header{"foo": {"bar"}},
|
||||
want: Header{"foo": {"bar"}},
|
||||
},
|
||||
+ {
|
||||
+ name: "nil value",
|
||||
+ in: Header{"foo": nil},
|
||||
+ want: Header{"foo": nil},
|
||||
+ },
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
--
|
||||
2.25.1
|
||||
|
||||
113
meta/recipes-devtools/go/go-1.14/CVE-2022-32189.patch
Normal file
113
meta/recipes-devtools/go/go-1.14/CVE-2022-32189.patch
Normal file
@@ -0,0 +1,113 @@
|
||||
From 027e7e1578d3d7614f7586eff3894b83d9709e14 Mon Sep 17 00:00:00 2001
|
||||
From: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
Date: Mon, 29 Aug 2022 10:08:34 +0530
|
||||
Subject: [PATCH] CVE-2022-32189
|
||||
|
||||
Upstream-Status: Backport [https://github.com/golang/go/commit/703c8ab7e5ba75c95553d4e249309297abad7102]
|
||||
CVE: CVE-2022-32189
|
||||
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
---
|
||||
src/math/big/floatmarsh.go | 7 +++++++
|
||||
src/math/big/floatmarsh_test.go | 12 ++++++++++++
|
||||
src/math/big/ratmarsh.go | 6 ++++++
|
||||
src/math/big/ratmarsh_test.go | 12 ++++++++++++
|
||||
4 files changed, 37 insertions(+)
|
||||
|
||||
diff --git a/src/math/big/floatmarsh.go b/src/math/big/floatmarsh.go
|
||||
index d1c1dab..990e085 100644
|
||||
--- a/src/math/big/floatmarsh.go
|
||||
+++ b/src/math/big/floatmarsh.go
|
||||
@@ -8,6 +8,7 @@ package big
|
||||
|
||||
import (
|
||||
"encoding/binary"
|
||||
+ "errors"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
@@ -67,6 +68,9 @@ func (z *Float) GobDecode(buf []byte) error {
|
||||
*z = Float{}
|
||||
return nil
|
||||
}
|
||||
+ if len(buf) < 6 {
|
||||
+ return errors.New("Float.GobDecode: buffer too small")
|
||||
+ }
|
||||
|
||||
if buf[0] != floatGobVersion {
|
||||
return fmt.Errorf("Float.GobDecode: encoding version %d not supported", buf[0])
|
||||
@@ -83,6 +87,9 @@ func (z *Float) GobDecode(buf []byte) error {
|
||||
z.prec = binary.BigEndian.Uint32(buf[2:])
|
||||
|
||||
if z.form == finite {
|
||||
+ if len(buf) < 10 {
|
||||
+ return errors.New("Float.GobDecode: buffer too small for finite form float")
|
||||
+ }
|
||||
z.exp = int32(binary.BigEndian.Uint32(buf[6:]))
|
||||
z.mant = z.mant.setBytes(buf[10:])
|
||||
}
|
||||
diff --git a/src/math/big/floatmarsh_test.go b/src/math/big/floatmarsh_test.go
|
||||
index c056d78..401f45a 100644
|
||||
--- a/src/math/big/floatmarsh_test.go
|
||||
+++ b/src/math/big/floatmarsh_test.go
|
||||
@@ -137,3 +137,15 @@ func TestFloatJSONEncoding(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
+
|
||||
+func TestFloatGobDecodeShortBuffer(t *testing.T) {
|
||||
+ for _, tc := range [][]byte{
|
||||
+ []byte{0x1, 0x0, 0x0, 0x0},
|
||||
+ []byte{0x1, 0xfa, 0x0, 0x0, 0x0, 0x0},
|
||||
+ } {
|
||||
+ err := NewFloat(0).GobDecode(tc)
|
||||
+ if err == nil {
|
||||
+ t.Error("expected GobDecode to return error for malformed input")
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/math/big/ratmarsh.go b/src/math/big/ratmarsh.go
|
||||
index fbc7b60..56102e8 100644
|
||||
--- a/src/math/big/ratmarsh.go
|
||||
+++ b/src/math/big/ratmarsh.go
|
||||
@@ -45,12 +45,18 @@ func (z *Rat) GobDecode(buf []byte) error {
|
||||
*z = Rat{}
|
||||
return nil
|
||||
}
|
||||
+ if len(buf) < 5 {
|
||||
+ return errors.New("Rat.GobDecode: buffer too small")
|
||||
+ }
|
||||
b := buf[0]
|
||||
if b>>1 != ratGobVersion {
|
||||
return fmt.Errorf("Rat.GobDecode: encoding version %d not supported", b>>1)
|
||||
}
|
||||
const j = 1 + 4
|
||||
i := j + binary.BigEndian.Uint32(buf[j-4:j])
|
||||
+ if len(buf) < int(i) {
|
||||
+ return errors.New("Rat.GobDecode: buffer too small")
|
||||
+ }
|
||||
z.a.neg = b&1 != 0
|
||||
z.a.abs = z.a.abs.setBytes(buf[j:i])
|
||||
z.b.abs = z.b.abs.setBytes(buf[i:])
|
||||
diff --git a/src/math/big/ratmarsh_test.go b/src/math/big/ratmarsh_test.go
|
||||
index 351d109..55a9878 100644
|
||||
--- a/src/math/big/ratmarsh_test.go
|
||||
+++ b/src/math/big/ratmarsh_test.go
|
||||
@@ -123,3 +123,15 @@ func TestRatXMLEncoding(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
+
|
||||
+func TestRatGobDecodeShortBuffer(t *testing.T) {
|
||||
+ for _, tc := range [][]byte{
|
||||
+ []byte{0x2},
|
||||
+ []byte{0x2, 0x0, 0x0, 0x0, 0xff},
|
||||
+ } {
|
||||
+ err := NewRat(1, 2).GobDecode(tc)
|
||||
+ if err == nil {
|
||||
+ t.Error("expected GobDecode to return error for malformed input")
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
--
|
||||
2.25.1
|
||||
|
||||
135
meta/recipes-devtools/python/python3/CVE-2021-28861.patch
Normal file
135
meta/recipes-devtools/python/python3/CVE-2021-28861.patch
Normal file
@@ -0,0 +1,135 @@
|
||||
From 4dc2cae3abd75f386374d0635d00443b897d0672 Mon Sep 17 00:00:00 2001
|
||||
From: "Miss Islington (bot)"
|
||||
<31488909+miss-islington@users.noreply.github.com>
|
||||
Date: Wed, 22 Jun 2022 01:42:52 -0700
|
||||
Subject: [PATCH] gh-87389: Fix an open redirection vulnerability in
|
||||
http.server. (GH-93879) (GH-94094)
|
||||
|
||||
Fix an open redirection vulnerability in the `http.server` module when
|
||||
an URI path starts with `//` that could produce a 301 Location header
|
||||
with a misleading target. Vulnerability discovered, and logic fix
|
||||
proposed, by Hamza Avvan (@hamzaavvan).
|
||||
|
||||
Test and comments authored by Gregory P. Smith [Google].
|
||||
(cherry picked from commit 4abab6b603dd38bec1168e9a37c40a48ec89508e)
|
||||
|
||||
Co-authored-by: Gregory P. Smith <greg@krypto.org>
|
||||
|
||||
Signed-off-by: Riyaz Khan <Riyaz.Khan@kpit.com>
|
||||
|
||||
CVE: CVE-2021-28861
|
||||
|
||||
Upstream-Status: Backport [https://github.com/python/cpython/commit/4dc2cae3abd75f386374d0635d00443b897d0672]
|
||||
|
||||
---
|
||||
Lib/http/server.py | 7 +++
|
||||
Lib/test/test_httpservers.py | 53 ++++++++++++++++++-
|
||||
...2-06-15-20-09-23.gh-issue-87389.QVaC3f.rst | 3 ++
|
||||
3 files changed, 61 insertions(+), 2 deletions(-)
|
||||
create mode 100644 Misc/NEWS.d/next/Security/2022-06-15-20-09-23.gh-issue-87389.QVaC3f.rst
|
||||
|
||||
diff --git a/Lib/http/server.py b/Lib/http/server.py
|
||||
index 38f7accad7a3..39de35458c38 100644
|
||||
--- a/Lib/http/server.py
|
||||
+++ b/Lib/http/server.py
|
||||
@@ -332,6 +332,13 @@ def parse_request(self):
|
||||
return False
|
||||
self.command, self.path = command, path
|
||||
|
||||
+ # gh-87389: The purpose of replacing '//' with '/' is to protect
|
||||
+ # against open redirect attacks possibly triggered if the path starts
|
||||
+ # with '//' because http clients treat //path as an absolute URI
|
||||
+ # without scheme (similar to http://path) rather than a path.
|
||||
+ if self.path.startswith('//'):
|
||||
+ self.path = '/' + self.path.lstrip('/') # Reduce to a single /
|
||||
+
|
||||
# Examine the headers and look for a Connection directive.
|
||||
try:
|
||||
self.headers = http.client.parse_headers(self.rfile,
|
||||
diff --git a/Lib/test/test_httpservers.py b/Lib/test/test_httpservers.py
|
||||
index 87d4924a34b3..fb026188f0b4 100644
|
||||
--- a/Lib/test/test_httpservers.py
|
||||
+++ b/Lib/test/test_httpservers.py
|
||||
@@ -330,7 +330,7 @@ class request_handler(NoLogRequestHandler, SimpleHTTPRequestHandler):
|
||||
pass
|
||||
|
||||
def setUp(self):
|
||||
- BaseTestCase.setUp(self)
|
||||
+ super().setUp()
|
||||
self.cwd = os.getcwd()
|
||||
basetempdir = tempfile.gettempdir()
|
||||
os.chdir(basetempdir)
|
||||
@@ -358,7 +358,7 @@ def tearDown(self):
|
||||
except:
|
||||
pass
|
||||
finally:
|
||||
- BaseTestCase.tearDown(self)
|
||||
+ super().tearDown()
|
||||
|
||||
def check_status_and_reason(self, response, status, data=None):
|
||||
def close_conn():
|
||||
@@ -414,6 +414,55 @@ def test_undecodable_filename(self):
|
||||
self.check_status_and_reason(response, HTTPStatus.OK,
|
||||
data=support.TESTFN_UNDECODABLE)
|
||||
|
||||
+ def test_get_dir_redirect_location_domain_injection_bug(self):
|
||||
+ """Ensure //evil.co/..%2f../../X does not put //evil.co/ in Location.
|
||||
+
|
||||
+ //netloc/ in a Location header is a redirect to a new host.
|
||||
+ https://github.com/python/cpython/issues/87389
|
||||
+
|
||||
+ This checks that a path resolving to a directory on our server cannot
|
||||
+ resolve into a redirect to another server.
|
||||
+ """
|
||||
+ os.mkdir(os.path.join(self.tempdir, 'existing_directory'))
|
||||
+ url = f'/python.org/..%2f..%2f..%2f..%2f..%2f../%0a%0d/../{self.tempdir_name}/existing_directory'
|
||||
+ expected_location = f'{url}/' # /python.org.../ single slash single prefix, trailing slash
|
||||
+ # Canonicalizes to /tmp/tempdir_name/existing_directory which does
|
||||
+ # exist and is a dir, triggering the 301 redirect logic.
|
||||
+ response = self.request(url)
|
||||
+ self.check_status_and_reason(response, HTTPStatus.MOVED_PERMANENTLY)
|
||||
+ location = response.getheader('Location')
|
||||
+ self.assertEqual(location, expected_location, msg='non-attack failed!')
|
||||
+
|
||||
+ # //python.org... multi-slash prefix, no trailing slash
|
||||
+ attack_url = f'/{url}'
|
||||
+ response = self.request(attack_url)
|
||||
+ self.check_status_and_reason(response, HTTPStatus.MOVED_PERMANENTLY)
|
||||
+ location = response.getheader('Location')
|
||||
+ self.assertFalse(location.startswith('//'), msg=location)
|
||||
+ self.assertEqual(location, expected_location,
|
||||
+ msg='Expected Location header to start with a single / and '
|
||||
+ 'end with a / as this is a directory redirect.')
|
||||
+
|
||||
+ # ///python.org... triple-slash prefix, no trailing slash
|
||||
+ attack3_url = f'//{url}'
|
||||
+ response = self.request(attack3_url)
|
||||
+ self.check_status_and_reason(response, HTTPStatus.MOVED_PERMANENTLY)
|
||||
+ self.assertEqual(response.getheader('Location'), expected_location)
|
||||
+
|
||||
+ # If the second word in the http request (Request-URI for the http
|
||||
+ # method) is a full URI, we don't worry about it, as that'll be parsed
|
||||
+ # and reassembled as a full URI within BaseHTTPRequestHandler.send_head
|
||||
+ # so no errant scheme-less //netloc//evil.co/ domain mixup can happen.
|
||||
+ attack_scheme_netloc_2slash_url = f'https://pypi.org/{url}'
|
||||
+ expected_scheme_netloc_location = f'{attack_scheme_netloc_2slash_url}/'
|
||||
+ response = self.request(attack_scheme_netloc_2slash_url)
|
||||
+ self.check_status_and_reason(response, HTTPStatus.MOVED_PERMANENTLY)
|
||||
+ location = response.getheader('Location')
|
||||
+ # We're just ensuring that the scheme and domain make it through, if
|
||||
+ # there are or aren't multiple slashes at the start of the path that
|
||||
+ # follows that isn't important in this Location: header.
|
||||
+ self.assertTrue(location.startswith('https://pypi.org/'), msg=location)
|
||||
+
|
||||
def test_get(self):
|
||||
#constructs the path relative to the root directory of the HTTPServer
|
||||
response = self.request(self.base_url + '/test')
|
||||
diff --git a/Misc/NEWS.d/next/Security/2022-06-15-20-09-23.gh-issue-87389.QVaC3f.rst b/Misc/NEWS.d/next/Security/2022-06-15-20-09-23.gh-issue-87389.QVaC3f.rst
|
||||
new file mode 100644
|
||||
index 000000000000..029d437190de
|
||||
--- /dev/null
|
||||
+++ b/Misc/NEWS.d/next/Security/2022-06-15-20-09-23.gh-issue-87389.QVaC3f.rst
|
||||
@@ -0,0 +1,3 @@
|
||||
+:mod:`http.server`: Fix an open redirection vulnerability in the HTTP server
|
||||
+when an URI path starts with ``//``. Vulnerability discovered, and initial
|
||||
+fix proposed, by Hamza Avvan.
|
||||
@@ -34,6 +34,7 @@ SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.xz \
|
||||
file://0001-python3-Do-not-hardcode-lib-for-distutils.patch \
|
||||
file://0020-configure.ac-setup.py-do-not-add-a-curses-include-pa.patch \
|
||||
file://makerace.patch \
|
||||
file://CVE-2021-28861.patch \
|
||||
"
|
||||
|
||||
SRC_URI_append_class-native = " \
|
||||
|
||||
@@ -100,6 +100,17 @@ SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \
|
||||
file://CVE-2020-13791.patch \
|
||||
file://CVE-2022-35414.patch \
|
||||
file://CVE-2020-27821.patch \
|
||||
file://CVE-2020-13754-1.patch \
|
||||
file://CVE-2020-13754-2.patch \
|
||||
file://CVE-2020-13754-3.patch \
|
||||
file://CVE-2020-13754-4.patch \
|
||||
file://CVE-2021-3713.patch \
|
||||
file://CVE-2021-3748.patch \
|
||||
file://CVE-2021-3930.patch \
|
||||
file://CVE-2021-4206.patch \
|
||||
file://CVE-2021-4207.patch \
|
||||
file://CVE-2022-0216-1.patch \
|
||||
file://CVE-2022-0216-2.patch \
|
||||
"
|
||||
UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar"
|
||||
|
||||
@@ -117,6 +128,9 @@ CVE_CHECK_WHITELIST += "CVE-2007-0998"
|
||||
# https://bugzilla.redhat.com/show_bug.cgi?id=1609015#c11
|
||||
CVE_CHECK_WHITELIST += "CVE-2018-18438"
|
||||
|
||||
# the issue introduced in v5.1.0-rc0
|
||||
CVE_CHECK_WHITELIST += "CVE-2020-27661"
|
||||
|
||||
COMPATIBLE_HOST_mipsarchn32 = "null"
|
||||
COMPATIBLE_HOST_mipsarchn64 = "null"
|
||||
|
||||
@@ -257,6 +271,9 @@ PACKAGECONFIG[libudev] = "--enable-libudev,--disable-libudev,eudev"
|
||||
PACKAGECONFIG[libxml2] = "--enable-libxml2,--disable-libxml2,libxml2"
|
||||
PACKAGECONFIG[seccomp] = "--enable-seccomp,--disable-seccomp,libseccomp"
|
||||
PACKAGECONFIG[capstone] = "--enable-capstone,--disable-capstone"
|
||||
# libnfs is currently provided by meta-kodi
|
||||
PACKAGECONFIG[libnfs] = "--enable-libnfs,--disable-libnfs,libnfs"
|
||||
PACKAGECONFIG[brlapi] = "--enable-brlapi,--disable-brlapi"
|
||||
|
||||
INSANE_SKIP_${PN} = "arch"
|
||||
|
||||
|
||||
91
meta/recipes-devtools/qemu/qemu/CVE-2020-13754-1.patch
Normal file
91
meta/recipes-devtools/qemu/qemu/CVE-2020-13754-1.patch
Normal file
@@ -0,0 +1,91 @@
|
||||
From 5d971f9e672507210e77d020d89e0e89165c8fc9 Mon Sep 17 00:00:00 2001
|
||||
From: "Michael S. Tsirkin" <mst@redhat.com>
|
||||
Date: Wed, 10 Jun 2020 09:47:49 -0400
|
||||
Subject: [PATCH] memory: Revert "memory: accept mismatching sizes in
|
||||
memory_region_access_valid"
|
||||
|
||||
Memory API documentation documents valid .min_access_size and .max_access_size
|
||||
fields and explains that any access outside these boundaries is blocked.
|
||||
|
||||
This is what devices seem to assume.
|
||||
|
||||
However this is not what the implementation does: it simply
|
||||
ignores the boundaries unless there's an "accepts" callback.
|
||||
|
||||
Naturally, this breaks a bunch of devices.
|
||||
|
||||
Revert to the documented behaviour.
|
||||
|
||||
Devices that want to allow any access can just drop the valid field,
|
||||
or add the impl field to have accesses converted to appropriate
|
||||
length.
|
||||
|
||||
Cc: qemu-stable@nongnu.org
|
||||
Reviewed-by: Richard Henderson <rth@twiddle.net>
|
||||
Fixes: CVE-2020-13754
|
||||
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1842363
|
||||
Fixes: a014ed07bd5a ("memory: accept mismatching sizes in memory_region_access_valid")
|
||||
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
|
||||
Message-Id: <20200610134731.1514409-1-mst@redhat.com>
|
||||
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
||||
|
||||
https://git.qemu.org/?p=qemu.git;a=patch;h=5d971f9e672507210e77d020d89e0e89165c8fc9
|
||||
CVE: CVE-2020-13754
|
||||
Upstream-Status: Backport
|
||||
Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com>
|
||||
---
|
||||
memory.c | 29 +++++++++--------------------
|
||||
1 file changed, 9 insertions(+), 20 deletions(-)
|
||||
|
||||
diff --git a/memory.c b/memory.c
|
||||
index 2f15a4b..9200b20 100644
|
||||
--- a/memory.c
|
||||
+++ b/memory.c
|
||||
@@ -1352,35 +1352,24 @@ bool memory_region_access_valid(MemoryRegion *mr,
|
||||
bool is_write,
|
||||
MemTxAttrs attrs)
|
||||
{
|
||||
- int access_size_min, access_size_max;
|
||||
- int access_size, i;
|
||||
-
|
||||
- if (!mr->ops->valid.unaligned && (addr & (size - 1))) {
|
||||
+ if (mr->ops->valid.accepts
|
||||
+ && !mr->ops->valid.accepts(mr->opaque, addr, size, is_write, attrs)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
- if (!mr->ops->valid.accepts) {
|
||||
- return true;
|
||||
- }
|
||||
-
|
||||
- access_size_min = mr->ops->valid.min_access_size;
|
||||
- if (!mr->ops->valid.min_access_size) {
|
||||
- access_size_min = 1;
|
||||
+ if (!mr->ops->valid.unaligned && (addr & (size - 1))) {
|
||||
+ return false;
|
||||
}
|
||||
|
||||
- access_size_max = mr->ops->valid.max_access_size;
|
||||
+ /* Treat zero as compatibility all valid */
|
||||
if (!mr->ops->valid.max_access_size) {
|
||||
- access_size_max = 4;
|
||||
+ return true;
|
||||
}
|
||||
|
||||
- access_size = MAX(MIN(size, access_size_max), access_size_min);
|
||||
- for (i = 0; i < size; i += access_size) {
|
||||
- if (!mr->ops->valid.accepts(mr->opaque, addr + i, access_size,
|
||||
- is_write, attrs)) {
|
||||
- return false;
|
||||
- }
|
||||
+ if (size > mr->ops->valid.max_access_size
|
||||
+ || size < mr->ops->valid.min_access_size) {
|
||||
+ return false;
|
||||
}
|
||||
-
|
||||
return true;
|
||||
}
|
||||
|
||||
--
|
||||
1.8.3.1
|
||||
|
||||
69
meta/recipes-devtools/qemu/qemu/CVE-2020-13754-2.patch
Normal file
69
meta/recipes-devtools/qemu/qemu/CVE-2020-13754-2.patch
Normal file
@@ -0,0 +1,69 @@
|
||||
From dba04c3488c4699f5afe96f66e448b1d447cf3fb Mon Sep 17 00:00:00 2001
|
||||
From: Michael Tokarev <mjt@tls.msk.ru>
|
||||
Date: Mon, 20 Jul 2020 19:06:27 +0300
|
||||
Subject: [PATCH] acpi: accept byte and word access to core ACPI registers
|
||||
|
||||
All ISA registers should be accessible as bytes, words or dwords
|
||||
(if wide enough). Fix the access constraints for acpi-pm-evt,
|
||||
acpi-pm-tmr & acpi-cnt registers.
|
||||
|
||||
Fixes: 5d971f9e67 (memory: Revert "memory: accept mismatching sizes in memory_region_access_valid")
|
||||
Fixes: afafe4bbe0 (apci: switch cnt to memory api)
|
||||
Fixes: 77d58b1e47 (apci: switch timer to memory api)
|
||||
Fixes: b5a7c024d2 (apci: switch evt to memory api)
|
||||
Buglink: https://lore.kernel.org/xen-devel/20200630170913.123646-1-anthony.perard@citrix.com/T/
|
||||
Buglink: https://bugs.debian.org/964793
|
||||
BugLink: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=964247
|
||||
BugLink: https://bugs.launchpad.net/bugs/1886318
|
||||
Reported-By: Simon John <git@the-jedi.co.uk>
|
||||
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
|
||||
Message-Id: <20200720160627.15491-1-mjt@msgid.tls.msk.ru>
|
||||
Cc: qemu-stable@nongnu.org
|
||||
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
|
||||
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
|
||||
|
||||
https://git.qemu.org/?p=qemu.git;a=patch;h=dba04c3488c4699f5afe96f66e448b1d447cf3fb
|
||||
CVE: CVE-2020-13754
|
||||
Upstream-Status: Backport
|
||||
Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com>
|
||||
---
|
||||
hw/acpi/core.c | 9 ++++++---
|
||||
1 file changed, 6 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/hw/acpi/core.c b/hw/acpi/core.c
|
||||
index f6d9ec4..ac06db3 100644
|
||||
--- a/hw/acpi/core.c
|
||||
+++ b/hw/acpi/core.c
|
||||
@@ -458,7 +458,8 @@ static void acpi_pm_evt_write(void *opaque, hwaddr addr, uint64_t val,
|
||||
static const MemoryRegionOps acpi_pm_evt_ops = {
|
||||
.read = acpi_pm_evt_read,
|
||||
.write = acpi_pm_evt_write,
|
||||
- .valid.min_access_size = 2,
|
||||
+ .impl.min_access_size = 2,
|
||||
+ .valid.min_access_size = 1,
|
||||
.valid.max_access_size = 2,
|
||||
.endianness = DEVICE_LITTLE_ENDIAN,
|
||||
};
|
||||
@@ -527,7 +528,8 @@ static void acpi_pm_tmr_write(void *opaque, hwaddr addr, uint64_t val,
|
||||
static const MemoryRegionOps acpi_pm_tmr_ops = {
|
||||
.read = acpi_pm_tmr_read,
|
||||
.write = acpi_pm_tmr_write,
|
||||
- .valid.min_access_size = 4,
|
||||
+ .impl.min_access_size = 4,
|
||||
+ .valid.min_access_size = 1,
|
||||
.valid.max_access_size = 4,
|
||||
.endianness = DEVICE_LITTLE_ENDIAN,
|
||||
};
|
||||
@@ -599,7 +601,8 @@ static void acpi_pm_cnt_write(void *opaque, hwaddr addr, uint64_t val,
|
||||
static const MemoryRegionOps acpi_pm_cnt_ops = {
|
||||
.read = acpi_pm_cnt_read,
|
||||
.write = acpi_pm_cnt_write,
|
||||
- .valid.min_access_size = 2,
|
||||
+ .impl.min_access_size = 2,
|
||||
+ .valid.min_access_size = 1,
|
||||
.valid.max_access_size = 2,
|
||||
.endianness = DEVICE_LITTLE_ENDIAN,
|
||||
};
|
||||
--
|
||||
1.8.3.1
|
||||
|
||||
65
meta/recipes-devtools/qemu/qemu/CVE-2020-13754-3.patch
Normal file
65
meta/recipes-devtools/qemu/qemu/CVE-2020-13754-3.patch
Normal file
@@ -0,0 +1,65 @@
|
||||
From 8e67fda2dd6202ccec093fda561107ba14830a17 Mon Sep 17 00:00:00 2001
|
||||
From: Laurent Vivier <lvivier@redhat.com>
|
||||
Date: Tue, 21 Jul 2020 10:33:22 +0200
|
||||
Subject: [PATCH] xhci: fix valid.max_access_size to access address registers
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=utf8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
QEMU XHCI advertises AC64 (64-bit addressing) but doesn't allow
|
||||
64-bit mode access in "runtime" and "operational" MemoryRegionOps.
|
||||
|
||||
Set the max_access_size based on sizeof(dma_addr_t) as AC64 is set.
|
||||
|
||||
XHCI specs:
|
||||
"If the xHC supports 64-bit addressing (AC64 = â1â), then software
|
||||
should write 64-bit registers using only Qword accesses. If a
|
||||
system is incapable of issuing Qword accesses, then writes to the
|
||||
64-bit address fields shall be performed using 2 Dword accesses;
|
||||
low Dword-first, high-Dword second. If the xHC supports 32-bit
|
||||
addressing (AC64 = â0â), then the high Dword of registers containing
|
||||
64-bit address fields are unused and software should write addresses
|
||||
using only Dword accesses"
|
||||
|
||||
The problem has been detected with SLOF, as linux kernel always accesses
|
||||
registers using 32-bit access even if AC64 is set and revealed by
|
||||
5d971f9e6725 ("memory: Revert "memory: accept mismatching sizes in memory_region_access_valid"")
|
||||
|
||||
Suggested-by: Alexey Kardashevskiy <aik@au1.ibm.com>
|
||||
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
|
||||
Message-id: 20200721083322.90651-1-lvivier@redhat.com
|
||||
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
|
||||
|
||||
https://git.qemu.org/?p=qemu.git;a=patch;h=8e67fda2dd6202ccec093fda561107ba14830a17
|
||||
CVE: CVE-2020-13754
|
||||
Upstream-Status: Backport
|
||||
Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com>
|
||||
---
|
||||
hw/usb/hcd-xhci.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
|
||||
index b330e36..67a18fe 100644
|
||||
--- a/hw/usb/hcd-xhci.c
|
||||
+++ b/hw/usb/hcd-xhci.c
|
||||
@@ -3184,7 +3184,7 @@ static const MemoryRegionOps xhci_oper_ops = {
|
||||
.read = xhci_oper_read,
|
||||
.write = xhci_oper_write,
|
||||
.valid.min_access_size = 4,
|
||||
- .valid.max_access_size = 4,
|
||||
+ .valid.max_access_size = sizeof(dma_addr_t),
|
||||
.endianness = DEVICE_LITTLE_ENDIAN,
|
||||
};
|
||||
|
||||
@@ -3200,7 +3200,7 @@ static const MemoryRegionOps xhci_runtime_ops = {
|
||||
.read = xhci_runtime_read,
|
||||
.write = xhci_runtime_write,
|
||||
.valid.min_access_size = 4,
|
||||
- .valid.max_access_size = 4,
|
||||
+ .valid.max_access_size = sizeof(dma_addr_t),
|
||||
.endianness = DEVICE_LITTLE_ENDIAN,
|
||||
};
|
||||
|
||||
--
|
||||
1.8.3.1
|
||||
|
||||
39
meta/recipes-devtools/qemu/qemu/CVE-2020-13754-4.patch
Normal file
39
meta/recipes-devtools/qemu/qemu/CVE-2020-13754-4.patch
Normal file
@@ -0,0 +1,39 @@
|
||||
From 70b78d4e71494c90d2ccb40381336bc9b9a22f79 Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Francis <alistair.francis@wdc.com>
|
||||
Date: Tue, 30 Jun 2020 13:12:11 -0700
|
||||
Subject: [PATCH] hw/riscv: Allow 64 bit access to SiFive CLINT
|
||||
|
||||
Commit 5d971f9e672507210e77d020d89e0e89165c8fc9
|
||||
"memory: Revert "memory: accept mismatching sizes in
|
||||
memory_region_access_valid"" broke most RISC-V boards as they do 64 bit
|
||||
accesses to the CLINT and QEMU would trigger a fault. Fix this failure
|
||||
by allowing 8 byte accesses.
|
||||
|
||||
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
|
||||
Reviewed-by: LIU Zhiwei<zhiwei_liu@c-sky.com>
|
||||
Message-Id: <122b78825b077e4dfd39b444d3a46fe894a7804c.1593547870.git.alistair.francis@wdc.com>
|
||||
|
||||
https://git.qemu.org/?p=qemu.git;a=patch;h=70b78d4e71494c90d2ccb40381336bc9b9a22f79
|
||||
CVE: CVE-2020-13754
|
||||
Upstream-Status: Backport
|
||||
Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com>
|
||||
---
|
||||
hw/riscv/sifive_clint.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/hw/riscv/sifive_clint.c b/hw/riscv/sifive_clint.c
|
||||
index b11ffa0..669c21a 100644
|
||||
--- a/hw/riscv/sifive_clint.c
|
||||
+++ b/hw/riscv/sifive_clint.c
|
||||
@@ -181,7 +181,7 @@ static const MemoryRegionOps sifive_clint_ops = {
|
||||
.endianness = DEVICE_LITTLE_ENDIAN,
|
||||
.valid = {
|
||||
.min_access_size = 4,
|
||||
- .max_access_size = 4
|
||||
+ .max_access_size = 8
|
||||
}
|
||||
};
|
||||
|
||||
--
|
||||
1.8.3.1
|
||||
|
||||
67
meta/recipes-devtools/qemu/qemu/CVE-2021-3713.patch
Normal file
67
meta/recipes-devtools/qemu/qemu/CVE-2021-3713.patch
Normal file
@@ -0,0 +1,67 @@
|
||||
From a114d6baedf2cccb454a46d36e399fec1bc3e1c0 Mon Sep 17 00:00:00 2001
|
||||
From: Gerd Hoffmann <kraxel@redhat.com>
|
||||
Date: Wed, 18 Aug 2021 14:05:05 +0200
|
||||
Subject: [PATCH] uas: add stream number sanity checks.
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
The device uses the guest-supplied stream number unchecked, which can
|
||||
lead to guest-triggered out-of-band access to the UASDevice->data3 and
|
||||
UASDevice->status3 fields. Add the missing checks.
|
||||
|
||||
Fixes: CVE-2021-3713
|
||||
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
|
||||
Reported-by: Chen Zhe <chenzhe@huawei.com>
|
||||
Reported-by: Tan Jingguo <tanjingguo@huawei.com>
|
||||
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
|
||||
Message-Id: <20210818120505.1258262-2-kraxel@redhat.com>
|
||||
|
||||
https://gitlab.com/qemu-project/qemu/-/commit/13b250b12ad3c59114a6a17d59caf073ce45b33a
|
||||
CVE: CVE-2021-3713
|
||||
Upstream-Status: Backport
|
||||
Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com>
|
||||
---
|
||||
hw/usb/dev-uas.c | 11 +++++++++++
|
||||
1 file changed, 11 insertions(+)
|
||||
|
||||
diff --git a/hw/usb/dev-uas.c b/hw/usb/dev-uas.c
|
||||
index 6d6d1073..0b8cd4dd 100644
|
||||
--- a/hw/usb/dev-uas.c
|
||||
+++ b/hw/usb/dev-uas.c
|
||||
@@ -830,6 +830,9 @@ static void usb_uas_handle_data(USBDevice *dev, USBPacket *p)
|
||||
}
|
||||
break;
|
||||
case UAS_PIPE_ID_STATUS:
|
||||
+ if (p->stream > UAS_MAX_STREAMS) {
|
||||
+ goto err_stream;
|
||||
+ }
|
||||
if (p->stream) {
|
||||
QTAILQ_FOREACH(st, &uas->results, next) {
|
||||
if (st->stream == p->stream) {
|
||||
@@ -857,6 +860,9 @@ static void usb_uas_handle_data(USBDevice *dev, USBPacket *p)
|
||||
break;
|
||||
case UAS_PIPE_ID_DATA_IN:
|
||||
case UAS_PIPE_ID_DATA_OUT:
|
||||
+ if (p->stream > UAS_MAX_STREAMS) {
|
||||
+ goto err_stream;
|
||||
+ }
|
||||
if (p->stream) {
|
||||
req = usb_uas_find_request(uas, p->stream);
|
||||
} else {
|
||||
@@ -892,6 +898,11 @@ static void usb_uas_handle_data(USBDevice *dev, USBPacket *p)
|
||||
p->status = USB_RET_STALL;
|
||||
break;
|
||||
}
|
||||
+
|
||||
+err_stream:
|
||||
+ error_report("%s: invalid stream %d", __func__, p->stream);
|
||||
+ p->status = USB_RET_STALL;
|
||||
+ return;
|
||||
}
|
||||
|
||||
static void usb_uas_unrealize(USBDevice *dev, Error **errp)
|
||||
124
meta/recipes-devtools/qemu/qemu/CVE-2021-3748.patch
Normal file
124
meta/recipes-devtools/qemu/qemu/CVE-2021-3748.patch
Normal file
@@ -0,0 +1,124 @@
|
||||
From bedd7e93d01961fcb16a97ae45d93acf357e11f6 Mon Sep 17 00:00:00 2001
|
||||
From: Jason Wang <jasowang@redhat.com>
|
||||
Date: Thu, 2 Sep 2021 13:44:12 +0800
|
||||
Subject: [PATCH] virtio-net: fix use after unmap/free for sg
|
||||
|
||||
When mergeable buffer is enabled, we try to set the num_buffers after
|
||||
the virtqueue elem has been unmapped. This will lead several issues,
|
||||
E.g a use after free when the descriptor has an address which belongs
|
||||
to the non direct access region. In this case we use bounce buffer
|
||||
that is allocated during address_space_map() and freed during
|
||||
address_space_unmap().
|
||||
|
||||
Fixing this by storing the elems temporarily in an array and delay the
|
||||
unmap after we set the the num_buffers.
|
||||
|
||||
This addresses CVE-2021-3748.
|
||||
|
||||
Reported-by: Alexander Bulekov <alxndr@bu.edu>
|
||||
Fixes: fbe78f4f55c6 ("virtio-net support")
|
||||
Cc: qemu-stable@nongnu.org
|
||||
Signed-off-by: Jason Wang <jasowang@redhat.com>
|
||||
|
||||
https://github.com/qemu/qemu/commit/bedd7e93d01961fcb16a97ae45d93acf357e11f6
|
||||
CVE: CVE-2021-3748
|
||||
Upstream-Status: Backport
|
||||
Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com>
|
||||
---
|
||||
hw/net/virtio-net.c | 39 ++++++++++++++++++++++++++++++++-------
|
||||
1 file changed, 32 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
|
||||
index 16d20cdee52a..f205331dcf8c 100644
|
||||
--- a/hw/net/virtio-net.c
|
||||
+++ b/hw/net/virtio-net.c
|
||||
@@ -1746,10 +1746,13 @@ static ssize_t virtio_net_receive_rcu(NetClientState *nc, const uint8_t *buf,
|
||||
VirtIONet *n = qemu_get_nic_opaque(nc);
|
||||
VirtIONetQueue *q = virtio_net_get_subqueue(nc);
|
||||
VirtIODevice *vdev = VIRTIO_DEVICE(n);
|
||||
+ VirtQueueElement *elems[VIRTQUEUE_MAX_SIZE];
|
||||
+ size_t lens[VIRTQUEUE_MAX_SIZE];
|
||||
struct iovec mhdr_sg[VIRTQUEUE_MAX_SIZE];
|
||||
struct virtio_net_hdr_mrg_rxbuf mhdr;
|
||||
unsigned mhdr_cnt = 0;
|
||||
- size_t offset, i, guest_offset;
|
||||
+ size_t offset, i, guest_offset, j;
|
||||
+ ssize_t err;
|
||||
|
||||
if (!virtio_net_can_receive(nc)) {
|
||||
return -1;
|
||||
@@ -1780,6 +1783,12 @@ static ssize_t virtio_net_receive_rcu(NetClientState *nc, const uint8_t *buf,
|
||||
|
||||
total = 0;
|
||||
|
||||
+ if (i == VIRTQUEUE_MAX_SIZE) {
|
||||
+ virtio_error(vdev, "virtio-net unexpected long buffer chain");
|
||||
+ err = size;
|
||||
+ goto err;
|
||||
+ }
|
||||
+
|
||||
elem = virtqueue_pop(q->rx_vq, sizeof(VirtQueueElement));
|
||||
if (!elem) {
|
||||
if (i) {
|
||||
@@ -1791,7 +1800,8 @@ static ssize_t virtio_net_receive_rcu(NetClientState *nc, const uint8_t *buf,
|
||||
n->guest_hdr_len, n->host_hdr_len,
|
||||
vdev->guest_features);
|
||||
}
|
||||
- return -1;
|
||||
+ err = -1;
|
||||
+ goto err;
|
||||
}
|
||||
|
||||
if (elem->in_num < 1) {
|
||||
@@ -1799,7 +1809,8 @@ static ssize_t virtio_net_receive_rcu(NetClientState *nc, const uint8_t *buf,
|
||||
"virtio-net receive queue contains no in buffers");
|
||||
virtqueue_detach_element(q->rx_vq, elem, 0);
|
||||
g_free(elem);
|
||||
- return -1;
|
||||
+ err = -1;
|
||||
+ goto err;
|
||||
}
|
||||
|
||||
sg = elem->in_sg;
|
||||
@@ -1836,12 +1847,13 @@ static ssize_t virtio_net_receive_rcu(NetClientState *nc, const uint8_t *buf,
|
||||
if (!n->mergeable_rx_bufs && offset < size) {
|
||||
virtqueue_unpop(q->rx_vq, elem, total);
|
||||
g_free(elem);
|
||||
- return size;
|
||||
+ err = size;
|
||||
+ goto err;
|
||||
}
|
||||
|
||||
- /* signal other side */
|
||||
- virtqueue_fill(q->rx_vq, elem, total, i++);
|
||||
- g_free(elem);
|
||||
+ elems[i] = elem;
|
||||
+ lens[i] = total;
|
||||
+ i++;
|
||||
}
|
||||
|
||||
if (mhdr_cnt) {
|
||||
@@ -1851,10 +1863,23 @@ static ssize_t virtio_net_receive_rcu(NetClientState *nc, const uint8_t *buf,
|
||||
&mhdr.num_buffers, sizeof mhdr.num_buffers);
|
||||
}
|
||||
|
||||
+ for (j = 0; j < i; j++) {
|
||||
+ /* signal other side */
|
||||
+ virtqueue_fill(q->rx_vq, elems[j], lens[j], j);
|
||||
+ g_free(elems[j]);
|
||||
+ }
|
||||
+
|
||||
virtqueue_flush(q->rx_vq, i);
|
||||
virtio_notify(vdev, q->rx_vq);
|
||||
|
||||
return size;
|
||||
+
|
||||
+err:
|
||||
+ for (j = 0; j < i; j++) {
|
||||
+ g_free(elems[j]);
|
||||
+ }
|
||||
+
|
||||
+ return err;
|
||||
}
|
||||
|
||||
static ssize_t virtio_net_do_receive(NetClientState *nc, const uint8_t *buf,
|
||||
53
meta/recipes-devtools/qemu/qemu/CVE-2021-3930.patch
Normal file
53
meta/recipes-devtools/qemu/qemu/CVE-2021-3930.patch
Normal file
@@ -0,0 +1,53 @@
|
||||
From b3af7fdf9cc537f8f0dd3e2423d83f5c99a457e8 Mon Sep 17 00:00:00 2001
|
||||
From: Mauro Matteo Cascella <mcascell@redhat.com>
|
||||
Date: Thu, 4 Nov 2021 17:31:38 +0100
|
||||
Subject: [PATCH] hw/scsi/scsi-disk: MODE_PAGE_ALLS not allowed in MODE SELECT
|
||||
commands
|
||||
|
||||
This avoids an off-by-one read of 'mode_sense_valid' buffer in
|
||||
hw/scsi/scsi-disk.c:mode_sense_page().
|
||||
|
||||
Fixes: CVE-2021-3930
|
||||
Cc: qemu-stable@nongnu.org
|
||||
Reported-by: Alexander Bulekov <alxndr@bu.edu>
|
||||
Fixes: a8f4bbe2900 ("scsi-disk: store valid mode pages in a table")
|
||||
Fixes: #546
|
||||
Reported-by: Qiuhao Li <Qiuhao.Li@outlook.com>
|
||||
Signed-off-by: Mauro Matteo Cascella <mcascell@redhat.com>
|
||||
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
||||
|
||||
https://gitlab.com/qemu-project/qemu/-/commit/b3af7fdf9cc537f8f0dd3e2423d83f5c99a457e8
|
||||
CVE: CVE-2021-3930
|
||||
Upstream-Status: Backport
|
||||
Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com>
|
||||
---
|
||||
hw/scsi/scsi-disk.c | 6 ++++++
|
||||
1 file changed, 6 insertions(+)
|
||||
|
||||
diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c
|
||||
index e8a547dbb7..d4914178ea 100644
|
||||
--- a/hw/scsi/scsi-disk.c
|
||||
+++ b/hw/scsi/scsi-disk.c
|
||||
@@ -1087,6 +1087,7 @@ static int mode_sense_page(SCSIDiskState *s, int page, uint8_t **p_outbuf,
|
||||
uint8_t *p = *p_outbuf + 2;
|
||||
int length;
|
||||
|
||||
+ assert(page < ARRAY_SIZE(mode_sense_valid));
|
||||
if ((mode_sense_valid[page] & (1 << s->qdev.type)) == 0) {
|
||||
return -1;
|
||||
}
|
||||
@@ -1428,6 +1429,11 @@ static int scsi_disk_check_mode_select(SCSIDiskState *s, int page,
|
||||
return -1;
|
||||
}
|
||||
|
||||
+ /* MODE_PAGE_ALLS is only valid for MODE SENSE commands */
|
||||
+ if (page == MODE_PAGE_ALLS) {
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
p = mode_current;
|
||||
memset(mode_current, 0, inlen + 2);
|
||||
len = mode_sense_page(s, page, &p, 0);
|
||||
--
|
||||
GitLab
|
||||
|
||||
89
meta/recipes-devtools/qemu/qemu/CVE-2021-4206.patch
Normal file
89
meta/recipes-devtools/qemu/qemu/CVE-2021-4206.patch
Normal file
@@ -0,0 +1,89 @@
|
||||
From fa892e9abb728e76afcf27323ab29c57fb0fe7aa Mon Sep 17 00:00:00 2001
|
||||
From: Mauro Matteo Cascella <mcascell@redhat.com>
|
||||
Date: Thu, 7 Apr 2022 10:17:12 +0200
|
||||
Subject: [PATCH] ui/cursor: fix integer overflow in cursor_alloc
|
||||
(CVE-2021-4206)
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Prevent potential integer overflow by limiting 'width' and 'height' to
|
||||
512x512. Also change 'datasize' type to size_t. Refer to security
|
||||
advisory https://starlabs.sg/advisories/22-4206/ for more information.
|
||||
|
||||
Fixes: CVE-2021-4206
|
||||
Signed-off-by: Mauro Matteo Cascella <mcascell@redhat.com>
|
||||
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
|
||||
Message-Id: <20220407081712.345609-1-mcascell@redhat.com>
|
||||
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
|
||||
|
||||
https://gitlab.com/qemu-project/qemu/-/commit/fa892e9a
|
||||
CVE: CVE-2021-4206
|
||||
Upstream-Status: Backport
|
||||
Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com>
|
||||
---
|
||||
hw/display/qxl-render.c | 7 +++++++
|
||||
hw/display/vmware_vga.c | 2 ++
|
||||
ui/cursor.c | 8 +++++++-
|
||||
3 files changed, 16 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/hw/display/qxl-render.c b/hw/display/qxl-render.c
|
||||
index 237ed293ba..ca217004bf 100644
|
||||
--- a/hw/display/qxl-render.c
|
||||
+++ b/hw/display/qxl-render.c
|
||||
@@ -247,6 +247,13 @@ static QEMUCursor *qxl_cursor(PCIQXLDevice *qxl, QXLCursor *cursor,
|
||||
size_t size;
|
||||
|
||||
c = cursor_alloc(cursor->header.width, cursor->header.height);
|
||||
+
|
||||
+ if (!c) {
|
||||
+ qxl_set_guest_bug(qxl, "%s: cursor %ux%u alloc error", __func__,
|
||||
+ cursor->header.width, cursor->header.height);
|
||||
+ goto fail;
|
||||
+ }
|
||||
+
|
||||
c->hot_x = cursor->header.hot_spot_x;
|
||||
c->hot_y = cursor->header.hot_spot_y;
|
||||
switch (cursor->header.type) {
|
||||
diff --git a/hw/display/vmware_vga.c b/hw/display/vmware_vga.c
|
||||
index 98c83474ad..45d06cbe25 100644
|
||||
--- a/hw/display/vmware_vga.c
|
||||
+++ b/hw/display/vmware_vga.c
|
||||
@@ -515,6 +515,8 @@ static inline void vmsvga_cursor_define(struct vmsvga_state_s *s,
|
||||
int i, pixels;
|
||||
|
||||
qc = cursor_alloc(c->width, c->height);
|
||||
+ assert(qc != NULL);
|
||||
+
|
||||
qc->hot_x = c->hot_x;
|
||||
qc->hot_y = c->hot_y;
|
||||
switch (c->bpp) {
|
||||
diff --git a/ui/cursor.c b/ui/cursor.c
|
||||
index 1d62ddd4d0..835f0802f9 100644
|
||||
--- a/ui/cursor.c
|
||||
+++ b/ui/cursor.c
|
||||
@@ -46,6 +46,8 @@ static QEMUCursor *cursor_parse_xpm(const char *xpm[])
|
||||
|
||||
/* parse pixel data */
|
||||
c = cursor_alloc(width, height);
|
||||
+ assert(c != NULL);
|
||||
+
|
||||
for (pixel = 0, y = 0; y < height; y++, line++) {
|
||||
for (x = 0; x < height; x++, pixel++) {
|
||||
idx = xpm[line][x];
|
||||
@@ -91,7 +93,11 @@ QEMUCursor *cursor_builtin_left_ptr(void)
|
||||
QEMUCursor *cursor_alloc(int width, int height)
|
||||
{
|
||||
QEMUCursor *c;
|
||||
- int datasize = width * height * sizeof(uint32_t);
|
||||
+ size_t datasize = width * height * sizeof(uint32_t);
|
||||
+
|
||||
+ if (width > 512 || height > 512) {
|
||||
+ return NULL;
|
||||
+ }
|
||||
|
||||
c = g_malloc0(sizeof(QEMUCursor) + datasize);
|
||||
c->width = width;
|
||||
--
|
||||
GitLab
|
||||
|
||||
43
meta/recipes-devtools/qemu/qemu/CVE-2021-4207.patch
Normal file
43
meta/recipes-devtools/qemu/qemu/CVE-2021-4207.patch
Normal file
@@ -0,0 +1,43 @@
|
||||
From 9569f5cb5b4bffa9d3ebc8ba7da1e03830a9a895 Mon Sep 17 00:00:00 2001
|
||||
From: Mauro Matteo Cascella <mcascell@redhat.com>
|
||||
Date: Thu, 7 Apr 2022 10:11:06 +0200
|
||||
Subject: [PATCH] display/qxl-render: fix race condition in qxl_cursor
|
||||
(CVE-2021-4207)
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Avoid fetching 'width' and 'height' a second time to prevent possible
|
||||
race condition. Refer to security advisory
|
||||
https://starlabs.sg/advisories/22-4207/ for more information.
|
||||
|
||||
Fixes: CVE-2021-4207
|
||||
Signed-off-by: Mauro Matteo Cascella <mcascell@redhat.com>
|
||||
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
|
||||
Message-Id: <20220407081106.343235-1-mcascell@redhat.com>
|
||||
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
|
||||
|
||||
https://gitlab.com/qemu-project/qemu/-/commit/9569f5cb
|
||||
CVE: CVE-2021-4207
|
||||
Upstream-Status: Backport
|
||||
Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com>
|
||||
---
|
||||
hw/display/qxl-render.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/hw/display/qxl-render.c b/hw/display/qxl-render.c
|
||||
index d28849b121..237ed293ba 100644
|
||||
--- a/hw/display/qxl-render.c
|
||||
+++ b/hw/display/qxl-render.c
|
||||
@@ -266,7 +266,7 @@ static QEMUCursor *qxl_cursor(PCIQXLDevice *qxl, QXLCursor *cursor,
|
||||
}
|
||||
break;
|
||||
case SPICE_CURSOR_TYPE_ALPHA:
|
||||
- size = sizeof(uint32_t) * cursor->header.width * cursor->header.height;
|
||||
+ size = sizeof(uint32_t) * c->width * c->height;
|
||||
qxl_unpack_chunks(c->data, size, qxl, &cursor->chunk, group_id);
|
||||
if (qxl->debug > 2) {
|
||||
cursor_print_ascii_art(c, "qxl/alpha");
|
||||
--
|
||||
GitLab
|
||||
|
||||
42
meta/recipes-devtools/qemu/qemu/CVE-2022-0216-1.patch
Normal file
42
meta/recipes-devtools/qemu/qemu/CVE-2022-0216-1.patch
Normal file
@@ -0,0 +1,42 @@
|
||||
From 6c8fa961da5e60f574bb52fd3ad44b1e9e8ad4b8 Mon Sep 17 00:00:00 2001
|
||||
From: Mauro Matteo Cascella <mcascell@redhat.com>
|
||||
Date: Tue, 5 Jul 2022 22:05:43 +0200
|
||||
Subject: [PATCH] scsi/lsi53c895a: fix use-after-free in lsi_do_msgout
|
||||
(CVE-2022-0216)
|
||||
|
||||
Set current_req->req to NULL to prevent reusing a free'd buffer in case of
|
||||
repeated SCSI cancel requests. Thanks to Thomas Huth for suggesting the patch.
|
||||
|
||||
Fixes: CVE-2022-0216
|
||||
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/972
|
||||
Signed-off-by: Mauro Matteo Cascella <mcascell@redhat.com>
|
||||
Reviewed-by: Thomas Huth <thuth@redhat.com>
|
||||
Message-Id: <20220705200543.2366809-1-mcascell@redhat.com>
|
||||
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
||||
|
||||
https://gitlab.com/qemu-project/qemu/-/commit/6c8fa961da5e60f574bb52fd3ad44b1e9e8ad4b8
|
||||
CVE: CVE-2022-0216
|
||||
Upstream-Status: Backport
|
||||
Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com>
|
||||
---
|
||||
hw/scsi/lsi53c895a.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/hw/scsi/lsi53c895a.c b/hw/scsi/lsi53c895a.c
|
||||
index c8773f73f7..99ea42d49b 100644
|
||||
--- a/hw/scsi/lsi53c895a.c
|
||||
+++ b/hw/scsi/lsi53c895a.c
|
||||
@@ -1028,8 +1028,9 @@ static void lsi_do_msgout(LSIState *s)
|
||||
case 0x0d:
|
||||
/* The ABORT TAG message clears the current I/O process only. */
|
||||
trace_lsi_do_msgout_abort(current_tag);
|
||||
- if (current_req) {
|
||||
+ if (current_req && current_req->req) {
|
||||
scsi_req_cancel(current_req->req);
|
||||
+ current_req->req = NULL;
|
||||
}
|
||||
lsi_disconnect(s);
|
||||
break;
|
||||
--
|
||||
GitLab
|
||||
|
||||
52
meta/recipes-devtools/qemu/qemu/CVE-2022-0216-2.patch
Normal file
52
meta/recipes-devtools/qemu/qemu/CVE-2022-0216-2.patch
Normal file
@@ -0,0 +1,52 @@
|
||||
From 4367a20cc442c56b05611b4224de9a61908f9eac Mon Sep 17 00:00:00 2001
|
||||
From: Mauro Matteo Cascella <mcascell@redhat.com>
|
||||
Date: Mon, 11 Jul 2022 14:33:16 +0200
|
||||
Subject: [PATCH] scsi/lsi53c895a: really fix use-after-free in lsi_do_msgout
|
||||
(CVE-2022-0216)
|
||||
|
||||
Set current_req to NULL, not current_req->req, to prevent reusing a free'd
|
||||
buffer in case of repeated SCSI cancel requests. Also apply the fix to
|
||||
CLEAR QUEUE and BUS DEVICE RESET messages as well, since they also cancel
|
||||
the request.
|
||||
|
||||
Thanks to Alexander Bulekov for providing a reproducer.
|
||||
|
||||
Fixes: CVE-2022-0216
|
||||
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/972
|
||||
Signed-off-by: Mauro Matteo Cascella <mcascell@redhat.com>
|
||||
Tested-by: Alexander Bulekov <alxndr@bu.edu>
|
||||
Message-Id: <20220711123316.421279-1-mcascell@redhat.com>
|
||||
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
||||
|
||||
https://gitlab.com/qemu-project/qemu/-/commit/4367a20cc4
|
||||
CVE: CVE-2022-0216
|
||||
Upstream-Status: Backport
|
||||
Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com>
|
||||
---
|
||||
hw/scsi/lsi53c895a.c | 3 +-
|
||||
1 files changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/hw/scsi/lsi53c895a.c b/hw/scsi/lsi53c895a.c
|
||||
index 99ea42d49b..ad5f5e5f39 100644
|
||||
--- a/hw/scsi/lsi53c895a.c
|
||||
+++ b/hw/scsi/lsi53c895a.c
|
||||
@@ -1030,7 +1030,7 @@ static void lsi_do_msgout(LSIState *s)
|
||||
trace_lsi_do_msgout_abort(current_tag);
|
||||
if (current_req && current_req->req) {
|
||||
scsi_req_cancel(current_req->req);
|
||||
- current_req->req = NULL;
|
||||
+ current_req = NULL;
|
||||
}
|
||||
lsi_disconnect(s);
|
||||
break;
|
||||
@@ -1056,6 +1056,7 @@ static void lsi_do_msgout(LSIState *s)
|
||||
/* clear the current I/O process */
|
||||
if (s->current) {
|
||||
scsi_req_cancel(s->current->req);
|
||||
+ current_req = NULL;
|
||||
}
|
||||
|
||||
/* As the current implemented devices scsi_disk and scsi_generic
|
||||
--
|
||||
GitLab
|
||||
|
||||
146
meta/recipes-devtools/subversion/subversion/CVE-2021-28544.patch
Normal file
146
meta/recipes-devtools/subversion/subversion/CVE-2021-28544.patch
Normal file
@@ -0,0 +1,146 @@
|
||||
From 61382fd8ea66000bd9ee8e203a6eab443220ee40 Mon Sep 17 00:00:00 2001
|
||||
From: Nathan Hartman <hartmannathan@apache.org>
|
||||
Date: Sun, 27 Mar 2022 05:59:18 +0000
|
||||
Subject: [PATCH] On the 1.14.x-r1899227 branch: Merge r1899227 from trunk
|
||||
w/testlist variation
|
||||
|
||||
git-svn-id: https://svn.apache.org/repos/asf/subversion/branches/1.14.x-r1899227@1899229 13f79535-47bb-0310-9956-ffa450edef68
|
||||
|
||||
CVE: CVE-2021-28544 [https://github.com/apache/subversion/commit/61382fd8ea66000bd9ee8e203a6eab443220ee40]
|
||||
Upstream-Status: Backport
|
||||
Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com>
|
||||
---
|
||||
subversion/libsvn_repos/log.c | 26 +++++-------
|
||||
subversion/tests/cmdline/authz_tests.py | 55 +++++++++++++++++++++++++
|
||||
2 files changed, 65 insertions(+), 16 deletions(-)
|
||||
|
||||
diff --git a/subversion/libsvn_repos/log.c b/subversion/libsvn_repos/log.c
|
||||
index d9a1fb1085e16..41ca8aed27174 100644
|
||||
--- a/subversion/libsvn_repos/log.c
|
||||
+++ b/subversion/libsvn_repos/log.c
|
||||
@@ -337,42 +337,36 @@ detect_changed(svn_repos_revision_access_level_t *access_level,
|
||||
if ( (change->change_kind == svn_fs_path_change_add)
|
||||
|| (change->change_kind == svn_fs_path_change_replace))
|
||||
{
|
||||
- const char *copyfrom_path = change->copyfrom_path;
|
||||
- svn_revnum_t copyfrom_rev = change->copyfrom_rev;
|
||||
-
|
||||
/* the following is a potentially expensive operation since on FSFS
|
||||
we will follow the DAG from ROOT to PATH and that requires
|
||||
actually reading the directories along the way. */
|
||||
if (!change->copyfrom_known)
|
||||
{
|
||||
- SVN_ERR(svn_fs_copied_from(©from_rev, ©from_path,
|
||||
+ SVN_ERR(svn_fs_copied_from(&change->copyfrom_rev, &change->copyfrom_path,
|
||||
root, path, iterpool));
|
||||
change->copyfrom_known = TRUE;
|
||||
}
|
||||
|
||||
- if (copyfrom_path && SVN_IS_VALID_REVNUM(copyfrom_rev))
|
||||
+ if (change->copyfrom_path && SVN_IS_VALID_REVNUM(change->copyfrom_rev))
|
||||
{
|
||||
- svn_boolean_t readable = TRUE;
|
||||
-
|
||||
if (callbacks->authz_read_func)
|
||||
{
|
||||
svn_fs_root_t *copyfrom_root;
|
||||
+ svn_boolean_t readable;
|
||||
|
||||
SVN_ERR(svn_fs_revision_root(©from_root, fs,
|
||||
- copyfrom_rev, iterpool));
|
||||
+ change->copyfrom_rev, iterpool));
|
||||
SVN_ERR(callbacks->authz_read_func(&readable,
|
||||
copyfrom_root,
|
||||
- copyfrom_path,
|
||||
+ change->copyfrom_path,
|
||||
callbacks->authz_read_baton,
|
||||
iterpool));
|
||||
if (! readable)
|
||||
- found_unreadable = TRUE;
|
||||
- }
|
||||
-
|
||||
- if (readable)
|
||||
- {
|
||||
- change->copyfrom_path = copyfrom_path;
|
||||
- change->copyfrom_rev = copyfrom_rev;
|
||||
+ {
|
||||
+ found_unreadable = TRUE;
|
||||
+ change->copyfrom_path = NULL;
|
||||
+ change->copyfrom_rev = SVN_INVALID_REVNUM;
|
||||
+ }
|
||||
}
|
||||
}
|
||||
}
|
||||
diff --git a/subversion/tests/cmdline/authz_tests.py b/subversion/tests/cmdline/authz_tests.py
|
||||
index 760cb3663d02f..92e8a5e1935c9 100755
|
||||
--- a/subversion/tests/cmdline/authz_tests.py
|
||||
+++ b/subversion/tests/cmdline/authz_tests.py
|
||||
@@ -1731,6 +1731,60 @@ def empty_group(sbox):
|
||||
'--username', svntest.main.wc_author,
|
||||
sbox.repo_url)
|
||||
|
||||
+@Skip(svntest.main.is_ra_type_file)
|
||||
+def log_inaccessible_copyfrom(sbox):
|
||||
+ "log doesn't leak inaccessible copyfrom paths"
|
||||
+
|
||||
+ sbox.build(empty=True)
|
||||
+ sbox.simple_add_text('secret', 'private')
|
||||
+ sbox.simple_commit(message='log message for r1')
|
||||
+ sbox.simple_copy('private', 'public')
|
||||
+ sbox.simple_commit(message='log message for r2')
|
||||
+
|
||||
+ svntest.actions.enable_revprop_changes(sbox.repo_dir)
|
||||
+ # Remove svn:date and svn:author for predictable output.
|
||||
+ svntest.actions.run_and_verify_svn(None, [], 'propdel', '--revprop',
|
||||
+ '-r2', 'svn:date', sbox.repo_url)
|
||||
+ svntest.actions.run_and_verify_svn(None, [], 'propdel', '--revprop',
|
||||
+ '-r2', 'svn:author', sbox.repo_url)
|
||||
+
|
||||
+ write_restrictive_svnserve_conf(sbox.repo_dir)
|
||||
+
|
||||
+ # First test with blanket access.
|
||||
+ write_authz_file(sbox,
|
||||
+ {"/" : "* = rw"})
|
||||
+ expected_output = svntest.verify.ExpectedOutput([
|
||||
+ "------------------------------------------------------------------------\n",
|
||||
+ "r2 | (no author) | (no date) | 1 line\n",
|
||||
+ "Changed paths:\n",
|
||||
+ " A /public (from /private:1)\n",
|
||||
+ "\n",
|
||||
+ "log message for r2\n",
|
||||
+ "------------------------------------------------------------------------\n",
|
||||
+ ])
|
||||
+ svntest.actions.run_and_verify_svn(expected_output, [],
|
||||
+ 'log', '-r2', '-v',
|
||||
+ sbox.repo_url)
|
||||
+
|
||||
+ # Now test with an inaccessible copy source (/private).
|
||||
+ write_authz_file(sbox,
|
||||
+ {"/" : "* = rw"},
|
||||
+ {"/private" : "* ="})
|
||||
+ expected_output = svntest.verify.ExpectedOutput([
|
||||
+ "------------------------------------------------------------------------\n",
|
||||
+ "r2 | (no author) | (no date) | 1 line\n",
|
||||
+ "Changed paths:\n",
|
||||
+ # The copy is shown as a plain add with no copyfrom info.
|
||||
+ " A /public\n",
|
||||
+ "\n",
|
||||
+ # No log message, as the revision is only partially visible.
|
||||
+ "\n",
|
||||
+ "------------------------------------------------------------------------\n",
|
||||
+ ])
|
||||
+ svntest.actions.run_and_verify_svn(expected_output, [],
|
||||
+ 'log', '-r2', '-v',
|
||||
+ sbox.repo_url)
|
||||
+
|
||||
|
||||
########################################################################
|
||||
# Run the tests
|
||||
@@ -1771,6 +1825,7 @@ def empty_group(sbox):
|
||||
inverted_group_membership,
|
||||
group_member_empty_string,
|
||||
empty_group,
|
||||
+ log_inaccessible_copyfrom,
|
||||
]
|
||||
serial_only = True
|
||||
|
||||
@@ -13,6 +13,7 @@ SRC_URI = "${APACHE_MIRROR}/${BPN}/${BPN}-${PV}.tar.bz2 \
|
||||
file://0001-Fix-libtool-name-in-configure.ac.patch \
|
||||
file://serfmacro.patch \
|
||||
file://CVE-2020-17525.patch \
|
||||
file://CVE-2021-28544.patch \
|
||||
"
|
||||
|
||||
SRC_URI[md5sum] = "3004b4dae18bf45a0b6ea4ef8820064d"
|
||||
|
||||
183
meta/recipes-extended/libarchive/libarchive/CVE-2021-23177.patch
Normal file
183
meta/recipes-extended/libarchive/libarchive/CVE-2021-23177.patch
Normal file
@@ -0,0 +1,183 @@
|
||||
Description: Fix handling of symbolic link ACLs
|
||||
Published as CVE-2021-23177
|
||||
Origin: upstream, https://github.com/libarchive/libarchive/commit/fba4f123cc456d2b2538f811bb831483bf336bad
|
||||
Bug-Debian: https://bugs.debian.org/1001986
|
||||
Author: Martin Matuska <martin@matuska.org>
|
||||
Last-Updated: 2021-12-20
|
||||
|
||||
CVE: CVE-2021-23177
|
||||
Upstream-Status: Backport [http://deb.debian.org/debian/pool/main/liba/libarchive/libarchive_3.4.3-2+deb11u1.debian.tar.xz]
|
||||
Signed-off-by: Ranjitsinh Rathod <ranjitsinh.rathod@kpit.com>
|
||||
|
||||
--- a/libarchive/archive_disk_acl_freebsd.c
|
||||
+++ b/libarchive/archive_disk_acl_freebsd.c
|
||||
@@ -319,7 +319,7 @@
|
||||
|
||||
static int
|
||||
set_acl(struct archive *a, int fd, const char *name,
|
||||
- struct archive_acl *abstract_acl,
|
||||
+ struct archive_acl *abstract_acl, __LA_MODE_T mode,
|
||||
int ae_requested_type, const char *tname)
|
||||
{
|
||||
int acl_type = 0;
|
||||
@@ -364,6 +364,13 @@
|
||||
return (ARCHIVE_FAILED);
|
||||
}
|
||||
|
||||
+ if (acl_type == ACL_TYPE_DEFAULT && !S_ISDIR(mode)) {
|
||||
+ errno = EINVAL;
|
||||
+ archive_set_error(a, errno,
|
||||
+ "Cannot set default ACL on non-directory");
|
||||
+ return (ARCHIVE_WARN);
|
||||
+ }
|
||||
+
|
||||
acl = acl_init(entries);
|
||||
if (acl == (acl_t)NULL) {
|
||||
archive_set_error(a, errno,
|
||||
@@ -542,7 +549,10 @@
|
||||
else if (acl_set_link_np(name, acl_type, acl) != 0)
|
||||
#else
|
||||
/* FreeBSD older than 8.0 */
|
||||
- else if (acl_set_file(name, acl_type, acl) != 0)
|
||||
+ else if (S_ISLNK(mode)) {
|
||||
+ /* acl_set_file() follows symbolic links, skip */
|
||||
+ ret = ARCHIVE_OK;
|
||||
+ } else if (acl_set_file(name, acl_type, acl) != 0)
|
||||
#endif
|
||||
{
|
||||
if (errno == EOPNOTSUPP) {
|
||||
@@ -677,14 +687,14 @@
|
||||
& ARCHIVE_ENTRY_ACL_TYPE_POSIX1E) != 0) {
|
||||
if ((archive_acl_types(abstract_acl)
|
||||
& ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0) {
|
||||
- ret = set_acl(a, fd, name, abstract_acl,
|
||||
+ ret = set_acl(a, fd, name, abstract_acl, mode,
|
||||
ARCHIVE_ENTRY_ACL_TYPE_ACCESS, "access");
|
||||
if (ret != ARCHIVE_OK)
|
||||
return (ret);
|
||||
}
|
||||
if ((archive_acl_types(abstract_acl)
|
||||
& ARCHIVE_ENTRY_ACL_TYPE_DEFAULT) != 0)
|
||||
- ret = set_acl(a, fd, name, abstract_acl,
|
||||
+ ret = set_acl(a, fd, name, abstract_acl, mode,
|
||||
ARCHIVE_ENTRY_ACL_TYPE_DEFAULT, "default");
|
||||
|
||||
/* Simultaneous POSIX.1e and NFSv4 is not supported */
|
||||
@@ -693,7 +703,7 @@
|
||||
#if ARCHIVE_ACL_FREEBSD_NFS4
|
||||
else if ((archive_acl_types(abstract_acl) &
|
||||
ARCHIVE_ENTRY_ACL_TYPE_NFS4) != 0) {
|
||||
- ret = set_acl(a, fd, name, abstract_acl,
|
||||
+ ret = set_acl(a, fd, name, abstract_acl, mode,
|
||||
ARCHIVE_ENTRY_ACL_TYPE_NFS4, "nfs4");
|
||||
}
|
||||
#endif
|
||||
--- a/libarchive/archive_disk_acl_linux.c
|
||||
+++ b/libarchive/archive_disk_acl_linux.c
|
||||
@@ -343,6 +343,11 @@
|
||||
return (ARCHIVE_FAILED);
|
||||
}
|
||||
|
||||
+ if (S_ISLNK(mode)) {
|
||||
+ /* Linux does not support RichACLs on symbolic links */
|
||||
+ return (ARCHIVE_OK);
|
||||
+ }
|
||||
+
|
||||
richacl = richacl_alloc(entries);
|
||||
if (richacl == NULL) {
|
||||
archive_set_error(a, errno,
|
||||
@@ -455,7 +460,7 @@
|
||||
#if ARCHIVE_ACL_LIBACL
|
||||
static int
|
||||
set_acl(struct archive *a, int fd, const char *name,
|
||||
- struct archive_acl *abstract_acl,
|
||||
+ struct archive_acl *abstract_acl, __LA_MODE_T mode,
|
||||
int ae_requested_type, const char *tname)
|
||||
{
|
||||
int acl_type = 0;
|
||||
@@ -488,6 +493,18 @@
|
||||
return (ARCHIVE_FAILED);
|
||||
}
|
||||
|
||||
+ if (S_ISLNK(mode)) {
|
||||
+ /* Linux does not support ACLs on symbolic links */
|
||||
+ return (ARCHIVE_OK);
|
||||
+ }
|
||||
+
|
||||
+ if (acl_type == ACL_TYPE_DEFAULT && !S_ISDIR(mode)) {
|
||||
+ errno = EINVAL;
|
||||
+ archive_set_error(a, errno,
|
||||
+ "Cannot set default ACL on non-directory");
|
||||
+ return (ARCHIVE_WARN);
|
||||
+ }
|
||||
+
|
||||
acl = acl_init(entries);
|
||||
if (acl == (acl_t)NULL) {
|
||||
archive_set_error(a, errno,
|
||||
@@ -727,14 +744,14 @@
|
||||
& ARCHIVE_ENTRY_ACL_TYPE_POSIX1E) != 0) {
|
||||
if ((archive_acl_types(abstract_acl)
|
||||
& ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0) {
|
||||
- ret = set_acl(a, fd, name, abstract_acl,
|
||||
+ ret = set_acl(a, fd, name, abstract_acl, mode,
|
||||
ARCHIVE_ENTRY_ACL_TYPE_ACCESS, "access");
|
||||
if (ret != ARCHIVE_OK)
|
||||
return (ret);
|
||||
}
|
||||
if ((archive_acl_types(abstract_acl)
|
||||
& ARCHIVE_ENTRY_ACL_TYPE_DEFAULT) != 0)
|
||||
- ret = set_acl(a, fd, name, abstract_acl,
|
||||
+ ret = set_acl(a, fd, name, abstract_acl, mode,
|
||||
ARCHIVE_ENTRY_ACL_TYPE_DEFAULT, "default");
|
||||
}
|
||||
#endif /* ARCHIVE_ACL_LIBACL */
|
||||
--- a/libarchive/archive_disk_acl_sunos.c
|
||||
+++ b/libarchive/archive_disk_acl_sunos.c
|
||||
@@ -443,7 +443,7 @@
|
||||
|
||||
static int
|
||||
set_acl(struct archive *a, int fd, const char *name,
|
||||
- struct archive_acl *abstract_acl,
|
||||
+ struct archive_acl *abstract_acl, __LA_MODE_T mode,
|
||||
int ae_requested_type, const char *tname)
|
||||
{
|
||||
aclent_t *aclent;
|
||||
@@ -467,7 +467,6 @@
|
||||
if (entries == 0)
|
||||
return (ARCHIVE_OK);
|
||||
|
||||
-
|
||||
switch (ae_requested_type) {
|
||||
case ARCHIVE_ENTRY_ACL_TYPE_POSIX1E:
|
||||
cmd = SETACL;
|
||||
@@ -492,6 +491,12 @@
|
||||
return (ARCHIVE_FAILED);
|
||||
}
|
||||
|
||||
+ if (S_ISLNK(mode)) {
|
||||
+ /* Skip ACLs on symbolic links */
|
||||
+ ret = ARCHIVE_OK;
|
||||
+ goto exit_free;
|
||||
+ }
|
||||
+
|
||||
e = 0;
|
||||
|
||||
while (archive_acl_next(a, abstract_acl, ae_requested_type, &ae_type,
|
||||
@@ -801,7 +806,7 @@
|
||||
if ((archive_acl_types(abstract_acl)
|
||||
& ARCHIVE_ENTRY_ACL_TYPE_POSIX1E) != 0) {
|
||||
/* Solaris writes POSIX.1e access and default ACLs together */
|
||||
- ret = set_acl(a, fd, name, abstract_acl,
|
||||
+ ret = set_acl(a, fd, name, abstract_acl, mode,
|
||||
ARCHIVE_ENTRY_ACL_TYPE_POSIX1E, "posix1e");
|
||||
|
||||
/* Simultaneous POSIX.1e and NFSv4 is not supported */
|
||||
@@ -810,7 +815,7 @@
|
||||
#if ARCHIVE_ACL_SUNOS_NFS4
|
||||
else if ((archive_acl_types(abstract_acl) &
|
||||
ARCHIVE_ENTRY_ACL_TYPE_NFS4) != 0) {
|
||||
- ret = set_acl(a, fd, name, abstract_acl,
|
||||
+ ret = set_acl(a, fd, name, abstract_acl, mode,
|
||||
ARCHIVE_ENTRY_ACL_TYPE_NFS4, "nfs4");
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,23 @@
|
||||
Description: Never follow symlinks when setting file flags on Linux
|
||||
Published as CVE-2021-31566
|
||||
Origin: upstream, https://github.com/libarchive/libarchive/commit/e2ad1a2c3064fa9eba6274b3641c4c1beed25c0b
|
||||
Bug-Debian: https://bugs.debian.org/1001990
|
||||
Author: Martin Matuska <martin@matuska.org>
|
||||
Last-Update: 2021-12-20
|
||||
|
||||
CVE: CVE-2021-31566
|
||||
Upstream-Status: Backport [http://deb.debian.org/debian/pool/main/liba/libarchive/libarchive_3.4.3-2+deb11u1.debian.tar.xz]
|
||||
Signed-off-by: Ranjitsinh Rathod <ranjitsinh.rathod@kpit.com>
|
||||
|
||||
--- a/libarchive/archive_write_disk_posix.c
|
||||
+++ b/libarchive/archive_write_disk_posix.c
|
||||
@@ -3927,7 +3927,8 @@
|
||||
|
||||
/* If we weren't given an fd, open it ourselves. */
|
||||
if (myfd < 0) {
|
||||
- myfd = open(name, O_RDONLY | O_NONBLOCK | O_BINARY | O_CLOEXEC);
|
||||
+ myfd = open(name, O_RDONLY | O_NONBLOCK | O_BINARY |
|
||||
+ O_CLOEXEC | O_NOFOLLOW);
|
||||
__archive_ensure_cloexec_flag(myfd);
|
||||
}
|
||||
if (myfd < 0)
|
||||
@@ -0,0 +1,172 @@
|
||||
Description: Do not follow symlinks when processing the fixup list
|
||||
Published as CVE-2021-31566
|
||||
Origin: upstream, https://github.com/libarchive/libarchive/commit/b41daecb5ccb4c8e3b2c53fd6147109fc12c3043
|
||||
Bug-Debian: https://bugs.debian.org/1001990
|
||||
Author: Martin Matuska <martin@matuska.org>
|
||||
Last-Update: 2021-12-20
|
||||
|
||||
CVE: CVE-2021-31566
|
||||
Upstream-Status: Backport [http://deb.debian.org/debian/pool/main/liba/libarchive/libarchive_3.4.3-2+deb11u1.debian.tar.xz]
|
||||
Signed-off-by: Ranjitsinh Rathod <ranjitsinh.rathod@kpit.com>
|
||||
|
||||
--- a/Makefile.am
|
||||
+++ b/Makefile.am
|
||||
@@ -556,6 +556,7 @@
|
||||
libarchive/test/test_write_disk.c \
|
||||
libarchive/test/test_write_disk_appledouble.c \
|
||||
libarchive/test/test_write_disk_failures.c \
|
||||
+ libarchive/test/test_write_disk_fixup.c \
|
||||
libarchive/test/test_write_disk_hardlink.c \
|
||||
libarchive/test/test_write_disk_hfs_compression.c \
|
||||
libarchive/test/test_write_disk_lookup.c \
|
||||
--- a/libarchive/archive_write_disk_posix.c
|
||||
+++ b/libarchive/archive_write_disk_posix.c
|
||||
@@ -2461,6 +2461,7 @@
|
||||
{
|
||||
struct archive_write_disk *a = (struct archive_write_disk *)_a;
|
||||
struct fixup_entry *next, *p;
|
||||
+ struct stat st;
|
||||
int fd, ret;
|
||||
|
||||
archive_check_magic(&a->archive, ARCHIVE_WRITE_DISK_MAGIC,
|
||||
@@ -2478,6 +2479,20 @@
|
||||
(TODO_TIMES | TODO_MODE_BASE | TODO_ACLS | TODO_FFLAGS)) {
|
||||
fd = open(p->name,
|
||||
O_WRONLY | O_BINARY | O_NOFOLLOW | O_CLOEXEC);
|
||||
+ if (fd == -1) {
|
||||
+ /* If we cannot lstat, skip entry */
|
||||
+ if (lstat(p->name, &st) != 0)
|
||||
+ goto skip_fixup_entry;
|
||||
+ /*
|
||||
+ * If we deal with a symbolic link, mark
|
||||
+ * it in the fixup mode to ensure no
|
||||
+ * modifications are made to its target.
|
||||
+ */
|
||||
+ if (S_ISLNK(st.st_mode)) {
|
||||
+ p->mode &= ~S_IFMT;
|
||||
+ p->mode |= S_IFLNK;
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
if (p->fixup & TODO_TIMES) {
|
||||
set_times(a, fd, p->mode, p->name,
|
||||
@@ -2492,7 +2507,12 @@
|
||||
fchmod(fd, p->mode);
|
||||
else
|
||||
#endif
|
||||
- chmod(p->name, p->mode);
|
||||
+#ifdef HAVE_LCHMOD
|
||||
+ lchmod(p->name, p->mode);
|
||||
+#else
|
||||
+ if (!S_ISLNK(p->mode))
|
||||
+ chmod(p->name, p->mode);
|
||||
+#endif
|
||||
}
|
||||
if (p->fixup & TODO_ACLS)
|
||||
archive_write_disk_set_acls(&a->archive, fd,
|
||||
@@ -2503,6 +2523,7 @@
|
||||
if (p->fixup & TODO_MAC_METADATA)
|
||||
set_mac_metadata(a, p->name, p->mac_metadata,
|
||||
p->mac_metadata_size);
|
||||
+skip_fixup_entry:
|
||||
next = p->next;
|
||||
archive_acl_clear(&p->acl);
|
||||
free(p->mac_metadata);
|
||||
@@ -2643,6 +2664,7 @@
|
||||
fe->next = a->fixup_list;
|
||||
a->fixup_list = fe;
|
||||
fe->fixup = 0;
|
||||
+ fe->mode = 0;
|
||||
fe->name = strdup(pathname);
|
||||
return (fe);
|
||||
}
|
||||
--- a/libarchive/test/CMakeLists.txt
|
||||
+++ b/libarchive/test/CMakeLists.txt
|
||||
@@ -208,6 +208,7 @@
|
||||
test_write_disk.c
|
||||
test_write_disk_appledouble.c
|
||||
test_write_disk_failures.c
|
||||
+ test_write_disk_fixup.c
|
||||
test_write_disk_hardlink.c
|
||||
test_write_disk_hfs_compression.c
|
||||
test_write_disk_lookup.c
|
||||
--- /dev/null
|
||||
+++ b/libarchive/test/test_write_disk_fixup.c
|
||||
@@ -0,0 +1,77 @@
|
||||
+/*-
|
||||
+ * Copyright (c) 2021 Martin Matuska
|
||||
+ * All rights reserved.
|
||||
+ *
|
||||
+ * Redistribution and use in source and binary forms, with or without
|
||||
+ * modification, are permitted provided that the following conditions
|
||||
+ * are met:
|
||||
+ * 1. Redistributions of source code must retain the above copyright
|
||||
+ * notice, this list of conditions and the following disclaimer.
|
||||
+ * 2. Redistributions in binary form must reproduce the above copyright
|
||||
+ * notice, this list of conditions and the following disclaimer in the
|
||||
+ * documentation and/or other materials provided with the distribution.
|
||||
+ *
|
||||
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
|
||||
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
+ */
|
||||
+#include "test.h"
|
||||
+
|
||||
+/*
|
||||
+ * Test fixup entries don't follow symlinks
|
||||
+ */
|
||||
+DEFINE_TEST(test_write_disk_fixup)
|
||||
+{
|
||||
+ struct archive *ad;
|
||||
+ struct archive_entry *ae;
|
||||
+ int r;
|
||||
+
|
||||
+ if (!canSymlink()) {
|
||||
+ skipping("Symlinks not supported");
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ /* Write entries to disk. */
|
||||
+ assert((ad = archive_write_disk_new()) != NULL);
|
||||
+
|
||||
+ /*
|
||||
+ * Create a file
|
||||
+ */
|
||||
+ assertMakeFile("victim", 0600, "a");
|
||||
+
|
||||
+ /*
|
||||
+ * Create a directory and a symlink with the same name
|
||||
+ */
|
||||
+
|
||||
+ /* Directory: dir */
|
||||
+ assert((ae = archive_entry_new()) != NULL);
|
||||
+ archive_entry_copy_pathname(ae, "dir");
|
||||
+ archive_entry_set_mode(ae, AE_IFDIR | 0606);
|
||||
+ assertEqualIntA(ad, 0, archive_write_header(ad, ae));
|
||||
+ assertEqualIntA(ad, 0, archive_write_finish_entry(ad));
|
||||
+ archive_entry_free(ae);
|
||||
+
|
||||
+ /* Symbolic Link: dir -> foo */
|
||||
+ assert((ae = archive_entry_new()) != NULL);
|
||||
+ archive_entry_copy_pathname(ae, "dir");
|
||||
+ archive_entry_set_mode(ae, AE_IFLNK | 0777);
|
||||
+ archive_entry_set_size(ae, 0);
|
||||
+ archive_entry_copy_symlink(ae, "victim");
|
||||
+ assertEqualIntA(ad, 0, r = archive_write_header(ad, ae));
|
||||
+ if (r >= ARCHIVE_WARN)
|
||||
+ assertEqualIntA(ad, 0, archive_write_finish_entry(ad));
|
||||
+ archive_entry_free(ae);
|
||||
+
|
||||
+ assertEqualInt(ARCHIVE_OK, archive_write_free(ad));
|
||||
+
|
||||
+ /* Test the entries on disk. */
|
||||
+ assertIsSymlink("dir", "victim", 0);
|
||||
+ assertFileMode("victim", 0600);
|
||||
+}
|
||||
@@ -36,6 +36,9 @@ SRC_URI = "http://libarchive.org/downloads/libarchive-${PV}.tar.gz \
|
||||
file://CVE-2021-36976-1.patch \
|
||||
file://CVE-2021-36976-2.patch \
|
||||
file://CVE-2021-36976-3.patch \
|
||||
file://CVE-2021-23177.patch \
|
||||
file://CVE-2021-31566-01.patch \
|
||||
file://CVE-2021-31566-02.patch \
|
||||
"
|
||||
|
||||
SRC_URI[md5sum] = "d953ed6b47694dadf0e6042f8f9ff451"
|
||||
|
||||
@@ -6,7 +6,7 @@ SECTION = "base"
|
||||
LICENSE = "PD & BSD-3-Clause"
|
||||
LIC_FILES_CHKSUM = "file://LICENSE;md5=c679c9d6b02bc2757b3eaf8f53c43fba"
|
||||
|
||||
PV = "2022a"
|
||||
PV = "2022c"
|
||||
|
||||
SRC_URI =" http://www.iana.org/time-zones/repository/releases/tzcode${PV}.tar.gz;name=tzcode \
|
||||
http://www.iana.org/time-zones/repository/releases/tzdata${PV}.tar.gz;name=tzdata \
|
||||
@@ -14,6 +14,6 @@ SRC_URI =" http://www.iana.org/time-zones/repository/releases/tzcode${PV}.tar.gz
|
||||
|
||||
UPSTREAM_CHECK_URI = "http://www.iana.org/time-zones"
|
||||
|
||||
SRC_URI[tzcode.sha256sum] = "f8575e7e33be9ee265df2081092526b81c80abac3f4a04399ae9d4d91cdadac7"
|
||||
SRC_URI[tzdata.sha256sum] = "ef7fffd9f4f50f4f58328b35022a32a5a056b245c5cb3d6791dddb342f871664"
|
||||
SRC_URI[tzcode.sha256sum] = "3e7ce1f3620cc0481907c7e074d69910793285bffe0ca331ef1a6d1ae3ea90cc"
|
||||
SRC_URI[tzdata.sha256sum] = "6974f4e348bf2323274b56dff9e7500247e3159eaa4b485dfa0cd66e75c14bfe"
|
||||
|
||||
|
||||
@@ -0,0 +1,100 @@
|
||||
From 95e581fd181b213c2ed7cdc63f2abc03eaaa77ec Mon Sep 17 00:00:00 2001
|
||||
From: Gert Wollny <gert.wollny@collabora.com>
|
||||
Date: Tue, 30 Nov 2021 10:17:26 +0100
|
||||
Subject: [PATCH] vrend: Add test to resource OOB write and fix it
|
||||
|
||||
v2: Also check that no depth != 1 has been send when none is due
|
||||
|
||||
Closes: #250
|
||||
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
|
||||
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
|
||||
|
||||
https://gitlab.freedesktop.org/virgl/virglrenderer/-/commit/95e581fd181b213c2ed7cdc63f2abc03eaaa77ec
|
||||
Upstream-Status: Backport
|
||||
CVE: CVE-2022-0135
|
||||
Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com>
|
||||
---
|
||||
src/vrend_renderer.c | 3 +++
|
||||
tests/test_fuzzer_formats.c | 43 +++++++++++++++++++++++++++++++++++++
|
||||
2 files changed, 46 insertions(+)
|
||||
|
||||
diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c
|
||||
index 28f669727..357b81b20 100644
|
||||
--- a/src/vrend_renderer.c
|
||||
+++ b/src/vrend_renderer.c
|
||||
@@ -7833,8 +7833,11 @@ static int vrend_renderer_transfer_write_iov(struct vrend_context *ctx,
|
||||
info->box->height) * elsize;
|
||||
if (res->target == GL_TEXTURE_3D ||
|
||||
res->target == GL_TEXTURE_2D_ARRAY ||
|
||||
+ res->target == GL_TEXTURE_2D_MULTISAMPLE_ARRAY ||
|
||||
res->target == GL_TEXTURE_CUBE_MAP_ARRAY)
|
||||
send_size *= info->box->depth;
|
||||
+ else if (need_temp && info->box->depth != 1)
|
||||
+ return EINVAL;
|
||||
|
||||
if (need_temp) {
|
||||
data = malloc(send_size);
|
||||
diff --git a/tests/test_fuzzer_formats.c b/tests/test_fuzzer_formats.c
|
||||
index 59d6fb671..2de9a9a3f 100644
|
||||
--- a/tests/test_fuzzer_formats.c
|
||||
+++ b/tests/test_fuzzer_formats.c
|
||||
@@ -957,6 +957,48 @@ static void test_vrend_set_signle_abo_heap_overflow() {
|
||||
virgl_renderer_submit_cmd((void *) cmd, ctx_id, 0xde);
|
||||
}
|
||||
|
||||
+/* Test adapted from yaojun8558363@gmail.com:
|
||||
+ * https://gitlab.freedesktop.org/virgl/virglrenderer/-/issues/250
|
||||
+*/
|
||||
+static void test_vrend_3d_resource_overflow() {
|
||||
+
|
||||
+ struct virgl_renderer_resource_create_args resource;
|
||||
+ resource.handle = 0x4c474572;
|
||||
+ resource.target = PIPE_TEXTURE_2D_ARRAY;
|
||||
+ resource.format = VIRGL_FORMAT_Z24X8_UNORM;
|
||||
+ resource.nr_samples = 2;
|
||||
+ resource.last_level = 0;
|
||||
+ resource.array_size = 3;
|
||||
+ resource.bind = VIRGL_BIND_SAMPLER_VIEW;
|
||||
+ resource.depth = 1;
|
||||
+ resource.width = 8;
|
||||
+ resource.height = 4;
|
||||
+ resource.flags = 0;
|
||||
+
|
||||
+ virgl_renderer_resource_create(&resource, NULL, 0);
|
||||
+ virgl_renderer_ctx_attach_resource(ctx_id, resource.handle);
|
||||
+
|
||||
+ uint32_t size = 0x400;
|
||||
+ uint32_t cmd[size];
|
||||
+ int i = 0;
|
||||
+ cmd[i++] = (size - 1) << 16 | 0 << 8 | VIRGL_CCMD_RESOURCE_INLINE_WRITE;
|
||||
+ cmd[i++] = resource.handle;
|
||||
+ cmd[i++] = 0; // level
|
||||
+ cmd[i++] = 0; // usage
|
||||
+ cmd[i++] = 0; // stride
|
||||
+ cmd[i++] = 0; // layer_stride
|
||||
+ cmd[i++] = 0; // x
|
||||
+ cmd[i++] = 0; // y
|
||||
+ cmd[i++] = 0; // z
|
||||
+ cmd[i++] = 8; // w
|
||||
+ cmd[i++] = 4; // h
|
||||
+ cmd[i++] = 3; // d
|
||||
+ memset(&cmd[i], 0, size - i);
|
||||
+
|
||||
+ virgl_renderer_submit_cmd((void *) cmd, ctx_id, size);
|
||||
+}
|
||||
+
|
||||
+
|
||||
int main()
|
||||
{
|
||||
initialize_environment();
|
||||
@@ -979,6 +1021,7 @@ int main()
|
||||
test_cs_nullpointer_deference();
|
||||
test_vrend_set_signle_abo_heap_overflow();
|
||||
|
||||
+ test_vrend_3d_resource_overflow();
|
||||
|
||||
virgl_renderer_context_destroy(ctx_id);
|
||||
virgl_renderer_cleanup(&cookie);
|
||||
--
|
||||
GitLab
|
||||
|
||||
@@ -13,6 +13,7 @@ SRCREV = "7d204f3927be65fb3365dce01dbcd04d447a4985"
|
||||
SRC_URI = "git://anongit.freedesktop.org/git/virglrenderer;branch=master \
|
||||
file://0001-gallium-Expand-libc-check-to-be-platform-OS-check.patch \
|
||||
file://0001-meson.build-use-python3-directly-for-python.patch \
|
||||
file://CVE-2022-0135.patch \
|
||||
"
|
||||
|
||||
S = "${WORKDIR}/git"
|
||||
|
||||
@@ -11,6 +11,7 @@ SRC_URI += " \
|
||||
file://0001-Disable-installing-header-file-provided-by-another-p.patch \
|
||||
file://0001-Fix-build-for-Linux-5.8-rc1.patch \
|
||||
file://0001-Fix-build-for-Linux-5.9-rc1.patch \
|
||||
file://fix-build-for-Linux-5.11-rc1.patch \
|
||||
"
|
||||
|
||||
EXTRA_OEMAKE='KERNEL_DIR="${STAGING_KERNEL_DIR}" PREFIX="${D}"'
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
From 55c6315058fc0dd189ffd116f2cc27ba4fa84cb6 Mon Sep 17 00:00:00 2001
|
||||
From: Joan Bruguera <joanbrugueram@gmail.com>
|
||||
Date: Mon, 28 Dec 2020 01:41:31 +0100
|
||||
Subject: [PATCH] Fix build for Linux 5.11-rc1
|
||||
|
||||
ksys_close was removed, as far as I can tell, close_fd replaces it.
|
||||
|
||||
See also: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=8760c909f54a82aaa6e76da19afe798a0c77c3c3
|
||||
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=1572bfdf21d4d50e51941498ffe0b56c2289f783
|
||||
|
||||
Upstream-Status: Backport [https://github.com/cryptodev-linux/cryptodev-linux/commit/55c6315058fc0dd189ffd116f2cc27ba4fa84cb6]
|
||||
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
|
||||
---
|
||||
ioctl.c | 4 +++-
|
||||
1 file changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/ioctl.c b/ioctl.c
|
||||
index 3d332380..95481d4f 100644
|
||||
--- a/ioctl.c
|
||||
+++ b/ioctl.c
|
||||
@@ -871,8 +871,10 @@ cryptodev_ioctl(struct file *filp, unsigned int cmd, unsigned long arg_)
|
||||
if (unlikely(ret)) {
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 17, 0))
|
||||
sys_close(fd);
|
||||
-#else
|
||||
+#elif (LINUX_VERSION_CODE < KERNEL_VERSION(5, 11, 0))
|
||||
ksys_close(fd);
|
||||
+#else
|
||||
+ close_fd(fd);
|
||||
#endif
|
||||
return ret;
|
||||
}
|
||||
@@ -132,7 +132,7 @@ LIC_FILES_CHKSUM = "file://LICENCE.Abilis;md5=b5ee3f410780e56711ad48eadc22b8bc \
|
||||
"
|
||||
# WHENCE checksum is defined separately to ease overriding it if
|
||||
# class-devupstream is selected.
|
||||
WHENCE_CHKSUM = "def08711eb23ba967fb7e1f8cff66178"
|
||||
WHENCE_CHKSUM = "98ecc3d3223df7ebdc23b0ec56aafb20"
|
||||
|
||||
# These are not common licenses, set NO_GENERIC_LICENSE for them
|
||||
# so that the license files will be copied from fetched source
|
||||
@@ -209,7 +209,7 @@ SRC_URI:class-devupstream = "git://git.kernel.org/pub/scm/linux/kernel/git/firmw
|
||||
# Pin this to the 20220509 release, override this in local.conf
|
||||
SRCREV:class-devupstream ?= "b19cbdca78ab2adfd210c91be15a22568e8b8cae"
|
||||
|
||||
SRC_URI[sha256sum] = "0abec827a035c82bdcabdf82aa37ded247bc682ef05861bd409ea6f477bab81d"
|
||||
SRC_URI[sha256sum] = "26fd00f2d8e96c4af6f44269a6b893eb857253044f75ad28ef6706a2250cd8e9"
|
||||
|
||||
inherit allarch
|
||||
|
||||
@@ -308,8 +308,14 @@ PACKAGES =+ "${PN}-ralink-license ${PN}-ralink \
|
||||
${PN}-qcom-license \
|
||||
${PN}-qcom-venus-1.8 ${PN}-qcom-venus-4.2 ${PN}-qcom-venus-5.2 ${PN}-qcom-venus-5.4 \
|
||||
${PN}-qcom-vpu-1.0 ${PN}-qcom-vpu-2.0 \
|
||||
${PN}-qcom-adreno-a3xx ${PN}-qcom-adreno-a530 \
|
||||
${PN}-qcom-adreno-a2xx ${PN}-qcom-adreno-a3xx ${PN}-qcom-adreno-a4xx ${PN}-qcom-adreno-a530 \
|
||||
${PN}-qcom-adreno-a630 ${PN}-qcom-adreno-a650 ${PN}-qcom-adreno-a660 \
|
||||
${PN}-qcom-apq8096-audio ${PN}-qcom-apq8096-modem \
|
||||
${PN}-qcom-sc8280xp-lenovo-x13s-compat \
|
||||
${PN}-qcom-sc8280xp-lenovo-x13s-audio \
|
||||
${PN}-qcom-sc8280xp-lenovo-x13s-adreno \
|
||||
${PN}-qcom-sc8280xp-lenovo-x13s-compute \
|
||||
${PN}-qcom-sc8280xp-lenovo-x13s-sensors \
|
||||
${PN}-qcom-sdm845-audio ${PN}-qcom-sdm845-compute ${PN}-qcom-sdm845-modem \
|
||||
${PN}-qcom-sm8250-audio ${PN}-qcom-sm8250-compute \
|
||||
${PN}-amlogic-vdec-license ${PN}-amlogic-vdec \
|
||||
@@ -962,11 +968,20 @@ FILES_${PN}-qcom-venus-5.2 = "${nonarch_base_libdir}/firmware/qcom/venus-5.2/*"
|
||||
FILES_${PN}-qcom-venus-5.4 = "${nonarch_base_libdir}/firmware/qcom/venus-5.4/*"
|
||||
FILES_${PN}-qcom-vpu-1.0 = "${nonarch_base_libdir}/firmware/qcom/vpu-1.0/*"
|
||||
FILES_${PN}-qcom-vpu-2.0 = "${nonarch_base_libdir}/firmware/qcom/vpu-2.0/*"
|
||||
FILES_${PN}-qcom-adreno-a3xx = "${nonarch_base_libdir}/firmware/qcom/a300_*.fw ${nonarch_base_libdir}/firmware/a300_*.fw"
|
||||
FILES_${PN}-qcom-adreno-a2xx = "${nonarch_base_libdir}/firmware/qcom/leia_*.fw"
|
||||
FILES_${PN}-qcom-adreno-a3xx = "${nonarch_base_libdir}/firmware/qcom/a3*_*.fw ${nonarch_base_libdir}/firmware/a300_*.fw"
|
||||
FILES_${PN}-qcom-adreno-a4xx = "${nonarch_base_libdir}/firmware/qcom/a4*_*.fw"
|
||||
FILES_${PN}-qcom-adreno-a530 = "${nonarch_base_libdir}/firmware/qcom/a530*.*"
|
||||
FILES_${PN}-qcom-adreno-a630 = "${nonarch_base_libdir}/firmware/qcom/a630*.* ${nonarch_base_libdir}/firmware/qcom/sdm845/a630*.*"
|
||||
FILES_${PN}-qcom-adreno-a650 = "${nonarch_base_libdir}/firmware/qcom/a650*.* ${nonarch_base_libdir}/firmware/qcom/sm8250/a650*.*"
|
||||
FILES_${PN}-qcom-adreno-a660 = "${nonarch_base_libdir}/firmware/qcom/a660*.*"
|
||||
FILES_${PN}-qcom-apq8096-audio = "${nonarch_base_libdir}/firmware/qcom/apq8096/adsp*.*"
|
||||
FILES_${PN}-qcom-apq8096-modem = "${nonarch_base_libdir}/firmware/qcom/apq8096/mba.mbn ${nonarch_base_libdir}/firmware/qcom/apq8096/modem*.* ${nonarch_base_libdir}/firmware/qcom/apq8096/wlanmdsp.mbn"
|
||||
FILES_${PN}-qcom-sc8280xp-lenovo-x13s-compat = "${nonarch_base_libdir}/firmware/qcom/LENOVO/21BX"
|
||||
FILES_${PN}-qcom-sc8280xp-lenovo-x13s-audio = "${nonarch_base_libdir}/firmware/qcom/sc8280xp/LENOVO/21BX/*adsp*.* ${nonarch_base_libdir}/firmware/qcom/sc8280xp/LENOVO/21BX/battmgr.jsn"
|
||||
FILES_${PN}-qcom-sc8280xp-lenovo-x13s-adreno = "${nonarch_base_libdir}/firmware/qcom/sc8280xp/LENOVO/21BX/qcdxkmsuc8280.mbn"
|
||||
FILES_${PN}-qcom-sc8280xp-lenovo-x13s-compute = "${nonarch_base_libdir}/firmware/qcom/sc8280xp/LENOVO/21BX/*cdsp*.*"
|
||||
FILES_${PN}-qcom-sc8280xp-lenovo-x13s-sensors = "${nonarch_base_libdir}/firmware/qcom/sc8280xp/LENOVO/21BX/*slpi*.*"
|
||||
FILES_${PN}-qcom-sdm845-audio = "${nonarch_base_libdir}/firmware/qcom/sdm845/adsp*.*"
|
||||
FILES_${PN}-qcom-sdm845-compute = "${nonarch_base_libdir}/firmware/qcom/sdm845/cdsp*.*"
|
||||
FILES_${PN}-qcom-sdm845-modem = "${nonarch_base_libdir}/firmware/qcom/sdm845/mba.mbn ${nonarch_base_libdir}/firmware/qcom/sdm845/modem*.* ${nonarch_base_libdir}/firmware/qcom/sdm845/wlanmdsp.mbn"
|
||||
@@ -978,17 +993,30 @@ RDEPENDS_${PN}-qcom-venus-5.2 = "${PN}-qcom-license"
|
||||
RDEPENDS_${PN}-qcom-venus-5.4 = "${PN}-qcom-license"
|
||||
RDEPENDS_${PN}-qcom-vpu-1.0 = "${PN}-qcom-license"
|
||||
RDEPENDS_${PN}-qcom-vpu-2.0 = "${PN}-qcom-license"
|
||||
RDEPENDS_${PN}-qcom-adreno-a2xx = "${PN}-qcom-license"
|
||||
RDEPENDS_${PN}-qcom-adreno-a3xx = "${PN}-qcom-license"
|
||||
RDEPENDS_${PN}-qcom-adreno-a4xx = "${PN}-qcom-license"
|
||||
RDEPENDS_${PN}-qcom-adreno-a530 = "${PN}-qcom-license"
|
||||
RDEPENDS_${PN}-qcom-adreno-a630 = "${PN}-qcom-license"
|
||||
RDEPENDS_${PN}-qcom-adreno-a650 = "${PN}-qcom-license"
|
||||
RDEPENDS_${PN}-qcom-adreno-a660 = "${PN}-qcom-license"
|
||||
RDEPENDS_${PN}-qcom-apq8096-audio = "${PN}-qcom-license"
|
||||
RDEPENDS_${PN}-qcom-apq8096-modem = "${PN}-qcom-license"
|
||||
RDEPENDS_${PN}-qcom-sc8280xp-lenovo-x13s-audio = "${PN}-qcom-license"
|
||||
RDEPENDS_${PN}-qcom-sc8280xp-lenovo-x13s-adreno = "${PN}-qcom-license"
|
||||
RDEPENDS_${PN}-qcom-sc8280xp-lenovo-x13s-compute = "${PN}-qcom-license"
|
||||
RDEPENDS_${PN}-qcom-sc8280xp-lenovo-x13s-sensors = "${PN}-qcom-license"
|
||||
RDEPENDS_${PN}-qcom-sdm845-audio = "${PN}-qcom-license"
|
||||
RDEPENDS_${PN}-qcom-sdm845-compute = "${PN}-qcom-license"
|
||||
RDEPENDS_${PN}-qcom-sdm845-modem = "${PN}-qcom-license"
|
||||
RDEPENDS_${PN}-qcom-sm8250-audio = "${PN}-qcom-license"
|
||||
RDEPENDS_${PN}-qcom-sm8250-compute = "${PN}-qcom-license"
|
||||
|
||||
RRECOMMENDS_${PN}-qcom-sc8280xp-lenovo-x13s-audio = "${PN}-qcom-sc8280xp-lenovo-x13s-compat"
|
||||
RRECOMMENDS_${PN}-qcom-sc8280xp-lenovo-x13s-adreno = "${PN}-qcom-sc8280xp-lenovo-x13s-compat"
|
||||
RRECOMMENDS_${PN}-qcom-sc8280xp-lenovo-x13s-compute = "${PN}-qcom-sc8280xp-lenovo-x13s-compat"
|
||||
RRECOMMENDS_${PN}-qcom-sc8280xp-lenovo-x13s-sensors = "${PN}-qcom-sc8280xp-lenovo-x13s-compat"
|
||||
|
||||
FILES_${PN}-liquidio = "${nonarch_base_libdir}/firmware/liquidio"
|
||||
|
||||
# For Amlogic VDEC
|
||||
@@ -1068,3 +1096,6 @@ python populate_packages_prepend () {
|
||||
# Firmware files are generally not ran on the CPU, so they can be
|
||||
# allarch despite being architecture specific
|
||||
INSANE_SKIP = "arch"
|
||||
|
||||
# Don't warn about already stripped files
|
||||
INSANE_SKIP:${PN} = "already-stripped"
|
||||
@@ -11,13 +11,13 @@ python () {
|
||||
raise bb.parse.SkipRecipe("Set PREFERRED_PROVIDER_virtual/kernel to linux-yocto-rt to enable it")
|
||||
}
|
||||
|
||||
SRCREV_machine ?= "f6c9d6db383201a730e8d638995eae82acd4d8e7"
|
||||
SRCREV_meta ?= "028688aaad2b64e353d771ba5505a8666cd01696"
|
||||
SRCREV_machine ?= "03cd66d9814a26fff4681d3a053654848e519fd6"
|
||||
SRCREV_meta ?= "2f18e629f78da51cacf531bed58a83568724a376"
|
||||
|
||||
SRC_URI = "git://git.yoctoproject.org/linux-yocto.git;branch=${KBRANCH};name=machine \
|
||||
git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-5.4;destsuffix=${KMETA}"
|
||||
|
||||
LINUX_VERSION ?= "5.4.209"
|
||||
LINUX_VERSION ?= "5.4.213"
|
||||
|
||||
LIC_FILES_CHKSUM = "file://COPYING;md5=bbea815ee2795b2f4230826c0c6b8814"
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ KCONFIG_MODE = "--allnoconfig"
|
||||
|
||||
require recipes-kernel/linux/linux-yocto.inc
|
||||
|
||||
LINUX_VERSION ?= "5.4.209"
|
||||
LINUX_VERSION ?= "5.4.213"
|
||||
LIC_FILES_CHKSUM = "file://COPYING;md5=bbea815ee2795b2f4230826c0c6b8814"
|
||||
|
||||
DEPENDS += "${@bb.utils.contains('ARCH', 'x86', 'elfutils-native', '', d)}"
|
||||
@@ -15,9 +15,9 @@ DEPENDS += "openssl-native util-linux-native"
|
||||
KMETA = "kernel-meta"
|
||||
KCONF_BSP_AUDIT_LEVEL = "2"
|
||||
|
||||
SRCREV_machine_qemuarm ?= "8f087017ff03465fa8d318c06a7e4e072c533daf"
|
||||
SRCREV_machine ?= "a4b7263158de8713dc85c5171aed99e3424a9f7c"
|
||||
SRCREV_meta ?= "028688aaad2b64e353d771ba5505a8666cd01696"
|
||||
SRCREV_machine_qemuarm ?= "284fd0f6e11db890ad6cfd246a2c47521db4a05f"
|
||||
SRCREV_machine ?= "6d8cf8757864e674bb8f55b6ff68de5e3387d110"
|
||||
SRCREV_meta ?= "2f18e629f78da51cacf531bed58a83568724a376"
|
||||
|
||||
PV = "${LINUX_VERSION}+git${SRCPV}"
|
||||
|
||||
|
||||
@@ -12,16 +12,16 @@ KBRANCH_qemux86 ?= "v5.4/standard/base"
|
||||
KBRANCH_qemux86-64 ?= "v5.4/standard/base"
|
||||
KBRANCH_qemumips64 ?= "v5.4/standard/mti-malta64"
|
||||
|
||||
SRCREV_machine_qemuarm ?= "4fefb5a57ecb9bc5c6aab38319f773b02c894e6b"
|
||||
SRCREV_machine_qemuarm64 ?= "407b5fa877ca8993a405542fa4c3d73584e8ea98"
|
||||
SRCREV_machine_qemumips ?= "1bfe5d39c9f954f0ac2480115f4750f39500d4f4"
|
||||
SRCREV_machine_qemuppc ?= "753def987b630ed41686223b5dc252436757e893"
|
||||
SRCREV_machine_qemuriscv64 ?= "90d5f03a7c79ccd5c02e0579049d22cf2686da9b"
|
||||
SRCREV_machine_qemux86 ?= "90d5f03a7c79ccd5c02e0579049d22cf2686da9b"
|
||||
SRCREV_machine_qemux86-64 ?= "90d5f03a7c79ccd5c02e0579049d22cf2686da9b"
|
||||
SRCREV_machine_qemumips64 ?= "b391bfc877fe8ae41e579ffd4bcd814b4ad438ea"
|
||||
SRCREV_machine ?= "90d5f03a7c79ccd5c02e0579049d22cf2686da9b"
|
||||
SRCREV_meta ?= "028688aaad2b64e353d771ba5505a8666cd01696"
|
||||
SRCREV_machine_qemuarm ?= "bcf3f5cf5f1bcfac1df54a2a9f19c92a49fc7538"
|
||||
SRCREV_machine_qemuarm64 ?= "fea87c9d80c7531f85f69fee97cf9500403cef6b"
|
||||
SRCREV_machine_qemumips ?= "f1d654a16a5b5a3bbc9288936827628a4a4553a2"
|
||||
SRCREV_machine_qemuppc ?= "f6bbc9d216fd3cef1df3ced215b0b22503c48906"
|
||||
SRCREV_machine_qemuriscv64 ?= "c0b728020967728840c39994e472db7ed7b727cf"
|
||||
SRCREV_machine_qemux86 ?= "c0b728020967728840c39994e472db7ed7b727cf"
|
||||
SRCREV_machine_qemux86-64 ?= "c0b728020967728840c39994e472db7ed7b727cf"
|
||||
SRCREV_machine_qemumips64 ?= "841245c9bd427e2e7cc786b92cecaf4390e5dd52"
|
||||
SRCREV_machine ?= "c0b728020967728840c39994e472db7ed7b727cf"
|
||||
SRCREV_meta ?= "2f18e629f78da51cacf531bed58a83568724a376"
|
||||
|
||||
# remap qemuarm to qemuarma15 for the 5.4 kernel
|
||||
# KMACHINE_qemuarm ?= "qemuarma15"
|
||||
@@ -30,7 +30,7 @@ SRC_URI = "git://git.yoctoproject.org/linux-yocto.git;name=machine;branch=${KBRA
|
||||
git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-5.4;destsuffix=${KMETA}"
|
||||
|
||||
LIC_FILES_CHKSUM = "file://COPYING;md5=bbea815ee2795b2f4230826c0c6b8814"
|
||||
LINUX_VERSION ?= "5.4.209"
|
||||
LINUX_VERSION ?= "5.4.213"
|
||||
|
||||
DEPENDS += "${@bb.utils.contains('ARCH', 'x86', 'elfutils-native', '', d)}"
|
||||
DEPENDS += "openssl-native util-linux-native"
|
||||
|
||||
@@ -5,7 +5,7 @@ LICENSE = "ISC"
|
||||
LIC_FILES_CHKSUM = "file://LICENSE;md5=07c4f6dea3845b02a18dc00c8c87699c"
|
||||
|
||||
SRC_URI = "https://www.kernel.org/pub/software/network/${BPN}/${BP}.tar.xz"
|
||||
SRC_URI[sha256sum] = "ac00f97efecce5046ed069d1d93f3365fdf994c7c7854a8fc50831e959537230"
|
||||
SRC_URI[sha256sum] = "59c8f7d17966db71b27f90e735ee8f5b42ca3527694a8c5e6e9b56bd379c3b84"
|
||||
|
||||
inherit bin_package allarch
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
From cf887f1b8e228bff6e19829e6d03995d70ad739d Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= <sebastian@centricular.com>
|
||||
Date: Wed, 18 May 2022 10:23:15 +0300
|
||||
Subject: [PATCH] matroskademux: Avoid integer-overflow resulting in heap
|
||||
corruption in WavPack header handling code
|
||||
|
||||
blocksize + WAVPACK4_HEADER_SIZE might overflow gsize, which then
|
||||
results in allocating a very small buffer. Into that buffer blocksize
|
||||
data is memcpy'd later which then causes out of bound writes and can
|
||||
potentially lead to anything from crashes to remote code execution.
|
||||
|
||||
Thanks to Adam Doupe for analyzing and reporting the issue.
|
||||
|
||||
CVE: CVE-2022-1920
|
||||
|
||||
https://gstreamer.freedesktop.org/security/sa-2022-0004.html
|
||||
|
||||
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1226
|
||||
|
||||
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2612>
|
||||
|
||||
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/commit/0df0dd7fe388174e4835eda4526b47f470a56370
|
||||
Upstream-Status: Backport
|
||||
Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com>
|
||||
---
|
||||
.../gst/matroska/matroska-demux.c | 10 +++++++++-
|
||||
1 file changed, 9 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/gst/matroska/matroska-demux.c b/gst/matroska/matroska-demux.c
|
||||
index 64cc6be60be..01d754c3eb9 100644
|
||||
--- a/gst/matroska/matroska-demux.c
|
||||
+++ b/gst/matroska/matroska-demux.c
|
||||
@@ -3933,7 +3933,8 @@ gst_matroska_demux_add_wvpk_header (GstElement * element,
|
||||
} else {
|
||||
guint8 *outdata = NULL;
|
||||
gsize buf_size, size;
|
||||
- guint32 block_samples, flags, crc, blocksize;
|
||||
+ guint32 block_samples, flags, crc;
|
||||
+ gsize blocksize;
|
||||
GstAdapter *adapter;
|
||||
|
||||
adapter = gst_adapter_new ();
|
||||
@@ -3974,6 +3975,13 @@ gst_matroska_demux_add_wvpk_header (GstElement * element,
|
||||
return GST_FLOW_ERROR;
|
||||
}
|
||||
|
||||
+ if (blocksize > G_MAXSIZE - WAVPACK4_HEADER_SIZE) {
|
||||
+ GST_ERROR_OBJECT (element, "Too big wavpack buffer");
|
||||
+ gst_buffer_unmap (*buf, &map);
|
||||
+ g_object_unref (adapter);
|
||||
+ return GST_FLOW_ERROR;
|
||||
+ }
|
||||
+
|
||||
g_assert (newbuf == NULL);
|
||||
|
||||
newbuf =
|
||||
--
|
||||
GitLab
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
From f503caad676971933dc0b52c4b313e5ef0d6dbb0 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= <sebastian@centricular.com>
|
||||
Date: Wed, 18 May 2022 12:00:48 +0300
|
||||
Subject: [PATCH] avidemux: Fix integer overflow resulting in heap corruption
|
||||
in DIB buffer inversion code
|
||||
|
||||
Check that width*bpp/8 doesn't overflow a guint and also that
|
||||
height*stride fits into the provided buffer without overflowing.
|
||||
|
||||
Thanks to Adam Doupe for analyzing and reporting the issue.
|
||||
|
||||
CVE: CVE-2022-1921
|
||||
|
||||
See https://gstreamer.freedesktop.org/security/sa-2022-0001.html
|
||||
|
||||
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1224
|
||||
|
||||
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2608>
|
||||
|
||||
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/commit/f503caad676971933dc0b52c4b313e5ef0d6dbb0
|
||||
Upstream-Status: Backport
|
||||
Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com>
|
||||
---
|
||||
.../gst/avi/gstavidemux.c | 17 ++++++++++++++---
|
||||
1 file changed, 14 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/gst/avi/gstavidemux.c b/gst/avi/gstavidemux.c
|
||||
index eafe865494c..0d18a6495c7 100644
|
||||
--- a/gst/avi/gstavidemux.c
|
||||
+++ b/gst/avi/gstavidemux.c
|
||||
@@ -4973,8 +4973,8 @@ swap_line (guint8 * d1, guint8 * d2, guint8 * tmp, gint bytes)
|
||||
static GstBuffer *
|
||||
gst_avi_demux_invert (GstAviStream * stream, GstBuffer * buf)
|
||||
{
|
||||
- gint y, w, h;
|
||||
- gint bpp, stride;
|
||||
+ guint y, w, h;
|
||||
+ guint bpp, stride;
|
||||
guint8 *tmp = NULL;
|
||||
GstMapInfo map;
|
||||
guint32 fourcc;
|
||||
@@ -5001,12 +5001,23 @@ gst_avi_demux_invert (GstAviStream * stream, GstBuffer * buf)
|
||||
h = stream->strf.vids->height;
|
||||
w = stream->strf.vids->width;
|
||||
bpp = stream->strf.vids->bit_cnt ? stream->strf.vids->bit_cnt : 8;
|
||||
+
|
||||
+ if ((guint64) w * ((guint64) bpp / 8) > G_MAXUINT - 4) {
|
||||
+ GST_WARNING ("Width x stride overflows");
|
||||
+ return buf;
|
||||
+ }
|
||||
+
|
||||
+ if (w == 0 || h == 0) {
|
||||
+ GST_WARNING ("Zero width or height");
|
||||
+ return buf;
|
||||
+ }
|
||||
+
|
||||
stride = GST_ROUND_UP_4 (w * (bpp / 8));
|
||||
|
||||
buf = gst_buffer_make_writable (buf);
|
||||
|
||||
gst_buffer_map (buf, &map, GST_MAP_READWRITE);
|
||||
- if (map.size < (stride * h)) {
|
||||
+ if (map.size < ((guint64) stride * (guint64) h)) {
|
||||
GST_WARNING ("Buffer is smaller than reported Width x Height x Depth");
|
||||
gst_buffer_unmap (buf, &map);
|
||||
return buf;
|
||||
--
|
||||
GitLab
|
||||
|
||||
@@ -0,0 +1,214 @@
|
||||
From ad6012159acf18c6b5c0f4edf037e8c9a2dbc966 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= <sebastian@centricular.com>
|
||||
Date: Wed, 18 May 2022 11:24:37 +0300
|
||||
Subject: [PATCH] matroskademux: Fix integer overflows in zlib/bz2/etc
|
||||
decompression code
|
||||
|
||||
Various variables were of smaller types than needed and there were no
|
||||
checks for any overflows when doing additions on the sizes. This is all
|
||||
checked now.
|
||||
|
||||
In addition the size of the decompressed data is limited to 120MB now as
|
||||
any larger sizes are likely pathological and we can avoid out of memory
|
||||
situations in many cases like this.
|
||||
|
||||
Also fix a bug where the available output size on the next iteration in
|
||||
the zlib/bz2 decompression code was provided too large and could
|
||||
potentially lead to out of bound writes.
|
||||
|
||||
Thanks to Adam Doupe for analyzing and reporting the issue.
|
||||
|
||||
CVE: CVE-2022-1922, CVE-2022-1923, CVE-2022-1924, CVE-2022-1925
|
||||
|
||||
https://gstreamer.freedesktop.org/security/sa-2022-0002.html
|
||||
|
||||
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1225
|
||||
|
||||
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2610>
|
||||
|
||||
CVE: CVE-2022-1922 CVE-2022-1923 CVE-2022-1924 CVE-2022-1925
|
||||
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/commit/ad6012159acf18c6b5c0f4edf037e8c9a2dbc966
|
||||
Upstream-Status: Backport
|
||||
Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com>
|
||||
---
|
||||
.../gst/matroska/matroska-read-common.c | 76 +++++++++++++++----
|
||||
1 file changed, 61 insertions(+), 15 deletions(-)
|
||||
|
||||
diff --git a/gst/matroska/matroska-read-common.c b/gst/matroska/matroska-read-common.c
|
||||
index eb317644cc5..6fadbba9567 100644
|
||||
--- a/gst/matroska/matroska-read-common.c
|
||||
+++ b/gst/matroska/matroska-read-common.c
|
||||
@@ -70,6 +70,10 @@ typedef struct
|
||||
gboolean audio_only;
|
||||
} TargetTypeContext;
|
||||
|
||||
+/* 120MB as maximum decompressed data size. Anything bigger is likely
|
||||
+ * pathological, and like this we avoid out of memory situations in many cases
|
||||
+ */
|
||||
+#define MAX_DECOMPRESS_SIZE (120 * 1024 * 1024)
|
||||
|
||||
static gboolean
|
||||
gst_matroska_decompress_data (GstMatroskaTrackEncoding * enc,
|
||||
@@ -77,19 +81,23 @@ gst_matroska_decompress_data (GstMatroskaTrackEncoding * enc,
|
||||
GstMatroskaTrackCompressionAlgorithm algo)
|
||||
{
|
||||
guint8 *new_data = NULL;
|
||||
- guint new_size = 0;
|
||||
+ gsize new_size = 0;
|
||||
guint8 *data = *data_out;
|
||||
- guint size = *size_out;
|
||||
+ const gsize size = *size_out;
|
||||
gboolean ret = TRUE;
|
||||
|
||||
+ if (size > G_MAXUINT32) {
|
||||
+ GST_WARNING ("too large compressed data buffer.");
|
||||
+ ret = FALSE;
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
if (algo == GST_MATROSKA_TRACK_COMPRESSION_ALGORITHM_ZLIB) {
|
||||
#ifdef HAVE_ZLIB
|
||||
/* zlib encoded data */
|
||||
z_stream zstream;
|
||||
- guint orig_size;
|
||||
int result;
|
||||
|
||||
- orig_size = size;
|
||||
zstream.zalloc = (alloc_func) 0;
|
||||
zstream.zfree = (free_func) 0;
|
||||
zstream.opaque = (voidpf) 0;
|
||||
@@ -99,8 +107,8 @@ gst_matroska_decompress_data (GstMatroskaTrackEncoding * enc,
|
||||
goto out;
|
||||
}
|
||||
zstream.next_in = (Bytef *) data;
|
||||
- zstream.avail_in = orig_size;
|
||||
- new_size = orig_size;
|
||||
+ zstream.avail_in = size;
|
||||
+ new_size = size;
|
||||
new_data = g_malloc (new_size);
|
||||
zstream.avail_out = new_size;
|
||||
zstream.next_out = (Bytef *) new_data;
|
||||
@@ -114,10 +122,18 @@ gst_matroska_decompress_data (GstMatroskaTrackEncoding * enc,
|
||||
break;
|
||||
}
|
||||
|
||||
+ if (new_size > G_MAXSIZE - 4096 || new_size + 4096 > MAX_DECOMPRESS_SIZE) {
|
||||
+ GST_WARNING ("too big decompressed data");
|
||||
+ result = Z_MEM_ERROR;
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
new_size += 4096;
|
||||
new_data = g_realloc (new_data, new_size);
|
||||
zstream.next_out = (Bytef *) (new_data + zstream.total_out);
|
||||
- zstream.avail_out += 4096;
|
||||
+ /* avail_out is an unsigned int */
|
||||
+ g_assert (new_size - zstream.total_out <= G_MAXUINT);
|
||||
+ zstream.avail_out = new_size - zstream.total_out;
|
||||
} while (zstream.avail_in > 0);
|
||||
|
||||
if (result != Z_STREAM_END) {
|
||||
@@ -137,13 +153,11 @@ gst_matroska_decompress_data (GstMatroskaTrackEncoding * enc,
|
||||
#ifdef HAVE_BZ2
|
||||
/* bzip2 encoded data */
|
||||
bz_stream bzstream;
|
||||
- guint orig_size;
|
||||
int result;
|
||||
|
||||
bzstream.bzalloc = NULL;
|
||||
bzstream.bzfree = NULL;
|
||||
bzstream.opaque = NULL;
|
||||
- orig_size = size;
|
||||
|
||||
if (BZ2_bzDecompressInit (&bzstream, 0, 0) != BZ_OK) {
|
||||
GST_WARNING ("bzip2 initialization failed.");
|
||||
@@ -152,8 +166,8 @@ gst_matroska_decompress_data (GstMatroskaTrackEncoding * enc,
|
||||
}
|
||||
|
||||
bzstream.next_in = (char *) data;
|
||||
- bzstream.avail_in = orig_size;
|
||||
- new_size = orig_size;
|
||||
+ bzstream.avail_in = size;
|
||||
+ new_size = size;
|
||||
new_data = g_malloc (new_size);
|
||||
bzstream.avail_out = new_size;
|
||||
bzstream.next_out = (char *) new_data;
|
||||
@@ -167,17 +181,31 @@ gst_matroska_decompress_data (GstMatroskaTrackEncoding * enc,
|
||||
break;
|
||||
}
|
||||
|
||||
+ if (new_size > G_MAXSIZE - 4096 || new_size + 4096 > MAX_DECOMPRESS_SIZE) {
|
||||
+ GST_WARNING ("too big decompressed data");
|
||||
+ result = BZ_MEM_ERROR;
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
new_size += 4096;
|
||||
new_data = g_realloc (new_data, new_size);
|
||||
- bzstream.next_out = (char *) (new_data + bzstream.total_out_lo32);
|
||||
- bzstream.avail_out += 4096;
|
||||
+ bzstream.next_out =
|
||||
+ (char *) (new_data + ((guint64) bzstream.total_out_hi32 << 32) +
|
||||
+ bzstream.total_out_lo32);
|
||||
+ /* avail_out is an unsigned int */
|
||||
+ g_assert (new_size - ((guint64) bzstream.total_out_hi32 << 32) +
|
||||
+ bzstream.total_out_lo32 <= G_MAXUINT);
|
||||
+ bzstream.avail_out =
|
||||
+ new_size - ((guint64) bzstream.total_out_hi32 << 32) +
|
||||
+ bzstream.total_out_lo32;
|
||||
} while (bzstream.avail_in > 0);
|
||||
|
||||
if (result != BZ_STREAM_END) {
|
||||
ret = FALSE;
|
||||
g_free (new_data);
|
||||
} else {
|
||||
- new_size = bzstream.total_out_lo32;
|
||||
+ new_size =
|
||||
+ ((guint64) bzstream.total_out_hi32 << 32) + bzstream.total_out_lo32;
|
||||
}
|
||||
BZ2_bzDecompressEnd (&bzstream);
|
||||
|
||||
@@ -189,7 +217,13 @@ gst_matroska_decompress_data (GstMatroskaTrackEncoding * enc,
|
||||
} else if (algo == GST_MATROSKA_TRACK_COMPRESSION_ALGORITHM_LZO1X) {
|
||||
/* lzo encoded data */
|
||||
int result;
|
||||
- int orig_size, out_size;
|
||||
+ gint orig_size, out_size;
|
||||
+
|
||||
+ if (size > G_MAXINT) {
|
||||
+ GST_WARNING ("too large compressed data buffer.");
|
||||
+ ret = FALSE;
|
||||
+ goto out;
|
||||
+ }
|
||||
|
||||
orig_size = size;
|
||||
out_size = size;
|
||||
@@ -203,6 +237,11 @@ gst_matroska_decompress_data (GstMatroskaTrackEncoding * enc,
|
||||
result = lzo1x_decode (new_data, &out_size, data, &orig_size);
|
||||
|
||||
if (orig_size > 0) {
|
||||
+ if (new_size > G_MAXINT - 4096 || new_size + 4096 > MAX_DECOMPRESS_SIZE) {
|
||||
+ GST_WARNING ("too big decompressed data");
|
||||
+ result = LZO_ERROR;
|
||||
+ break;
|
||||
+ }
|
||||
new_size += 4096;
|
||||
new_data = g_realloc (new_data, new_size);
|
||||
}
|
||||
@@ -221,6 +260,13 @@ gst_matroska_decompress_data (GstMatroskaTrackEncoding * enc,
|
||||
} else if (algo == GST_MATROSKA_TRACK_COMPRESSION_ALGORITHM_HEADERSTRIP) {
|
||||
/* header stripped encoded data */
|
||||
if (enc->comp_settings_length > 0) {
|
||||
+ if (size > G_MAXSIZE - enc->comp_settings_length
|
||||
+ || size + enc->comp_settings_length > MAX_DECOMPRESS_SIZE) {
|
||||
+ GST_WARNING ("too big decompressed data");
|
||||
+ ret = FALSE;
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
new_data = g_malloc (size + enc->comp_settings_length);
|
||||
new_size = size + enc->comp_settings_length;
|
||||
|
||||
--
|
||||
GitLab
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
From 14d306da6da51a762c4dc701d161bb52ab66d774 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= <sebastian@centricular.com>
|
||||
Date: Mon, 30 May 2022 10:15:37 +0300
|
||||
Subject: [PATCH] qtdemux: Fix integer overflows in zlib decompression code
|
||||
|
||||
Various variables were of smaller types than needed and there were no
|
||||
checks for any overflows when doing additions on the sizes. This is all
|
||||
checked now.
|
||||
|
||||
In addition the size of the decompressed data is limited to 200MB now as
|
||||
any larger sizes are likely pathological and we can avoid out of memory
|
||||
situations in many cases like this.
|
||||
|
||||
Also fix a bug where the available output size on the next iteration in
|
||||
the zlib decompression code was provided too large and could
|
||||
potentially lead to out of bound writes.
|
||||
|
||||
Thanks to Adam Doupe for analyzing and reporting the issue.
|
||||
|
||||
CVE: tbd
|
||||
|
||||
https://gstreamer.freedesktop.org/security/sa-2022-0003.html
|
||||
|
||||
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1225
|
||||
|
||||
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2610>
|
||||
|
||||
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/commit/14d306da6da51a762c4dc701d161bb52ab66d774
|
||||
CVE: CVE-2022-2122
|
||||
Upstream-Status: Backport
|
||||
Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com>
|
||||
---
|
||||
gst/isomp4/qtdemux.c | 8 +++++++-
|
||||
1 file changed, 7 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/gst/isomp4/qtdemux.c b/gst/isomp4/qtdemux.c
|
||||
index 7cc346b1e63..97ba0799a8d 100644
|
||||
--- a/gst/isomp4/qtdemux.c
|
||||
+++ b/gst/isomp4/qtdemux.c
|
||||
@@ -7905,10 +7905,16 @@ qtdemux_inflate (void *z_buffer, guint z_length, guint * length)
|
||||
break;
|
||||
}
|
||||
|
||||
+ if (*length > G_MAXUINT - 4096 || *length > QTDEMUX_MAX_SAMPLE_INDEX_SIZE) {
|
||||
+ GST_WARNING ("too big decompressed data");
|
||||
+ ret = Z_MEM_ERROR;
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
*length += 4096;
|
||||
buffer = (guint8 *) g_realloc (buffer, *length);
|
||||
z.next_out = (Bytef *) (buffer + z.total_out);
|
||||
- z.avail_out += 4096;
|
||||
+ z.avail_out += *length - z.total_out;
|
||||
} while (z.avail_in > 0);
|
||||
|
||||
if (ret != Z_STREAM_END) {
|
||||
--
|
||||
GitLab
|
||||
|
||||
@@ -10,6 +10,10 @@ SRC_URI = " \
|
||||
file://0001-qt-include-ext-qt-gstqtgl.h-instead-of-gst-gl-gstglf.patch \
|
||||
file://CVE-2021-3497.patch \
|
||||
file://CVE-2021-3498.patch \
|
||||
file://CVE-2022-1920.patch \
|
||||
file://CVE-2022-1921.patch \
|
||||
file://CVE-2022-1922-1923-1924-1925.patch \
|
||||
file://CVE-2022-2122.patch \
|
||||
"
|
||||
|
||||
SRC_URI[md5sum] = "c79b6c2f8eaadb2bb66615b694db399e"
|
||||
|
||||
@@ -83,5 +83,12 @@ CVE_CHECK_WHITELIST += "CVE-2021-3522"
|
||||
# so we need to ignore the false hits
|
||||
CVE_CHECK_WHITELIST += "CVE-2021-3497"
|
||||
CVE_CHECK_WHITELIST += "CVE-2021-3498"
|
||||
CVE_CHECK_WHITELIST += "CVE-2022-1920"
|
||||
CVE_CHECK_WHITELIST += "CVE-2022-1921"
|
||||
CVE_CHECK_WHITELIST += "CVE-2022-1922"
|
||||
CVE_CHECK_WHITELIST += "CVE-2022-1923"
|
||||
CVE_CHECK_WHITELIST += "CVE-2022-1924"
|
||||
CVE_CHECK_WHITELIST += "CVE-2022-1925"
|
||||
CVE_CHECK_WHITELIST += "CVE-2022-2122"
|
||||
|
||||
require gstreamer1.0-ptest.inc
|
||||
|
||||
@@ -0,0 +1,159 @@
|
||||
From 07d79fcac2ead271b60e32aeb80f7b4f3be9ac8c Mon Sep 17 00:00:00 2001
|
||||
From: Su Laus <sulau@freenet.de>
|
||||
Date: Wed, 9 Feb 2022 21:31:29 +0000
|
||||
Subject: [PATCH] tiffcrop.c: Fix issue #352 heap-buffer-overflow by correcting
|
||||
uint32_t underflow.
|
||||
|
||||
CVE: CVE-2022-2867 CVE-2022-2868 CVE-2022-2869
|
||||
Upstream-Status: Backport [https://gitlab.com/libtiff/libtiff/-/commit/07d79fcac2ead271b60e32aeb80f7b4f3be9ac8c]
|
||||
Signed-off-by: Virendra Thakur <virendrak@kpit.com>
|
||||
---
|
||||
Index: tiff-4.1.0/tools/tiffcrop.c
|
||||
===================================================================
|
||||
--- tiff-4.1.0.orig/tools/tiffcrop.c
|
||||
+++ tiff-4.1.0/tools/tiffcrop.c
|
||||
@@ -5153,29 +5153,45 @@ computeInputPixelOffsets(struct crop_mas
|
||||
y1 = _TIFFClampDoubleToUInt32(crop->corners[i].Y1);
|
||||
y2 = _TIFFClampDoubleToUInt32(crop->corners[i].Y2);
|
||||
}
|
||||
- if (x1 < 1)
|
||||
- crop->regionlist[i].x1 = 0;
|
||||
- else
|
||||
- crop->regionlist[i].x1 = (uint32) (x1 - 1);
|
||||
+ /* a) Region needs to be within image sizes 0.. width-1; 0..length-1
|
||||
+ * b) Corners are expected to be submitted as top-left to bottom-right.
|
||||
+ * Therefore, check that and reorder input.
|
||||
+ * (be aware x,y are already casted to (uint32_t) and avoid (0 - 1) )
|
||||
+ */
|
||||
+ uint32_t aux;
|
||||
+ if (x1 > x2) {
|
||||
+ aux = x1;
|
||||
+ x1 = x2;
|
||||
+ x2 = aux;
|
||||
+ }
|
||||
+ if (y1 > y2) {
|
||||
+ aux = y1;
|
||||
+ y1 = y2;
|
||||
+ y2 = aux;
|
||||
+ }
|
||||
+ if (x1 > image->width - 1)
|
||||
+ crop->regionlist[i].x1 = image->width - 1;
|
||||
+ else if (x1 > 0)
|
||||
+ crop->regionlist[i].x1 = (uint32_t)(x1 - 1);
|
||||
|
||||
if (x2 > image->width - 1)
|
||||
crop->regionlist[i].x2 = image->width - 1;
|
||||
- else
|
||||
- crop->regionlist[i].x2 = (uint32) (x2 - 1);
|
||||
- zwidth = crop->regionlist[i].x2 - crop->regionlist[i].x1 + 1;
|
||||
-
|
||||
- if (y1 < 1)
|
||||
- crop->regionlist[i].y1 = 0;
|
||||
- else
|
||||
- crop->regionlist[i].y1 = (uint32) (y1 - 1);
|
||||
+ else if (x2 > 0)
|
||||
+ crop->regionlist[i].x2 = (uint32_t)(x2 - 1);
|
||||
+
|
||||
+ zwidth = crop->regionlist[i].x2 - crop->regionlist[i].x1 + 1;
|
||||
+
|
||||
+ if (y1 > image->length - 1)
|
||||
+ crop->regionlist[i].y1 = image->length - 1;
|
||||
+ else if (y1 > 0)
|
||||
+ crop->regionlist[i].y1 = (uint32_t)(y1 - 1);
|
||||
|
||||
if (y2 > image->length - 1)
|
||||
crop->regionlist[i].y2 = image->length - 1;
|
||||
- else
|
||||
- crop->regionlist[i].y2 = (uint32) (y2 - 1);
|
||||
-
|
||||
- zlength = crop->regionlist[i].y2 - crop->regionlist[i].y1 + 1;
|
||||
+ else if (y2 > 0)
|
||||
+ crop->regionlist[i].y2 = (uint32_t)(y2 - 1);
|
||||
|
||||
+ zlength = crop->regionlist[i].y2 - crop->regionlist[i].y1 + 1;
|
||||
if (zwidth > max_width)
|
||||
max_width = zwidth;
|
||||
if (zlength > max_length)
|
||||
@@ -5205,7 +5221,7 @@ computeInputPixelOffsets(struct crop_mas
|
||||
}
|
||||
}
|
||||
return (0);
|
||||
- }
|
||||
+ } /* crop_mode == CROP_REGIONS */
|
||||
|
||||
/* Convert crop margins into offsets into image
|
||||
* Margins are expressed as pixel rows and columns, not bytes
|
||||
@@ -5241,7 +5257,7 @@ computeInputPixelOffsets(struct crop_mas
|
||||
bmargin = (uint32) 0;
|
||||
return (-1);
|
||||
}
|
||||
- }
|
||||
+ } /* crop_mode == CROP_MARGINS */
|
||||
else
|
||||
{ /* no margins requested */
|
||||
tmargin = (uint32) 0;
|
||||
@@ -5332,24 +5348,23 @@ computeInputPixelOffsets(struct crop_mas
|
||||
off->endx = endx;
|
||||
off->endy = endy;
|
||||
|
||||
- crop_width = endx - startx + 1;
|
||||
- crop_length = endy - starty + 1;
|
||||
-
|
||||
- if (crop_width <= 0)
|
||||
+ if (endx + 1 <= startx)
|
||||
{
|
||||
TIFFError("computeInputPixelOffsets",
|
||||
"Invalid left/right margins and /or image crop width requested");
|
||||
return (-1);
|
||||
}
|
||||
+ crop_width = endx - startx + 1;
|
||||
if (crop_width > image->width)
|
||||
crop_width = image->width;
|
||||
|
||||
- if (crop_length <= 0)
|
||||
+ if (endy + 1 <= starty)
|
||||
{
|
||||
TIFFError("computeInputPixelOffsets",
|
||||
"Invalid top/bottom margins and /or image crop length requested");
|
||||
return (-1);
|
||||
}
|
||||
+ crop_length = endy - starty + 1;
|
||||
if (crop_length > image->length)
|
||||
crop_length = image->length;
|
||||
|
||||
@@ -5449,10 +5464,17 @@ getCropOffsets(struct image_data *image,
|
||||
else
|
||||
crop->selections = crop->zones;
|
||||
|
||||
- for (i = 0; i < crop->zones; i++)
|
||||
+ /* Initialize regions iterator i */
|
||||
+ i = 0;
|
||||
+ for (int j = 0; j < crop->zones; j++)
|
||||
{
|
||||
- seg = crop->zonelist[i].position;
|
||||
- total = crop->zonelist[i].total;
|
||||
+ seg = crop->zonelist[j].position;
|
||||
+ total = crop->zonelist[j].total;
|
||||
+
|
||||
+ /* check for not allowed zone cases like 0:0; 4:3; etc. and skip that input */
|
||||
+ if (seg == 0 || total == 0 || seg > total) {
|
||||
+ continue;
|
||||
+ }
|
||||
|
||||
switch (crop->edge_ref)
|
||||
{
|
||||
@@ -5581,8 +5603,11 @@ getCropOffsets(struct image_data *image,
|
||||
i + 1, (uint32)zwidth, (uint32)zlength,
|
||||
crop->regionlist[i].x1, crop->regionlist[i].x2,
|
||||
crop->regionlist[i].y1, crop->regionlist[i].y2);
|
||||
+ /* increment regions iterator */
|
||||
+ i++;
|
||||
}
|
||||
-
|
||||
+ /* set number of generated regions out of given zones */
|
||||
+ crop->selections = i;
|
||||
return (0);
|
||||
} /* end getCropOffsets */
|
||||
|
||||
--
|
||||
GitLab
|
||||
29
meta/recipes-multimedia/libtiff/files/CVE-2022-34526.patch
Normal file
29
meta/recipes-multimedia/libtiff/files/CVE-2022-34526.patch
Normal file
@@ -0,0 +1,29 @@
|
||||
From 06386cc9dff5dc162006abe11fd4d1a6fad616cc Mon Sep 17 00:00:00 2001
|
||||
From: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
Date: Thu, 18 Aug 2022 09:40:50 +0530
|
||||
Subject: [PATCH] CVE-2022-34526
|
||||
|
||||
Upstream-Status: Backport [https://gitlab.com/libtiff/libtiff/-/commit/275735d0354e39c0ac1dc3c0db2120d6f31d1990]
|
||||
CVE: CVE-2022-34526
|
||||
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
---
|
||||
libtiff/tif_dirinfo.c | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/libtiff/tif_dirinfo.c b/libtiff/tif_dirinfo.c
|
||||
index 52d53d4..4a1ca00 100644
|
||||
--- a/libtiff/tif_dirinfo.c
|
||||
+++ b/libtiff/tif_dirinfo.c
|
||||
@@ -983,6 +983,9 @@ _TIFFCheckFieldIsValidForCodec(TIFF *tif, ttag_t tag)
|
||||
default:
|
||||
return 1;
|
||||
}
|
||||
+ if( !TIFFIsCODECConfigured(tif->tif_dir.td_compression) ) {
|
||||
+ return 0;
|
||||
+ }
|
||||
/* Check if codec specific tags are allowed for the current
|
||||
* compression scheme (codec) */
|
||||
switch (tif->tif_dir.td_compression) {
|
||||
--
|
||||
2.25.1
|
||||
|
||||
212
meta/recipes-multimedia/libtiff/tiff/CVE-2022-1354.patch
Normal file
212
meta/recipes-multimedia/libtiff/tiff/CVE-2022-1354.patch
Normal file
@@ -0,0 +1,212 @@
|
||||
From 87881e093691a35c60b91cafed058ba2dd5d9807 Mon Sep 17 00:00:00 2001
|
||||
From: Even Rouault <even.rouault@spatialys.com>
|
||||
Date: Sun, 5 Dec 2021 14:37:46 +0100
|
||||
Subject: [PATCH] TIFFReadDirectory: fix OJPEG hack (fixes #319)
|
||||
|
||||
to avoid having the size of the strip arrays inconsistent with the
|
||||
number of strips returned by TIFFNumberOfStrips(), which may cause
|
||||
out-ouf-bounds array read afterwards.
|
||||
|
||||
One of the OJPEG hack that alters SamplesPerPixel may influence the
|
||||
number of strips. Hence compute tif_dir.td_nstrips only afterwards.
|
||||
|
||||
CVE: CVE-2022-1354
|
||||
|
||||
Upstream-Status: Backport
|
||||
[https://gitlab.com/libtiff/libtiff/-/commit/87f580f39011109b3bb5f6eca13fac543a542798]
|
||||
|
||||
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
|
||||
---
|
||||
libtiff/tif_dirread.c | 162 ++++++++++++++++++++++--------------------
|
||||
1 file changed, 83 insertions(+), 79 deletions(-)
|
||||
|
||||
diff --git a/libtiff/tif_dirread.c b/libtiff/tif_dirread.c
|
||||
index 8f434ef5..14c031d1 100644
|
||||
--- a/libtiff/tif_dirread.c
|
||||
+++ b/libtiff/tif_dirread.c
|
||||
@@ -3794,50 +3794,7 @@ TIFFReadDirectory(TIFF* tif)
|
||||
MissingRequired(tif,"ImageLength");
|
||||
goto bad;
|
||||
}
|
||||
- /*
|
||||
- * Setup appropriate structures (by strip or by tile)
|
||||
- */
|
||||
- if (!TIFFFieldSet(tif, FIELD_TILEDIMENSIONS)) {
|
||||
- tif->tif_dir.td_nstrips = TIFFNumberOfStrips(tif);
|
||||
- tif->tif_dir.td_tilewidth = tif->tif_dir.td_imagewidth;
|
||||
- tif->tif_dir.td_tilelength = tif->tif_dir.td_rowsperstrip;
|
||||
- tif->tif_dir.td_tiledepth = tif->tif_dir.td_imagedepth;
|
||||
- tif->tif_flags &= ~TIFF_ISTILED;
|
||||
- } else {
|
||||
- tif->tif_dir.td_nstrips = TIFFNumberOfTiles(tif);
|
||||
- tif->tif_flags |= TIFF_ISTILED;
|
||||
- }
|
||||
- if (!tif->tif_dir.td_nstrips) {
|
||||
- TIFFErrorExt(tif->tif_clientdata, module,
|
||||
- "Cannot handle zero number of %s",
|
||||
- isTiled(tif) ? "tiles" : "strips");
|
||||
- goto bad;
|
||||
- }
|
||||
- tif->tif_dir.td_stripsperimage = tif->tif_dir.td_nstrips;
|
||||
- if (tif->tif_dir.td_planarconfig == PLANARCONFIG_SEPARATE)
|
||||
- tif->tif_dir.td_stripsperimage /= tif->tif_dir.td_samplesperpixel;
|
||||
- if (!TIFFFieldSet(tif, FIELD_STRIPOFFSETS)) {
|
||||
-#ifdef OJPEG_SUPPORT
|
||||
- if ((tif->tif_dir.td_compression==COMPRESSION_OJPEG) &&
|
||||
- (isTiled(tif)==0) &&
|
||||
- (tif->tif_dir.td_nstrips==1)) {
|
||||
- /*
|
||||
- * XXX: OJPEG hack.
|
||||
- * If a) compression is OJPEG, b) it's not a tiled TIFF,
|
||||
- * and c) the number of strips is 1,
|
||||
- * then we tolerate the absence of stripoffsets tag,
|
||||
- * because, presumably, all required data is in the
|
||||
- * JpegInterchangeFormat stream.
|
||||
- */
|
||||
- TIFFSetFieldBit(tif, FIELD_STRIPOFFSETS);
|
||||
- } else
|
||||
-#endif
|
||||
- {
|
||||
- MissingRequired(tif,
|
||||
- isTiled(tif) ? "TileOffsets" : "StripOffsets");
|
||||
- goto bad;
|
||||
- }
|
||||
- }
|
||||
+
|
||||
/*
|
||||
* Second pass: extract other information.
|
||||
*/
|
||||
@@ -4042,41 +3999,6 @@ TIFFReadDirectory(TIFF* tif)
|
||||
} /* -- if (!dp->tdir_ignore) */
|
||||
} /* -- for-loop -- */
|
||||
|
||||
- if( tif->tif_mode == O_RDWR &&
|
||||
- tif->tif_dir.td_stripoffset_entry.tdir_tag != 0 &&
|
||||
- tif->tif_dir.td_stripoffset_entry.tdir_count == 0 &&
|
||||
- tif->tif_dir.td_stripoffset_entry.tdir_type == 0 &&
|
||||
- tif->tif_dir.td_stripoffset_entry.tdir_offset.toff_long8 == 0 &&
|
||||
- tif->tif_dir.td_stripbytecount_entry.tdir_tag != 0 &&
|
||||
- tif->tif_dir.td_stripbytecount_entry.tdir_count == 0 &&
|
||||
- tif->tif_dir.td_stripbytecount_entry.tdir_type == 0 &&
|
||||
- tif->tif_dir.td_stripbytecount_entry.tdir_offset.toff_long8 == 0 )
|
||||
- {
|
||||
- /* Directory typically created with TIFFDeferStrileArrayWriting() */
|
||||
- TIFFSetupStrips(tif);
|
||||
- }
|
||||
- else if( !(tif->tif_flags&TIFF_DEFERSTRILELOAD) )
|
||||
- {
|
||||
- if( tif->tif_dir.td_stripoffset_entry.tdir_tag != 0 )
|
||||
- {
|
||||
- if (!TIFFFetchStripThing(tif,&(tif->tif_dir.td_stripoffset_entry),
|
||||
- tif->tif_dir.td_nstrips,
|
||||
- &tif->tif_dir.td_stripoffset_p))
|
||||
- {
|
||||
- goto bad;
|
||||
- }
|
||||
- }
|
||||
- if( tif->tif_dir.td_stripbytecount_entry.tdir_tag != 0 )
|
||||
- {
|
||||
- if (!TIFFFetchStripThing(tif,&(tif->tif_dir.td_stripbytecount_entry),
|
||||
- tif->tif_dir.td_nstrips,
|
||||
- &tif->tif_dir.td_stripbytecount_p))
|
||||
- {
|
||||
- goto bad;
|
||||
- }
|
||||
- }
|
||||
- }
|
||||
-
|
||||
/*
|
||||
* OJPEG hack:
|
||||
* - If a) compression is OJPEG, and b) photometric tag is missing,
|
||||
@@ -4147,6 +4069,88 @@ TIFFReadDirectory(TIFF* tif)
|
||||
}
|
||||
}
|
||||
|
||||
+ /*
|
||||
+ * Setup appropriate structures (by strip or by tile)
|
||||
+ * We do that only after the above OJPEG hack which alters SamplesPerPixel
|
||||
+ * and thus influences the number of strips in the separate planarconfig.
|
||||
+ */
|
||||
+ if (!TIFFFieldSet(tif, FIELD_TILEDIMENSIONS)) {
|
||||
+ tif->tif_dir.td_nstrips = TIFFNumberOfStrips(tif);
|
||||
+ tif->tif_dir.td_tilewidth = tif->tif_dir.td_imagewidth;
|
||||
+ tif->tif_dir.td_tilelength = tif->tif_dir.td_rowsperstrip;
|
||||
+ tif->tif_dir.td_tiledepth = tif->tif_dir.td_imagedepth;
|
||||
+ tif->tif_flags &= ~TIFF_ISTILED;
|
||||
+ } else {
|
||||
+ tif->tif_dir.td_nstrips = TIFFNumberOfTiles(tif);
|
||||
+ tif->tif_flags |= TIFF_ISTILED;
|
||||
+ }
|
||||
+ if (!tif->tif_dir.td_nstrips) {
|
||||
+ TIFFErrorExt(tif->tif_clientdata, module,
|
||||
+ "Cannot handle zero number of %s",
|
||||
+ isTiled(tif) ? "tiles" : "strips");
|
||||
+ goto bad;
|
||||
+ }
|
||||
+ tif->tif_dir.td_stripsperimage = tif->tif_dir.td_nstrips;
|
||||
+ if (tif->tif_dir.td_planarconfig == PLANARCONFIG_SEPARATE)
|
||||
+ tif->tif_dir.td_stripsperimage /= tif->tif_dir.td_samplesperpixel;
|
||||
+ if (!TIFFFieldSet(tif, FIELD_STRIPOFFSETS)) {
|
||||
+#ifdef OJPEG_SUPPORT
|
||||
+ if ((tif->tif_dir.td_compression==COMPRESSION_OJPEG) &&
|
||||
+ (isTiled(tif)==0) &&
|
||||
+ (tif->tif_dir.td_nstrips==1)) {
|
||||
+ /*
|
||||
+ * XXX: OJPEG hack.
|
||||
+ * If a) compression is OJPEG, b) it's not a tiled TIFF,
|
||||
+ * and c) the number of strips is 1,
|
||||
+ * then we tolerate the absence of stripoffsets tag,
|
||||
+ * because, presumably, all required data is in the
|
||||
+ * JpegInterchangeFormat stream.
|
||||
+ */
|
||||
+ TIFFSetFieldBit(tif, FIELD_STRIPOFFSETS);
|
||||
+ } else
|
||||
+#endif
|
||||
+ {
|
||||
+ MissingRequired(tif,
|
||||
+ isTiled(tif) ? "TileOffsets" : "StripOffsets");
|
||||
+ goto bad;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if( tif->tif_mode == O_RDWR &&
|
||||
+ tif->tif_dir.td_stripoffset_entry.tdir_tag != 0 &&
|
||||
+ tif->tif_dir.td_stripoffset_entry.tdir_count == 0 &&
|
||||
+ tif->tif_dir.td_stripoffset_entry.tdir_type == 0 &&
|
||||
+ tif->tif_dir.td_stripoffset_entry.tdir_offset.toff_long8 == 0 &&
|
||||
+ tif->tif_dir.td_stripbytecount_entry.tdir_tag != 0 &&
|
||||
+ tif->tif_dir.td_stripbytecount_entry.tdir_count == 0 &&
|
||||
+ tif->tif_dir.td_stripbytecount_entry.tdir_type == 0 &&
|
||||
+ tif->tif_dir.td_stripbytecount_entry.tdir_offset.toff_long8 == 0 )
|
||||
+ {
|
||||
+ /* Directory typically created with TIFFDeferStrileArrayWriting() */
|
||||
+ TIFFSetupStrips(tif);
|
||||
+ }
|
||||
+ else if( !(tif->tif_flags&TIFF_DEFERSTRILELOAD) )
|
||||
+ {
|
||||
+ if( tif->tif_dir.td_stripoffset_entry.tdir_tag != 0 )
|
||||
+ {
|
||||
+ if (!TIFFFetchStripThing(tif,&(tif->tif_dir.td_stripoffset_entry),
|
||||
+ tif->tif_dir.td_nstrips,
|
||||
+ &tif->tif_dir.td_stripoffset_p))
|
||||
+ {
|
||||
+ goto bad;
|
||||
+ }
|
||||
+ }
|
||||
+ if( tif->tif_dir.td_stripbytecount_entry.tdir_tag != 0 )
|
||||
+ {
|
||||
+ if (!TIFFFetchStripThing(tif,&(tif->tif_dir.td_stripbytecount_entry),
|
||||
+ tif->tif_dir.td_nstrips,
|
||||
+ &tif->tif_dir.td_stripbytecount_p))
|
||||
+ {
|
||||
+ goto bad;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
/*
|
||||
* Make sure all non-color channels are extrasamples.
|
||||
* If it's not the case, define them as such.
|
||||
--
|
||||
2.25.1
|
||||
|
||||
62
meta/recipes-multimedia/libtiff/tiff/CVE-2022-1355.patch
Normal file
62
meta/recipes-multimedia/libtiff/tiff/CVE-2022-1355.patch
Normal file
@@ -0,0 +1,62 @@
|
||||
From fb1db384959698edd6caeea84e28253d272a0f96 Mon Sep 17 00:00:00 2001
|
||||
From: Su_Laus <sulau@freenet.de>
|
||||
Date: Sat, 2 Apr 2022 22:33:31 +0200
|
||||
Subject: [PATCH] tiffcp: avoid buffer overflow in "mode" string (fixes #400)
|
||||
|
||||
CVE: CVE-2022-1355
|
||||
|
||||
Upstream-Status: Backport
|
||||
[https://gitlab.com/libtiff/libtiff/-/commit/c1ae29f9ebacd29b7c3e0c7db671af7db3584bc2]
|
||||
|
||||
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
|
||||
---
|
||||
tools/tiffcp.c | 25 ++++++++++++++++++++-----
|
||||
1 file changed, 20 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/tools/tiffcp.c b/tools/tiffcp.c
|
||||
index fd129bb7..8d944ff6 100644
|
||||
--- a/tools/tiffcp.c
|
||||
+++ b/tools/tiffcp.c
|
||||
@@ -274,19 +274,34 @@ main(int argc, char* argv[])
|
||||
deftilewidth = atoi(optarg);
|
||||
break;
|
||||
case 'B':
|
||||
- *mp++ = 'b'; *mp = '\0';
|
||||
+ if (strlen(mode) < (sizeof(mode) - 1))
|
||||
+ {
|
||||
+ *mp++ = 'b'; *mp = '\0';
|
||||
+ }
|
||||
break;
|
||||
case 'L':
|
||||
- *mp++ = 'l'; *mp = '\0';
|
||||
+ if (strlen(mode) < (sizeof(mode) - 1))
|
||||
+ {
|
||||
+ *mp++ = 'l'; *mp = '\0';
|
||||
+ }
|
||||
break;
|
||||
case 'M':
|
||||
- *mp++ = 'm'; *mp = '\0';
|
||||
+ if (strlen(mode) < (sizeof(mode) - 1))
|
||||
+ {
|
||||
+ *mp++ = 'm'; *mp = '\0';
|
||||
+ }
|
||||
break;
|
||||
case 'C':
|
||||
- *mp++ = 'c'; *mp = '\0';
|
||||
+ if (strlen(mode) < (sizeof(mode) - 1))
|
||||
+ {
|
||||
+ *mp++ = 'c'; *mp = '\0';
|
||||
+ }
|
||||
break;
|
||||
case '8':
|
||||
- *mp++ = '8'; *mp = '\0';
|
||||
+ if (strlen(mode) < (sizeof(mode)-1))
|
||||
+ {
|
||||
+ *mp++ = '8'; *mp = '\0';
|
||||
+ }
|
||||
break;
|
||||
case 'x':
|
||||
pageInSeq = 1;
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@@ -25,6 +25,10 @@ SRC_URI = "http://download.osgeo.org/libtiff/tiff-${PV}.tar.gz \
|
||||
file://CVE-2022-0891.patch \
|
||||
file://CVE-2022-0924.patch \
|
||||
file://CVE-2022-2056-CVE-2022-2057-CVE-2022-2058.patch \
|
||||
file://CVE-2022-34526.patch \
|
||||
file://CVE-2022-2867-CVE-2022-2868-CVE-2022-2869.patch \
|
||||
file://CVE-2022-1354.patch \
|
||||
file://CVE-2022-1355.patch \
|
||||
"
|
||||
SRC_URI[md5sum] = "2165e7aba557463acc0664e71a3ed424"
|
||||
SRC_URI[sha256sum] = "5d29f32517dadb6dbcd1255ea5bbc93a2b54b94fbf83653b4d65c7d6775b8634"
|
||||
|
||||
72
meta/recipes-support/curl/curl/CVE-2022-35252.patch
Normal file
72
meta/recipes-support/curl/curl/CVE-2022-35252.patch
Normal file
@@ -0,0 +1,72 @@
|
||||
From c9212bdb21f0cc90a1a60dfdbb716deefe78fd40 Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Stenberg <daniel@haxx.se>
|
||||
Date: Mon, 29 Aug 2022 00:09:17 +0200
|
||||
Subject: [PATCH] cookie: reject cookies with "control bytes"
|
||||
|
||||
Rejects 0x01 - 0x1f (except 0x09) plus 0x7f
|
||||
|
||||
Reported-by: Axel Chong
|
||||
|
||||
Bug: https://curl.se/docs/CVE-2022-35252.html
|
||||
|
||||
CVE-2022-35252
|
||||
|
||||
Closes #9381
|
||||
|
||||
Upstream-Status: Backport [https://github.com/curl/curl/commit/8dfc93e573ca740544a2d79ebb]
|
||||
|
||||
Signed-off-by: Robert Joslyn <robert.joslyn@redrectangle.org>
|
||||
---
|
||||
lib/cookie.c | 29 +++++++++++++++++++++++++++++
|
||||
1 file changed, 29 insertions(+)
|
||||
|
||||
diff --git a/lib/cookie.c b/lib/cookie.c
|
||||
index a9ad20a..66c7715 100644
|
||||
--- a/lib/cookie.c
|
||||
+++ b/lib/cookie.c
|
||||
@@ -412,6 +412,30 @@ static bool bad_domain(const char *domain)
|
||||
return !strchr(domain, '.') && !strcasecompare(domain, "localhost");
|
||||
}
|
||||
|
||||
+/*
|
||||
+ RFC 6265 section 4.1.1 says a server should accept this range:
|
||||
+
|
||||
+ cookie-octet = %x21 / %x23-2B / %x2D-3A / %x3C-5B / %x5D-7E
|
||||
+
|
||||
+ But Firefox and Chrome as of June 2022 accept space, comma and double-quotes
|
||||
+ fine. The prime reason for filtering out control bytes is that some HTTP
|
||||
+ servers return 400 for requests that contain such.
|
||||
+*/
|
||||
+static int invalid_octets(const char *p)
|
||||
+{
|
||||
+ /* Reject all bytes \x01 - \x1f (*except* \x09, TAB) + \x7f */
|
||||
+ static const char badoctets[] = {
|
||||
+ "\x01\x02\x03\x04\x05\x06\x07\x08\x0a"
|
||||
+ "\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14"
|
||||
+ "\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x7f"
|
||||
+ };
|
||||
+ size_t vlen, len;
|
||||
+ /* scan for all the octets that are *not* in cookie-octet */
|
||||
+ len = strcspn(p, badoctets);
|
||||
+ vlen = strlen(p);
|
||||
+ return (len != vlen);
|
||||
+}
|
||||
+
|
||||
/****************************************************************************
|
||||
*
|
||||
* Curl_cookie_add()
|
||||
@@ -558,6 +582,11 @@ Curl_cookie_add(struct Curl_easy *data,
|
||||
badcookie = TRUE;
|
||||
break;
|
||||
}
|
||||
+ if(invalid_octets(whatptr) || invalid_octets(name)) {
|
||||
+ infof(data, "invalid octets in name/value, cookie dropped");
|
||||
+ badcookie = TRUE;
|
||||
+ break;
|
||||
+ }
|
||||
}
|
||||
else if(!len) {
|
||||
/* this was a "<name>=" with no content, and we must allow
|
||||
--
|
||||
2.35.1
|
||||
|
||||
@@ -38,6 +38,7 @@ SRC_URI = "https://curl.haxx.se/download/curl-${PV}.tar.bz2 \
|
||||
file://CVE-2022-32206.patch \
|
||||
file://CVE-2022-32207.patch \
|
||||
file://CVE-2022-32208.patch \
|
||||
file://CVE-2022-35252.patch \
|
||||
"
|
||||
|
||||
SRC_URI[md5sum] = "ec5fc263f898a3dfef08e805f1ecca42"
|
||||
|
||||
37
meta/recipes-support/gnutls/gnutls/CVE-2021-4209.patch
Normal file
37
meta/recipes-support/gnutls/gnutls/CVE-2021-4209.patch
Normal file
@@ -0,0 +1,37 @@
|
||||
From 3db352734472d851318944db13be73da61300568 Mon Sep 17 00:00:00 2001
|
||||
From: Daiki Ueno <ueno@gnu.org>
|
||||
Date: Wed, 22 Dec 2021 09:12:25 +0100
|
||||
Subject: [PATCH] wrap_nettle_hash_fast: avoid calling _update with zero-length
|
||||
input
|
||||
|
||||
As Nettle's hash update functions internally call memcpy, providing
|
||||
zero-length input may cause undefined behavior.
|
||||
|
||||
Signed-off-by: Daiki Ueno <ueno@gnu.org>
|
||||
|
||||
https://gitlab.com/gnutls/gnutls/-/commit/3db352734472d851318944db13be73da61300568
|
||||
Upstream-Status: Backport
|
||||
CVE: CVE-2021-4209
|
||||
Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com>
|
||||
---
|
||||
lib/nettle/mac.c | 4 +++-
|
||||
1 file changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/lib/nettle/mac.c b/lib/nettle/mac.c
|
||||
index f9d4d7a8df..35e070fab0 100644
|
||||
--- a/lib/nettle/mac.c
|
||||
+++ b/lib/nettle/mac.c
|
||||
@@ -788,7 +788,9 @@ static int wrap_nettle_hash_fast(gnutls_digest_algorithm_t algo,
|
||||
if (ret < 0)
|
||||
return gnutls_assert_val(ret);
|
||||
|
||||
- ctx.update(&ctx, text_size, text);
|
||||
+ if (text_size > 0) {
|
||||
+ ctx.update(&ctx, text_size, text);
|
||||
+ }
|
||||
ctx.digest(&ctx, ctx.length, digest);
|
||||
|
||||
return 0;
|
||||
--
|
||||
GitLab
|
||||
|
||||
@@ -26,6 +26,7 @@ SRC_URI = "https://www.gnupg.org/ftp/gcrypt/gnutls/v${SHRT_VER}/gnutls-${PV}.tar
|
||||
file://CVE-2021-20231.patch \
|
||||
file://CVE-2021-20232.patch \
|
||||
file://CVE-2022-2509.patch \
|
||||
file://CVE-2021-4209.patch \
|
||||
"
|
||||
|
||||
SRC_URI[sha256sum] = "5630751adec7025b8ef955af4d141d00d252a985769f51b4059e5affa3d39d63"
|
||||
|
||||
21
meta/recipes-support/sqlite/files/CVE-2020-35525.patch
Normal file
21
meta/recipes-support/sqlite/files/CVE-2020-35525.patch
Normal file
@@ -0,0 +1,21 @@
|
||||
From: drh <drh@noemail.net>
|
||||
Date: Thu, 20 Feb 2020 14:08:51 +0000
|
||||
Subject: [PATCH] Early-out on the INTERSECT query processing following an
|
||||
error.
|
||||
|
||||
Upstream-Status: Backport [http://security.debian.org/debian-security/pool/updates/main/s/sqlite3/sqlite3_3.27.2-3+deb10u2.debian.tar.xz]
|
||||
CVE: CVE-2020-35525
|
||||
Signed-off-by: Virendra Thakur <virendrak@kpit.com>
|
||||
---
|
||||
Index: sqlite-autoconf-3310100/sqlite3.c
|
||||
===================================================================
|
||||
--- sqlite-autoconf-3310100.orig/sqlite3.c
|
||||
+++ sqlite-autoconf-3310100/sqlite3.c
|
||||
@@ -130767,6 +130767,7 @@ static int multiSelect(
|
||||
/* Generate code to take the intersection of the two temporary
|
||||
** tables.
|
||||
*/
|
||||
+ if( rc ) break;
|
||||
assert( p->pEList );
|
||||
iBreak = sqlite3VdbeMakeLabel(pParse);
|
||||
iCont = sqlite3VdbeMakeLabel(pParse);
|
||||
22
meta/recipes-support/sqlite/files/CVE-2020-35527.patch
Normal file
22
meta/recipes-support/sqlite/files/CVE-2020-35527.patch
Normal file
@@ -0,0 +1,22 @@
|
||||
From: dan <dan@noemail.net>
|
||||
Date: Mon, 26 Oct 2020 13:24:36 +0000
|
||||
Subject: [PATCH] Fix a problem with ALTER TABLE for views that have a nested
|
||||
FROM clause. Ticket [f50af3e8a565776b].
|
||||
|
||||
Upstream-Status: Backport [http://security.debian.org/debian-security/pool/updates/main/s/sqlite3/sqlite3_3.27.2-3+deb10u2.debian.tar.xz]
|
||||
CVE: CVE-2020-35527
|
||||
Signed-off-by: Virendra Thakur <virendra.thakur@kpit.com>
|
||||
---
|
||||
Index: sqlite-autoconf-3310100/sqlite3.c
|
||||
===================================================================
|
||||
--- sqlite-autoconf-3310100.orig/sqlite3.c
|
||||
+++ sqlite-autoconf-3310100/sqlite3.c
|
||||
@@ -133110,7 +133110,7 @@ static int selectExpander(Walker *pWalke
|
||||
pNew = sqlite3ExprListAppend(pParse, pNew, pExpr);
|
||||
sqlite3TokenInit(&sColname, zColname);
|
||||
sqlite3ExprListSetName(pParse, pNew, &sColname, 0);
|
||||
- if( pNew && (p->selFlags & SF_NestedFrom)!=0 ){
|
||||
+ if( pNew && (p->selFlags & SF_NestedFrom)!=0 && !IN_RENAME_OBJECT ){
|
||||
struct ExprList_item *pX = &pNew->a[pNew->nExpr-1];
|
||||
sqlite3DbFree(db, pX->zEName);
|
||||
if( pSub ){
|
||||
23
meta/recipes-support/sqlite/files/CVE-2021-20223.patch
Normal file
23
meta/recipes-support/sqlite/files/CVE-2021-20223.patch
Normal file
@@ -0,0 +1,23 @@
|
||||
From d1d43efa4fb0f2098c0e2c5bf2e807c58d5ec05b Mon Sep 17 00:00:00 2001
|
||||
From: dan <dan@noemail.net>
|
||||
Date: Mon, 26 Oct 2020 13:24:36 +0000
|
||||
Subject: [PATCH] Prevent fts5 tokenizer unicode61 from considering '\0' to be
|
||||
a token characters, even if other characters of class "Cc" are.
|
||||
|
||||
FossilOrigin-Name: b7b7bde9b7a03665e3691c6d51118965f216d2dfb1617f138b9f9e60e418ed2f
|
||||
|
||||
CVE: CVE-2021-20223
|
||||
Upstream-Status: Backport [https://github.com/sqlite/sqlite/commit/d1d43efa4fb0f2098c0e2c5bf2e807c58d5ec05b.patch]
|
||||
Comment: Removed manifest, manifest.uuid and fts5tok1.test as these files are not present in the amalgamated source code
|
||||
Signed-Off-by: Sana.Kazi@kpit.com
|
||||
---
|
||||
--- a/sqlite3.c 2022-09-09 13:54:30.010768197 +0530
|
||||
+++ b/sqlite3.c 2022-09-09 13:56:25.458769142 +0530
|
||||
@@ -227114,6 +227114,7 @@
|
||||
}
|
||||
iTbl++;
|
||||
}
|
||||
+ aAscii[0] = 0; /* 0x00 is never a token character */
|
||||
}
|
||||
|
||||
/*
|
||||
29
meta/recipes-support/sqlite/files/CVE-2022-35737.patch
Normal file
29
meta/recipes-support/sqlite/files/CVE-2022-35737.patch
Normal file
@@ -0,0 +1,29 @@
|
||||
From 2bbf4c999dbb4b520561a57e0bafc19a15562093 Mon Sep 17 00:00:00 2001
|
||||
From: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
Date: Fri, 2 Sep 2022 11:22:29 +0530
|
||||
Subject: [PATCH] CVE-2022-35737
|
||||
|
||||
Upstream-Status: Backport [https://www.sqlite.org/src/info/aab790a16e1bdff7]
|
||||
CVE: CVE-2022-35737
|
||||
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
---
|
||||
sqlite3.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/sqlite3.c b/sqlite3.c
|
||||
index f664217..33dfb78 100644
|
||||
--- a/sqlite3.c
|
||||
+++ b/sqlite3.c
|
||||
@@ -28758,7 +28758,8 @@ SQLITE_API void sqlite3_str_vappendf(
|
||||
case etSQLESCAPE: /* %q: Escape ' characters */
|
||||
case etSQLESCAPE2: /* %Q: Escape ' and enclose in '...' */
|
||||
case etSQLESCAPE3: { /* %w: Escape " characters */
|
||||
- int i, j, k, n, isnull;
|
||||
+ i64 i, j, k, n;
|
||||
+ int isnull;
|
||||
int needQuote;
|
||||
char ch;
|
||||
char q = ((xtype==etSQLESCAPE3)?'"':'\''); /* Quote character */
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@@ -13,6 +13,10 @@ SRC_URI = "http://www.sqlite.org/2020/sqlite-autoconf-${SQLITE_PV}.tar.gz \
|
||||
file://CVE-2020-13630.patch \
|
||||
file://CVE-2020-13631.patch \
|
||||
file://CVE-2020-13632.patch \
|
||||
file://CVE-2022-35737.patch \
|
||||
file://CVE-2020-35525.patch \
|
||||
file://CVE-2020-35527.patch \
|
||||
file://CVE-2021-20223.patch \
|
||||
"
|
||||
SRC_URI[md5sum] = "2d0a553534c521504e3ac3ad3b90f125"
|
||||
SRC_URI[sha256sum] = "62284efebc05a76f909c580ffa5c008a7d22a1287285d68b7825a2b6b51949ae"
|
||||
|
||||
@@ -20,8 +20,8 @@ SRC_URI = "git://github.com/vim/vim.git;branch=master;protocol=https \
|
||||
file://no-path-adjust.patch \
|
||||
"
|
||||
|
||||
PV .= ".0115"
|
||||
SRCREV = "6747cf1671bd41cddee77c65b3f9a70509f968db"
|
||||
PV .= ".0598"
|
||||
SRCREV = "8279af514ca7e5fd3c31cf13b0864163d1a0bfeb"
|
||||
|
||||
# Remove when 8.3 is out
|
||||
UPSTREAM_VERSION_UNKNOWN = "1"
|
||||
|
||||
@@ -128,7 +128,7 @@ PROTO_RE="[a-z][a-z+]*://"
|
||||
GIT_RE="\(^\($PROTO_RE\)\?\)\($USER_RE@\)\?\([^:/]*\)[:/]\(.*\)"
|
||||
REMOTE_URL=${REMOTE_URL%.git}
|
||||
REMOTE_REPO=$(echo $REMOTE_URL | sed "s#$GIT_RE#\5#")
|
||||
REMOTE_URL=$(echo $REMOTE_URL | sed "s#$GIT_RE#git://\4/\5#")
|
||||
REMOTE_URL=$(echo $REMOTE_URL | sed "s#$GIT_RE#https://\4/\5#")
|
||||
|
||||
if [ -z "$BRANCH" ]; then
|
||||
BRANCH=$(git branch | grep -e "^\* " | cut -d' ' -f2)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user