mirror of
https://git.yoctoproject.org/poky
synced 2026-02-22 01:19:41 +01:00
Compare commits
125 Commits
yocto-3.1.
...
dunfell-23
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
74b22db687 | ||
|
|
67dbe8a1c2 | ||
|
|
80b8fc829f | ||
|
|
9bae357b12 | ||
|
|
d3f4731220 | ||
|
|
7f73831fde | ||
|
|
6aa55dd279 | ||
|
|
50ea49f3d9 | ||
|
|
65ccb30159 | ||
|
|
9317b4771c | ||
|
|
955ae70225 | ||
|
|
871a373527 | ||
|
|
d1a9079782 | ||
|
|
7369788009 | ||
|
|
468ac59e9c | ||
|
|
2c00edba7f | ||
|
|
cf9e68db31 | ||
|
|
60cfe38b51 | ||
|
|
b35ee4a64e | ||
|
|
2a01b629de | ||
|
|
043cb19a0d | ||
|
|
6fef2a1c2c | ||
|
|
7721fa8185 | ||
|
|
7c1bc90654 | ||
|
|
bdd30be1a3 | ||
|
|
ffcdd251ff | ||
|
|
4e28505e23 | ||
|
|
b90687ad24 | ||
|
|
1f4497167a | ||
|
|
6918a0298a | ||
|
|
660de76134 | ||
|
|
3e75c5d0b4 | ||
|
|
e7eeef5ab7 | ||
|
|
9b62e6b834 | ||
|
|
def634eeae | ||
|
|
f6f391b4af | ||
|
|
b06370cc2d | ||
|
|
50204d091b | ||
|
|
420d5551b2 | ||
|
|
6bcc4029d4 | ||
|
|
4d8b5c4d70 | ||
|
|
f63635a30d | ||
|
|
d56b8f6f76 | ||
|
|
189108ac74 | ||
|
|
0d253da720 | ||
|
|
4ed9972582 | ||
|
|
4bd52d64c9 | ||
|
|
474c37c17e | ||
|
|
f721d78703 | ||
|
|
b3bf5ccd83 | ||
|
|
c00a882bd6 | ||
|
|
ea562eaec5 | ||
|
|
e142f4ebfb | ||
|
|
02108b6dbc | ||
|
|
045071f712 | ||
|
|
8fb30a6705 | ||
|
|
5b3ddc2a50 | ||
|
|
fa25ed8a6a | ||
|
|
ef3c563a4f | ||
|
|
e2cb601ab6 | ||
|
|
ed4791c8b0 | ||
|
|
4cd1c26076 | ||
|
|
9716a47c53 | ||
|
|
d520587d90 | ||
|
|
950183b0c1 | ||
|
|
b6a93f7c79 | ||
|
|
dd28323b17 | ||
|
|
2b5d41d03f | ||
|
|
ae90e3876d | ||
|
|
d6f40be29b | ||
|
|
77269f9163 | ||
|
|
0de8d08213 | ||
|
|
378c364b12 | ||
|
|
18784ee733 | ||
|
|
0ca4b99162 | ||
|
|
f9cb0aec9c | ||
|
|
2c99b4e9b3 | ||
|
|
555a75484d | ||
|
|
7e830c8370 | ||
|
|
4625b656ec | ||
|
|
48d80a80a9 | ||
|
|
922fe187e1 | ||
|
|
6f4b2ce8a4 | ||
|
|
3de8ba0b1c | ||
|
|
7f702f6e67 | ||
|
|
9a93dde4e3 | ||
|
|
55b0822504 | ||
|
|
8b5ec9d483 | ||
|
|
08acba82d1 | ||
|
|
ccbfeb9d53 | ||
|
|
bb4a62557b | ||
|
|
a2a412fcd7 | ||
|
|
33b3eaa04d | ||
|
|
6f1a5a8783 | ||
|
|
123068a0f4 | ||
|
|
6d7754c80e | ||
|
|
587ea95477 | ||
|
|
92b976d733 | ||
|
|
91802e4b14 | ||
|
|
fc849db69b | ||
|
|
14fdc41afa | ||
|
|
684efee23c | ||
|
|
0a7e7c8882 | ||
|
|
6a4ccf65e8 | ||
|
|
a92e5ec215 | ||
|
|
0304752a46 | ||
|
|
08d1a1313c | ||
|
|
aabe9c0f70 | ||
|
|
a930008acb | ||
|
|
d514cc9758 | ||
|
|
184ade83cd | ||
|
|
ffc49508d2 | ||
|
|
785bdf6555 | ||
|
|
8161d2b4f7 | ||
|
|
462de8f86f | ||
|
|
02476f72f4 | ||
|
|
1d36ed3306 | ||
|
|
f30d69e51f | ||
|
|
4542e5f944 | ||
|
|
427882f470 | ||
|
|
8cdd3eb6e6 | ||
|
|
7d2f118cb6 | ||
|
|
9c2186108e | ||
|
|
1f7b04355c | ||
|
|
8f65434827 |
@@ -28,7 +28,7 @@ logger = logging.getLogger("BitBake.Data")
|
||||
|
||||
__setvar_keyword__ = ["_append", "_prepend", "_remove"]
|
||||
__setvar_regexp__ = re.compile(r'(?P<base>.*?)(?P<keyword>_append|_prepend|_remove)(_(?P<add>[^A-Z]*))?$')
|
||||
__expand_var_regexp__ = re.compile(r"\${[a-zA-Z0-9\-_+./~]+?}")
|
||||
__expand_var_regexp__ = re.compile(r"\${[a-zA-Z0-9\-_+./~:]+?}")
|
||||
__expand_python_regexp__ = re.compile(r"\${@.+?}")
|
||||
__whitespace_split__ = re.compile(r'(\s)')
|
||||
__override_regexp__ = re.compile(r'[a-z0-9]+')
|
||||
@@ -481,6 +481,7 @@ class DataSmart(MutableMapping):
|
||||
|
||||
def setVar(self, var, value, **loginfo):
|
||||
#print("var=" + str(var) + " val=" + str(value))
|
||||
var = var.replace(":", "_")
|
||||
self.expand_cache = {}
|
||||
parsing=False
|
||||
if 'parsing' in loginfo:
|
||||
@@ -589,6 +590,8 @@ class DataSmart(MutableMapping):
|
||||
"""
|
||||
Rename the variable key to newkey
|
||||
"""
|
||||
key = key.replace(":", "_")
|
||||
newkey = newkey.replace(":", "_")
|
||||
if key == newkey:
|
||||
bb.warn("Calling renameVar with equivalent keys (%s) is invalid" % key)
|
||||
return
|
||||
@@ -637,6 +640,7 @@ class DataSmart(MutableMapping):
|
||||
self.setVar(var + "_prepend", value, ignore=True, parsing=True)
|
||||
|
||||
def delVar(self, var, **loginfo):
|
||||
var = var.replace(":", "_")
|
||||
self.expand_cache = {}
|
||||
|
||||
loginfo['detail'] = ""
|
||||
@@ -664,6 +668,7 @@ class DataSmart(MutableMapping):
|
||||
override = None
|
||||
|
||||
def setVarFlag(self, var, flag, value, **loginfo):
|
||||
var = var.replace(":", "_")
|
||||
self.expand_cache = {}
|
||||
|
||||
if 'op' not in loginfo:
|
||||
@@ -687,6 +692,7 @@ class DataSmart(MutableMapping):
|
||||
self.dict["__exportlist"]["_content"].add(var)
|
||||
|
||||
def getVarFlag(self, var, flag, expand=True, noweakdefault=False, parsing=False, retparser=False):
|
||||
var = var.replace(":", "_")
|
||||
if flag == "_content":
|
||||
cachename = var
|
||||
else:
|
||||
@@ -814,6 +820,7 @@ class DataSmart(MutableMapping):
|
||||
return value
|
||||
|
||||
def delVarFlag(self, var, flag, **loginfo):
|
||||
var = var.replace(":", "_")
|
||||
self.expand_cache = {}
|
||||
|
||||
local_var, _ = self._findVar(var)
|
||||
@@ -831,6 +838,7 @@ class DataSmart(MutableMapping):
|
||||
del self.dict[var][flag]
|
||||
|
||||
def appendVarFlag(self, var, flag, value, **loginfo):
|
||||
var = var.replace(":", "_")
|
||||
loginfo['op'] = 'append'
|
||||
loginfo['flag'] = flag
|
||||
self.varhistory.record(**loginfo)
|
||||
@@ -838,6 +846,7 @@ class DataSmart(MutableMapping):
|
||||
self.setVarFlag(var, flag, newvalue, ignore=True)
|
||||
|
||||
def prependVarFlag(self, var, flag, value, **loginfo):
|
||||
var = var.replace(":", "_")
|
||||
loginfo['op'] = 'prepend'
|
||||
loginfo['flag'] = flag
|
||||
self.varhistory.record(**loginfo)
|
||||
@@ -845,6 +854,7 @@ class DataSmart(MutableMapping):
|
||||
self.setVarFlag(var, flag, newvalue, ignore=True)
|
||||
|
||||
def setVarFlags(self, var, flags, **loginfo):
|
||||
var = var.replace(":", "_")
|
||||
self.expand_cache = {}
|
||||
infer_caller_details(loginfo)
|
||||
if not var in self.dict:
|
||||
@@ -859,6 +869,7 @@ class DataSmart(MutableMapping):
|
||||
self.dict[var][i] = flags[i]
|
||||
|
||||
def getVarFlags(self, var, expand = False, internalflags=False):
|
||||
var = var.replace(":", "_")
|
||||
local_var, _ = self._findVar(var)
|
||||
flags = {}
|
||||
|
||||
@@ -875,6 +886,7 @@ class DataSmart(MutableMapping):
|
||||
|
||||
|
||||
def delVarFlags(self, var, **loginfo):
|
||||
var = var.replace(":", "_")
|
||||
self.expand_cache = {}
|
||||
if not var in self.dict:
|
||||
self._makeShadowCopy(var)
|
||||
|
||||
@@ -97,6 +97,7 @@ class DataNode(AstNode):
|
||||
def eval(self, data):
|
||||
groupd = self.groupd
|
||||
key = groupd["var"]
|
||||
key = key.replace(":", "_")
|
||||
loginfo = {
|
||||
'variable': key,
|
||||
'file': self.filename,
|
||||
@@ -207,6 +208,7 @@ class ExportFuncsNode(AstNode):
|
||||
def eval(self, data):
|
||||
|
||||
for func in self.n:
|
||||
func = func.replace(":", "_")
|
||||
calledfunc = self.classname + "_" + func
|
||||
|
||||
if data.getVar(func, False) and not data.getVarFlag(func, 'export_func', False):
|
||||
|
||||
@@ -22,7 +22,7 @@ from .ConfHandler import include, init
|
||||
# For compatibility
|
||||
bb.deprecate_import(__name__, "bb.parse", ["vars_from_file"])
|
||||
|
||||
__func_start_regexp__ = re.compile(r"(((?P<py>python)|(?P<fr>fakeroot))\s*)*(?P<func>[\w\.\-\+\{\}\$]+)?\s*\(\s*\)\s*{$" )
|
||||
__func_start_regexp__ = re.compile(r"(((?P<py>python(?=(\s|\()))|(?P<fr>fakeroot(?=\s)))\s*)*(?P<func>[\w\.\-\+\{\}\$:]+)?\s*\(\s*\)\s*{$" )
|
||||
__inherit_regexp__ = re.compile(r"inherit\s+(.+)" )
|
||||
__export_func_regexp__ = re.compile(r"EXPORT_FUNCTIONS\s+(.+)" )
|
||||
__addtask_regexp__ = re.compile(r"addtask\s+(?P<func>\w+)\s*((before\s*(?P<before>((.*(?=after))|(.*))))|(after\s*(?P<after>((.*(?=before))|(.*)))))*")
|
||||
|
||||
@@ -20,7 +20,7 @@ from bb.parse import ParseError, resolve_file, ast, logger, handle
|
||||
__config_regexp__ = re.compile( r"""
|
||||
^
|
||||
(?P<exp>export\s+)?
|
||||
(?P<var>[a-zA-Z0-9\-_+.${}/~]+?)
|
||||
(?P<var>[a-zA-Z0-9\-_+.${}/~:]+?)
|
||||
(\[(?P<flag>[a-zA-Z0-9\-_+.]+)\])?
|
||||
|
||||
\s* (
|
||||
|
||||
@@ -151,7 +151,7 @@ def findPreferredProvider(pn, cfgData, dataCache, pkg_pn = None, item = None):
|
||||
if item:
|
||||
itemstr = " (for item %s)" % item
|
||||
if preferred_file is None:
|
||||
logger.warn("preferred version %s of %s not available%s", pv_str, pn, itemstr)
|
||||
logger.warning("preferred version %s of %s not available%s", pv_str, pn, itemstr)
|
||||
available_vers = []
|
||||
for file_set in pkg_pn:
|
||||
for f in file_set:
|
||||
@@ -163,7 +163,7 @@ def findPreferredProvider(pn, cfgData, dataCache, pkg_pn = None, item = None):
|
||||
available_vers.append(ver_str)
|
||||
if available_vers:
|
||||
available_vers.sort()
|
||||
logger.warn("versions of %s available: %s", pn, ' '.join(available_vers))
|
||||
logger.warning("versions of %s available: %s", pn, ' '.join(available_vers))
|
||||
else:
|
||||
logger.debug(1, "selecting %s as PREFERRED_VERSION %s of package %s%s", preferred_file, pv_str, pn, itemstr)
|
||||
|
||||
|
||||
@@ -111,9 +111,9 @@ ${D}${libdir}/pkgconfig/*.pc
|
||||
self.assertExecs(set(["sed"]))
|
||||
|
||||
def test_parameter_expansion_modifiers(self):
|
||||
# - and + are also valid modifiers for parameter expansion, but are
|
||||
# -,+ and : are also valid modifiers for parameter expansion, but are
|
||||
# valid characters in bitbake variable names, so are not included here
|
||||
for i in ('=', ':-', ':=', '?', ':?', ':+', '#', '%', '##', '%%'):
|
||||
for i in ('=', '?', '#', '%', '##', '%%'):
|
||||
name = "foo%sbar" % i
|
||||
self.parseExpression("${%s}" % name)
|
||||
self.assertNotIn(name, self.references)
|
||||
|
||||
@@ -16,7 +16,7 @@ import os
|
||||
import sys
|
||||
import datetime
|
||||
|
||||
current_version = "3.1.10"
|
||||
current_version = "3.1.11"
|
||||
|
||||
# String used in sidebar
|
||||
version = 'Version: ' + current_version
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
DISTRO : "3.1.10"
|
||||
DISTRO : "3.1.11"
|
||||
DISTRO_NAME_NO_CAP : "dunfell"
|
||||
DISTRO_NAME : "Dunfell"
|
||||
DISTRO_NAME_NO_CAP_MINUS_ONE : "zeus"
|
||||
YOCTO_DOC_VERSION : "3.1.10"
|
||||
YOCTO_DOC_VERSION : "3.1.11"
|
||||
YOCTO_DOC_VERSION_MINUS_ONE : "3.0.2"
|
||||
DISTRO_REL_TAG : "yocto-3.1.10"
|
||||
POKYVERSION : "23.0.10"
|
||||
DISTRO_REL_TAG : "yocto-3.1.11"
|
||||
POKYVERSION : "23.0.11"
|
||||
YOCTO_POKY : "poky-&DISTRO_NAME_NO_CAP;-&POKYVERSION;"
|
||||
YOCTO_DL_URL : "https://downloads.yoctoproject.org"
|
||||
YOCTO_AB_URL : "https://autobuilder.yoctoproject.org"
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
- :yocto_docs:`3.1.8 Documentation </3.1.8>`
|
||||
- :yocto_docs:`3.1.9 Documentation </3.1.9>`
|
||||
- :yocto_docs:`3.1.10 Documentation </3.1.10>`
|
||||
- :yocto_docs:`3.1.11 Documentation </3.1.11>`
|
||||
|
||||
==========================
|
||||
Previous Release Manuals
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
var all_versions = {
|
||||
'dev': 'dev (3.3)',
|
||||
'3.1.10': '3.1.10',
|
||||
'3.1.11': '3.1.11',
|
||||
'3.0.4': '3.0.4',
|
||||
'2.7.4': '2.7.4',
|
||||
};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
DISTRO = "poky"
|
||||
DISTRO_NAME = "Poky (Yocto Project Reference Distro)"
|
||||
DISTRO_VERSION = "3.1.10"
|
||||
DISTRO_VERSION = "3.1.11"
|
||||
DISTRO_CODENAME = "dunfell"
|
||||
SDK_VENDOR = "-pokysdk"
|
||||
SDK_VERSION = "${@d.getVar('DISTRO_VERSION').replace('snapshot-${DATE}', 'snapshot')}"
|
||||
@@ -24,7 +24,7 @@ DISTRO_FEATURES ?= "${DISTRO_FEATURES_DEFAULT} ${POKY_DEFAULT_DISTRO_FEATURES}"
|
||||
PREFERRED_VERSION_linux-yocto ?= "5.4%"
|
||||
|
||||
SDK_NAME = "${DISTRO}-${TCLIBC}-${SDKMACHINE}-${IMAGE_BASENAME}-${TUNE_PKGARCH}-${MACHINE}"
|
||||
SDKPATH = "/opt/${DISTRO}/${SDK_VERSION}"
|
||||
SDKPATHINSTALL = "/opt/${DISTRO}/${SDK_VERSION}"
|
||||
|
||||
DISTRO_EXTRA_RDEPENDS += " ${POKY_DEFAULT_EXTRA_RDEPENDS}"
|
||||
DISTRO_EXTRA_RRECOMMENDS += " ${POKY_DEFAULT_EXTRA_RRECOMMENDS}"
|
||||
|
||||
@@ -281,7 +281,10 @@ python do_ar_configured() {
|
||||
# ${STAGING_DATADIR}/aclocal/libtool.m4, so we can't re-run the
|
||||
# do_configure, we archive the already configured ${S} to
|
||||
# instead of.
|
||||
elif pn != 'libtool-native':
|
||||
# The kernel class functions require it to be on work-shared, we
|
||||
# don't unpack, patch, configure again, just archive the already
|
||||
# configured ${S}
|
||||
elif not (pn == 'libtool-native' or is_work_shared(d)):
|
||||
def runTask(task):
|
||||
prefuncs = d.getVarFlag(task, 'prefuncs') or ''
|
||||
for func in prefuncs.split():
|
||||
@@ -484,6 +487,9 @@ python do_unpack_and_patch() {
|
||||
src_orig = '%s.orig' % src
|
||||
oe.path.copytree(src, src_orig)
|
||||
|
||||
if bb.data.inherits_class('dos2unix', d):
|
||||
bb.build.exec_func('do_convert_crlf_to_lf', d)
|
||||
|
||||
# Make sure gcc and kernel sources are patched only once
|
||||
if not (d.getVar('SRC_URI') == "" or is_work_shared(d)):
|
||||
bb.build.exec_func('do_patch', d)
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
# the only method to check against CVEs. Running this tool
|
||||
# doesn't guarantee your packages are free of CVEs.
|
||||
|
||||
# The product name that the CVE database uses. Defaults to BPN, but may need to
|
||||
# The product name that the CVE database uses defaults to BPN, but may need to
|
||||
# be overriden per recipe (for example tiff.bb sets CVE_PRODUCT=libtiff).
|
||||
CVE_PRODUCT ??= "${BPN}"
|
||||
CVE_VERSION ??= "${PV}"
|
||||
@@ -53,7 +53,14 @@ CVE_CHECK_PN_WHITELIST ?= ""
|
||||
#
|
||||
CVE_CHECK_WHITELIST ?= ""
|
||||
|
||||
# set to "alphabetical" for version using single alphabetical character as increament release
|
||||
# Layers to be excluded
|
||||
CVE_CHECK_LAYER_EXCLUDELIST ??= ""
|
||||
|
||||
# Layers to be included
|
||||
CVE_CHECK_LAYER_INCLUDELIST ??= ""
|
||||
|
||||
|
||||
# set to "alphabetical" for version using single alphabetical character as increment release
|
||||
CVE_VERSION_SUFFIX ??= ""
|
||||
|
||||
python cve_save_summary_handler () {
|
||||
@@ -159,9 +166,12 @@ def get_patches_cves(d):
|
||||
pn = d.getVar("PN")
|
||||
cve_match = re.compile("CVE:( CVE\-\d{4}\-\d+)+")
|
||||
|
||||
# Matches last CVE-1234-211432 in the file name, also if written
|
||||
# with small letters. Not supporting multiple CVE id's in a single
|
||||
# file name.
|
||||
# Matches the last "CVE-YYYY-ID" in the file name, also if written
|
||||
# in lowercase. Possible to have multiple CVE IDs in a single
|
||||
# file name, but only the last one will be detected from the file name.
|
||||
# However, patch files contents addressing multiple CVE IDs are supported
|
||||
# (cve_match regular expression)
|
||||
|
||||
cve_file_name_match = re.compile(".*([Cc][Vv][Ee]\-\d{4}\-\d+)")
|
||||
|
||||
patched_cves = set()
|
||||
@@ -223,14 +233,11 @@ def check_cves(d, patched_cves):
|
||||
return ([], [], [])
|
||||
pv = d.getVar("CVE_VERSION").split("+git")[0]
|
||||
|
||||
# If the recipe has been whitlisted we return empty lists
|
||||
# If the recipe has been whitelisted we return empty lists
|
||||
if pn in d.getVar("CVE_CHECK_PN_WHITELIST").split():
|
||||
bb.note("Recipe has been whitelisted, skipping check")
|
||||
return ([], [], [])
|
||||
|
||||
old_cve_whitelist = d.getVar("CVE_CHECK_CVE_WHITELIST")
|
||||
if old_cve_whitelist:
|
||||
bb.warn("CVE_CHECK_CVE_WHITELIST is deprecated, please use CVE_CHECK_WHITELIST.")
|
||||
cve_whitelist = d.getVar("CVE_CHECK_WHITELIST").split()
|
||||
|
||||
import sqlite3
|
||||
@@ -334,11 +341,21 @@ def cve_write_data(d, patched, unpatched, whitelisted, cve_data):
|
||||
CVE manifest if enabled.
|
||||
"""
|
||||
|
||||
|
||||
cve_file = d.getVar("CVE_CHECK_LOG")
|
||||
fdir_name = d.getVar("FILE_DIRNAME")
|
||||
layer = fdir_name.split("/")[-3]
|
||||
|
||||
nvd_link = "https://web.nvd.nist.gov/view/vuln/detail?vulnId="
|
||||
include_layers = d.getVar("CVE_CHECK_LAYER_INCLUDELIST").split()
|
||||
exclude_layers = d.getVar("CVE_CHECK_LAYER_EXCLUDELIST").split()
|
||||
|
||||
if exclude_layers and layer in exclude_layers:
|
||||
return
|
||||
|
||||
if include_layers and layer not in include_layers:
|
||||
return
|
||||
|
||||
nvd_link = "https://nvd.nist.gov/vuln/detail/"
|
||||
write_string = ""
|
||||
unpatched_cves = []
|
||||
bb.utils.mkdirhier(os.path.dirname(cve_file))
|
||||
|
||||
@@ -240,7 +240,7 @@ EXTRA_IMAGECMD_jffs2 ?= "--pad ${JFFS2_ENDIANNESS} --eraseblock=${JFFS2_ERASEBLO
|
||||
EXTRA_IMAGECMD_ext2 ?= "-i 4096"
|
||||
EXTRA_IMAGECMD_ext3 ?= "-i 4096"
|
||||
EXTRA_IMAGECMD_ext4 ?= "-i 4096"
|
||||
EXTRA_IMAGECMD_btrfs ?= "-n 4096"
|
||||
EXTRA_IMAGECMD_btrfs ?= "-n 4096 --shrink"
|
||||
EXTRA_IMAGECMD_f2fs ?= ""
|
||||
|
||||
do_image_cpio[depends] += "cpio-native:do_populate_sysroot"
|
||||
|
||||
@@ -320,6 +320,21 @@ do_kernel_checkout() {
|
||||
fi
|
||||
fi
|
||||
cd ${S}
|
||||
|
||||
# convert any remote branches to local tracking ones
|
||||
for i in `git branch -a --no-color | grep remotes | grep -v HEAD`; do
|
||||
b=`echo $i | cut -d' ' -f2 | sed 's%remotes/origin/%%'`;
|
||||
git show-ref --quiet --verify -- "refs/heads/$b"
|
||||
if [ $? -ne 0 ]; then
|
||||
git branch $b $i > /dev/null
|
||||
fi
|
||||
done
|
||||
|
||||
# Create a working tree copy of the kernel by checking out a branch
|
||||
machine_branch="${@ get_machine_branch(d, "${KBRANCH}" )}"
|
||||
|
||||
# checkout and clobber any unimportant files
|
||||
git checkout -f ${machine_branch}
|
||||
else
|
||||
# case: we have no git repository at all.
|
||||
# To support low bandwidth options for building the kernel, we'll just
|
||||
@@ -341,21 +356,6 @@ do_kernel_checkout() {
|
||||
git commit -q -m "baseline commit: creating repo for ${PN}-${PV}"
|
||||
git clean -d -f
|
||||
fi
|
||||
|
||||
# convert any remote branches to local tracking ones
|
||||
for i in `git branch -a --no-color | grep remotes | grep -v HEAD`; do
|
||||
b=`echo $i | cut -d' ' -f2 | sed 's%remotes/origin/%%'`;
|
||||
git show-ref --quiet --verify -- "refs/heads/$b"
|
||||
if [ $? -ne 0 ]; then
|
||||
git branch $b $i > /dev/null
|
||||
fi
|
||||
done
|
||||
|
||||
# Create a working tree copy of the kernel by checking out a branch
|
||||
machine_branch="${@ get_machine_branch(d, "${KBRANCH}" )}"
|
||||
|
||||
# checkout and clobber any unimportant files
|
||||
git checkout -f ${machine_branch}
|
||||
}
|
||||
do_kernel_checkout[dirs] = "${S}"
|
||||
|
||||
|
||||
@@ -31,8 +31,8 @@ python do_populate_lic() {
|
||||
f.write("%s: %s\n" % (key, info[key]))
|
||||
}
|
||||
|
||||
PSEUDO_IGNORE_PATHS .= ",${@','.join(((d.getVar('COMMON_LICENSE_DIR') or '') + ' ' + (d.getVar('LICENSE_PATH') or '')).split())}"
|
||||
# it would be better to copy them in do_install_append, but find_license_filesa is python
|
||||
PSEUDO_IGNORE_PATHS .= ",${@','.join(((d.getVar('COMMON_LICENSE_DIR') or '') + ' ' + (d.getVar('LICENSE_PATH') or '') + ' ' + d.getVar('COREBASE') + '/meta/COPYING').split())}"
|
||||
# it would be better to copy them in do_install:append, but find_license_filesa is python
|
||||
python perform_packagecopy_prepend () {
|
||||
enabled = oe.data.typed_value('LICENSE_CREATE_PACKAGE', d)
|
||||
if d.getVar('CLASSOVERRIDE') == 'class-target' and enabled:
|
||||
|
||||
@@ -106,7 +106,6 @@ python __anonymous () {
|
||||
d.setVar("LINGUAS_INSTALL", "")
|
||||
# FIXME, we need to map this to something, not delete it!
|
||||
d.setVar("PACKAGE_INSTALL_ATTEMPTONLY", "")
|
||||
bb.build.deltask('do_populate_sdk', d)
|
||||
bb.build.deltask('do_populate_sdk_ext', d)
|
||||
return
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ python () {
|
||||
|
||||
SDK_RDEPENDS = "${TOOLCHAIN_TARGET_TASK} ${TOOLCHAIN_HOST_TASK}"
|
||||
SDK_DEPENDS = "virtual/fakeroot-native ${SDK_ARCHIVE_DEPENDS} cross-localedef-native nativesdk-qemuwrapper-cross ${@' '.join(["%s-qemuwrapper-cross" % m for m in d.getVar("MULTILIB_VARIANTS").split()])} qemuwrapper-cross"
|
||||
PATH_prepend = "${STAGING_DIR_HOST}${SDKPATHNATIVE}${bindir}/crossscripts:${@":".join(all_multilib_tune_values(d, 'STAGING_BINDIR_CROSS').split())}:"
|
||||
PATH_prepend = "${WORKDIR}/recipe-sysroot/${SDKPATHNATIVE}${bindir}/crossscripts:${@":".join(all_multilib_tune_values(d, 'STAGING_BINDIR_CROSS').split())}:"
|
||||
SDK_DEPENDS += "nativesdk-glibc-locale"
|
||||
|
||||
# We want the MULTIARCH_TARGET_SYS to point to the TUNE_PKGARCH, not PACKAGE_ARCH as it
|
||||
@@ -275,6 +275,7 @@ EOF
|
||||
# substitute variables
|
||||
sed -i -e 's#@SDK_ARCH@#${SDK_ARCH}#g' \
|
||||
-e 's#@SDKPATH@#${SDKPATH}#g' \
|
||||
-e 's#@SDKPATHINSTALL@#${SDKPATHINSTALL}#g' \
|
||||
-e 's#@SDKEXTPATH@#${SDKEXTPATH}#g' \
|
||||
-e 's#@OLDEST_KERNEL@#${SDK_OLDEST_KERNEL}#g' \
|
||||
-e 's#@REAL_MULTIMACH_TARGET_SYS@#${REAL_MULTIMACH_TARGET_SYS}#g' \
|
||||
|
||||
@@ -705,6 +705,7 @@ def sstate_package(ss, d):
|
||||
pass
|
||||
except OSError as e:
|
||||
# Handle read-only file systems gracefully
|
||||
import errno
|
||||
if e.errno != errno.EROFS:
|
||||
raise e
|
||||
|
||||
@@ -1014,6 +1015,7 @@ def sstate_checkhashes(sq_data, d, siginfo=False, currentcount=0, summary=True,
|
||||
bb.parse.siggen.checkhashes(sq_data, missed, found, d)
|
||||
|
||||
return found
|
||||
setscene_depvalid[vardepsexclude] = "SSTATE_EXCLUDEDEPS_SYSROOT"
|
||||
|
||||
BB_SETSCENE_DEPVALID = "setscene_depvalid"
|
||||
|
||||
@@ -1147,6 +1149,7 @@ python sstate_eventhandler() {
|
||||
pass
|
||||
except OSError as e:
|
||||
# Handle read-only file systems gracefully
|
||||
import errno
|
||||
if e.errno != errno.EROFS:
|
||||
raise e
|
||||
|
||||
|
||||
@@ -233,7 +233,7 @@ create_cmdline_wrapper () {
|
||||
#!/bin/bash
|
||||
realpath=\`readlink -fn \$0\`
|
||||
realdir=\`dirname \$realpath\`
|
||||
exec -a \`dirname \$realpath\`/$cmdname \`dirname \$realpath\`/$cmdname.real $cmdoptions "\$@"
|
||||
exec -a \$realdir/$cmdname \$realdir/$cmdname.real $cmdoptions "\$@"
|
||||
END
|
||||
chmod +x $cmd
|
||||
}
|
||||
|
||||
@@ -421,8 +421,10 @@ PKGDATA_DIR = "${TMPDIR}/pkgdata/${MACHINE}"
|
||||
|
||||
SDK_NAME_PREFIX ?= "oecore"
|
||||
SDK_NAME = "${SDK_NAME_PREFIX}-${SDK_ARCH}-${TUNE_PKGARCH}"
|
||||
SDKPATH = "/usr/local/${SDK_NAME_PREFIX}-${SDK_ARCH}"
|
||||
SDKPATH = "/usr/local/oe-sdk-hardcoded-buildpath"
|
||||
SDKPATHNATIVE = "${SDKPATH}/sysroots/${SDK_SYS}"
|
||||
# The path to default to installing the SDK to
|
||||
SDKPATHINSTALL = "/usr/local/${SDK_NAME_PREFIX}-${SDK_ARCH}"
|
||||
|
||||
##################################################################
|
||||
# Kernel info.
|
||||
@@ -639,7 +641,7 @@ APACHE_MIRROR = "https://archive.apache.org/dist"
|
||||
DEBIAN_MIRROR = "http://ftp.debian.org/debian/pool"
|
||||
GENTOO_MIRROR = "http://distfiles.gentoo.org/distfiles"
|
||||
GNOME_GIT = "git://gitlab.gnome.org/GNOME"
|
||||
GNOME_MIRROR = "https://ftp.gnome.org/pub/GNOME/sources"
|
||||
GNOME_MIRROR = "https://download.gnome.org/sources/"
|
||||
GNU_MIRROR = "https://ftp.gnu.org/gnu"
|
||||
GNUPG_MIRROR = "https://www.gnupg.org/ftp/gcrypt"
|
||||
GPE_MIRROR = "http://gpe.linuxtogo.org/download/source"
|
||||
|
||||
@@ -61,10 +61,6 @@ CVE_CHECK_WHITELIST += "CVE-2020-29509 CVE-2020-29511"
|
||||
# There was a proposed patch https://lists.gnu.org/archive/html/qemu-devel/2021-02/msg06098.html
|
||||
# however qemu maintainers are sure the patch is incorrect and should not be applied.
|
||||
|
||||
# flex:flex-native https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2019-6293
|
||||
# Upstream bug, still open: https://github.com/westes/flex/issues/414
|
||||
# Causes memory exhaustion so potential DoS but no buffer overflow, low priority
|
||||
|
||||
# wget https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2021-31879
|
||||
# https://mail.gnu.org/archive/html/bug-wget/2021-02/msg00002.html
|
||||
# No response upstream as of 2021/5/12
|
||||
|
||||
@@ -102,4 +102,4 @@ SSTATE_EXCLUDEDEPS_SYSROOT += ".*->autoconf-archive-native"
|
||||
# We need to keep bitbake tools in PATH
|
||||
# Avoid empty path entries
|
||||
BITBAKEPATH := "${@os.path.dirname(bb.utils.which(d.getVar('PATH'),'bitbake'))}"
|
||||
PATH := "${@'${BITBAKEPATH}:' if '${BITBAKEPATH}' is not '' else ''}${HOSTTOOLS_DIR}"
|
||||
PATH := "${@'${BITBAKEPATH}:' if '${BITBAKEPATH}' != '' else ''}${HOSTTOOLS_DIR}"
|
||||
|
||||
@@ -56,7 +56,8 @@ if ! xz -V > /dev/null 2>&1; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
DEFAULT_INSTALL_DIR="@SDKPATH@"
|
||||
SDK_BUILD_PATH="@SDKPATH@"
|
||||
DEFAULT_INSTALL_DIR="@SDKPATHINSTALL@"
|
||||
SUDO_EXEC=""
|
||||
EXTRA_TAR_OPTIONS=""
|
||||
target_sdk_dir=""
|
||||
|
||||
@@ -61,7 +61,7 @@ done | xargs -n100 file | grep ":.*\(ASCII\|script\|source\).*text" | \
|
||||
-e "$target_sdk_dir/post-relocate-setup" \
|
||||
-e "$target_sdk_dir/${0##*/}" | \
|
||||
xargs -n100 $SUDO_EXEC sed -i \
|
||||
-e "s:$DEFAULT_INSTALL_DIR:$target_sdk_dir:g" \
|
||||
-e "s:$SDK_BUILD_PATH:$target_sdk_dir:g" \
|
||||
-e "s:^#! */usr/bin/perl.*:#! /usr/bin/env perl:g" \
|
||||
-e "s: /usr/bin/perl: /usr/bin/env perl:g"
|
||||
|
||||
@@ -72,7 +72,7 @@ fi
|
||||
|
||||
# change all symlinks pointing to @SDKPATH@
|
||||
for l in $($SUDO_EXEC find $native_sysroot -type l); do
|
||||
$SUDO_EXEC ln -sfn $(readlink $l|$SUDO_EXEC sed -e "s:$DEFAULT_INSTALL_DIR:$target_sdk_dir:") $l
|
||||
$SUDO_EXEC ln -sfn $(readlink $l|$SUDO_EXEC sed -e "s:$SDK_BUILD_PATH:$target_sdk_dir:") $l
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Failed to setup symlinks. Relocate script failed. Abort!"
|
||||
exit 1
|
||||
|
||||
@@ -136,7 +136,7 @@
|
||||
"expected_results": ""
|
||||
},
|
||||
"3": {
|
||||
"action": "Check that default values are as follows: \n\tDISTRO - poky \n\tIMAGE_FSTYPES - ext3 jffs2 tar.bz2 \n\tIMAGE_INSTALL_append - \"Not set\" \n\tPACKAGE_CLASES - package_rpm \n SSTATE_DIR - /homeDirectory/poky/sstate-cache \n\n",
|
||||
"action": "Check that default values are as follows: \n\tDISTRO - poky \n\tIMAGE_FSTYPES - ext3 jffs2 tar.bz2 \n\tIMAGE_INSTALL_append - \"Not set\" \n\tPACKAGE_CLASSES - package_rpm \n SSTATE_DIR - /homeDirectory/poky/sstate-cache \n\n",
|
||||
"expected_results": ""
|
||||
},
|
||||
"4": {
|
||||
|
||||
@@ -13,12 +13,12 @@ class DateTest(OERuntimeTestCase):
|
||||
def setUp(self):
|
||||
if self.tc.td.get('VIRTUAL-RUNTIME_init_manager') == 'systemd':
|
||||
self.logger.debug('Stopping systemd-timesyncd daemon')
|
||||
self.target.run('systemctl disable --now systemd-timesyncd')
|
||||
self.target.run('systemctl disable --now --runtime systemd-timesyncd')
|
||||
|
||||
def tearDown(self):
|
||||
if self.tc.td.get('VIRTUAL-RUNTIME_init_manager') == 'systemd':
|
||||
self.logger.debug('Starting systemd-timesyncd daemon')
|
||||
self.target.run('systemctl enable --now systemd-timesyncd')
|
||||
self.target.run('systemctl enable --now --runtime systemd-timesyncd')
|
||||
|
||||
@OETestDepends(['ssh.SSHTest.test_ssh'])
|
||||
@OEHasPackage(['coreutils', 'busybox'])
|
||||
@@ -28,14 +28,13 @@ class DateTest(OERuntimeTestCase):
|
||||
self.assertEqual(status, 0, msg=msg)
|
||||
oldDate = output
|
||||
|
||||
sampleDate = '"2016-08-09 10:00:00"'
|
||||
(status, output) = self.target.run("date -s %s" % sampleDate)
|
||||
sampleTimestamp = 1488800000
|
||||
(status, output) = self.target.run("date -s @%d" % sampleTimestamp)
|
||||
self.assertEqual(status, 0, msg='Date set failed, output: %s' % output)
|
||||
|
||||
(status, output) = self.target.run("date -R")
|
||||
p = re.match('Tue, 09 Aug 2016 10:00:.. \+0000', output)
|
||||
(status, output) = self.target.run('date +"%s"')
|
||||
msg = 'The date was not set correctly, output: %s' % output
|
||||
self.assertTrue(p, msg=msg)
|
||||
self.assertTrue(int(output) - sampleTimestamp < 300, msg=msg)
|
||||
|
||||
(status, output) = self.target.run('date -s "%s"' % oldDate)
|
||||
msg = 'Failed to reset date, output: %s' % output
|
||||
|
||||
36
meta/lib/oeqa/runtime/cases/ethernet_ip_connman.py
Normal file
36
meta/lib/oeqa/runtime/cases/ethernet_ip_connman.py
Normal file
@@ -0,0 +1,36 @@
|
||||
from oeqa.runtime.case import OERuntimeTestCase
|
||||
from oeqa.core.decorator.depends import OETestDepends
|
||||
from oeqa.core.decorator.data import skipIfQemu
|
||||
|
||||
class Ethernet_Test(OERuntimeTestCase):
|
||||
|
||||
def set_ip(self, x):
|
||||
x = x.split(".")
|
||||
sample_host_address = '150'
|
||||
x[3] = sample_host_address
|
||||
x = '.'.join(x)
|
||||
return x
|
||||
|
||||
@skipIfQemu('qemuall', 'Test only runs on real hardware')
|
||||
@OETestDepends(['ssh.SSHTest.test_ssh'])
|
||||
def test_set_virtual_ip(self):
|
||||
(status, output) = self.target.run("ifconfig eth0 | grep 'inet ' | awk '{print $2}'")
|
||||
self.assertEqual(status, 0, msg='Failed to get ip address. Make sure you have an ethernet connection on your device, output: %s' % output)
|
||||
original_ip = output
|
||||
virtual_ip = self.set_ip(original_ip)
|
||||
|
||||
(status, output) = self.target.run("ifconfig eth0:1 %s netmask 255.255.255.0 && sleep 2 && ping -c 5 %s && ifconfig eth0:1 down" % (virtual_ip,virtual_ip))
|
||||
self.assertEqual(status, 0, msg='Failed to create virtual ip address, output: %s' % output)
|
||||
|
||||
@OETestDepends(['ethernet_ip_connman.Ethernet_Test.test_set_virtual_ip'])
|
||||
def test_get_ip_from_dhcp(self):
|
||||
(status, output) = self.target.run("connmanctl services | grep -E '*AO Wired|*AR Wired' | awk '{print $3}'")
|
||||
self.assertEqual(status, 0, msg='No wired interfaces are detected, output: %s' % output)
|
||||
wired_interfaces = output
|
||||
|
||||
(status, output) = self.target.run("ip route | grep default | awk '{print $3}'")
|
||||
self.assertEqual(status, 0, msg='Failed to retrieve the default gateway, output: %s' % output)
|
||||
default_gateway = output
|
||||
|
||||
(status, output) = self.target.run("connmanctl config %s --ipv4 dhcp && sleep 2 && ping -c 5 %s" % (wired_interfaces,default_gateway))
|
||||
self.assertEqual(status, 0, msg='Failed to get dynamic IP address via DHCP in connmand, output: %s' % output)
|
||||
@@ -90,6 +90,7 @@ qemux86_common = [
|
||||
"glamor initialization failed",
|
||||
"blk_update_request: I/O error, dev fd0, sector 0 op 0x0:(READ)",
|
||||
"floppy: error",
|
||||
'failed to IDENTIFY (I/O error, err_mask=0x4)',
|
||||
] + common_errors
|
||||
|
||||
ignore_errors = {
|
||||
|
||||
38
meta/lib/oeqa/runtime/cases/rtc.py
Normal file
38
meta/lib/oeqa/runtime/cases/rtc.py
Normal file
@@ -0,0 +1,38 @@
|
||||
from oeqa.runtime.case import OERuntimeTestCase
|
||||
from oeqa.core.decorator.depends import OETestDepends
|
||||
from oeqa.runtime.decorator.package import OEHasPackage
|
||||
|
||||
import re
|
||||
|
||||
class RTCTest(OERuntimeTestCase):
|
||||
|
||||
def setUp(self):
|
||||
if self.tc.td.get('VIRTUAL-RUNTIME_init_manager') == 'systemd':
|
||||
self.logger.debug('Stopping systemd-timesyncd daemon')
|
||||
self.target.run('systemctl disable --now --runtime systemd-timesyncd')
|
||||
|
||||
def tearDown(self):
|
||||
if self.tc.td.get('VIRTUAL-RUNTIME_init_manager') == 'systemd':
|
||||
self.logger.debug('Starting systemd-timesyncd daemon')
|
||||
self.target.run('systemctl enable --now --runtime systemd-timesyncd')
|
||||
|
||||
@OETestDepends(['ssh.SSHTest.test_ssh'])
|
||||
@OEHasPackage(['coreutils', 'busybox'])
|
||||
def test_rtc(self):
|
||||
(status, output) = self.target.run('hwclock -r')
|
||||
self.assertEqual(status, 0, msg='Failed to get RTC time, output: %s' % output)
|
||||
|
||||
(status, current_datetime) = self.target.run('date +"%m%d%H%M%Y"')
|
||||
self.assertEqual(status, 0, msg='Failed to get system current date & time, output: %s' % current_datetime)
|
||||
|
||||
example_datetime = '062309452008'
|
||||
(status, output) = self.target.run('date %s ; hwclock -w ; hwclock -r' % example_datetime)
|
||||
check_hwclock = re.search('2008-06-23 09:45:..', output)
|
||||
self.assertTrue(check_hwclock, msg='The RTC time was not set correctly, output: %s' % output)
|
||||
|
||||
(status, output) = self.target.run('date %s' % current_datetime)
|
||||
self.assertEqual(status, 0, msg='Failed to reset system date & time, output: %s' % output)
|
||||
|
||||
(status, output) = self.target.run('hwclock -w')
|
||||
self.assertEqual(status, 0, msg='Failed to reset RTC time, output: %s' % output)
|
||||
|
||||
33
meta/lib/oeqa/runtime/cases/suspend.py
Normal file
33
meta/lib/oeqa/runtime/cases/suspend.py
Normal file
@@ -0,0 +1,33 @@
|
||||
from oeqa.runtime.case import OERuntimeTestCase
|
||||
from oeqa.core.decorator.depends import OETestDepends
|
||||
from oeqa.core.decorator.data import skipIfQemu
|
||||
import threading
|
||||
import time
|
||||
|
||||
class Suspend_Test(OERuntimeTestCase):
|
||||
|
||||
def test_date(self):
|
||||
(status, output) = self.target.run('date')
|
||||
self.assertEqual(status, 0, msg = 'Failed to run date command, output : %s' % output)
|
||||
|
||||
def test_ping(self):
|
||||
t_thread = threading.Thread(target=self.target.run, args=("ping 8.8.8.8",))
|
||||
t_thread.start()
|
||||
time.sleep(2)
|
||||
|
||||
status, output = self.target.run('pidof ping')
|
||||
self.target.run('kill -9 %s' % output)
|
||||
self.assertEqual(status, 0, msg = 'Not able to find process that runs ping, output : %s' % output)
|
||||
|
||||
def set_suspend(self):
|
||||
(status, output) = self.target.run('sudo rtcwake -m mem -s 10')
|
||||
self.assertEqual(status, 0, msg = 'Failed to suspends your system to RAM, output : %s' % output)
|
||||
|
||||
@skipIfQemu('qemuall', 'Test only runs on real hardware')
|
||||
@OETestDepends(['ssh.SSHTest.test_ssh'])
|
||||
def test_suspend(self):
|
||||
self.test_date()
|
||||
self.test_ping()
|
||||
self.set_suspend()
|
||||
self.test_date()
|
||||
self.test_ping()
|
||||
21
meta/lib/oeqa/runtime/cases/terminal.py
Normal file
21
meta/lib/oeqa/runtime/cases/terminal.py
Normal file
@@ -0,0 +1,21 @@
|
||||
from oeqa.runtime.case import OERuntimeTestCase
|
||||
from oeqa.core.decorator.depends import OETestDepends
|
||||
from oeqa.runtime.decorator.package import OEHasPackage
|
||||
|
||||
import threading
|
||||
import time
|
||||
|
||||
class TerminalTest(OERuntimeTestCase):
|
||||
|
||||
@OEHasPackage(['matchbox-terminal'])
|
||||
@OETestDepends(['ssh.SSHTest.test_ssh'])
|
||||
def test_terminal_running(self):
|
||||
t_thread = threading.Thread(target=self.target.run, args=("export DISPLAY=:0 && matchbox-terminal -e 'sh -c \"uname -a && exec sh\"'",))
|
||||
t_thread.start()
|
||||
time.sleep(2)
|
||||
|
||||
status, output = self.target.run('pidof matchbox-terminal')
|
||||
number_of_terminal = len(output.split())
|
||||
self.assertEqual(number_of_terminal, 1, msg='There should be only one terminal being launched. Number of terminal launched : %s' % number_of_terminal)
|
||||
self.target.run('kill -9 %s' % output)
|
||||
self.assertEqual(status, 0, msg='Not able to find process that runs terminal.')
|
||||
22
meta/lib/oeqa/runtime/cases/usb_hid.py
Normal file
22
meta/lib/oeqa/runtime/cases/usb_hid.py
Normal file
@@ -0,0 +1,22 @@
|
||||
from oeqa.runtime.case import OERuntimeTestCase
|
||||
from oeqa.core.decorator.depends import OETestDepends
|
||||
from oeqa.core.decorator.data import skipIfQemu
|
||||
from oeqa.runtime.decorator.package import OEHasPackage
|
||||
|
||||
class USB_HID_Test(OERuntimeTestCase):
|
||||
|
||||
def keyboard_mouse_simulation(self):
|
||||
(status, output) = self.target.run('export DISPLAY=:0 && xdotool key F2 && xdotool mousemove 100 100')
|
||||
return self.assertEqual(status, 0, msg = 'Failed to simulate keyboard/mouse input event, output : %s' % output)
|
||||
|
||||
def set_suspend(self):
|
||||
(status, output) = self.target.run('sudo rtcwake -m mem -s 10')
|
||||
return self.assertEqual(status, 0, msg = 'Failed to suspends your system to RAM, output : %s' % output)
|
||||
|
||||
@OEHasPackage(['xdotool'])
|
||||
@skipIfQemu('qemuall', 'Test only runs on real hardware')
|
||||
@OETestDepends(['ssh.SSHTest.test_ssh'])
|
||||
def test_USB_Hid_input(self):
|
||||
self.keyboard_mouse_simulation()
|
||||
self.set_suspend()
|
||||
self.keyboard_mouse_simulation()
|
||||
@@ -33,7 +33,7 @@ class GlibcSelfTestBase(OESelftestTestCase, OEPTestResultTestCase):
|
||||
|
||||
ptestsuite = "glibc-user" if ssh is None else "glibc"
|
||||
self.ptest_section(ptestsuite)
|
||||
with open(os.path.join(builddir, "tests.sum"), "r") as f:
|
||||
with open(os.path.join(builddir, "tests.sum"), "r", errors='replace') as f:
|
||||
for test, result in parse_values(f):
|
||||
self.ptest_result(ptestsuite, test, result)
|
||||
|
||||
|
||||
@@ -216,6 +216,7 @@ class TestImage(OESelftestTestCase):
|
||||
Author: Alexander Kanavin <alex.kanavin@gmail.com>
|
||||
"""
|
||||
import subprocess, os
|
||||
self.skipTest("Crashes in mesa observed with this test on dunfell: https://bugzilla.yoctoproject.org/show_bug.cgi?id=14527")
|
||||
try:
|
||||
content = os.listdir("/dev/dri")
|
||||
if len([i for i in content if i.startswith('render')]) == 0:
|
||||
|
||||
@@ -120,7 +120,10 @@ class QemuRunner:
|
||||
import fcntl
|
||||
fl = fcntl.fcntl(o, fcntl.F_GETFL)
|
||||
fcntl.fcntl(o, fcntl.F_SETFL, fl | os.O_NONBLOCK)
|
||||
return os.read(o.fileno(), 1000000).decode("utf-8")
|
||||
try:
|
||||
return os.read(o.fileno(), 1000000).decode("utf-8")
|
||||
except BlockingIOError:
|
||||
return ""
|
||||
|
||||
|
||||
def handleSIGCHLD(self, signum, frame):
|
||||
@@ -435,6 +438,8 @@ class QemuRunner:
|
||||
if self.runqemu.poll() is None:
|
||||
self.logger.debug("Sending SIGKILL to runqemu")
|
||||
os.killpg(os.getpgid(self.runqemu.pid), signal.SIGKILL)
|
||||
if not self.runqemu.stdout.closed:
|
||||
self.logger.info("Output from runqemu:\n%s" % self.getOutput(self.runqemu.stdout))
|
||||
self.runqemu.stdin.close()
|
||||
self.runqemu.stdout.close()
|
||||
self.runqemu_exited = True
|
||||
|
||||
@@ -21,6 +21,7 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=2d5025d4aa3495befef8f17206a5b0a1 \
|
||||
|
||||
SRC_URI = "https://github.com/lathiat/avahi/releases/download/v${PV}/avahi-${PV}.tar.gz \
|
||||
file://fix-CVE-2017-6519.patch \
|
||||
file://CVE-2021-3468.patch \
|
||||
"
|
||||
|
||||
UPSTREAM_CHECK_URI = "https://github.com/lathiat/avahi/releases/"
|
||||
|
||||
42
meta/recipes-connectivity/avahi/files/CVE-2021-3468.patch
Normal file
42
meta/recipes-connectivity/avahi/files/CVE-2021-3468.patch
Normal file
@@ -0,0 +1,42 @@
|
||||
From 447affe29991ee99c6b9732fc5f2c1048a611d3b Mon Sep 17 00:00:00 2001
|
||||
From: Riccardo Schirone <sirmy15@gmail.com>
|
||||
Date: Fri, 26 Mar 2021 11:50:24 +0100
|
||||
Subject: [PATCH] Avoid infinite-loop in avahi-daemon by handling HUP event in
|
||||
client_work
|
||||
|
||||
If a client fills the input buffer, client_work() disables the
|
||||
AVAHI_WATCH_IN event, thus preventing the function from executing the
|
||||
`read` syscall the next times it is called. However, if the client then
|
||||
terminates the connection, the socket file descriptor receives a HUP
|
||||
event, which is not handled, thus the kernel keeps marking the HUP event
|
||||
as occurring. While iterating over the file descriptors that triggered
|
||||
an event, the client file descriptor will keep having the HUP event and
|
||||
the client_work() function is always called with AVAHI_WATCH_HUP but
|
||||
without nothing being done, thus entering an infinite loop.
|
||||
|
||||
See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=984938
|
||||
|
||||
Upstream-Status: Backport
|
||||
CVE: CVE-2021-3468
|
||||
Signed-off-by: Steve Sakoman <steve@sakoman.com>
|
||||
|
||||
---
|
||||
avahi-daemon/simple-protocol.c | 5 +++++
|
||||
1 file changed, 5 insertions(+)
|
||||
|
||||
diff --git a/avahi-daemon/simple-protocol.c b/avahi-daemon/simple-protocol.c
|
||||
index 3e0ebb11..6c0274d6 100644
|
||||
--- a/avahi-daemon/simple-protocol.c
|
||||
+++ b/avahi-daemon/simple-protocol.c
|
||||
@@ -424,6 +424,11 @@ static void client_work(AvahiWatch *watch, AVAHI_GCC_UNUSED int fd, AvahiWatchEv
|
||||
}
|
||||
}
|
||||
|
||||
+ if (events & AVAHI_WATCH_HUP) {
|
||||
+ client_free(c);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
c->server->poll_api->watch_update(
|
||||
watch,
|
||||
(c->outbuf_length > 0 ? AVAHI_WATCH_OUT : 0) |
|
||||
@@ -23,7 +23,7 @@ SRC_URI_append_class-nativesdk = " \
|
||||
file://environment.d-openssl.sh \
|
||||
"
|
||||
|
||||
SRC_URI[sha256sum] = "892a0875b9872acd04a9fde79b1f943075d5ea162415de3047c327df33fbaee5"
|
||||
SRC_URI[sha256sum] = "0b7a3e5e59c34827fe0c3a74b7ec8baef302b98fa80088d7f9153aa16fa76bd1"
|
||||
|
||||
inherit lib_package multilib_header multilib_script ptest
|
||||
MULTILIB_SCRIPTS = "${PN}-bin:${bindir}/c_rehash"
|
||||
@@ -1,57 +1,31 @@
|
||||
SUMMARY = "D-Bus test package (for D-bus functionality testing only)"
|
||||
HOMEPAGE = "http://dbus.freedesktop.org"
|
||||
SECTION = "base"
|
||||
LICENSE = "AFL-2.1 | GPLv2+"
|
||||
LIC_FILES_CHKSUM = "file://COPYING;md5=10dded3b58148f3f1fd804b26354af3e \
|
||||
file://dbus/dbus.h;beginline=6;endline=20;md5=7755c9d7abccd5dbd25a6a974538bb3c"
|
||||
|
||||
require dbus.inc
|
||||
|
||||
SRC_URI += "file://run-ptest \
|
||||
file://python-config.patch \
|
||||
"
|
||||
|
||||
DEPENDS = "dbus glib-2.0"
|
||||
|
||||
RDEPENDS_${PN}-dev = ""
|
||||
|
||||
SRC_URI = "http://dbus.freedesktop.org/releases/dbus/dbus-${PV}.tar.gz \
|
||||
file://tmpdir.patch \
|
||||
file://run-ptest \
|
||||
file://python-config.patch \
|
||||
file://clear-guid_from_server-if-send_negotiate_unix_f.patch \
|
||||
"
|
||||
|
||||
SRC_URI[md5sum] = "2dbeae80dfc9e3632320c6a53d5e8890"
|
||||
SRC_URI[sha256sum] = "54a22d2fa42f2eb2a871f32811c6005b531b9613b1b93a0d269b05e7549fec80"
|
||||
|
||||
S="${WORKDIR}/dbus-${PV}"
|
||||
FILESEXTRAPATHS =. "${FILE_DIRNAME}/dbus:"
|
||||
|
||||
inherit autotools pkgconfig gettext ptest upstream-version-is-even
|
||||
inherit ptest
|
||||
|
||||
EXTRA_OECONF_X = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', '--with-x', '--without-x', d)}"
|
||||
EXTRA_OECONF_X_class-native = "--without-x"
|
||||
|
||||
EXTRA_OECONF = "--enable-tests \
|
||||
EXTRA_OECONF += "--enable-tests \
|
||||
--enable-modular-tests \
|
||||
--enable-installed-tests \
|
||||
--enable-checks \
|
||||
--enable-asserts \
|
||||
--enable-largefile \
|
||||
--disable-xml-docs \
|
||||
--disable-doxygen-docs \
|
||||
--disable-libaudit \
|
||||
--with-dbus-test-dir=${PTEST_PATH} \
|
||||
${EXTRA_OECONF_X} \
|
||||
--enable-embedded-tests \
|
||||
"
|
||||
|
||||
EXTRA_OECONF_append_class-target = " SYSTEMCTL=${base_bindir}/systemctl"
|
||||
|
||||
PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd x11', d)}"
|
||||
PACKAGECONFIG_class-native = ""
|
||||
PACKAGECONFIG_class-nativesdk = ""
|
||||
|
||||
PACKAGECONFIG[systemd] = "--enable-systemd --with-systemdsystemunitdir=${systemd_system_unitdir},--disable-systemd --without-systemdsystemunitdir,systemd"
|
||||
PACKAGECONFIG[x11] = "--with-x --enable-x11-autolaunch,--without-x --disable-x11-autolaunch, virtual/libx11 libsm"
|
||||
PACKAGECONFIG[user-session] = "--enable-user-session --with-systemduserunitdir=${systemd_user_unitdir},--disable-user-session"
|
||||
PACKAGECONFIG[verbose-mode] = "--enable-verbose-mode,,,"
|
||||
|
||||
do_install() {
|
||||
:
|
||||
}
|
||||
34
meta/recipes-core/dbus/dbus.inc
Normal file
34
meta/recipes-core/dbus/dbus.inc
Normal file
@@ -0,0 +1,34 @@
|
||||
inherit autotools pkgconfig gettext upstream-version-is-even
|
||||
|
||||
LICENSE = "AFL-2.1 | GPLv2+"
|
||||
LIC_FILES_CHKSUM = "file://COPYING;md5=10dded3b58148f3f1fd804b26354af3e \
|
||||
file://dbus/dbus.h;beginline=6;endline=20;md5=7755c9d7abccd5dbd25a6a974538bb3c"
|
||||
|
||||
SRC_URI = "https://dbus.freedesktop.org/releases/dbus/dbus-${PV}.tar.gz \
|
||||
file://tmpdir.patch \
|
||||
file://dbus-1.init \
|
||||
file://clear-guid_from_server-if-send_negotiate_unix_f.patch \
|
||||
"
|
||||
|
||||
SRC_URI[md5sum] = "dfe8a71f412e0b53be26ed4fbfdc91c4"
|
||||
SRC_URI[sha256sum] = "f77620140ecb4cdc67f37fb444f8a6bea70b5b6461f12f1cbe2cec60fa7de5fe"
|
||||
|
||||
EXTRA_OECONF = "--disable-xml-docs \
|
||||
--disable-doxygen-docs \
|
||||
--disable-libaudit \
|
||||
--enable-largefile \
|
||||
--with-system-socket=/run/dbus/system_bus_socket \
|
||||
"
|
||||
EXTRA_OECONF_append_class-target = " SYSTEMCTL=${base_bindir}/systemctl"
|
||||
EXTRA_OECONF_append_class-native = " --disable-selinux"
|
||||
|
||||
PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd x11', d)} \
|
||||
user-session \
|
||||
"
|
||||
PACKAGECONFIG_class-native = ""
|
||||
PACKAGECONFIG_class-nativesdk = ""
|
||||
|
||||
PACKAGECONFIG[systemd] = "--enable-systemd --with-systemdsystemunitdir=${systemd_system_unitdir},--disable-systemd --without-systemdsystemunitdir,systemd"
|
||||
PACKAGECONFIG[x11] = "--with-x --enable-x11-autolaunch,--without-x --disable-x11-autolaunch, virtual/libx11 libsm"
|
||||
PACKAGECONFIG[user-session] = "--enable-user-session --with-systemduserunitdir=${systemd_user_unitdir},--disable-user-session"
|
||||
PACKAGECONFIG[verbose-mode] = "--enable-verbose-mode,,,"
|
||||
@@ -1,78 +0,0 @@
|
||||
From 872b085f12f56da25a2dbd9bd0b2dff31d5aea63 Mon Sep 17 00:00:00 2001
|
||||
From: Simon McVittie <smcv@collabora.com>
|
||||
Date: Thu, 16 Apr 2020 14:45:11 +0100
|
||||
Subject: [PATCH] sysdeps-unix: On MSG_CTRUNC, close the fds we did receive
|
||||
|
||||
MSG_CTRUNC indicates that we have received fewer fds that we should
|
||||
have done because the buffer was too small, but we were treating it
|
||||
as though it indicated that we received *no* fds. If we received any,
|
||||
we still have to make sure we close them, otherwise they will be leaked.
|
||||
|
||||
On the system bus, if an attacker can induce us to leak fds in this
|
||||
way, that's a local denial of service via resource exhaustion.
|
||||
|
||||
Reported-by: Kevin Backhouse, GitHub Security Lab
|
||||
Fixes: dbus#294
|
||||
Fixes: CVE-2020-12049
|
||||
Fixes: GHSL-2020-057
|
||||
|
||||
Upstream-Status: Backport [https://gitlab.freedesktop.org/dbus/dbus/-/commit/872b085f12f56da25a2dbd9bd0b2dff31d5aea63]
|
||||
CVE: CVE-2020-12049
|
||||
Signed-off-by: Lee Chee Yang <chee.yang.lee@intel.com>
|
||||
---
|
||||
dbus/dbus-sysdeps-unix.c | 32 ++++++++++++++++++++------------
|
||||
1 file changed, 20 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/dbus/dbus-sysdeps-unix.c b/dbus/dbus-sysdeps-unix.c
|
||||
index b5fc2466..b176dae1 100644
|
||||
--- a/dbus/dbus-sysdeps-unix.c
|
||||
+++ b/dbus/dbus-sysdeps-unix.c
|
||||
@@ -435,18 +435,6 @@ _dbus_read_socket_with_unix_fds (DBusSocket fd,
|
||||
struct cmsghdr *cm;
|
||||
dbus_bool_t found = FALSE;
|
||||
|
||||
- if (m.msg_flags & MSG_CTRUNC)
|
||||
- {
|
||||
- /* Hmm, apparently the control data was truncated. The bad
|
||||
- thing is that we might have completely lost a couple of fds
|
||||
- without chance to recover them. Hence let's treat this as a
|
||||
- serious error. */
|
||||
-
|
||||
- errno = ENOSPC;
|
||||
- _dbus_string_set_length (buffer, start);
|
||||
- return -1;
|
||||
- }
|
||||
-
|
||||
for (cm = CMSG_FIRSTHDR(&m); cm; cm = CMSG_NXTHDR(&m, cm))
|
||||
if (cm->cmsg_level == SOL_SOCKET && cm->cmsg_type == SCM_RIGHTS)
|
||||
{
|
||||
@@ -501,6 +489,26 @@ _dbus_read_socket_with_unix_fds (DBusSocket fd,
|
||||
if (!found)
|
||||
*n_fds = 0;
|
||||
|
||||
+ if (m.msg_flags & MSG_CTRUNC)
|
||||
+ {
|
||||
+ unsigned int i;
|
||||
+
|
||||
+ /* Hmm, apparently the control data was truncated. The bad
|
||||
+ thing is that we might have completely lost a couple of fds
|
||||
+ without chance to recover them. Hence let's treat this as a
|
||||
+ serious error. */
|
||||
+
|
||||
+ /* We still need to close whatever fds we *did* receive,
|
||||
+ * otherwise they'll never get closed. (CVE-2020-12049) */
|
||||
+ for (i = 0; i < *n_fds; i++)
|
||||
+ close (fds[i]);
|
||||
+
|
||||
+ *n_fds = 0;
|
||||
+ errno = ENOSPC;
|
||||
+ _dbus_string_set_length (buffer, start);
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
/* put length back (doesn't actually realloc) */
|
||||
_dbus_string_set_length (buffer, start + bytes_read);
|
||||
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@@ -2,9 +2,9 @@ SUMMARY = "D-Bus message bus"
|
||||
DESCRIPTION = "D-Bus is a message bus system, a simple way for applications to talk to one another. In addition to interprocess communication, D-Bus helps coordinate process lifecycle; it makes it simple and reliable to code a \"single instance\" application or daemon, and to launch applications and daemons on demand when their services are needed."
|
||||
HOMEPAGE = "https://dbus.freedesktop.org"
|
||||
SECTION = "base"
|
||||
LICENSE = "AFL-2.1 | GPLv2+"
|
||||
LIC_FILES_CHKSUM = "file://COPYING;md5=10dded3b58148f3f1fd804b26354af3e \
|
||||
file://dbus/dbus.h;beginline=6;endline=20;md5=7755c9d7abccd5dbd25a6a974538bb3c"
|
||||
|
||||
require dbus.inc
|
||||
|
||||
DEPENDS = "expat virtual/libintl autoconf-archive"
|
||||
RDEPENDS_dbus_class-native = ""
|
||||
RDEPENDS_dbus_class-nativesdk = ""
|
||||
@@ -12,17 +12,7 @@ PACKAGES += "${@bb.utils.contains('DISTRO_FEATURES', 'ptest', '${PN}-ptest', '',
|
||||
ALLOW_EMPTY_dbus-ptest = "1"
|
||||
RDEPENDS_dbus-ptest_class-target = "dbus-test-ptest"
|
||||
|
||||
SRC_URI = "https://dbus.freedesktop.org/releases/dbus/dbus-${PV}.tar.gz \
|
||||
file://tmpdir.patch \
|
||||
file://dbus-1.init \
|
||||
file://clear-guid_from_server-if-send_negotiate_unix_f.patch \
|
||||
file://CVE-2020-12049.patch \
|
||||
"
|
||||
|
||||
SRC_URI[md5sum] = "2dbeae80dfc9e3632320c6a53d5e8890"
|
||||
SRC_URI[sha256sum] = "54a22d2fa42f2eb2a871f32811c6005b531b9613b1b93a0d269b05e7549fec80"
|
||||
|
||||
inherit useradd autotools pkgconfig gettext update-rc.d upstream-version-is-even
|
||||
inherit useradd update-rc.d
|
||||
|
||||
INITSCRIPT_NAME = "dbus-1"
|
||||
INITSCRIPT_PARAMS = "start 02 5 3 2 . stop 20 0 1 6 ."
|
||||
@@ -93,27 +83,7 @@ pkg_postinst_dbus() {
|
||||
}
|
||||
|
||||
|
||||
EXTRA_OECONF = "--disable-tests \
|
||||
--disable-xml-docs \
|
||||
--disable-doxygen-docs \
|
||||
--disable-libaudit \
|
||||
--enable-largefile \
|
||||
--with-system-socket=/run/dbus/system_bus_socket \
|
||||
"
|
||||
|
||||
EXTRA_OECONF_append_class-target = " SYSTEMCTL=${base_bindir}/systemctl"
|
||||
EXTRA_OECONF_append_class-native = " --disable-selinux"
|
||||
|
||||
PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd x11', d)} \
|
||||
user-session \
|
||||
"
|
||||
|
||||
PACKAGECONFIG_class-native = ""
|
||||
PACKAGECONFIG_class-nativesdk = ""
|
||||
|
||||
PACKAGECONFIG[systemd] = "--enable-systemd --with-systemdsystemunitdir=${systemd_system_unitdir},--disable-systemd --without-systemdsystemunitdir,systemd"
|
||||
PACKAGECONFIG[x11] = "--with-x --enable-x11-autolaunch,--without-x --disable-x11-autolaunch, virtual/libx11 libsm"
|
||||
PACKAGECONFIG[user-session] = "--enable-user-session --with-systemduserunitdir=${systemd_user_unitdir},--disable-user-session"
|
||||
EXTRA_OECONF += "--disable-tests"
|
||||
|
||||
do_install() {
|
||||
autotools_do_install
|
||||
72
meta/recipes-core/glibc/glibc/CVE-2021-33574_1.patch
Normal file
72
meta/recipes-core/glibc/glibc/CVE-2021-33574_1.patch
Normal file
@@ -0,0 +1,72 @@
|
||||
From 42d359350510506b87101cf77202fefcbfc790cb Mon Sep 17 00:00:00 2001
|
||||
From: Andreas Schwab <schwab@linux-m68k.org>
|
||||
Date: Thu, 27 May 2021 12:49:47 +0200
|
||||
Subject: [PATCH] Use __pthread_attr_copy in mq_notify (bug 27896)
|
||||
|
||||
Make a deep copy of the pthread attribute object to remove a potential
|
||||
use-after-free issue.
|
||||
|
||||
Upstream-Status: Backport
|
||||
CVE: CVE-2021-33574 patch#1
|
||||
Signed-off-by: Armin Kuster <akuster@mvista.com>
|
||||
|
||||
---
|
||||
NEWS | 4 ++++
|
||||
sysdeps/unix/sysv/linux/mq_notify.c | 15 ++++++++++-----
|
||||
2 files changed, 14 insertions(+), 5 deletions(-)
|
||||
|
||||
Index: git/NEWS
|
||||
===================================================================
|
||||
--- git.orig/NEWS
|
||||
+++ git/NEWS
|
||||
@@ -7,6 +7,10 @@ using `glibc' in the "product" field.
|
||||
|
||||
Version 2.31.1
|
||||
|
||||
+ CVE-2021-33574: The mq_notify function has a potential use-after-free
|
||||
+ issue when using a notification type of SIGEV_THREAD and a thread
|
||||
+ attribute with a non-default affinity mask.
|
||||
+
|
||||
The following bugs are resolved with this release:
|
||||
[19519] iconv(1) with -c option hangs on illegal multi-byte sequences
|
||||
(CVE-2016-10228)
|
||||
Index: git/sysdeps/unix/sysv/linux/mq_notify.c
|
||||
===================================================================
|
||||
--- git.orig/sysdeps/unix/sysv/linux/mq_notify.c
|
||||
+++ git/sysdeps/unix/sysv/linux/mq_notify.c
|
||||
@@ -135,8 +135,11 @@ helper_thread (void *arg)
|
||||
(void) __pthread_barrier_wait (¬ify_barrier);
|
||||
}
|
||||
else if (data.raw[NOTIFY_COOKIE_LEN - 1] == NOTIFY_REMOVED)
|
||||
- /* The only state we keep is the copy of the thread attributes. */
|
||||
- free (data.attr);
|
||||
+ {
|
||||
+ /* The only state we keep is the copy of the thread attributes. */
|
||||
+ pthread_attr_destroy (data.attr);
|
||||
+ free (data.attr);
|
||||
+ }
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
@@ -257,8 +260,7 @@ mq_notify (mqd_t mqdes, const struct sig
|
||||
if (data.attr == NULL)
|
||||
return -1;
|
||||
|
||||
- memcpy (data.attr, notification->sigev_notify_attributes,
|
||||
- sizeof (pthread_attr_t));
|
||||
+ __pthread_attr_copy (data.attr, notification->sigev_notify_attributes);
|
||||
}
|
||||
|
||||
/* Construct the new request. */
|
||||
@@ -272,7 +274,10 @@ mq_notify (mqd_t mqdes, const struct sig
|
||||
|
||||
/* If it failed, free the allocated memory. */
|
||||
if (__glibc_unlikely (retval != 0))
|
||||
- free (data.attr);
|
||||
+ {
|
||||
+ pthread_attr_destroy (data.attr);
|
||||
+ free (data.attr);
|
||||
+ }
|
||||
|
||||
return retval;
|
||||
}
|
||||
73
meta/recipes-core/glibc/glibc/CVE-2021-33574_2.patch
Normal file
73
meta/recipes-core/glibc/glibc/CVE-2021-33574_2.patch
Normal file
@@ -0,0 +1,73 @@
|
||||
From 217b6dc298156bdb0d6aea9ea93e7e394a5ff091 Mon Sep 17 00:00:00 2001
|
||||
From: Florian Weimer <fweimer@redhat.com>
|
||||
Date: Tue, 1 Jun 2021 17:51:41 +0200
|
||||
Subject: [PATCH] Fix use of __pthread_attr_copy in mq_notify (bug 27896)
|
||||
|
||||
__pthread_attr_copy can fail and does not initialize the attribute
|
||||
structure in that case.
|
||||
|
||||
If __pthread_attr_copy is never called and there is no allocated
|
||||
attribute, pthread_attr_destroy should not be called, otherwise
|
||||
there is a null pointer dereference in rt/tst-mqueue6.
|
||||
|
||||
Fixes commit 42d359350510506b87101cf77202fefcbfc790cb
|
||||
("Use __pthread_attr_copy in mq_notify (bug 27896)").
|
||||
|
||||
Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
|
||||
|
||||
https://sourceware.org/bugzilla/attachment.cgi?id=13497
|
||||
|
||||
Upstream-Status: Backport
|
||||
CVE: CVE-2021-33574 patch#2
|
||||
Signed-off-by: Armin Kuster <akuster@mvista.com>
|
||||
|
||||
---
|
||||
Index: git/sysdeps/unix/sysv/linux/mq_notify.c
|
||||
===================================================================
|
||||
--- git.orig/sysdeps/unix/sysv/linux/mq_notify.c
|
||||
+++ git/sysdeps/unix/sysv/linux/mq_notify.c
|
||||
@@ -260,7 +260,34 @@ mq_notify (mqd_t mqdes, const struct sig
|
||||
if (data.attr == NULL)
|
||||
return -1;
|
||||
|
||||
- __pthread_attr_copy (data.attr, notification->sigev_notify_attributes);
|
||||
+ memcpy (data.attr, notification->sigev_notify_attributes,
|
||||
+ sizeof (pthread_attr_t));
|
||||
+
|
||||
+ struct pthread_attr *source =
|
||||
+ (struct pthread_attr *) (notification->sigev_notify_attributes);
|
||||
+ struct pthread_attr *target = (struct pthread_attr *) (data.attr);
|
||||
+ cpu_set_t *newp;
|
||||
+ cpu_set_t *cpuset = source->cpuset;
|
||||
+ size_t cpusetsize = source->cpusetsize;
|
||||
+
|
||||
+ /* alloc a new memory for cpuset to avoid use after free */
|
||||
+ if (cpuset != NULL && cpusetsize > 0)
|
||||
+ {
|
||||
+ newp = (cpu_set_t *) malloc (cpusetsize);
|
||||
+ if (newp == NULL)
|
||||
+ {
|
||||
+ free(data.attr);
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ memcpy (newp, cpuset, cpusetsize);
|
||||
+ target->cpuset = newp;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ target->cpuset = NULL;
|
||||
+ target->cpusetsize = 0;
|
||||
+ }
|
||||
}
|
||||
|
||||
/* Construct the new request. */
|
||||
@@ -273,7 +300,7 @@ mq_notify (mqd_t mqdes, const struct sig
|
||||
int retval = INLINE_SYSCALL (mq_notify, 2, mqdes, &se);
|
||||
|
||||
/* If it failed, free the allocated memory. */
|
||||
- if (__glibc_unlikely (retval != 0))
|
||||
+ if (retval != 0 && data.attr != NULL)
|
||||
{
|
||||
pthread_attr_destroy (data.attr);
|
||||
free (data.attr);
|
||||
41
meta/recipes-core/glibc/glibc/CVE-2021-38604.patch
Normal file
41
meta/recipes-core/glibc/glibc/CVE-2021-38604.patch
Normal file
@@ -0,0 +1,41 @@
|
||||
From b805aebd42364fe696e417808a700fdb9800c9e8 Mon Sep 17 00:00:00 2001
|
||||
From: Nikita Popov <npv1310@gmail.com>
|
||||
Date: Mon, 9 Aug 2021 20:17:34 +0530
|
||||
Subject: [PATCH] librt: fix NULL pointer dereference (bug 28213)
|
||||
|
||||
Helper thread frees copied attribute on NOTIFY_REMOVED message
|
||||
received from the OS kernel. Unfortunately, it fails to check whether
|
||||
copied attribute actually exists (data.attr != NULL). This worked
|
||||
earlier because free() checks passed pointer before actually
|
||||
attempting to release corresponding memory. But
|
||||
__pthread_attr_destroy assumes pointer is not NULL.
|
||||
|
||||
So passing NULL pointer to __pthread_attr_destroy will result in
|
||||
segmentation fault. This scenario is possible if
|
||||
notification->sigev_notify_attributes == NULL (which means default
|
||||
thread attributes should be used).
|
||||
|
||||
Signed-off-by: Nikita Popov <npv1310@gmail.com>
|
||||
Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
|
||||
|
||||
Upstream-Status: Backport
|
||||
CVE: CVE-2021-38604
|
||||
Signed-off-by: Armin Kuser <akuster@mvista.com>
|
||||
|
||||
---
|
||||
sysdeps/unix/sysv/linux/mq_notify.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
Index: git/sysdeps/unix/sysv/linux/mq_notify.c
|
||||
===================================================================
|
||||
--- git.orig/sysdeps/unix/sysv/linux/mq_notify.c
|
||||
+++ git/sysdeps/unix/sysv/linux/mq_notify.c
|
||||
@@ -134,7 +134,7 @@ helper_thread (void *arg)
|
||||
to wait until it is done with it. */
|
||||
(void) __pthread_barrier_wait (¬ify_barrier);
|
||||
}
|
||||
- else if (data.raw[NOTIFY_COOKIE_LEN - 1] == NOTIFY_REMOVED)
|
||||
+ else if (data.raw[NOTIFY_COOKIE_LEN - 1] == NOTIFY_REMOVED && data.attr != NULL)
|
||||
{
|
||||
/* The only state we keep is the copy of the thread attributes. */
|
||||
pthread_attr_destroy (data.attr);
|
||||
@@ -18,6 +18,16 @@ CVE_CHECK_WHITELIST += "CVE-2019-1010022 CVE-2019-1010023 CVE-2019-1010024"
|
||||
# Potential patch at https://sourceware.org/bugzilla/show_bug.cgi?id=22853
|
||||
CVE_CHECK_WHITELIST += "CVE-2019-1010025"
|
||||
|
||||
# glibc https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2021-35942
|
||||
# The wordexp function in the GNU C Library (aka glibc) through 2.33 may crash
|
||||
# or read arbitrary memory in parse_param (in posix/wordexp.c) when called with
|
||||
# an untrusted, crafted pattern, potentially resulting in a denial of service
|
||||
# or disclosure of information. Patch was backported to 2.31 branch already:
|
||||
# https://sourceware.org/git/?p=glibc.git;a=commit;h=4f0a61f75385c9a5879cbe7202042e88f692a3c8
|
||||
# which is already included in the dunfell branch of poky:
|
||||
# https://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?h=dunfell&id=e1e89ff7d75c3d2223f9e3bd875b9b0c5e15836b
|
||||
CVE_CHECK_WHITELIST += "CVE-2021-35942"
|
||||
|
||||
DEPENDS += "gperf-native bison-native make-native"
|
||||
|
||||
NATIVESDKFIXES ?= ""
|
||||
@@ -57,6 +67,9 @@ SRC_URI = "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \
|
||||
file://0028-inject-file-assembly-directives.patch \
|
||||
file://0029-locale-prevent-maybe-uninitialized-errors-with-Os-BZ.patch \
|
||||
file://CVE-2020-29573.patch \
|
||||
file://CVE-2021-33574_1.patch \
|
||||
file://CVE-2021-33574_2.patch \
|
||||
file://CVE-2021-38604.patch \
|
||||
"
|
||||
S = "${WORKDIR}/git"
|
||||
B = "${WORKDIR}/build-${TARGET_SYS}"
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
From e2263b58d7733835355d7b46c3caa96d911a4717 Mon Sep 17 00:00:00 2001
|
||||
From: Simon Schwarz <simon.schwarz@infoteam.de>
|
||||
Date: Fri, 6 Nov 2020 08:53:20 +0100
|
||||
Subject: [PATCH] inet6.defn: Added -1 option to dhclient on upping an
|
||||
interface
|
||||
|
||||
This prevents hangs on startup when no server is available and dhcpv6 is used
|
||||
|
||||
Upstream-Status: Pending
|
||||
|
||||
Signed-off-by: Simon Schwarz <simon.schwarz@infoteam.de>
|
||||
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
|
||||
---
|
||||
inet6.defn | 12 ++++++------
|
||||
1 file changed, 6 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/inet6.defn b/inet6.defn
|
||||
index 73dce24..25022e3 100644
|
||||
--- a/inet6.defn
|
||||
+++ b/inet6.defn
|
||||
@@ -29,9 +29,9 @@ method auto
|
||||
if (var_set("accept_ra", ifd) && !var_true("accept_ra", ifd))
|
||||
/sbin/ip link set dev %iface% up
|
||||
/lib/ifupdown/wait-for-ll6.sh if (var_true("dhcp", ifd) && execable("/lib/ifupdown/wait-for-ll6.sh"))
|
||||
- /sbin/dhclient -6 -v -P -pf /run/dhclient6.%iface%.pid -lf /var/lib/dhcp/dhclient6.%iface%.leases -I -df /var/lib/dhcp/dhclient.%iface%.leases %iface% \
|
||||
+ /sbin/dhclient -6 -1 -v -P -pf /run/dhclient6.%iface%.pid -lf /var/lib/dhcp/dhclient6.%iface%.leases -I -df /var/lib/dhcp/dhclient.%iface%.leases %iface% \
|
||||
if (var_true("dhcp", ifd) && execable("/sbin/dhclient") && var_true("request_prefix", ifd))
|
||||
- /sbin/dhclient -6 -v -S -pf /run/dhclient6.%iface%.pid -lf /var/lib/dhcp/dhclient6.%iface%.leases -I -df /var/lib/dhcp/dhclient.%iface%.leases %iface% \
|
||||
+ /sbin/dhclient -6 -1 -v -S -pf /run/dhclient6.%iface%.pid -lf /var/lib/dhcp/dhclient6.%iface%.leases -I -df /var/lib/dhcp/dhclient.%iface%.leases %iface% \
|
||||
elsif (var_true("dhcp", ifd) && execable("/sbin/dhclient"))
|
||||
echo 'No DHCPv6 client software found!' >&2; false \
|
||||
elsif (var_true("dhcp", ifd))
|
||||
@@ -154,9 +154,9 @@ method dhcp
|
||||
if (var_set("accept_ra", ifd) && !var_true("accept_ra", ifd))
|
||||
/sbin/ip link set dev %iface% [[address %hwaddress%]] up
|
||||
/lib/ifupdown/wait-for-ll6.sh if (execable("/lib/ifupdown/wait-for-ll6.sh"))
|
||||
- /sbin/dhclient -6 -v -pf /run/dhclient6.%iface%.pid -lf /var/lib/dhcp/dhclient6.%iface%.leases -I -P -N -df /var/lib/dhcp/dhclient.%iface%.leases %iface% \
|
||||
+ /sbin/dhclient -6 -1 -v -pf /run/dhclient6.%iface%.pid -lf /var/lib/dhcp/dhclient6.%iface%.leases -I -P -N -df /var/lib/dhcp/dhclient.%iface%.leases %iface% \
|
||||
if (execable("/sbin/dhclient") && var_true("request_prefix", ifd))
|
||||
- /sbin/dhclient -6 -v -pf /run/dhclient6.%iface%.pid -lf /var/lib/dhcp/dhclient6.%iface%.leases -I -df /var/lib/dhcp/dhclient.%iface%.leases %iface% \
|
||||
+ /sbin/dhclient -6 -1 -v -pf /run/dhclient6.%iface%.pid -lf /var/lib/dhcp/dhclient6.%iface%.leases -I -df /var/lib/dhcp/dhclient.%iface%.leases %iface% \
|
||||
elsif (execable("/sbin/dhclient"))
|
||||
echo 'No DHCPv6 client software found!' >&2; false \
|
||||
elsif (1)
|
||||
@@ -325,7 +325,7 @@ method dhcp
|
||||
|
||||
up
|
||||
/sbin/ifconfig %iface% [[link %hwaddress%]] up
|
||||
- /sbin/dhclient -6 -pf /run/dhclient6.%iface%.pid -lf /var/lib/dhcp/dhclient6.%iface%.leases -I -df /var/lib/dhcp/dhclient.%iface%.leases %iface% \
|
||||
+ /sbin/dhclient -6 -1 -pf /run/dhclient6.%iface%.pid -lf /var/lib/dhcp/dhclient6.%iface%.leases -I -df /var/lib/dhcp/dhclient.%iface%.leases %iface% \
|
||||
if (execable("/sbin/dhclient"))
|
||||
echo 'No DHCPv6 client software found!' >&2; false \
|
||||
elsif (1)
|
||||
@@ -397,7 +397,7 @@ method dhcp
|
||||
up
|
||||
[[Warning: Option hwaddress: %hwaddress% not yet supported]]
|
||||
inetutils-ifconfig --interface %iface% --up
|
||||
- /sbin/dhclient -6 -pf /run/dhclient6.%iface///.%.pid -lf /var/lib/dhcp/dhclient6.%iface///.%.leases -I -df /var/lib/dhcp/dhclient.%iface///.%.leases %iface% \
|
||||
+ /sbin/dhclient -6 -1 -pf /run/dhclient6.%iface///.%.pid -lf /var/lib/dhcp/dhclient6.%iface///.%.leases -I -df /var/lib/dhcp/dhclient.%iface///.%.leases %iface% \
|
||||
if (execable("/sbin/dhclient"))
|
||||
echo 'No DHCPv6 client software found!' >&2; false \
|
||||
elsif (1)
|
||||
--
|
||||
2.17.1
|
||||
|
||||
@@ -12,6 +12,7 @@ SRC_URI = "git://salsa.debian.org/debian/ifupdown.git;protocol=https \
|
||||
file://99_network \
|
||||
file://0001-Define-FNM_EXTMATCH-for-musl.patch \
|
||||
file://0001-Makefile-do-not-use-dpkg-for-determining-OS-type.patch \
|
||||
file://0001-inet6.defn-Added-1-option-to-dhclient-on-upping-an-i.patch \
|
||||
file://run-ptest \
|
||||
${@bb.utils.contains('DISTRO_FEATURES', 'ptest', 'file://tweak-ptest-script.patch', '', d)} \
|
||||
"
|
||||
|
||||
@@ -24,7 +24,7 @@ IMAGE_FSTYPES = "wic.vmdk"
|
||||
|
||||
inherit core-image setuptools3
|
||||
|
||||
SRCREV ?= "f22c2d6670d3b6f0d6eaa201fb2f9307a8d503d5"
|
||||
SRCREV ?= "67dbe8a1c2b485d0cec174d28107b0ac8ea77d5f"
|
||||
SRC_URI = "git://git.yoctoproject.org/poky;branch=dunfell \
|
||||
file://Yocto_Build_Appliance.vmx \
|
||||
file://Yocto_Build_Appliance.vmxf \
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#/bin/sh
|
||||
#!/bin/sh
|
||||
# Copyright (C) 2011 O.S. Systems Software LTDA.
|
||||
# Licensed on MIT
|
||||
|
||||
|
||||
73
meta/recipes-core/libxml/libxml2/CVE-2021-3541.patch
Normal file
73
meta/recipes-core/libxml/libxml2/CVE-2021-3541.patch
Normal file
@@ -0,0 +1,73 @@
|
||||
From 8598060bacada41a0eb09d95c97744ff4e428f8e Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Veillard <veillard@redhat.com>
|
||||
Date: Thu, 13 May 2021 14:55:12 +0200
|
||||
Subject: [PATCH] Patch for security issue CVE-2021-3541
|
||||
|
||||
This is relapted to parameter entities expansion and following
|
||||
the line of the billion laugh attack. Somehow in that path the
|
||||
counting of parameters was missed and the normal algorithm based
|
||||
on entities "density" was useless.
|
||||
|
||||
Upstream-Status: Backport
|
||||
[https://gitlab.gnome.org/GNOME/libxml2/-/commit/8598060bacada41a0eb09d95c97744ff4e428f8e]
|
||||
CVE: CVE-2021-3541
|
||||
Signed-off-by: Steve Sakoman <steve@sakoman.com>
|
||||
|
||||
---
|
||||
parser.c | 26 ++++++++++++++++++++++++++
|
||||
1 file changed, 26 insertions(+)
|
||||
|
||||
diff --git a/parser.c b/parser.c
|
||||
index f5e5e169..c9312fa4 100644
|
||||
--- a/parser.c
|
||||
+++ b/parser.c
|
||||
@@ -140,6 +140,7 @@ xmlParserEntityCheck(xmlParserCtxtPtr ctxt, size_t size,
|
||||
xmlEntityPtr ent, size_t replacement)
|
||||
{
|
||||
size_t consumed = 0;
|
||||
+ int i;
|
||||
|
||||
if ((ctxt == NULL) || (ctxt->options & XML_PARSE_HUGE))
|
||||
return (0);
|
||||
@@ -177,6 +178,28 @@ xmlParserEntityCheck(xmlParserCtxtPtr ctxt, size_t size,
|
||||
rep = NULL;
|
||||
}
|
||||
}
|
||||
+
|
||||
+ /*
|
||||
+ * Prevent entity exponential check, not just replacement while
|
||||
+ * parsing the DTD
|
||||
+ * The check is potentially costly so do that only once in a thousand
|
||||
+ */
|
||||
+ if ((ctxt->instate == XML_PARSER_DTD) && (ctxt->nbentities > 10000) &&
|
||||
+ (ctxt->nbentities % 1024 == 0)) {
|
||||
+ for (i = 0;i < ctxt->inputNr;i++) {
|
||||
+ consumed += ctxt->inputTab[i]->consumed +
|
||||
+ (ctxt->inputTab[i]->cur - ctxt->inputTab[i]->base);
|
||||
+ }
|
||||
+ if (ctxt->nbentities > consumed * XML_PARSER_NON_LINEAR) {
|
||||
+ xmlFatalErr(ctxt, XML_ERR_ENTITY_LOOP, NULL);
|
||||
+ ctxt->instate = XML_PARSER_EOF;
|
||||
+ return (1);
|
||||
+ }
|
||||
+ consumed = 0;
|
||||
+ }
|
||||
+
|
||||
+
|
||||
+
|
||||
if (replacement != 0) {
|
||||
if (replacement < XML_MAX_TEXT_LENGTH)
|
||||
return(0);
|
||||
@@ -7963,6 +7986,9 @@ xmlParsePEReference(xmlParserCtxtPtr ctxt)
|
||||
xmlChar start[4];
|
||||
xmlCharEncoding enc;
|
||||
|
||||
+ if (xmlParserEntityCheck(ctxt, 0, entity, 0))
|
||||
+ return;
|
||||
+
|
||||
if ((entity->etype == XML_EXTERNAL_PARAMETER_ENTITY) &&
|
||||
((ctxt->options & XML_PARSE_NOENT) == 0) &&
|
||||
((ctxt->options & XML_PARSE_DTDVALID) == 0) &&
|
||||
--
|
||||
GitLab
|
||||
|
||||
@@ -26,6 +26,7 @@ SRC_URI = "http://www.xmlsoft.org/sources/libxml2-${PV}.tar.gz;name=libtar \
|
||||
file://CVE-2021-3517.patch \
|
||||
file://CVE-2021-3537.patch \
|
||||
file://CVE-2021-3518.patch \
|
||||
file://CVE-2021-3541.patch \
|
||||
"
|
||||
|
||||
SRC_URI[libtar.md5sum] = "10942a1dc23137a8aa07f0639cbfece5"
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
From 498627ebda6271b59920f43a0b9b6187edeb7b09 Mon Sep 17 00:00:00 2001
|
||||
From: Adrian Herrera <adr.her.arc.95@gmail.com>
|
||||
Date: Mon, 22 Mar 2021 21:06:47 +0000
|
||||
Subject: [PATCH] Fix VLA parameter warning
|
||||
|
||||
Make VLA buffer types consistent in declarations and definitions.
|
||||
Resolves build crash when using -Werror due to "vla-parameter" warning.
|
||||
|
||||
Upstream-Status: Submitted [https://github.com/google/brotli/pull/893]
|
||||
Signed-off-by: Adrian Herrera <adr.her.arc.95@gmail.com>
|
||||
---
|
||||
c/dec/decode.c | 6 ++++--
|
||||
c/enc/encode.c | 5 +++--
|
||||
2 files changed, 7 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/BaseTools/Source/C/BrotliCompress/brotli/c/dec/decode.c b/BaseTools/Source/C/BrotliCompress/brotli/c/dec/decode.c
|
||||
index 114c505..bb6f1ab 100644
|
||||
--- a/BaseTools/Source/C/BrotliCompress/brotli/c/dec/decode.c
|
||||
+++ b/BaseTools/Source/C/BrotliCompress/brotli/c/dec/decode.c
|
||||
@@ -2030,8 +2030,10 @@ static BROTLI_NOINLINE BrotliDecoderErrorCode SafeProcessCommands(
|
||||
}
|
||||
|
||||
BrotliDecoderResult BrotliDecoderDecompress(
|
||||
- size_t encoded_size, const uint8_t* encoded_buffer, size_t* decoded_size,
|
||||
- uint8_t* decoded_buffer) {
|
||||
+ size_t encoded_size,
|
||||
+ const uint8_t encoded_buffer[BROTLI_ARRAY_PARAM(encoded_size)],
|
||||
+ size_t* decoded_size,
|
||||
+ uint8_t decoded_buffer[BROTLI_ARRAY_PARAM(*decoded_size)]) {
|
||||
BrotliDecoderState s;
|
||||
BrotliDecoderResult result;
|
||||
size_t total_out = 0;
|
||||
diff --git a/c/enc/encode.c b/c/enc/encode.c
|
||||
index 68548ef..ab0a490 100644
|
||||
--- a/BaseTools/Source/C/BrotliCompress/brotli/c/enc/encode.c
|
||||
+++ c/BaseTools/Source/C/BrotliCompress/brotli/c/enc/encode.c
|
||||
@@ -1470,8 +1470,9 @@ static size_t MakeUncompressedStream(
|
||||
|
||||
BROTLI_BOOL BrotliEncoderCompress(
|
||||
int quality, int lgwin, BrotliEncoderMode mode, size_t input_size,
|
||||
- const uint8_t* input_buffer, size_t* encoded_size,
|
||||
- uint8_t* encoded_buffer) {
|
||||
+ const uint8_t input_buffer[BROTLI_ARRAY_PARAM(input_size)],
|
||||
+ size_t* encoded_size,
|
||||
+ uint8_t encoded_buffer[BROTLI_ARRAY_PARAM(*encoded_size)]) {
|
||||
BrotliEncoderState* s;
|
||||
size_t out_size = *encoded_size;
|
||||
const uint8_t* input_start = input_buffer;
|
||||
--
|
||||
2.31.1
|
||||
|
||||
@@ -17,7 +17,8 @@ SRC_URI = "gitsm://github.com/tianocore/edk2.git;branch=master;protocol=https \
|
||||
file://0002-BaseTools-makefile-adjust-to-build-in-under-bitbake.patch \
|
||||
file://0003-ovmf-enable-long-path-file.patch \
|
||||
file://0004-ovmf-Update-to-latest.patch \
|
||||
"
|
||||
file://0001-Fix-VLA-parameter-warning.patch \
|
||||
"
|
||||
|
||||
PV = "edk2-stable202008"
|
||||
SRCREV = "06dc822d045c2bb42e497487935485302486e151"
|
||||
@@ -37,7 +38,7 @@ EDK_TOOLS_DIR="edk2_basetools"
|
||||
BUILD_OPTIMIZATION="-pipe"
|
||||
|
||||
# OVMF supports IA only, although it could conceivably support ARM someday.
|
||||
COMPATIBLE_HOST='(i.86|x86_64).*'
|
||||
COMPATIBLE_HOST_class-target='(i.86|x86_64).*'
|
||||
|
||||
# Additional build flags for OVMF with Secure Boot.
|
||||
# Fedora also uses "-D SMM_REQUIRE -D EXCLUDE_SHELL_FROM_FD".
|
||||
|
||||
42
meta/recipes-core/systemd/systemd/CVE-2020-13529.patch
Normal file
42
meta/recipes-core/systemd/systemd/CVE-2020-13529.patch
Normal file
@@ -0,0 +1,42 @@
|
||||
From 38e980a6a5a3442c2f48b1f827284388096d8ca5 Mon Sep 17 00:00:00 2001
|
||||
From: Yu Watanabe <watanabe.yu+github@gmail.com>
|
||||
Date: Thu, 24 Jun 2021 01:22:07 +0900
|
||||
Subject: [PATCH] sd-dhcp-client: tentatively ignore FORCERENEW command
|
||||
|
||||
This makes DHCP client ignore FORCERENEW requests, as unauthenticated
|
||||
FORCERENEW requests causes a security issue (TALOS-2020-1142, CVE-2020-13529).
|
||||
|
||||
Let's re-enable this after RFC3118 (Authentication for DHCP Messages)
|
||||
and/or RFC6704 (Forcerenew Nonce Authentication) are implemented.
|
||||
|
||||
Fixes #16774.
|
||||
|
||||
Upstream-Status: Backport [https://github.com/systemd/systemd/commit/38e980a6a5a3442c2f48b1f827284388096d8ca5]
|
||||
CVE: CVE-2020-13529
|
||||
|
||||
Signed-off-by: Ranjitsinh Rathod <ranjitsinh.rathod@kpit.com>
|
||||
|
||||
---
|
||||
src/libsystemd-network/sd-dhcp-client.c | 8 ++++++++
|
||||
1 file changed, 8 insertions(+)
|
||||
|
||||
--- a/src/libsystemd-network/sd-dhcp-client.c
|
||||
+++ b/src/libsystemd-network/sd-dhcp-client.c
|
||||
@@ -1392,9 +1392,17 @@ static int client_handle_forcerenew(sd_dhcp_client *client, DHCPMessage *force,
|
||||
if (r != DHCP_FORCERENEW)
|
||||
return -ENOMSG;
|
||||
|
||||
+#if 0
|
||||
log_dhcp_client(client, "FORCERENEW");
|
||||
|
||||
return 0;
|
||||
+#else
|
||||
+ /* FIXME: Ignore FORCERENEW requests until we implement RFC3118 (Authentication for DHCP
|
||||
+ * Messages) and/or RFC6704 (Forcerenew Nonce Authentication), as unauthenticated FORCERENEW
|
||||
+ * requests causes a security issue (TALOS-2020-1142, CVE-2020-13529). */
|
||||
+ log_dhcp_client(client, "Received FORCERENEW, ignoring.");
|
||||
+ return -ENOMSG;
|
||||
+#endif
|
||||
}
|
||||
|
||||
static bool lease_equal(const sd_dhcp_lease *a, const sd_dhcp_lease *b) {
|
||||
67
meta/recipes-core/systemd/systemd/CVE-2021-33910.patch
Normal file
67
meta/recipes-core/systemd/systemd/CVE-2021-33910.patch
Normal file
@@ -0,0 +1,67 @@
|
||||
Backport of:
|
||||
|
||||
From 441e0115646d54f080e5c3bb0ba477c892861ab9 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
||||
Date: Wed, 23 Jun 2021 11:46:41 +0200
|
||||
Subject: [PATCH 1/2] basic/unit-name: do not use strdupa() on a path
|
||||
|
||||
The path may have unbounded length, for example through a fuse mount.
|
||||
|
||||
CVE-2021-33910: attacked controlled alloca() leads to crash in systemd and
|
||||
ultimately a kernel panic. Systemd parses the content of /proc/self/mountinfo
|
||||
and each mountpoint is passed to mount_setup_unit(), which calls
|
||||
unit_name_path_escape() underneath. A local attacker who is able to mount a
|
||||
filesystem with a very long path can crash systemd and the whole system.
|
||||
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=1970887
|
||||
|
||||
The resulting string length is bounded by UNIT_NAME_MAX, which is 256. But we
|
||||
can't easily check the length after simplification before doing the
|
||||
simplification, which in turns uses a copy of the string we can write to.
|
||||
So we can't reject paths that are too long before doing the duplication.
|
||||
Hence the most obvious solution is to switch back to strdup(), as before
|
||||
7410616cd9dbbec97cf98d75324da5cda2b2f7a2.
|
||||
|
||||
Upstream-Status: Backport [https://github.com/systemd/systemd/pull/20256/commits/441e0115646d54f080e5c3bb0ba477c892861ab9]
|
||||
CVE: CVE-2021-33910
|
||||
|
||||
Signed-off-by: Ranjitsinh Rathod <ranjitsinh.rathod@kpit.com>
|
||||
|
||||
---
|
||||
src/basic/unit-name.c | 13 +++++--------
|
||||
1 file changed, 5 insertions(+), 8 deletions(-)
|
||||
|
||||
--- a/src/basic/unit-name.c
|
||||
+++ b/src/basic/unit-name.c
|
||||
@@ -369,12 +369,13 @@ int unit_name_unescape(const char *f, char **ret) {
|
||||
}
|
||||
|
||||
int unit_name_path_escape(const char *f, char **ret) {
|
||||
- char *p, *s;
|
||||
+ _cleanup_free_ char *p = NULL;
|
||||
+ char *s;
|
||||
|
||||
assert(f);
|
||||
assert(ret);
|
||||
|
||||
- p = strdupa(f);
|
||||
+ p = strdup(f);
|
||||
if (!p)
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -386,13 +387,9 @@ int unit_name_path_escape(const char *f, char **ret) {
|
||||
if (!path_is_normalized(p))
|
||||
return -EINVAL;
|
||||
|
||||
- /* Truncate trailing slashes */
|
||||
+ /* Truncate trailing slashes and skip leading slashes */
|
||||
delete_trailing_chars(p, "/");
|
||||
-
|
||||
- /* Truncate leading slashes */
|
||||
- p = skip_leading_chars(p, "/");
|
||||
-
|
||||
- s = unit_name_escape(p);
|
||||
+ s = unit_name_escape(skip_leading_chars(p, "/"));
|
||||
}
|
||||
if (!s)
|
||||
return -ENOMEM;
|
||||
@@ -20,6 +20,8 @@ SRC_URI += "file://touchscreen.rules \
|
||||
file://99-default.preset \
|
||||
file://0001-binfmt-Don-t-install-dependency-links-at-install-tim.patch \
|
||||
file://0003-implment-systemd-sysv-install-for-OE.patch \
|
||||
file://CVE-2021-33910.patch \
|
||||
file://CVE-2020-13529.patch \
|
||||
"
|
||||
|
||||
# patches needed by musl
|
||||
|
||||
33
meta/recipes-core/util-linux/util-linux/CVE-2021-37600.patch
Normal file
33
meta/recipes-core/util-linux/util-linux/CVE-2021-37600.patch
Normal file
@@ -0,0 +1,33 @@
|
||||
From 1c9143d0c1f979c3daf10e1c37b5b1e916c22a1c Mon Sep 17 00:00:00 2001
|
||||
From: Karel Zak <kzak@redhat.com>
|
||||
Date: Tue, 27 Jul 2021 11:58:31 +0200
|
||||
Subject: [PATCH] sys-utils/ipcutils: be careful when call calloc() for uint64
|
||||
nmembs
|
||||
|
||||
Fix: https://github.com/karelzak/util-linux/issues/1395
|
||||
Signed-off-by: Karel Zak <kzak@redhat.com>
|
||||
|
||||
CVE: CVE-2021-37600
|
||||
Upstream-Status: Backport [1c9143d0c1f979c3daf10e1c37b5b1e916c22a1c]
|
||||
|
||||
Signed-off-by: Dragos-Marian Panait <dragos.panait@windriver.com>
|
||||
---
|
||||
sys-utils/ipcutils.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/sys-utils/ipcutils.c b/sys-utils/ipcutils.c
|
||||
index e784c4dcb..18868cfd3 100644
|
||||
--- a/sys-utils/ipcutils.c
|
||||
+++ b/sys-utils/ipcutils.c
|
||||
@@ -218,7 +218,7 @@ static void get_sem_elements(struct sem_data *p)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
- if (!p || !p->sem_nsems || p->sem_perm.id < 0)
|
||||
+ if (!p || !p->sem_nsems || p->sem_nsems > SIZE_MAX || p->sem_perm.id < 0)
|
||||
return;
|
||||
|
||||
p->elements = xcalloc(p->sem_nsems, sizeof(struct sem_elem));
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@@ -11,6 +11,7 @@ SRC_URI += "file://configure-sbindir.patch \
|
||||
file://0001-libfdisk-script-accept-sector-size-ignore-unknown-he.patch \
|
||||
file://0001-kill-include-sys-types.h-before-checking-SYS_pidfd_s.patch \
|
||||
file://0001-include-cleanup-pidfd-inckudes.patch \
|
||||
file://CVE-2021-37600.patch \
|
||||
"
|
||||
SRC_URI[md5sum] = "7f64882f631225f0295ca05080cee1bf"
|
||||
SRC_URI[sha256sum] = "d9de3edd287366cd908e77677514b9387b22bc7b88f45b83e1922c3597f1d7f9"
|
||||
|
||||
@@ -48,5 +48,7 @@ SRC_URI = "\
|
||||
file://CVE-2020-16598.patch \
|
||||
file://CVE-2021-20197.patch \
|
||||
file://CVE-2021-3487.patch \
|
||||
file://CVE-2021-3549.patch \
|
||||
file://CVE-2020-16593.patch \
|
||||
"
|
||||
S = "${WORKDIR}/git"
|
||||
|
||||
204
meta/recipes-devtools/binutils/binutils/CVE-2020-16593.patch
Normal file
204
meta/recipes-devtools/binutils/binutils/CVE-2020-16593.patch
Normal file
@@ -0,0 +1,204 @@
|
||||
From aec72fda3b320c36eb99fc1c4cf95b10fc026729 Mon Sep 17 00:00:00 2001
|
||||
From: Alan Modra <amodra@gmail.com>
|
||||
Date: Thu, 16 Apr 2020 17:49:38 +0930
|
||||
Subject: [PATCH] PR25827, Null pointer dereferencing in scan_unit_for_symbols
|
||||
|
||||
PR 25827
|
||||
* dwarf2.c (scan_unit_for_symbols): Wrap overlong lines. Don't
|
||||
strdup(0).
|
||||
|
||||
Upstream-Status: Backport
|
||||
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=aec72fda3b320c36eb99fc1c4cf95b10fc026729
|
||||
CVE: CVE-2020-16593
|
||||
Signed-off-by: Armin Kuster <akuster@mvista.com>
|
||||
|
||||
|
||||
Index: git/bfd/dwarf2.c
|
||||
===================================================================
|
||||
--- git.orig/bfd/dwarf2.c
|
||||
+++ git/bfd/dwarf2.c
|
||||
@@ -295,12 +295,12 @@ struct comp_unit
|
||||
/* This data structure holds the information of an abbrev. */
|
||||
struct abbrev_info
|
||||
{
|
||||
- unsigned int number; /* Number identifying abbrev. */
|
||||
- enum dwarf_tag tag; /* DWARF tag. */
|
||||
- int has_children; /* Boolean. */
|
||||
- unsigned int num_attrs; /* Number of attributes. */
|
||||
- struct attr_abbrev *attrs; /* An array of attribute descriptions. */
|
||||
- struct abbrev_info *next; /* Next in chain. */
|
||||
+ unsigned int number; /* Number identifying abbrev. */
|
||||
+ enum dwarf_tag tag; /* DWARF tag. */
|
||||
+ bfd_boolean has_children; /* TRUE if the abbrev has children. */
|
||||
+ unsigned int num_attrs; /* Number of attributes. */
|
||||
+ struct attr_abbrev * attrs; /* An array of attribute descriptions. */
|
||||
+ struct abbrev_info * next; /* Next in chain. */
|
||||
};
|
||||
|
||||
struct attr_abbrev
|
||||
@@ -1487,6 +1487,8 @@ struct varinfo
|
||||
{
|
||||
/* Pointer to previous variable in list of all variables */
|
||||
struct varinfo *prev_var;
|
||||
+ /* The offset of the varinfo from the start of the unit. */
|
||||
+ bfd_uint64_t unit_offset;
|
||||
/* Source location file name */
|
||||
char *file;
|
||||
/* Source location line number */
|
||||
@@ -1497,7 +1499,7 @@ struct varinfo
|
||||
/* Where the symbol is defined */
|
||||
asection *sec;
|
||||
/* Is this a stack variable? */
|
||||
- unsigned int stack: 1;
|
||||
+ bfd_boolean stack;
|
||||
};
|
||||
|
||||
/* Return TRUE if NEW_LINE should sort after LINE. */
|
||||
@@ -2871,7 +2873,7 @@ lookup_symbol_in_variable_table (struct
|
||||
struct varinfo* each;
|
||||
|
||||
for (each = unit->variable_table; each; each = each->prev_var)
|
||||
- if (each->stack == 0
|
||||
+ if (! each->stack
|
||||
&& each->file != NULL
|
||||
&& each->name != NULL
|
||||
&& each->addr == addr
|
||||
@@ -3166,6 +3168,20 @@ read_rangelist (struct comp_unit *unit,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
+static struct varinfo *
|
||||
+lookup_var_by_offset (bfd_uint64_t offset, struct varinfo * table)
|
||||
+{
|
||||
+ while (table)
|
||||
+ {
|
||||
+ if (table->unit_offset == offset)
|
||||
+ return table;
|
||||
+ table = table->prev_var;
|
||||
+ }
|
||||
+
|
||||
+ return NULL;
|
||||
+}
|
||||
+
|
||||
+
|
||||
/* DWARF2 Compilation unit functions. */
|
||||
|
||||
/* Scan over each die in a comp. unit looking for functions to add
|
||||
@@ -3202,6 +3218,9 @@ scan_unit_for_symbols (struct comp_unit
|
||||
bfd_vma low_pc = 0;
|
||||
bfd_vma high_pc = 0;
|
||||
bfd_boolean high_pc_relative = FALSE;
|
||||
+ bfd_uint64_t current_offset;
|
||||
+
|
||||
+ current_offset = info_ptr - unit->info_ptr_unit;
|
||||
|
||||
/* PR 17512: file: 9f405d9d. */
|
||||
if (info_ptr >= info_ptr_end)
|
||||
@@ -3234,12 +3253,13 @@ scan_unit_for_symbols (struct comp_unit
|
||||
goto fail;
|
||||
}
|
||||
|
||||
- var = NULL;
|
||||
if (abbrev->tag == DW_TAG_subprogram
|
||||
|| abbrev->tag == DW_TAG_entry_point
|
||||
|| abbrev->tag == DW_TAG_inlined_subroutine)
|
||||
{
|
||||
bfd_size_type amt = sizeof (struct funcinfo);
|
||||
+
|
||||
+ var = NULL;
|
||||
func = (struct funcinfo *) bfd_zalloc (abfd, amt);
|
||||
if (func == NULL)
|
||||
goto fail;
|
||||
@@ -3268,13 +3288,15 @@ scan_unit_for_symbols (struct comp_unit
|
||||
if (var == NULL)
|
||||
goto fail;
|
||||
var->tag = abbrev->tag;
|
||||
- var->stack = 1;
|
||||
+ var->stack = TRUE;
|
||||
var->prev_var = unit->variable_table;
|
||||
unit->variable_table = var;
|
||||
+ var->unit_offset = current_offset;
|
||||
/* PR 18205: Missing debug information can cause this
|
||||
var to be attached to an already cached unit. */
|
||||
}
|
||||
-
|
||||
+ else
|
||||
+ var = NULL;
|
||||
/* No inline function in scope at this nesting level. */
|
||||
nested_funcs[nesting_level].func = 0;
|
||||
}
|
||||
@@ -3362,6 +3384,33 @@ scan_unit_for_symbols (struct comp_unit
|
||||
{
|
||||
switch (attr.name)
|
||||
{
|
||||
+ case DW_AT_specification:
|
||||
+ if (attr.u.val)
|
||||
+ {
|
||||
+ struct varinfo * spec_var;
|
||||
+
|
||||
+ spec_var = lookup_var_by_offset (attr.u.val,
|
||||
+ unit->variable_table);
|
||||
+ if (spec_var == NULL)
|
||||
+ {
|
||||
+ _bfd_error_handler (_("DWARF error: could not find "
|
||||
+ "variable specification "
|
||||
+ "at offset %lx"),
|
||||
+ (unsigned long) attr.u.val);
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ if (var->name == NULL)
|
||||
+ var->name = spec_var->name;
|
||||
+ if (var->file == NULL && spec_var->file != NULL)
|
||||
+ var->file = strdup (spec_var->file);
|
||||
+ if (var->line == 0)
|
||||
+ var->line = spec_var->line;
|
||||
+ if (var->sec == NULL)
|
||||
+ var->sec = spec_var->sec;
|
||||
+ }
|
||||
+ break;
|
||||
+
|
||||
case DW_AT_name:
|
||||
if (is_str_attr (attr.form))
|
||||
var->name = attr.u.str;
|
||||
@@ -3378,7 +3427,7 @@ scan_unit_for_symbols (struct comp_unit
|
||||
|
||||
case DW_AT_external:
|
||||
if (attr.u.val != 0)
|
||||
- var->stack = 0;
|
||||
+ var->stack = FALSE;
|
||||
break;
|
||||
|
||||
case DW_AT_location:
|
||||
@@ -3392,7 +3441,7 @@ scan_unit_for_symbols (struct comp_unit
|
||||
if (attr.u.blk->data != NULL
|
||||
&& *attr.u.blk->data == DW_OP_addr)
|
||||
{
|
||||
- var->stack = 0;
|
||||
+ var->stack = FALSE;
|
||||
|
||||
/* Verify that DW_OP_addr is the only opcode in the
|
||||
location, in which case the block size will be 1
|
||||
@@ -3888,7 +3937,7 @@ comp_unit_hash_info (struct dwarf2_debug
|
||||
each_var = each_var->prev_var)
|
||||
{
|
||||
/* Skip stack vars and vars with no files or names. */
|
||||
- if (each_var->stack == 0
|
||||
+ if (! each_var->stack
|
||||
&& each_var->file != NULL
|
||||
&& each_var->name != NULL)
|
||||
/* There is no need to copy name string into hash table as
|
||||
Index: git/bfd/ChangeLog
|
||||
===================================================================
|
||||
--- git.orig/bfd/ChangeLog
|
||||
+++ git/bfd/ChangeLog
|
||||
@@ -1,3 +1,9 @@
|
||||
+2020-04-16 Alan Modra <amodra@gmail.com>
|
||||
+
|
||||
+ PR 25827
|
||||
+ * dwarf2.c (scan_unit_for_symbols): Wrap overlong lines. Don't
|
||||
+ strdup(0).
|
||||
+
|
||||
2020-02-19 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
PR binutils/25355
|
||||
187
meta/recipes-devtools/binutils/binutils/CVE-2021-3549.patch
Normal file
187
meta/recipes-devtools/binutils/binutils/CVE-2021-3549.patch
Normal file
@@ -0,0 +1,187 @@
|
||||
From 1cfcf3004e1830f8fe9112cfcd15285508d2c2b7 Mon Sep 17 00:00:00 2001
|
||||
From: Alan Modra <amodra@gmail.com>
|
||||
Date: Thu, 11 Feb 2021 16:56:42 +1030
|
||||
Subject: [PATCH] PR27290, PR27293, PR27295, various avr objdump fixes
|
||||
|
||||
Adds missing sanity checks for avr device info note, to avoid
|
||||
potential buffer overflows. Uses bfd_malloc_and_get_section for
|
||||
sanity checking section size.
|
||||
|
||||
PR 27290
|
||||
PR 27293
|
||||
PR 27295
|
||||
* od-elf32_avr.c (elf32_avr_get_note_section_contents): Formatting.
|
||||
Use bfd_malloc_and_get_section.
|
||||
(elf32_avr_get_note_desc): Formatting. Return descsz. Sanity
|
||||
check namesz. Return NULL if descsz is too small. Ensure
|
||||
string table is terminated.
|
||||
(elf32_avr_get_device_info): Formatting. Add note_size param.
|
||||
Sanity check note.
|
||||
(elf32_avr_dump_mem_usage): Adjust to suit.
|
||||
|
||||
Upstream-Status: Backport
|
||||
CVE: CVE-2021-3549
|
||||
Signed-of-by: Armin Kuster <akuster@mvista.com>
|
||||
|
||||
---
|
||||
binutils/ChangeLog | 14 +++++++++
|
||||
binutils/od-elf32_avr.c | 66 ++++++++++++++++++++++++++---------------
|
||||
2 files changed, 56 insertions(+), 24 deletions(-)
|
||||
|
||||
Index: git/binutils/od-elf32_avr.c
|
||||
===================================================================
|
||||
--- git.orig/binutils/od-elf32_avr.c
|
||||
+++ git/binutils/od-elf32_avr.c
|
||||
@@ -77,23 +77,29 @@ elf32_avr_filter (bfd *abfd)
|
||||
return bfd_get_flavour (abfd) == bfd_target_elf_flavour;
|
||||
}
|
||||
|
||||
-static char*
|
||||
+static char *
|
||||
elf32_avr_get_note_section_contents (bfd *abfd, bfd_size_type *size)
|
||||
{
|
||||
asection *section;
|
||||
+ bfd_byte *contents;
|
||||
|
||||
- if ((section = bfd_get_section_by_name (abfd, ".note.gnu.avr.deviceinfo")) == NULL)
|
||||
+ section = bfd_get_section_by_name (abfd, ".note.gnu.avr.deviceinfo");
|
||||
+ if (section == NULL)
|
||||
return NULL;
|
||||
|
||||
- *size = bfd_section_size (section);
|
||||
- char *contents = (char *) xmalloc (*size);
|
||||
- bfd_get_section_contents (abfd, section, contents, 0, *size);
|
||||
+ if (!bfd_malloc_and_get_section (abfd, section, &contents))
|
||||
+ {
|
||||
+ free (contents);
|
||||
+ contents = NULL;
|
||||
+ }
|
||||
|
||||
- return contents;
|
||||
+ *size = bfd_section_size (section);
|
||||
+ return (char *) contents;
|
||||
}
|
||||
|
||||
-static char* elf32_avr_get_note_desc (bfd *abfd, char *contents,
|
||||
- bfd_size_type size)
|
||||
+static char *
|
||||
+elf32_avr_get_note_desc (bfd *abfd, char *contents, bfd_size_type size,
|
||||
+ bfd_size_type *descsz)
|
||||
{
|
||||
Elf_External_Note *xnp = (Elf_External_Note *) contents;
|
||||
Elf_Internal_Note in;
|
||||
@@ -107,42 +113,54 @@ static char* elf32_avr_get_note_desc (bf
|
||||
if (in.namesz > contents - in.namedata + size)
|
||||
return NULL;
|
||||
|
||||
+ if (in.namesz != 4 || strcmp (in.namedata, "AVR") != 0)
|
||||
+ return NULL;
|
||||
+
|
||||
in.descsz = bfd_get_32 (abfd, xnp->descsz);
|
||||
in.descdata = in.namedata + align_power (in.namesz, 2);
|
||||
- if (in.descsz != 0
|
||||
- && (in.descdata >= contents + size
|
||||
- || in.descsz > contents - in.descdata + size))
|
||||
+ if (in.descsz < 6 * sizeof (uint32_t)
|
||||
+ || in.descdata >= contents + size
|
||||
+ || in.descsz > contents - in.descdata + size)
|
||||
return NULL;
|
||||
|
||||
- if (strcmp (in.namedata, "AVR") != 0)
|
||||
- return NULL;
|
||||
+ /* If the note has a string table, ensure it is 0 terminated. */
|
||||
+ if (in.descsz > 8 * sizeof (uint32_t))
|
||||
+ in.descdata[in.descsz - 1] = 0;
|
||||
|
||||
+ *descsz = in.descsz;
|
||||
return in.descdata;
|
||||
}
|
||||
|
||||
static void
|
||||
elf32_avr_get_device_info (bfd *abfd, char *description,
|
||||
- deviceinfo *device)
|
||||
+ bfd_size_type desc_size, deviceinfo *device)
|
||||
{
|
||||
if (description == NULL)
|
||||
return;
|
||||
|
||||
const bfd_size_type memory_sizes = 6;
|
||||
|
||||
- memcpy (device, description, memory_sizes * sizeof(uint32_t));
|
||||
- device->name = NULL;
|
||||
+ memcpy (device, description, memory_sizes * sizeof (uint32_t));
|
||||
+ desc_size -= memory_sizes * sizeof (uint32_t);
|
||||
+ if (desc_size < 8)
|
||||
+ return;
|
||||
|
||||
- uint32_t *stroffset_table = ((uint32_t *) description) + memory_sizes;
|
||||
+ uint32_t *stroffset_table = (uint32_t *) description + memory_sizes;
|
||||
bfd_size_type stroffset_table_size = bfd_get_32 (abfd, stroffset_table);
|
||||
- char *str_table = ((char *) stroffset_table) + stroffset_table_size;
|
||||
|
||||
/* If the only content is the size itself, there's nothing in the table */
|
||||
- if (stroffset_table_size == 4)
|
||||
+ if (stroffset_table_size < 8)
|
||||
return;
|
||||
+ if (desc_size <= stroffset_table_size)
|
||||
+ return;
|
||||
+ desc_size -= stroffset_table_size;
|
||||
|
||||
/* First entry is the device name index. */
|
||||
uint32_t device_name_index = bfd_get_32 (abfd, stroffset_table + 1);
|
||||
+ if (device_name_index >= desc_size)
|
||||
+ return;
|
||||
|
||||
+ char *str_table = (char *) stroffset_table + stroffset_table_size;
|
||||
device->name = str_table + device_name_index;
|
||||
}
|
||||
|
||||
@@ -183,7 +201,7 @@ static void
|
||||
elf32_avr_dump_mem_usage (bfd *abfd)
|
||||
{
|
||||
char *description = NULL;
|
||||
- bfd_size_type note_section_size = 0;
|
||||
+ bfd_size_type sec_size, desc_size;
|
||||
|
||||
deviceinfo device = { 0, 0, 0, 0, 0, 0, NULL };
|
||||
device.name = "Unknown";
|
||||
@@ -192,13 +210,13 @@ elf32_avr_dump_mem_usage (bfd *abfd)
|
||||
bfd_size_type text_usage = 0;
|
||||
bfd_size_type eeprom_usage = 0;
|
||||
|
||||
- char *contents = elf32_avr_get_note_section_contents (abfd,
|
||||
- ¬e_section_size);
|
||||
+ char *contents = elf32_avr_get_note_section_contents (abfd, &sec_size);
|
||||
|
||||
if (contents != NULL)
|
||||
{
|
||||
- description = elf32_avr_get_note_desc (abfd, contents, note_section_size);
|
||||
- elf32_avr_get_device_info (abfd, description, &device);
|
||||
+ description = elf32_avr_get_note_desc (abfd, contents, sec_size,
|
||||
+ &desc_size);
|
||||
+ elf32_avr_get_device_info (abfd, description, desc_size, &device);
|
||||
}
|
||||
|
||||
elf32_avr_get_memory_usage (abfd, &text_usage, &data_usage,
|
||||
Index: git/binutils/ChangeLog
|
||||
===================================================================
|
||||
--- git.orig/binutils/ChangeLog
|
||||
+++ git/binutils/ChangeLog
|
||||
@@ -1,3 +1,17 @@
|
||||
+2021-02-11 Alan Modra <amodra@gmail.com>
|
||||
+
|
||||
+ PR 27290
|
||||
+ PR 27293
|
||||
+ PR 27295
|
||||
+ * od-elf32_avr.c (elf32_avr_get_note_section_contents): Formatting.
|
||||
+ Use bfd_malloc_and_get_section.
|
||||
+ (elf32_avr_get_note_desc): Formatting. Return descsz. Sanity
|
||||
+ check namesz. Return NULL if descsz is too small. Ensure
|
||||
+ string table is terminated.
|
||||
+ (elf32_avr_get_device_info): Formatting. Add note_size param.
|
||||
+ Sanity check note.
|
||||
+ (elf32_avr_dump_mem_usage): Adjust to suit.
|
||||
+
|
||||
2020-02-01 Nick Clifton <nickc@redhat.com>
|
||||
|
||||
* configure: Regenerate.
|
||||
@@ -0,0 +1,22 @@
|
||||
Ensure "small" file systems also have the default inode size (256 bytes) so that
|
||||
can store 64-bit timestamps and work past 2038.
|
||||
|
||||
The "small" type is any size >3MB and <512MB, which covers a lot of relatively
|
||||
small filesystems built by OE, especially when they're sized to fit the contents
|
||||
and expand to the storage on boot.
|
||||
|
||||
Upstream-Status: Inappropriate
|
||||
Signed-off-by: Ross Burton <ross.burton@arm.com>
|
||||
|
||||
diff --git a/misc/mke2fs.conf.in b/misc/mke2fs.conf.in
|
||||
index 01e35cf8..29f41dc0 100644
|
||||
--- a/misc/mke2fs.conf.in
|
||||
+++ b/misc/mke2fs.conf.in
|
||||
@@ -16,7 +16,6 @@
|
||||
}
|
||||
small = {
|
||||
blocksize = 1024
|
||||
- inode_size = 128
|
||||
inode_ratio = 4096
|
||||
}
|
||||
floppy = {
|
||||
@@ -14,6 +14,7 @@ SRC_URI += "file://remove.ldconfig.call.patch \
|
||||
|
||||
SRC_URI_append_class-native = " file://e2fsprogs-fix-missing-check-for-permission-denied.patch \
|
||||
file://quiet-debugfs.patch \
|
||||
file://big-inodes-for-small-fs.patch \
|
||||
"
|
||||
|
||||
SRCREV = "984ff8d6a0a1d5dc300505f67b38ed5047d51dac"
|
||||
|
||||
@@ -26,6 +26,11 @@ SRC_URI[sha256sum] = "e87aae032bf07c26f85ac0ed3250998c37621d95f8bd748b31f15b33c4
|
||||
UPSTREAM_CHECK_URI = "https://github.com/westes/flex/releases"
|
||||
UPSTREAM_CHECK_REGEX = "flex-(?P<pver>\d+(\.\d+)+)\.tar"
|
||||
|
||||
# Disputed - yes there is stack exhaustion but no bug and it is building the
|
||||
# parser, not running it, effectively similar to a compiler ICE. Upstream no plans to address
|
||||
# https://github.com/westes/flex/issues/414
|
||||
CVE_CHECK_WHITELIST += "CVE-2019-6293"
|
||||
|
||||
inherit autotools gettext texinfo ptest
|
||||
|
||||
M4 = "${bindir}/m4"
|
||||
|
||||
@@ -16,6 +16,15 @@ SRC_URI += "\
|
||||
file://0006-cmd-dist-separate-host-and-target-builds.patch \
|
||||
file://0007-cmd-go-make-GOROOT-precious-by-default.patch \
|
||||
file://0008-use-GOBUILDMODE-to-set-buildmode.patch \
|
||||
file://CVE-2021-34558.patch \
|
||||
file://CVE-2021-33196.patch \
|
||||
file://CVE-2021-33197.patch \
|
||||
"
|
||||
SRC_URI_append_libc-musl = " file://0009-ld-replace-glibc-dynamic-linker-with-musl.patch"
|
||||
SRC_URI[main.sha256sum] = "7ed13b2209e54a451835997f78035530b331c5b6943cdcd68a3d815fdc009149"
|
||||
|
||||
# Upstream don't believe it is a signifiant real world issue and will only
|
||||
# fix in 1.17 onwards where we can drop this.
|
||||
# https://github.com/golang/go/issues/30999#issuecomment-910470358
|
||||
CVE_CHECK_WHITELIST += "CVE-2021-29923"
|
||||
|
||||
|
||||
124
meta/recipes-devtools/go/go-1.14/CVE-2021-33196.patch
Normal file
124
meta/recipes-devtools/go/go-1.14/CVE-2021-33196.patch
Normal file
@@ -0,0 +1,124 @@
|
||||
From 74242baa4136c7a9132a8ccd9881354442788c8c Mon Sep 17 00:00:00 2001
|
||||
From: Roland Shoemaker <roland@golang.org>
|
||||
Date: Tue, 11 May 2021 11:31:31 -0700
|
||||
Subject: [PATCH] archive/zip: only preallocate File slice if reasonably sized
|
||||
|
||||
Since the number of files in the EOCD record isn't validated, it isn't
|
||||
safe to preallocate Reader.Files using that field. A malformed archive
|
||||
can indicate it contains up to 1 << 128 - 1 files. We can still safely
|
||||
preallocate the slice by checking if the specified number of files in
|
||||
the archive is reasonable, given the size of the archive.
|
||||
|
||||
Thanks to the OSS-Fuzz project for discovering this issue and to
|
||||
Emmanuel Odeke for reporting it.
|
||||
|
||||
Fixes #46242
|
||||
Fixes CVE-2021-33196
|
||||
|
||||
Change-Id: I3c76d8eec178468b380d87fdb4a3f2cb06f0ee76
|
||||
Reviewed-on: https://go-review.googlesource.com/c/go/+/318909
|
||||
Trust: Roland Shoemaker <roland@golang.org>
|
||||
Trust: Katie Hockman <katie@golang.org>
|
||||
Trust: Joe Tsai <thebrokentoaster@gmail.com>
|
||||
Run-TryBot: Roland Shoemaker <roland@golang.org>
|
||||
TryBot-Result: Go Bot <gobot@golang.org>
|
||||
Reviewed-by: Katie Hockman <katie@golang.org>
|
||||
Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
|
||||
|
||||
Upstream-Status: Backport
|
||||
CVE: CVE-2021-33196
|
||||
Signed-off-by: Armin Kuster <akuster@mvista.com>
|
||||
|
||||
---
|
||||
src/archive/zip/reader.go | 10 +++++-
|
||||
src/archive/zip/reader_test.go | 59 ++++++++++++++++++++++++++++++++++
|
||||
2 files changed, 68 insertions(+), 1 deletion(-)
|
||||
|
||||
Index: go/src/archive/zip/reader.go
|
||||
===================================================================
|
||||
--- go.orig/src/archive/zip/reader.go
|
||||
+++ go/src/archive/zip/reader.go
|
||||
@@ -84,7 +84,15 @@ func (z *Reader) init(r io.ReaderAt, siz
|
||||
return err
|
||||
}
|
||||
z.r = r
|
||||
- z.File = make([]*File, 0, end.directoryRecords)
|
||||
+ // Since the number of directory records is not validated, it is not
|
||||
+ // safe to preallocate z.File without first checking that the specified
|
||||
+ // number of files is reasonable, since a malformed archive may
|
||||
+ // 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 {
|
||||
+ z.File = make([]*File, 0, end.directoryRecords)
|
||||
+ }
|
||||
z.Comment = end.comment
|
||||
rs := io.NewSectionReader(r, 0, size)
|
||||
if _, err = rs.Seek(int64(end.directoryOffset), io.SeekStart); err != nil {
|
||||
Index: go/src/archive/zip/reader_test.go
|
||||
===================================================================
|
||||
--- go.orig/src/archive/zip/reader_test.go
|
||||
+++ go/src/archive/zip/reader_test.go
|
||||
@@ -1070,3 +1070,62 @@ func TestIssue12449(t *testing.T) {
|
||||
t.Errorf("Error reading the archive: %v", err)
|
||||
}
|
||||
}
|
||||
+
|
||||
+func TestCVE202133196(t *testing.T) {
|
||||
+ // Archive that indicates it has 1 << 128 -1 files,
|
||||
+ // this would previously cause a panic due to attempting
|
||||
+ // to allocate a slice with 1 << 128 -1 elements.
|
||||
+ data := []byte{
|
||||
+ 0x50, 0x4b, 0x03, 0x04, 0x14, 0x00, 0x08, 0x08,
|
||||
+ 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
+ 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x02,
|
||||
+ 0x03, 0x62, 0x61, 0x65, 0x03, 0x04, 0x00, 0x00,
|
||||
+ 0xff, 0xff, 0x50, 0x4b, 0x07, 0x08, 0xbe, 0x20,
|
||||
+ 0x5c, 0x6c, 0x09, 0x00, 0x00, 0x00, 0x03, 0x00,
|
||||
+ 0x00, 0x00, 0x50, 0x4b, 0x01, 0x02, 0x14, 0x00,
|
||||
+ 0x14, 0x00, 0x08, 0x08, 0x08, 0x00, 0x00, 0x00,
|
||||
+ 0x00, 0x00, 0xbe, 0x20, 0x5c, 0x6c, 0x09, 0x00,
|
||||
+ 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00,
|
||||
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
+ 0x01, 0x02, 0x03, 0x50, 0x4b, 0x06, 0x06, 0x2c,
|
||||
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2d,
|
||||
+ 0x00, 0x2d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
+ 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
|
||||
+ 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
+ 0xff, 0xff, 0xff, 0x31, 0x00, 0x00, 0x00, 0x00,
|
||||
+ 0x00, 0x00, 0x00, 0x3a, 0x00, 0x00, 0x00, 0x00,
|
||||
+ 0x00, 0x00, 0x00, 0x50, 0x4b, 0x06, 0x07, 0x00,
|
||||
+ 0x00, 0x00, 0x00, 0x6b, 0x00, 0x00, 0x00, 0x00,
|
||||
+ 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x50,
|
||||
+ 0x4b, 0x05, 0x06, 0x00, 0x00, 0x00, 0x00, 0xff,
|
||||
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
+ 0xff, 0xff, 0xff, 0x00, 0x00,
|
||||
+ }
|
||||
+ _, err := NewReader(bytes.NewReader(data), int64(len(data)))
|
||||
+ if err != ErrFormat {
|
||||
+ t.Fatalf("unexpected error, got: %v, want: %v", err, ErrFormat)
|
||||
+ }
|
||||
+
|
||||
+ // Also check that an archive containing a handful of empty
|
||||
+ // files doesn't cause an issue
|
||||
+ b := bytes.NewBuffer(nil)
|
||||
+ w := NewWriter(b)
|
||||
+ for i := 0; i < 5; i++ {
|
||||
+ _, err := w.Create("")
|
||||
+ if err != nil {
|
||||
+ t.Fatalf("Writer.Create failed: %s", err)
|
||||
+ }
|
||||
+ }
|
||||
+ if err := w.Close(); err != nil {
|
||||
+ t.Fatalf("Writer.Close failed: %s", err)
|
||||
+ }
|
||||
+ r, err := NewReader(bytes.NewReader(b.Bytes()), int64(b.Len()))
|
||||
+ if err != nil {
|
||||
+ t.Fatalf("NewReader failed: %s", err)
|
||||
+ }
|
||||
+ if len(r.File) != 5 {
|
||||
+ t.Errorf("Archive has unexpected number of files, got %d, want 5", len(r.File))
|
||||
+ }
|
||||
+}
|
||||
152
meta/recipes-devtools/go/go-1.14/CVE-2021-33197.patch
Normal file
152
meta/recipes-devtools/go/go-1.14/CVE-2021-33197.patch
Normal file
@@ -0,0 +1,152 @@
|
||||
From cbd1ca84453fecf3825a6bb9f985823e8bc32b76 Mon Sep 17 00:00:00 2001
|
||||
From: Filippo Valsorda <filippo@golang.org>
|
||||
Date: Fri, 21 May 2021 14:02:30 -0400
|
||||
Subject: [PATCH] [release-branch.go1.15] net/http/httputil: always remove
|
||||
hop-by-hop headers
|
||||
|
||||
Previously, we'd fail to remove the Connection header from a request
|
||||
like this:
|
||||
|
||||
Connection:
|
||||
Connection: x-header
|
||||
|
||||
Updates #46313
|
||||
Fixes #46314
|
||||
Fixes CVE-2021-33197
|
||||
|
||||
Change-Id: Ie3009e926ceecfa86dfa6bcc6fe14ff01086be7d
|
||||
Reviewed-on: https://go-review.googlesource.com/c/go/+/321929
|
||||
Run-TryBot: Filippo Valsorda <filippo@golang.org>
|
||||
Reviewed-by: Katie Hockman <katie@golang.org>
|
||||
Trust: Katie Hockman <katie@golang.org>
|
||||
Trust: Filippo Valsorda <filippo@golang.org>
|
||||
TryBot-Result: Go Bot <gobot@golang.org>
|
||||
Reviewed-on: https://go-review.googlesource.com/c/go/+/323091
|
||||
Run-TryBot: Katie Hockman <katie@golang.org>
|
||||
|
||||
Upstream-Status: Backport
|
||||
CVE: CVE-2021-33197
|
||||
Signed-off-by: Armin Kuster <akuster@mvista.com>
|
||||
|
||||
---
|
||||
src/net/http/httputil/reverseproxy.go | 22 ++++----
|
||||
src/net/http/httputil/reverseproxy_test.go | 63 +++++++++++++++++++++-
|
||||
2 files changed, 70 insertions(+), 15 deletions(-)
|
||||
|
||||
Index: go/src/net/http/httputil/reverseproxy.go
|
||||
===================================================================
|
||||
--- go.orig/src/net/http/httputil/reverseproxy.go
|
||||
+++ go/src/net/http/httputil/reverseproxy.go
|
||||
@@ -221,22 +221,18 @@ func (p *ReverseProxy) ServeHTTP(rw http
|
||||
// important is "Connection" because we want a persistent
|
||||
// connection, regardless of what the client sent to us.
|
||||
for _, h := range hopHeaders {
|
||||
- hv := outreq.Header.Get(h)
|
||||
- if hv == "" {
|
||||
- continue
|
||||
- }
|
||||
- if h == "Te" && hv == "trailers" {
|
||||
- // Issue 21096: tell backend applications that
|
||||
- // care about trailer support that we support
|
||||
- // trailers. (We do, but we don't go out of
|
||||
- // our way to advertise that unless the
|
||||
- // incoming client request thought it was
|
||||
- // worth mentioning)
|
||||
- continue
|
||||
- }
|
||||
outreq.Header.Del(h)
|
||||
}
|
||||
|
||||
+ // Issue 21096: tell backend applications that care about trailer support
|
||||
+ // that we support trailers. (We do, but we don't go out of our way to
|
||||
+ // advertise that unless the incoming client request thought it was worth
|
||||
+ // mentioning.) Note that we look at req.Header, not outreq.Header, since
|
||||
+ // the latter has passed through removeConnectionHeaders.
|
||||
+ if httpguts.HeaderValuesContainsToken(req.Header["Te"], "trailers") {
|
||||
+ outreq.Header.Set("Te", "trailers")
|
||||
+ }
|
||||
+
|
||||
// After stripping all the hop-by-hop connection headers above, add back any
|
||||
// necessary for protocol upgrades, such as for websockets.
|
||||
if reqUpType != "" {
|
||||
Index: go/src/net/http/httputil/reverseproxy_test.go
|
||||
===================================================================
|
||||
--- go.orig/src/net/http/httputil/reverseproxy_test.go
|
||||
+++ go/src/net/http/httputil/reverseproxy_test.go
|
||||
@@ -91,8 +91,9 @@ func TestReverseProxy(t *testing.T) {
|
||||
|
||||
getReq, _ := http.NewRequest("GET", frontend.URL, nil)
|
||||
getReq.Host = "some-name"
|
||||
- getReq.Header.Set("Connection", "close")
|
||||
- getReq.Header.Set("Te", "trailers")
|
||||
+ getReq.Header.Set("Connection", "close, TE")
|
||||
+ getReq.Header.Add("Te", "foo")
|
||||
+ getReq.Header.Add("Te", "bar, trailers")
|
||||
getReq.Header.Set("Proxy-Connection", "should be deleted")
|
||||
getReq.Header.Set("Upgrade", "foo")
|
||||
getReq.Close = true
|
||||
@@ -236,6 +237,64 @@ func TestReverseProxyStripHeadersPresent
|
||||
}
|
||||
}
|
||||
|
||||
+func TestReverseProxyStripEmptyConnection(t *testing.T) {
|
||||
+ // See Issue 46313.
|
||||
+ const backendResponse = "I am the backend"
|
||||
+
|
||||
+ // someConnHeader is some arbitrary header to be declared as a hop-by-hop header
|
||||
+ // in the Request's Connection header.
|
||||
+ const someConnHeader = "X-Some-Conn-Header"
|
||||
+
|
||||
+ backend := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
+ if c := r.Header.Values("Connection"); len(c) != 0 {
|
||||
+ t.Errorf("handler got header %q = %v; want empty", "Connection", c)
|
||||
+ }
|
||||
+ if c := r.Header.Get(someConnHeader); c != "" {
|
||||
+ t.Errorf("handler got header %q = %q; want empty", someConnHeader, c)
|
||||
+ }
|
||||
+ w.Header().Add("Connection", "")
|
||||
+ w.Header().Add("Connection", someConnHeader)
|
||||
+ w.Header().Set(someConnHeader, "should be deleted")
|
||||
+ io.WriteString(w, backendResponse)
|
||||
+ }))
|
||||
+ defer backend.Close()
|
||||
+ backendURL, err := url.Parse(backend.URL)
|
||||
+ if err != nil {
|
||||
+ t.Fatal(err)
|
||||
+ }
|
||||
+ proxyHandler := NewSingleHostReverseProxy(backendURL)
|
||||
+ frontend := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
+ proxyHandler.ServeHTTP(w, r)
|
||||
+ if c := r.Header.Get(someConnHeader); c != "should be deleted" {
|
||||
+ t.Errorf("handler modified header %q = %q; want %q", someConnHeader, c, "should be deleted")
|
||||
+ }
|
||||
+ }))
|
||||
+ defer frontend.Close()
|
||||
+
|
||||
+ getReq, _ := http.NewRequest("GET", frontend.URL, nil)
|
||||
+ getReq.Header.Add("Connection", "")
|
||||
+ getReq.Header.Add("Connection", someConnHeader)
|
||||
+ getReq.Header.Set(someConnHeader, "should be deleted")
|
||||
+ res, err := frontend.Client().Do(getReq)
|
||||
+ if err != nil {
|
||||
+ t.Fatalf("Get: %v", err)
|
||||
+ }
|
||||
+ defer res.Body.Close()
|
||||
+ bodyBytes, err := ioutil.ReadAll(res.Body)
|
||||
+ if err != nil {
|
||||
+ t.Fatalf("reading body: %v", err)
|
||||
+ }
|
||||
+ if got, want := string(bodyBytes), backendResponse; got != want {
|
||||
+ t.Errorf("got body %q; want %q", got, want)
|
||||
+ }
|
||||
+ if c := res.Header.Get("Connection"); c != "" {
|
||||
+ t.Errorf("handler got header %q = %q; want empty", "Connection", c)
|
||||
+ }
|
||||
+ if c := res.Header.Get(someConnHeader); c != "" {
|
||||
+ t.Errorf("handler got header %q = %q; want empty", someConnHeader, c)
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
func TestXForwardedFor(t *testing.T) {
|
||||
const prevForwardedFor = "client ip"
|
||||
const backendResponse = "I am the backend"
|
||||
51
meta/recipes-devtools/go/go-1.14/CVE-2021-34558.patch
Normal file
51
meta/recipes-devtools/go/go-1.14/CVE-2021-34558.patch
Normal file
@@ -0,0 +1,51 @@
|
||||
From a98589711da5e9d935e8d690cfca92892e86d557 Mon Sep 17 00:00:00 2001
|
||||
From: Roland Shoemaker <roland@golang.org>
|
||||
Date: Wed, 9 Jun 2021 11:31:27 -0700
|
||||
Subject: [PATCH] crypto/tls: test key type when casting
|
||||
|
||||
When casting the certificate public key in generateClientKeyExchange,
|
||||
check the type is appropriate. This prevents a panic when a server
|
||||
agrees to a RSA based key exchange, but then sends an ECDSA (or
|
||||
other) certificate.
|
||||
|
||||
Fixes #47143
|
||||
Fixes CVE-2021-34558
|
||||
|
||||
Thanks to Imre Rad for reporting this issue.
|
||||
|
||||
Change-Id: Iabccacca6052769a605cccefa1216a9f7b7f6aea
|
||||
Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1116723
|
||||
Reviewed-by: Filippo Valsorda <valsorda@google.com>
|
||||
Reviewed-by: Katie Hockman <katiehockman@google.com>
|
||||
Reviewed-on: https://go-review.googlesource.com/c/go/+/334031
|
||||
Trust: Filippo Valsorda <filippo@golang.org>
|
||||
Run-TryBot: Filippo Valsorda <filippo@golang.org>
|
||||
TryBot-Result: Go Bot <gobot@golang.org>
|
||||
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
|
||||
|
||||
Upstream-Status: Backport
|
||||
https://github.com/golang/go/commit/a98589711da5e9d935e8d690cfca92892e86d557
|
||||
CVE: CVE-2021-34558
|
||||
Signed-off-by: Armin Kuster <akuster@mvista.com>
|
||||
|
||||
---
|
||||
src/crypto/tls/key_agreement.go | 6 +++++-
|
||||
1 file changed, 5 insertions(+), 1 deletion(-)
|
||||
|
||||
Index: go/src/crypto/tls/key_agreement.go
|
||||
===================================================================
|
||||
--- go.orig/src/crypto/tls/key_agreement.go
|
||||
+++ go/src/crypto/tls/key_agreement.go
|
||||
@@ -67,7 +67,11 @@ func (ka rsaKeyAgreement) generateClient
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
- encrypted, err := rsa.EncryptPKCS1v15(config.rand(), cert.PublicKey.(*rsa.PublicKey), preMasterSecret)
|
||||
+ rsaKey, ok := cert.PublicKey.(*rsa.PublicKey)
|
||||
+ if !ok {
|
||||
+ return nil, nil, errors.New("tls: server certificate contains incorrect key type for selected ciphersuite")
|
||||
+ }
|
||||
+ encrypted, err := rsa.EncryptPKCS1v15(config.rand(), rsaKey, preMasterSecret)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
@@ -0,0 +1,431 @@
|
||||
From 597c7a8333df84a87cc48fb8477b603ffbf372a6 Mon Sep 17 00:00:00 2001
|
||||
From: Andrej Valek <andrej.valek@siemens.com>
|
||||
Date: Mon, 23 Aug 2021 12:45:11 +0200
|
||||
Subject: [PATCH] feat(cpp17): remove deprecated exception specifications for
|
||||
C++ 17
|
||||
|
||||
Upstream-Status: Submitted [https://salsa.debian.org/installer-team/mklibs/-/merge_requests/2]
|
||||
|
||||
based on: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0003r5.html
|
||||
|
||||
Signed-off-by: Andrej Valek <andrej.valek@siemens.com>
|
||||
---
|
||||
src/mklibs-readelf/elf.cpp | 48 ++++++++++++++++++++---------------------
|
||||
src/mklibs-readelf/elf.hpp | 18 ++++++++--------
|
||||
src/mklibs-readelf/elf_data.hpp | 36 +++++++++++++++----------------
|
||||
3 files changed, 51 insertions(+), 51 deletions(-)
|
||||
|
||||
diff --git a/src/mklibs-readelf/elf.cpp b/src/mklibs-readelf/elf.cpp
|
||||
index 0e4c0f3..2e6d0f6 100644
|
||||
--- a/src/mklibs-readelf/elf.cpp
|
||||
+++ b/src/mklibs-readelf/elf.cpp
|
||||
@@ -36,7 +36,7 @@ file::~file () throw ()
|
||||
delete *it;
|
||||
}
|
||||
|
||||
-file *file::open (const char *filename) throw (std::bad_alloc, std::runtime_error)
|
||||
+file *file::open (const char *filename) throw ()
|
||||
{
|
||||
struct stat buf;
|
||||
int fd;
|
||||
@@ -72,7 +72,7 @@ file *file::open (const char *filename) throw (std::bad_alloc, std::runtime_erro
|
||||
}
|
||||
|
||||
template<typename _class>
|
||||
-file *file::open_class(uint8_t *mem, size_t len) throw (std::bad_alloc, std::runtime_error)
|
||||
+file *file::open_class(uint8_t *mem, size_t len) throw ()
|
||||
{
|
||||
switch (mem[EI_DATA])
|
||||
{
|
||||
@@ -86,7 +86,7 @@ file *file::open_class(uint8_t *mem, size_t len) throw (std::bad_alloc, std::run
|
||||
}
|
||||
|
||||
template <typename _class, typename _data>
|
||||
-file_data<_class, _data>::file_data(uint8_t *mem, size_t len) throw (std::bad_alloc, std::runtime_error)
|
||||
+file_data<_class, _data>::file_data(uint8_t *mem, size_t len) throw ()
|
||||
: file(mem, len)
|
||||
{
|
||||
if (mem[EI_CLASS] != _class::id)
|
||||
@@ -190,7 +190,7 @@ section_data<_class, _data>::section_data(Shdr *shdr, uint8_t *mem) throw ()
|
||||
}
|
||||
|
||||
template <typename _class, typename _data>
|
||||
-void section_data<_class, _data>::update(const file &file) throw (std::bad_alloc)
|
||||
+void section_data<_class, _data>::update(const file &file) throw ()
|
||||
{
|
||||
const section_type<section_type_STRTAB> §ion =
|
||||
dynamic_cast<const section_type<section_type_STRTAB> &>(file.get_section(file.get_shstrndx()));
|
||||
@@ -204,7 +204,7 @@ section_type<section_type_DYNAMIC>::~section_type() throw ()
|
||||
}
|
||||
|
||||
template <typename _class, typename _data>
|
||||
-section_real<_class, _data, section_type_DYNAMIC>::section_real(Shdr *header, uint8_t *mem) throw (std::bad_alloc)
|
||||
+section_real<_class, _data, section_type_DYNAMIC>::section_real(Shdr *header, uint8_t *mem) throw ()
|
||||
: section_data<_class, _data>(header, mem)
|
||||
{
|
||||
if (this->type != SHT_DYNAMIC)
|
||||
@@ -221,7 +221,7 @@ section_real<_class, _data, section_type_DYNAMIC>::section_real(Shdr *header, ui
|
||||
}
|
||||
|
||||
template <typename _class, typename _data>
|
||||
-void section_real<_class, _data, section_type_DYNAMIC>::update(const file &file) throw (std::bad_alloc)
|
||||
+void section_real<_class, _data, section_type_DYNAMIC>::update(const file &file) throw ()
|
||||
{
|
||||
section_data<_class, _data>::update(file);
|
||||
|
||||
@@ -243,7 +243,7 @@ section_type<section_type_DYNSYM>::~section_type() throw ()
|
||||
}
|
||||
|
||||
template <typename _class, typename _data>
|
||||
-section_real<_class, _data, section_type_DYNSYM>::section_real(Shdr *header, uint8_t *mem) throw (std::bad_alloc)
|
||||
+section_real<_class, _data, section_type_DYNSYM>::section_real(Shdr *header, uint8_t *mem) throw ()
|
||||
: section_data<_class, _data>(header, mem)
|
||||
{
|
||||
if (this->type != SHT_DYNSYM)
|
||||
@@ -260,7 +260,7 @@ section_real<_class, _data, section_type_DYNSYM>::section_real(Shdr *header, uin
|
||||
}
|
||||
|
||||
template <typename _class, typename _data>
|
||||
-void section_real<_class, _data, section_type_DYNSYM>::update(const file &file) throw (std::bad_alloc)
|
||||
+void section_real<_class, _data, section_type_DYNSYM>::update(const file &file) throw ()
|
||||
{
|
||||
section_data<_class, _data>::update (file);
|
||||
|
||||
@@ -285,7 +285,7 @@ const version_definition *section_type<section_type_GNU_VERDEF>::get_version_def
|
||||
}
|
||||
|
||||
template <typename _class, typename _data>
|
||||
-section_real<_class, _data, section_type_GNU_VERDEF>::section_real(Shdr *header, uint8_t *mem) throw (std::bad_alloc)
|
||||
+section_real<_class, _data, section_type_GNU_VERDEF>::section_real(Shdr *header, uint8_t *mem) throw ()
|
||||
: section_data<_class, _data>(header, mem)
|
||||
{
|
||||
if (this->type != SHT_GNU_verdef)
|
||||
@@ -307,7 +307,7 @@ section_real<_class, _data, section_type_GNU_VERDEF>::section_real(Shdr *header,
|
||||
}
|
||||
|
||||
template <typename _class, typename _data>
|
||||
-void section_real<_class, _data, section_type_GNU_VERDEF>::update(const file &file) throw (std::bad_alloc)
|
||||
+void section_real<_class, _data, section_type_GNU_VERDEF>::update(const file &file) throw ()
|
||||
{
|
||||
section_data<_class, _data>::update(file);
|
||||
|
||||
@@ -333,7 +333,7 @@ const version_requirement_entry *section_type<section_type_GNU_VERNEED>::get_ver
|
||||
|
||||
template <typename _class, typename _data>
|
||||
section_real<_class, _data, section_type_GNU_VERNEED>::
|
||||
-section_real(Shdr *header, uint8_t *mem) throw (std::bad_alloc)
|
||||
+section_real(Shdr *header, uint8_t *mem) throw ()
|
||||
: section_data<_class, _data> (header, mem)
|
||||
{
|
||||
if (this->type != SHT_GNU_verneed)
|
||||
@@ -355,7 +355,7 @@ section_real(Shdr *header, uint8_t *mem) throw (std::bad_alloc)
|
||||
}
|
||||
|
||||
template <typename _class, typename _data>
|
||||
-void section_real<_class, _data, section_type_GNU_VERNEED>::update(const file &file) throw (std::bad_alloc)
|
||||
+void section_real<_class, _data, section_type_GNU_VERNEED>::update(const file &file) throw ()
|
||||
{
|
||||
section_data<_class, _data>::update(file);
|
||||
|
||||
@@ -372,7 +372,7 @@ void section_real<_class, _data, section_type_GNU_VERNEED>::update(const file &f
|
||||
|
||||
template <typename _class, typename _data>
|
||||
section_real<_class, _data, section_type_GNU_VERSYM>::
|
||||
-section_real (Shdr *header, uint8_t *mem) throw (std::bad_alloc)
|
||||
+section_real (Shdr *header, uint8_t *mem) throw ()
|
||||
: section_data<_class, _data> (header, mem)
|
||||
{
|
||||
if (this->type != SHT_GNU_versym)
|
||||
@@ -399,7 +399,7 @@ segment_data<_class, _data>::segment_data (Phdr *phdr, uint8_t *mem) throw ()
|
||||
}
|
||||
|
||||
template <typename _class, typename _data>
|
||||
-segment_real<_class, _data, segment_type_INTERP>::segment_real (Phdr *header, uint8_t *mem) throw (std::bad_alloc)
|
||||
+segment_real<_class, _data, segment_type_INTERP>::segment_real (Phdr *header, uint8_t *mem) throw ()
|
||||
: segment_data<_class, _data> (header, mem)
|
||||
{
|
||||
if (this->type != PT_INTERP)
|
||||
@@ -429,13 +429,13 @@ dynamic_data<_class, _data>::dynamic_data (Dyn *dyn) throw ()
|
||||
}
|
||||
|
||||
template <typename _class, typename _data>
|
||||
-void dynamic_data<_class, _data>::update_string(const section_type<section_type_STRTAB> §ion) throw (std::bad_alloc)
|
||||
+void dynamic_data<_class, _data>::update_string(const section_type<section_type_STRTAB> §ion) throw ()
|
||||
{
|
||||
if (is_string)
|
||||
val_string = section.get_string(val);
|
||||
}
|
||||
|
||||
-std::string symbol::get_version () const throw (std::bad_alloc)
|
||||
+std::string symbol::get_version () const throw ()
|
||||
{
|
||||
if (verneed)
|
||||
return verneed->get_name();
|
||||
@@ -445,7 +445,7 @@ std::string symbol::get_version () const throw (std::bad_alloc)
|
||||
return "Base";
|
||||
}
|
||||
|
||||
-std::string symbol::get_version_file () const throw (std::bad_alloc)
|
||||
+std::string symbol::get_version_file () const throw ()
|
||||
{
|
||||
if (verneed)
|
||||
return verneed->get_file();
|
||||
@@ -453,7 +453,7 @@ std::string symbol::get_version_file () const throw (std::bad_alloc)
|
||||
return "None";
|
||||
}
|
||||
|
||||
-std::string symbol::get_name_version () const throw (std::bad_alloc)
|
||||
+std::string symbol::get_name_version () const throw ()
|
||||
{
|
||||
std::string ver;
|
||||
|
||||
@@ -478,13 +478,13 @@ symbol_data<_class, _data>::symbol_data (Sym *sym) throw ()
|
||||
}
|
||||
|
||||
template <typename _class, typename _data>
|
||||
-void symbol_data<_class, _data>::update_string(const section_type<section_type_STRTAB> §ion) throw (std::bad_alloc)
|
||||
+void symbol_data<_class, _data>::update_string(const section_type<section_type_STRTAB> §ion) throw ()
|
||||
{
|
||||
name_string = section.get_string(name);
|
||||
}
|
||||
|
||||
template <typename _class, typename _data>
|
||||
-void symbol_data<_class, _data>::update_version(const file &file, uint16_t index) throw (std::bad_alloc)
|
||||
+void symbol_data<_class, _data>::update_version(const file &file, uint16_t index) throw ()
|
||||
{
|
||||
if (!file.get_section_GNU_VERSYM())
|
||||
return;
|
||||
@@ -531,13 +531,13 @@ version_definition_data<_class, _data>::version_definition_data (Verdef *verdef)
|
||||
}
|
||||
|
||||
template <typename _class, typename _data>
|
||||
-void version_definition_data<_class, _data>::update_string(const section_type<section_type_STRTAB> §ion) throw (std::bad_alloc)
|
||||
+void version_definition_data<_class, _data>::update_string(const section_type<section_type_STRTAB> §ion) throw ()
|
||||
{
|
||||
for (std::vector<uint32_t>::iterator it = names.begin(); it != names.end(); ++it)
|
||||
names_string.push_back(section.get_string(*it));
|
||||
}
|
||||
|
||||
-version_requirement::version_requirement() throw (std::bad_alloc)
|
||||
+version_requirement::version_requirement() throw ()
|
||||
: file_string("None")
|
||||
{ }
|
||||
|
||||
@@ -561,7 +561,7 @@ version_requirement_data<_class, _data>::version_requirement_data (Verneed *vern
|
||||
|
||||
template <typename _class, typename _data>
|
||||
void version_requirement_data<_class, _data>::
|
||||
-update_string(const section_type<section_type_STRTAB> §ion) throw (std::bad_alloc)
|
||||
+update_string(const section_type<section_type_STRTAB> §ion) throw ()
|
||||
{
|
||||
file_string = section.get_string(file);
|
||||
|
||||
@@ -596,7 +596,7 @@ version_requirement_entry_data(Vernaux *vna, const version_requirement &verneed)
|
||||
|
||||
template <typename _class, typename _data>
|
||||
void version_requirement_entry_data<_class, _data>::
|
||||
-update_string(const section_type<section_type_STRTAB> §ion) throw (std::bad_alloc)
|
||||
+update_string(const section_type<section_type_STRTAB> §ion) throw ()
|
||||
{
|
||||
name_string = section.get_string(name);
|
||||
}
|
||||
diff --git a/src/mklibs-readelf/elf.hpp b/src/mklibs-readelf/elf.hpp
|
||||
index 70e61cd..afb0c9e 100644
|
||||
--- a/src/mklibs-readelf/elf.hpp
|
||||
+++ b/src/mklibs-readelf/elf.hpp
|
||||
@@ -49,7 +49,7 @@ namespace Elf
|
||||
const uint16_t get_shstrndx() const throw () { return shstrndx; }
|
||||
|
||||
const std::vector<section *> get_sections() const throw () { return sections; };
|
||||
- const section &get_section(unsigned int i) const throw (std::out_of_range) { return *sections.at(i); };
|
||||
+ const section &get_section(unsigned int i) const throw () { return *sections.at(i); };
|
||||
const section_type<section_type_DYNAMIC> *get_section_DYNAMIC() const throw () { return section_DYNAMIC; };
|
||||
const section_type<section_type_DYNSYM> *get_section_DYNSYM() const throw () { return section_DYNSYM; };
|
||||
const section_type<section_type_GNU_VERDEF> *get_section_GNU_VERDEF() const throw () { return section_GNU_VERDEF; };
|
||||
@@ -59,13 +59,13 @@ namespace Elf
|
||||
const std::vector<segment *> get_segments() const throw () { return segments; };
|
||||
const segment_type<segment_type_INTERP> *get_segment_INTERP() const throw () { return segment_INTERP; };
|
||||
|
||||
- static file *open(const char *filename) throw (std::bad_alloc, std::runtime_error);
|
||||
+ static file *open(const char *filename) throw ();
|
||||
|
||||
protected:
|
||||
- file(uint8_t *mem, size_t len) throw (std::bad_alloc) : mem(mem), len(len) { }
|
||||
+ file(uint8_t *mem, size_t len) throw () : mem(mem), len(len) { }
|
||||
|
||||
template<typename _class>
|
||||
- static file *open_class(uint8_t *, size_t) throw (std::bad_alloc, std::runtime_error);
|
||||
+ static file *open_class(uint8_t *, size_t) throw ();
|
||||
|
||||
uint16_t type;
|
||||
uint16_t machine;
|
||||
@@ -128,7 +128,7 @@ namespace Elf
|
||||
class section_type<section_type_STRTAB> : public virtual section
|
||||
{
|
||||
public:
|
||||
- std::string get_string(uint32_t offset) const throw (std::bad_alloc)
|
||||
+ std::string get_string(uint32_t offset) const throw ()
|
||||
{
|
||||
return std::string(reinterpret_cast<const char *> (mem + offset));
|
||||
}
|
||||
@@ -263,10 +263,10 @@ namespace Elf
|
||||
uint8_t get_bind () const throw () { return bind; }
|
||||
uint8_t get_type () const throw () { return type; }
|
||||
const std::string &get_name_string() const throw () { return name_string; }
|
||||
- std::string get_version() const throw (std::bad_alloc);
|
||||
- std::string get_version_file() const throw (std::bad_alloc);
|
||||
+ std::string get_version() const throw ();
|
||||
+ std::string get_version_file() const throw ();
|
||||
uint16_t get_version_data() const throw () { return versym; }
|
||||
- std::string get_name_version() const throw (std::bad_alloc);
|
||||
+ std::string get_name_version() const throw ();
|
||||
|
||||
protected:
|
||||
uint32_t name;
|
||||
@@ -305,7 +305,7 @@ namespace Elf
|
||||
class version_requirement
|
||||
{
|
||||
public:
|
||||
- version_requirement() throw (std::bad_alloc);
|
||||
+ version_requirement() throw ();
|
||||
virtual ~version_requirement () throw () { }
|
||||
|
||||
const std::string &get_file() const throw () { return file_string; }
|
||||
diff --git a/src/mklibs-readelf/elf_data.hpp b/src/mklibs-readelf/elf_data.hpp
|
||||
index 05effee..3871982 100644
|
||||
--- a/src/mklibs-readelf/elf_data.hpp
|
||||
+++ b/src/mklibs-readelf/elf_data.hpp
|
||||
@@ -94,7 +94,7 @@ namespace Elf
|
||||
class file_data : public file
|
||||
{
|
||||
public:
|
||||
- file_data(uint8_t *, size_t len) throw (std::bad_alloc, std::runtime_error);
|
||||
+ file_data(uint8_t *, size_t len) throw ();
|
||||
|
||||
const uint8_t get_class() const throw () { return _class::id; }
|
||||
const uint8_t get_data() const throw () { return _data::id; }
|
||||
@@ -109,7 +109,7 @@ namespace Elf
|
||||
public:
|
||||
section_data(Shdr *, uint8_t *) throw ();
|
||||
|
||||
- virtual void update(const file &) throw (std::bad_alloc);
|
||||
+ virtual void update(const file &) throw ();
|
||||
};
|
||||
|
||||
template <typename _class, typename _data, typename _type>
|
||||
@@ -133,9 +133,9 @@ namespace Elf
|
||||
typedef typename _elfdef<_class>::Shdr Shdr;
|
||||
|
||||
public:
|
||||
- section_real(Shdr *, uint8_t *) throw (std::bad_alloc);
|
||||
+ section_real(Shdr *, uint8_t *) throw ();
|
||||
|
||||
- void update(const file &) throw (std::bad_alloc);
|
||||
+ void update(const file &) throw ();
|
||||
};
|
||||
|
||||
template <typename _class, typename _data>
|
||||
@@ -147,9 +147,9 @@ namespace Elf
|
||||
typedef typename _elfdef<_class>::Shdr Shdr;
|
||||
|
||||
public:
|
||||
- section_real(Shdr *, uint8_t *) throw (std::bad_alloc);
|
||||
+ section_real(Shdr *, uint8_t *) throw ();
|
||||
|
||||
- void update(const file &) throw (std::bad_alloc);
|
||||
+ void update(const file &) throw ();
|
||||
};
|
||||
|
||||
template <typename _class, typename _data>
|
||||
@@ -161,9 +161,9 @@ namespace Elf
|
||||
typedef typename _elfdef<_class>::Shdr Shdr;
|
||||
|
||||
public:
|
||||
- section_real(Shdr *, uint8_t *) throw (std::bad_alloc);
|
||||
+ section_real(Shdr *, uint8_t *) throw ();
|
||||
|
||||
- void update(const file &) throw (std::bad_alloc);
|
||||
+ void update(const file &) throw ();
|
||||
};
|
||||
|
||||
template <typename _class, typename _data>
|
||||
@@ -175,9 +175,9 @@ namespace Elf
|
||||
typedef typename _elfdef<_class>::Shdr Shdr;
|
||||
|
||||
public:
|
||||
- section_real(Shdr *, uint8_t *) throw (std::bad_alloc);
|
||||
+ section_real(Shdr *, uint8_t *) throw ();
|
||||
|
||||
- void update(const file &) throw (std::bad_alloc);
|
||||
+ void update(const file &) throw ();
|
||||
};
|
||||
|
||||
template <typename _class, typename _data>
|
||||
@@ -189,7 +189,7 @@ namespace Elf
|
||||
typedef typename _elfdef<_class>::Shdr Shdr;
|
||||
|
||||
public:
|
||||
- section_real(Shdr *, uint8_t *) throw (std::bad_alloc);
|
||||
+ section_real(Shdr *, uint8_t *) throw ();
|
||||
};
|
||||
|
||||
template <typename _class, typename _data>
|
||||
@@ -220,7 +220,7 @@ namespace Elf
|
||||
typedef typename _elfdef<_class>::Phdr Phdr;
|
||||
|
||||
public:
|
||||
- segment_real (Phdr *, uint8_t *) throw (std::bad_alloc);
|
||||
+ segment_real (Phdr *, uint8_t *) throw ();
|
||||
};
|
||||
|
||||
template <typename _class, typename _data>
|
||||
@@ -232,7 +232,7 @@ namespace Elf
|
||||
public:
|
||||
dynamic_data (Dyn *) throw ();
|
||||
|
||||
- void update_string(const section_type<section_type_STRTAB> &) throw (std::bad_alloc);
|
||||
+ void update_string(const section_type<section_type_STRTAB> &) throw ();
|
||||
};
|
||||
|
||||
template <typename _class, typename _data>
|
||||
@@ -244,8 +244,8 @@ namespace Elf
|
||||
public:
|
||||
symbol_data (Sym *) throw ();
|
||||
|
||||
- void update_string(const section_type<section_type_STRTAB> &) throw (std::bad_alloc);
|
||||
- virtual void update_version (const file &, uint16_t) throw (std::bad_alloc);
|
||||
+ void update_string(const section_type<section_type_STRTAB> &) throw ();
|
||||
+ virtual void update_version (const file &, uint16_t) throw ();
|
||||
};
|
||||
|
||||
template <typename _class, typename _data>
|
||||
@@ -257,7 +257,7 @@ namespace Elf
|
||||
|
||||
version_definition_data (Verdef *) throw ();
|
||||
|
||||
- void update_string(const section_type<section_type_STRTAB> &) throw (std::bad_alloc);
|
||||
+ void update_string(const section_type<section_type_STRTAB> &) throw ();
|
||||
};
|
||||
|
||||
template <typename _class, typename _data>
|
||||
@@ -269,7 +269,7 @@ namespace Elf
|
||||
|
||||
version_requirement_data (Verneed *) throw ();
|
||||
|
||||
- void update_string(const section_type<section_type_STRTAB> &) throw (std::bad_alloc);
|
||||
+ void update_string(const section_type<section_type_STRTAB> &) throw ();
|
||||
};
|
||||
|
||||
template <typename _class, typename _data>
|
||||
@@ -280,7 +280,7 @@ namespace Elf
|
||||
|
||||
version_requirement_entry_data (Vernaux *, const version_requirement &) throw ();
|
||||
|
||||
- void update_string(const section_type<section_type_STRTAB> &) throw (std::bad_alloc);
|
||||
+ void update_string(const section_type<section_type_STRTAB> &) throw ();
|
||||
};
|
||||
}
|
||||
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -12,6 +12,7 @@ SRC_URI = "http://snapshot.debian.org/archive/debian/20180828T214102Z/pool/main/
|
||||
file://avoid-failure-on-symbol-provided-by-application.patch \
|
||||
file://show-GNU-unique-symbols-as-provided-symbols.patch \
|
||||
file://fix_cross_compile.patch \
|
||||
file://remove-deprecated-exception-specification-cpp17.patch \
|
||||
"
|
||||
|
||||
SRC_URI[md5sum] = "6b6eeb9b4016c6a7317acc28c89e32cc"
|
||||
|
||||
@@ -1,363 +0,0 @@
|
||||
SUMMARY = "The Python Programming Language"
|
||||
HOMEPAGE = "http://www.python.org"
|
||||
DESCRIPTION = "Python is a programming language that lets you work more quickly and integrate your systems more effectively."
|
||||
LICENSE = "PSF-2.0 & BSD-0-Clause"
|
||||
SECTION = "devel/python"
|
||||
|
||||
LIC_FILES_CHKSUM = "file://LICENSE;md5=c22d2438294c784731bf9dd224a467b7"
|
||||
|
||||
SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.xz \
|
||||
file://run-ptest \
|
||||
file://create_manifest3.py \
|
||||
file://get_module_deps3.py \
|
||||
file://python3-manifest.json \
|
||||
file://check_build_completeness.py \
|
||||
file://cgi_py.patch \
|
||||
file://0001-Do-not-add-usr-lib-termcap-to-linker-flags-to-avoid-.patch \
|
||||
${@bb.utils.contains('PACKAGECONFIG', 'tk', '', 'file://avoid_warning_about_tkinter.patch', d)} \
|
||||
file://0001-Do-not-use-the-shell-version-of-python-config-that-w.patch \
|
||||
file://python-config.patch \
|
||||
file://0001-Makefile.pre-use-qemu-wrapper-when-gathering-profile.patch \
|
||||
file://0001-Do-not-hardcode-lib-as-location-for-site-packages-an.patch \
|
||||
file://0001-python3-use-cc_basename-to-replace-CC-for-checking-c.patch \
|
||||
file://0001-Lib-sysconfig.py-fix-another-place-where-lib-is-hard.patch \
|
||||
file://0001-Makefile-fix-Issue36464-parallel-build-race-problem.patch \
|
||||
file://0001-bpo-36852-proper-detection-of-mips-architecture-for-.patch \
|
||||
file://crosspythonpath.patch \
|
||||
file://reformat_sysconfig.py \
|
||||
file://0001-Use-FLAG_REF-always-for-interned-strings.patch \
|
||||
file://0001-test_locale.py-correct-the-test-output-format.patch \
|
||||
file://0017-setup.py-do-not-report-missing-dependencies-for-disa.patch \
|
||||
file://0001-setup.py-pass-missing-libraries-to-Extension-for-mul.patch \
|
||||
file://0001-Makefile-do-not-compile-.pyc-in-parallel.patch \
|
||||
file://0001-configure.ac-fix-LIBPL.patch \
|
||||
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://0001-test_ctypes.test_find-skip-without-tools-sdk.patch \
|
||||
"
|
||||
|
||||
SRC_URI_append_class-native = " \
|
||||
file://0001-distutils-sysconfig-append-STAGING_LIBDIR-python-sys.patch \
|
||||
file://12-distutils-prefix-is-inside-staging-area.patch \
|
||||
file://0001-Don-t-search-system-for-headers-libraries.patch \
|
||||
"
|
||||
|
||||
SRC_URI[md5sum] = "d9eee4b20155553830a2025e4dcaa7b3"
|
||||
SRC_URI[sha256sum] = "6af24a66093dd840bcccf371d4044a3027e655cf24591ce26e48022bc79219d9"
|
||||
|
||||
# exclude pre-releases for both python 2.x and 3.x
|
||||
UPSTREAM_CHECK_REGEX = "[Pp]ython-(?P<pver>\d+(\.\d+)+).tar"
|
||||
|
||||
CVE_PRODUCT = "python"
|
||||
|
||||
# Upstream consider this expected behaviour
|
||||
CVE_CHECK_WHITELIST += "CVE-2007-4559"
|
||||
# This is not exploitable when glibc has CVE-2016-10739 fixed.
|
||||
CVE_CHECK_WHITELIST += "CVE-2019-18348"
|
||||
|
||||
# This is windows only issue.
|
||||
CVE_CHECK_WHITELIST += "CVE-2020-15523"
|
||||
|
||||
PYTHON_MAJMIN = "3.8"
|
||||
|
||||
S = "${WORKDIR}/Python-${PV}"
|
||||
|
||||
BBCLASSEXTEND = "native nativesdk"
|
||||
|
||||
inherit autotools pkgconfig qemu ptest multilib_header update-alternatives
|
||||
|
||||
MULTILIB_SUFFIX = "${@d.getVar('base_libdir',1).split('/')[-1]}"
|
||||
|
||||
ALTERNATIVE_${PN}-dev = "python3-config"
|
||||
ALTERNATIVE_LINK_NAME[python3-config] = "${bindir}/python${PYTHON_MAJMIN}-config"
|
||||
ALTERNATIVE_TARGET[python3-config] = "${bindir}/python${PYTHON_MAJMIN}-config-${MULTILIB_SUFFIX}"
|
||||
|
||||
|
||||
DEPENDS = "bzip2-replacement-native libffi bzip2 openssl sqlite3 zlib virtual/libintl xz virtual/crypt util-linux libtirpc libnsl2 autoconf-archive"
|
||||
DEPENDS_append_class-target = " python3-native"
|
||||
DEPENDS_append_class-nativesdk = " python3-native"
|
||||
|
||||
EXTRA_OECONF = " --without-ensurepip --enable-shared"
|
||||
EXTRA_OECONF_append_class-native = " --bindir=${bindir}/${PN}"
|
||||
|
||||
export CROSSPYTHONPATH="${STAGING_LIBDIR_NATIVE}/python${PYTHON_MAJMIN}/lib-dynload/"
|
||||
|
||||
EXTRANATIVEPATH += "python3-native"
|
||||
|
||||
CACHED_CONFIGUREVARS = " \
|
||||
ac_cv_file__dev_ptmx=yes \
|
||||
ac_cv_file__dev_ptc=no \
|
||||
ac_cv_working_tzset=yes \
|
||||
"
|
||||
python() {
|
||||
# PGO currently causes builds to not be reproducible, so disable it for
|
||||
# now. See YOCTO #13407
|
||||
if bb.utils.contains('MACHINE_FEATURES', 'qemu-usermode', True, False, d) and d.getVar('BUILD_REPRODUCIBLE_BINARIES') != '1':
|
||||
d.setVar('PACKAGECONFIG_PGO', 'pgo')
|
||||
else:
|
||||
d.setVar('PACKAGECONFIG_PGO', '')
|
||||
}
|
||||
|
||||
PACKAGECONFIG_class-target ??= "readline ${PACKAGECONFIG_PGO} gdbm"
|
||||
PACKAGECONFIG_class-native ??= "readline gdbm"
|
||||
PACKAGECONFIG_class-nativesdk ??= "readline gdbm"
|
||||
PACKAGECONFIG[readline] = ",,readline"
|
||||
# Use profile guided optimisation by running PyBench inside qemu-user
|
||||
PACKAGECONFIG[pgo] = "--enable-optimizations,,qemu-native"
|
||||
PACKAGECONFIG[tk] = ",,tk"
|
||||
PACKAGECONFIG[gdbm] = ",,gdbm"
|
||||
|
||||
do_configure_prepend () {
|
||||
mkdir -p ${B}/Modules
|
||||
cat > ${B}/Modules/Setup.local << EOF
|
||||
*disabled*
|
||||
${@bb.utils.contains('PACKAGECONFIG', 'gdbm', '', '_gdbm _dbm', d)}
|
||||
${@bb.utils.contains('PACKAGECONFIG', 'readline', '', 'readline', d)}
|
||||
EOF
|
||||
}
|
||||
|
||||
CPPFLAGS_append = " -I${STAGING_INCDIR}/ncursesw -I${STAGING_INCDIR}/uuid"
|
||||
|
||||
EXTRA_OEMAKE = '\
|
||||
STAGING_LIBDIR=${STAGING_LIBDIR} \
|
||||
STAGING_INCDIR=${STAGING_INCDIR} \
|
||||
LIB=${baselib} \
|
||||
'
|
||||
|
||||
do_compile_prepend_class-target() {
|
||||
if ${@bb.utils.contains('PACKAGECONFIG', 'pgo', 'true', 'false', d)}; then
|
||||
qemu_binary="${@qemu_wrapper_cmdline(d, '${STAGING_DIR_TARGET}', ['${B}', '${STAGING_DIR_TARGET}/${base_libdir}'])}"
|
||||
cat >pgo-wrapper <<EOF
|
||||
#!/bin/sh
|
||||
cd ${B}
|
||||
$qemu_binary "\$@"
|
||||
EOF
|
||||
chmod +x pgo-wrapper
|
||||
fi
|
||||
}
|
||||
|
||||
do_install_prepend() {
|
||||
${WORKDIR}/check_build_completeness.py ${T}/log.do_compile
|
||||
}
|
||||
|
||||
do_install_append_class-target() {
|
||||
oe_multilib_header python${PYTHON_MAJMIN}/pyconfig.h
|
||||
}
|
||||
|
||||
do_install_append_class-native() {
|
||||
# Make sure we use /usr/bin/env python
|
||||
for PYTHSCRIPT in `grep -rIl ${bindir}/${PN}/python ${D}${bindir}/${PN}`; do
|
||||
sed -i -e '1s|^#!.*|#!/usr/bin/env python3|' $PYTHSCRIPT
|
||||
done
|
||||
# Add a symlink to the native Python so that scripts can just invoke
|
||||
# "nativepython" and get the right one without needing absolute paths
|
||||
# (these often end up too long for the #! parser in the kernel as the
|
||||
# buffer is 128 bytes long).
|
||||
ln -s python3-native/python3 ${D}${bindir}/nativepython3
|
||||
}
|
||||
|
||||
do_install_append() {
|
||||
mkdir -p ${D}${libdir}/python-sysconfigdata
|
||||
sysconfigfile=`find ${D} -name _sysconfig*.py`
|
||||
cp $sysconfigfile ${D}${libdir}/python-sysconfigdata/_sysconfigdata.py
|
||||
|
||||
sed -i \
|
||||
-e "s,^ 'LIBDIR'.*, 'LIBDIR': '${STAGING_LIBDIR}'\,,g" \
|
||||
-e "s,^ 'INCLUDEDIR'.*, 'INCLUDEDIR': '${STAGING_INCDIR}'\,,g" \
|
||||
-e "s,^ 'CONFINCLUDEDIR'.*, 'CONFINCLUDEDIR': '${STAGING_INCDIR}'\,,g" \
|
||||
-e "/^ 'INCLDIRSTOMAKE'/{N; s,/usr/include,${STAGING_INCDIR},g}" \
|
||||
-e "/^ 'INCLUDEPY'/s,/usr/include,${STAGING_INCDIR},g" \
|
||||
${D}${libdir}/python-sysconfigdata/_sysconfigdata.py
|
||||
}
|
||||
|
||||
do_install_append_class-nativesdk () {
|
||||
create_wrapper ${D}${bindir}/python${PYTHON_MAJMIN} TERMINFO_DIRS='${sysconfdir}/terminfo:/etc/terminfo:/usr/share/terminfo:/usr/share/misc/terminfo:/lib/terminfo' PYTHONNOUSERSITE='1'
|
||||
}
|
||||
|
||||
SSTATE_SCAN_FILES += "Makefile _sysconfigdata.py"
|
||||
PACKAGE_PREPROCESS_FUNCS += "py_package_preprocess"
|
||||
|
||||
py_package_preprocess () {
|
||||
# Remove references to buildmachine paths in target Makefile and _sysconfigdata
|
||||
sed -i -e 's:--sysroot=${STAGING_DIR_TARGET}::g' -e s:'--with-libtool-sysroot=${STAGING_DIR_TARGET}'::g \
|
||||
-e 's|${DEBUG_PREFIX_MAP}||g' \
|
||||
-e 's:${HOSTTOOLS_DIR}/::g' \
|
||||
-e 's:${RECIPE_SYSROOT_NATIVE}::g' \
|
||||
-e 's:${RECIPE_SYSROOT}::g' \
|
||||
-e 's:${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}::g' \
|
||||
${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config-${PYTHON_MAJMIN}${PYTHON_ABI}*/Makefile \
|
||||
${PKGD}/${libdir}/python${PYTHON_MAJMIN}/_sysconfigdata*.py \
|
||||
${PKGD}/${bindir}/python${PYTHON_MAJMIN}-config
|
||||
|
||||
# Reformat _sysconfigdata after modifying it so that it remains
|
||||
# reproducible
|
||||
for c in ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/_sysconfigdata*.py; do
|
||||
python3 ${WORKDIR}/reformat_sysconfig.py $c
|
||||
done
|
||||
|
||||
# Recompile _sysconfigdata after modifying it
|
||||
cd ${PKGD}
|
||||
sysconfigfile=`find . -name _sysconfigdata_*.py`
|
||||
${STAGING_BINDIR_NATIVE}/python3-native/python3 \
|
||||
-c "from py_compile import compile; compile('$sysconfigfile')"
|
||||
${STAGING_BINDIR_NATIVE}/python3-native/python3 \
|
||||
-c "from py_compile import compile; compile('$sysconfigfile', optimize=1)"
|
||||
${STAGING_BINDIR_NATIVE}/python3-native/python3 \
|
||||
-c "from py_compile import compile; compile('$sysconfigfile', optimize=2)"
|
||||
cd -
|
||||
|
||||
mv ${PKGD}/${bindir}/python${PYTHON_MAJMIN}-config ${PKGD}/${bindir}/python${PYTHON_MAJMIN}-config-${MULTILIB_SUFFIX}
|
||||
|
||||
#Remove the unneeded copy of target sysconfig data
|
||||
rm -rf ${PKGD}/${libdir}/python-sysconfigdata
|
||||
}
|
||||
|
||||
# We want bytecode precompiled .py files (.pyc's) by default
|
||||
# but the user may set it on their own conf
|
||||
INCLUDE_PYCS ?= "1"
|
||||
|
||||
python(){
|
||||
import collections, json
|
||||
|
||||
filename = os.path.join(d.getVar('THISDIR'), 'python3', 'python3-manifest.json')
|
||||
# This python changes the datastore based on the contents of a file, so mark
|
||||
# that dependency.
|
||||
bb.parse.mark_dependency(d, filename)
|
||||
|
||||
with open(filename) as manifest_file:
|
||||
manifest_str = manifest_file.read()
|
||||
json_start = manifest_str.find('# EOC') + 6
|
||||
manifest_file.seek(json_start)
|
||||
manifest_str = manifest_file.read()
|
||||
python_manifest = json.loads(manifest_str, object_pairs_hook=collections.OrderedDict)
|
||||
|
||||
# First set RPROVIDES for -native case
|
||||
# Hardcoded since it cant be python3-native-foo, should be python3-foo-native
|
||||
pn = 'python3'
|
||||
rprovides = d.getVar('RPROVIDES').split()
|
||||
|
||||
# ${PN}-misc-native is not in the manifest
|
||||
rprovides.append(pn + '-misc-native')
|
||||
|
||||
for key in python_manifest:
|
||||
pypackage = pn + '-' + key + '-native'
|
||||
if pypackage not in rprovides:
|
||||
rprovides.append(pypackage)
|
||||
|
||||
d.setVar('RPROVIDES_class-native', ' '.join(rprovides))
|
||||
|
||||
# Then work on the target
|
||||
include_pycs = d.getVar('INCLUDE_PYCS')
|
||||
|
||||
packages = d.getVar('PACKAGES').split()
|
||||
pn = d.getVar('PN')
|
||||
|
||||
newpackages=[]
|
||||
for key in python_manifest:
|
||||
pypackage = pn + '-' + key
|
||||
|
||||
if pypackage not in packages:
|
||||
# We need to prepend, otherwise python-misc gets everything
|
||||
# so we use a new variable
|
||||
newpackages.append(pypackage)
|
||||
|
||||
# "Build" python's manifest FILES, RDEPENDS and SUMMARY
|
||||
d.setVar('FILES_' + pypackage, '')
|
||||
for value in python_manifest[key]['files']:
|
||||
d.appendVar('FILES_' + pypackage, ' ' + value)
|
||||
|
||||
# Add cached files
|
||||
if include_pycs == '1':
|
||||
for value in python_manifest[key]['cached']:
|
||||
d.appendVar('FILES_' + pypackage, ' ' + value)
|
||||
|
||||
for value in python_manifest[key]['rdepends']:
|
||||
# Make it work with or without $PN
|
||||
if '${PN}' in value:
|
||||
value=value.split('-', 1)[1]
|
||||
d.appendVar('RDEPENDS_' + pypackage, ' ' + pn + '-' + value)
|
||||
|
||||
for value in python_manifest[key].get('rrecommends', ()):
|
||||
if '${PN}' in value:
|
||||
value=value.split('-', 1)[1]
|
||||
d.appendVar('RRECOMMENDS_' + pypackage, ' ' + pn + '-' + value)
|
||||
|
||||
d.setVar('SUMMARY_' + pypackage, python_manifest[key]['summary'])
|
||||
|
||||
# Prepending so to avoid python-misc getting everything
|
||||
packages = newpackages + packages
|
||||
d.setVar('PACKAGES', ' '.join(packages))
|
||||
d.setVar('ALLOW_EMPTY_${PN}-modules', '1')
|
||||
d.setVar('ALLOW_EMPTY_${PN}-pkgutil', '1')
|
||||
}
|
||||
|
||||
# Files needed to create a new manifest
|
||||
|
||||
do_create_manifest() {
|
||||
# This task should be run with every new release of Python.
|
||||
# We must ensure that PACKAGECONFIG enables everything when creating
|
||||
# a new manifest, this is to base our new manifest on a complete
|
||||
# native python build, containing all dependencies, otherwise the task
|
||||
# wont be able to find the required files.
|
||||
# e.g. BerkeleyDB is an optional build dependency so it may or may not
|
||||
# be present, we must ensure it is.
|
||||
|
||||
cd ${WORKDIR}
|
||||
# This needs to be executed by python-native and NOT by HOST's python
|
||||
nativepython3 create_manifest3.py ${PYTHON_MAJMIN}
|
||||
cp python3-manifest.json.new ${THISDIR}/python3/python3-manifest.json
|
||||
}
|
||||
|
||||
# bitbake python -c create_manifest
|
||||
# Make sure we have native python ready when we create a new manifest
|
||||
addtask do_create_manifest after do_patch do_prepare_recipe_sysroot
|
||||
|
||||
# manual dependency additions
|
||||
RRECOMMENDS_${PN}-core_append_class-nativesdk = " nativesdk-python3-modules"
|
||||
RRECOMMENDS_${PN}-crypt_append_class-target = " openssl ca-certificates"
|
||||
RRECOMMENDS_${PN}-crypt_append_class-nativesdk = " openssl ca-certificates"
|
||||
|
||||
# For historical reasons PN is empty and provided by python3-modules
|
||||
FILES_${PN} = ""
|
||||
RPROVIDES_${PN}-modules = "${PN}"
|
||||
|
||||
FILES_${PN}-pydoc += "${bindir}/pydoc${PYTHON_MAJMIN} ${bindir}/pydoc3"
|
||||
FILES_${PN}-idle += "${bindir}/idle3 ${bindir}/idle${PYTHON_MAJMIN}"
|
||||
|
||||
# provide python-pyvenv from python3-venv
|
||||
RPROVIDES_${PN}-venv += "python3-pyvenv"
|
||||
|
||||
# package libpython3
|
||||
PACKAGES =+ "libpython3 libpython3-staticdev"
|
||||
FILES_libpython3 = "${libdir}/libpython*.so.*"
|
||||
FILES_libpython3-staticdev += "${libdir}/python${PYTHON_MAJMIN}/config-${PYTHON_MAJMIN}-*/libpython${PYTHON_MAJMIN}.a"
|
||||
INSANE_SKIP_${PN}-dev += "dev-elf"
|
||||
INSANE_SKIP_${PN}-ptest += "dev-deps"
|
||||
|
||||
# catch all the rest (unsorted)
|
||||
PACKAGES += "${PN}-misc"
|
||||
RDEPENDS_${PN}-misc += "python3-core python3-email python3-codecs python3-pydoc python3-pickle python3-audio"
|
||||
RDEPENDS_${PN}-modules_append_class-target = " python3-misc"
|
||||
RDEPENDS_${PN}-modules_append_class-nativesdk = " python3-misc"
|
||||
FILES_${PN}-misc = "${libdir}/python${PYTHON_MAJMIN} ${libdir}/python${PYTHON_MAJMIN}/lib-dynload"
|
||||
|
||||
# catch manpage
|
||||
PACKAGES += "${PN}-man"
|
||||
FILES_${PN}-man = "${datadir}/man"
|
||||
|
||||
# See https://bugs.python.org/issue18748 and https://bugs.python.org/issue37395
|
||||
RDEPENDS_libpython3_append_libc-glibc = " libgcc"
|
||||
RDEPENDS_${PN}-ctypes_append_libc-glibc = " ${MLPREFIX}ldconfig"
|
||||
RDEPENDS_${PN}-ptest = "${PN}-modules ${PN}-tests ${PN}-dev unzip bzip2 libgcc tzdata-europe coreutils sed"
|
||||
RDEPENDS_${PN}-ptest_append_libc-glibc = " locale-base-tr-tr.iso-8859-9"
|
||||
RDEPENDS_${PN}-tkinter += "${@bb.utils.contains('PACKAGECONFIG', 'tk', 'tk tk-lib', '', d)}"
|
||||
RDEPENDS_${PN}-dev = ""
|
||||
|
||||
RDEPENDS_${PN}-tests_append_class-target = " bash"
|
||||
RDEPENDS_${PN}-tests_append_class-nativesdk = " bash"
|
||||
|
||||
# Python's tests contain large numbers of files we don't need in the recipe sysroots
|
||||
SYSROOT_PREPROCESS_FUNCS += " py3_sysroot_cleanup"
|
||||
py3_sysroot_cleanup () {
|
||||
rm -rf ${SYSROOT_DESTDIR}${libdir}/python${PYTHON_MAJMIN}/test
|
||||
}
|
||||
@@ -35,27 +35,56 @@ SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \
|
||||
file://CVE-2020-7039-2.patch \
|
||||
file://CVE-2020-7039-3.patch \
|
||||
file://0001-Add-enable-disable-udev.patch \
|
||||
file://CVE-2020-7211.patch \
|
||||
file://0001-qemu-Do-not-include-file-if-not-exists.patch \
|
||||
file://CVE-2020-7211.patch \
|
||||
file://0001-qemu-Do-not-include-file-if-not-exists.patch \
|
||||
file://CVE-2020-11102.patch \
|
||||
file://CVE-2020-11869.patch \
|
||||
file://CVE-2020-13361.patch \
|
||||
file://CVE-2020-10761.patch \
|
||||
file://CVE-2020-10702.patch \
|
||||
file://CVE-2020-13659.patch \
|
||||
file://CVE-2020-13800.patch \
|
||||
file://CVE-2020-13362.patch \
|
||||
file://CVE-2020-15863.patch \
|
||||
file://CVE-2020-14364.patch \
|
||||
file://CVE-2020-14415.patch \
|
||||
file://CVE-2020-16092.patch \
|
||||
file://0001-target-mips-Increase-number-of-TLB-entries-on-the-34.patch \
|
||||
file://CVE-2019-20175.patch \
|
||||
file://CVE-2020-24352.patch \
|
||||
file://CVE-2020-25723.patch \
|
||||
file://CVE-2021-20203.patch \
|
||||
file://CVE-2021-3392.patch \
|
||||
"
|
||||
file://CVE-2020-11869.patch \
|
||||
file://CVE-2020-13361.patch \
|
||||
file://CVE-2020-10761.patch \
|
||||
file://CVE-2020-10702.patch \
|
||||
file://CVE-2020-13659.patch \
|
||||
file://CVE-2020-13800.patch \
|
||||
file://CVE-2020-13362.patch \
|
||||
file://CVE-2020-15863.patch \
|
||||
file://CVE-2020-14364.patch \
|
||||
file://CVE-2020-14415.patch \
|
||||
file://CVE-2020-16092.patch \
|
||||
file://0001-target-mips-Increase-number-of-TLB-entries-on-the-34.patch \
|
||||
file://CVE-2019-20175.patch \
|
||||
file://CVE-2020-24352.patch \
|
||||
file://CVE-2020-25723.patch \
|
||||
file://CVE-2021-20203.patch \
|
||||
file://CVE-2021-3392.patch \
|
||||
file://CVE-2020-25085.patch \
|
||||
file://CVE-2020-25624_1.patch \
|
||||
file://CVE-2020-25624_2.patch \
|
||||
file://CVE-2020-25625.patch \
|
||||
file://CVE-2020-29443.patch \
|
||||
file://CVE-2021-20221.patch \
|
||||
file://CVE-2021-20181.patch \
|
||||
file://CVE-2021-3416_1.patch \
|
||||
file://CVE-2021-3416_2.patch \
|
||||
file://CVE-2021-3416_3.patch \
|
||||
file://CVE-2021-3416_5.patch \
|
||||
file://CVE-2021-3416_6.patch \
|
||||
file://CVE-2021-3416_7.patch \
|
||||
file://CVE-2021-3416_8.patch \
|
||||
file://CVE-2021-3416_9.patch \
|
||||
file://CVE-2021-3416_10.patch \
|
||||
file://CVE-2021-20257.patch \
|
||||
file://CVE-2021-3544.patch \
|
||||
file://CVE-2021-3544_2.patch \
|
||||
file://CVE-2021-3544_3.patch \
|
||||
file://CVE-2021-3544_4.patch \
|
||||
file://CVE-2021-3544_5.patch \
|
||||
file://CVE-2021-3545.patch \
|
||||
file://CVE-2021-3546.patch \
|
||||
file://CVE-2021-3527-1.patch \
|
||||
file://CVE-2021-3527-2.patch \
|
||||
file://CVE-2021-3582.patch \
|
||||
file://CVE-2021-3607.patch \
|
||||
file://CVE-2021-3608.patch \
|
||||
"
|
||||
UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar"
|
||||
|
||||
SRC_URI[md5sum] = "278eeb294e4b497e79af7a57e660cb9a"
|
||||
@@ -210,6 +239,7 @@ PACKAGECONFIG[glusterfs] = "--enable-glusterfs,--disable-glusterfs"
|
||||
PACKAGECONFIG[xkbcommon] = "--enable-xkbcommon,--disable-xkbcommon,libxkbcommon"
|
||||
PACKAGECONFIG[libudev] = "--enable-libudev,--disable-libudev,eudev"
|
||||
PACKAGECONFIG[libxml2] = "--enable-libxml2,--disable-libxml2,libxml2"
|
||||
PACKAGECONFIG[seccomp] = "--enable-seccomp,--disable-seccomp,libseccomp"
|
||||
|
||||
INSANE_SKIP_${PN} = "arch"
|
||||
|
||||
|
||||
46
meta/recipes-devtools/qemu/qemu/CVE-2020-25085.patch
Normal file
46
meta/recipes-devtools/qemu/qemu/CVE-2020-25085.patch
Normal file
@@ -0,0 +1,46 @@
|
||||
From dfba99f17feb6d4a129da19d38df1bcd8579d1c3 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= <f4bug@amsat.org>
|
||||
Date: Tue, 1 Sep 2020 15:22:06 +0200
|
||||
Subject: [PATCH] hw/sd/sdhci: Fix DMA Transfer Block Size field
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
The 'Transfer Block Size' field is 12-bit wide.
|
||||
|
||||
See section '2.2.2. Block Size Register (Offset 004h)' in datasheet.
|
||||
|
||||
Two different bug reproducer available:
|
||||
- https://bugs.launchpad.net/qemu/+bug/1892960
|
||||
- https://ruhr-uni-bochum.sciebo.de/s/NNWP2GfwzYKeKwE?path=%2Fsdhci_oob_write1
|
||||
|
||||
Cc: qemu-stable@nongnu.org
|
||||
Buglink: https://bugs.launchpad.net/qemu/+bug/1892960
|
||||
Fixes: d7dfca0807a ("hw/sdhci: introduce standard SD host controller")
|
||||
Reported-by: Alexander Bulekov <alxndr@bu.edu>
|
||||
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
|
||||
Reviewed-by: Prasad J Pandit <pjp@fedoraproject.org>
|
||||
Tested-by: Alexander Bulekov <alxndr@bu.edu>
|
||||
Message-Id: <20200901140411.112150-3-f4bug@amsat.org>
|
||||
|
||||
Upstream-Status: Backport
|
||||
CVE: CVE-2020-25085
|
||||
Signed-off-by: Armin Kuster <akuster@mvista.com>
|
||||
|
||||
---
|
||||
hw/sd/sdhci.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
Index: qemu-4.2.0/hw/sd/sdhci.c
|
||||
===================================================================
|
||||
--- qemu-4.2.0.orig/hw/sd/sdhci.c
|
||||
+++ qemu-4.2.0/hw/sd/sdhci.c
|
||||
@@ -1129,7 +1129,7 @@ sdhci_write(void *opaque, hwaddr offset,
|
||||
break;
|
||||
case SDHC_BLKSIZE:
|
||||
if (!TRANSFERRING_DATA(s->prnsts)) {
|
||||
- MASKED_WRITE(s->blksize, mask, value);
|
||||
+ MASKED_WRITE(s->blksize, mask, extract32(value, 0, 12));
|
||||
MASKED_WRITE(s->blkcnt, mask >> 16, value >> 16);
|
||||
}
|
||||
|
||||
87
meta/recipes-devtools/qemu/qemu/CVE-2020-25624_1.patch
Normal file
87
meta/recipes-devtools/qemu/qemu/CVE-2020-25624_1.patch
Normal file
@@ -0,0 +1,87 @@
|
||||
From fbec359e9279ce78908b9f2af2c264e7448336af Mon Sep 17 00:00:00 2001
|
||||
From: Guenter Roeck <linux@roeck-us.net>
|
||||
Date: Mon, 17 Feb 2020 12:48:10 -0800
|
||||
Subject: [PATCH] hw: usb: hcd-ohci: Move OHCISysBusState and TYPE_SYSBUS_OHCI
|
||||
to include file
|
||||
|
||||
We need to be able to use OHCISysBusState outside hcd-ohci.c, so move it
|
||||
to its include file.
|
||||
|
||||
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
|
||||
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
|
||||
Tested-by: Niek Linnenbank <nieklinnenbank@gmail.com>
|
||||
Message-id: 20200217204812.9857-2-linux@roeck-us.net
|
||||
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
|
||||
|
||||
Upstream-Status: Backport
|
||||
CVE: CVE-2020-25624 patch #1
|
||||
Signed-off-by: Armin Kuster <akuster@mvista.com>
|
||||
|
||||
---
|
||||
hw/usb/hcd-ohci.c | 15 ---------------
|
||||
hw/usb/hcd-ohci.h | 16 ++++++++++++++++
|
||||
2 files changed, 16 insertions(+), 15 deletions(-)
|
||||
|
||||
diff --git a/hw/usb/hcd-ohci.c b/hw/usb/hcd-ohci.c
|
||||
index 8a94bd004a..1e6e85e86a 100644
|
||||
--- a/hw/usb/hcd-ohci.c
|
||||
+++ b/hw/usb/hcd-ohci.c
|
||||
@@ -1870,21 +1870,6 @@ void ohci_sysbus_die(struct OHCIState *ohci)
|
||||
ohci_bus_stop(ohci);
|
||||
}
|
||||
|
||||
-#define TYPE_SYSBUS_OHCI "sysbus-ohci"
|
||||
-#define SYSBUS_OHCI(obj) OBJECT_CHECK(OHCISysBusState, (obj), TYPE_SYSBUS_OHCI)
|
||||
-
|
||||
-typedef struct {
|
||||
- /*< private >*/
|
||||
- SysBusDevice parent_obj;
|
||||
- /*< public >*/
|
||||
-
|
||||
- OHCIState ohci;
|
||||
- char *masterbus;
|
||||
- uint32_t num_ports;
|
||||
- uint32_t firstport;
|
||||
- dma_addr_t dma_offset;
|
||||
-} OHCISysBusState;
|
||||
-
|
||||
static void ohci_realize_pxa(DeviceState *dev, Error **errp)
|
||||
{
|
||||
OHCISysBusState *s = SYSBUS_OHCI(dev);
|
||||
diff --git a/hw/usb/hcd-ohci.h b/hw/usb/hcd-ohci.h
|
||||
index 16e3f1e13a..5c8819aedf 100644
|
||||
--- a/hw/usb/hcd-ohci.h
|
||||
+++ b/hw/usb/hcd-ohci.h
|
||||
@@ -22,6 +22,7 @@
|
||||
#define HCD_OHCI_H
|
||||
|
||||
#include "sysemu/dma.h"
|
||||
+#include "hw/usb.h"
|
||||
|
||||
/* Number of Downstream Ports on the root hub: */
|
||||
#define OHCI_MAX_PORTS 15
|
||||
@@ -90,6 +91,21 @@ typedef struct OHCIState {
|
||||
void (*ohci_die)(struct OHCIState *ohci);
|
||||
} OHCIState;
|
||||
|
||||
+#define TYPE_SYSBUS_OHCI "sysbus-ohci"
|
||||
+#define SYSBUS_OHCI(obj) OBJECT_CHECK(OHCISysBusState, (obj), TYPE_SYSBUS_OHCI)
|
||||
+
|
||||
+typedef struct {
|
||||
+ /*< private >*/
|
||||
+ SysBusDevice parent_obj;
|
||||
+ /*< public >*/
|
||||
+
|
||||
+ OHCIState ohci;
|
||||
+ char *masterbus;
|
||||
+ uint32_t num_ports;
|
||||
+ uint32_t firstport;
|
||||
+ dma_addr_t dma_offset;
|
||||
+} OHCISysBusState;
|
||||
+
|
||||
extern const VMStateDescription vmstate_ohci_state;
|
||||
|
||||
void usb_ohci_init(OHCIState *ohci, DeviceState *dev, uint32_t num_ports,
|
||||
--
|
||||
2.25.1
|
||||
|
||||
101
meta/recipes-devtools/qemu/qemu/CVE-2020-25624_2.patch
Normal file
101
meta/recipes-devtools/qemu/qemu/CVE-2020-25624_2.patch
Normal file
@@ -0,0 +1,101 @@
|
||||
From 1328fe0c32d5474604105b8105310e944976b058 Mon Sep 17 00:00:00 2001
|
||||
From: Prasad J Pandit <pjp@fedoraproject.org>
|
||||
Date: Tue, 15 Sep 2020 23:52:58 +0530
|
||||
Subject: [PATCH] hw: usb: hcd-ohci: check len and frame_number variables
|
||||
|
||||
While servicing the OHCI transfer descriptors(TD), OHCI host
|
||||
controller derives variables 'start_addr', 'end_addr', 'len'
|
||||
etc. from values supplied by the host controller driver.
|
||||
Host controller driver may supply values such that using
|
||||
above variables leads to out-of-bounds access issues.
|
||||
Add checks to avoid them.
|
||||
|
||||
AddressSanitizer: stack-buffer-overflow on address 0x7ffd53af76a0
|
||||
READ of size 2 at 0x7ffd53af76a0 thread T0
|
||||
#0 ohci_service_iso_td ../hw/usb/hcd-ohci.c:734
|
||||
#1 ohci_service_ed_list ../hw/usb/hcd-ohci.c:1180
|
||||
#2 ohci_process_lists ../hw/usb/hcd-ohci.c:1214
|
||||
#3 ohci_frame_boundary ../hw/usb/hcd-ohci.c:1257
|
||||
#4 timerlist_run_timers ../util/qemu-timer.c:572
|
||||
#5 qemu_clock_run_timers ../util/qemu-timer.c:586
|
||||
#6 qemu_clock_run_all_timers ../util/qemu-timer.c:672
|
||||
#7 main_loop_wait ../util/main-loop.c:527
|
||||
#8 qemu_main_loop ../softmmu/vl.c:1676
|
||||
#9 main ../softmmu/main.c:50
|
||||
|
||||
Reported-by: Gaoning Pan <pgn@zju.edu.cn>
|
||||
Reported-by: Yongkang Jia <j_kangel@163.com>
|
||||
Reported-by: Yi Ren <yunye.ry@alibaba-inc.com>
|
||||
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
|
||||
Message-id: 20200915182259.68522-2-ppandit@redhat.com
|
||||
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
|
||||
|
||||
Upstream-Status: Backport
|
||||
CVE: CVE-2020-25624 patch #2
|
||||
Signed-off-by: Armin Kuster <akuster@mvista.com>
|
||||
|
||||
---
|
||||
hw/usb/hcd-ohci.c | 24 ++++++++++++++++++++++--
|
||||
1 file changed, 22 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/hw/usb/hcd-ohci.c b/hw/usb/hcd-ohci.c
|
||||
index 1e6e85e86a..9dc59101f9 100644
|
||||
--- a/hw/usb/hcd-ohci.c
|
||||
+++ b/hw/usb/hcd-ohci.c
|
||||
@@ -731,7 +731,11 @@ static int ohci_service_iso_td(OHCIState *ohci, struct ohci_ed *ed,
|
||||
}
|
||||
|
||||
start_offset = iso_td.offset[relative_frame_number];
|
||||
- next_offset = iso_td.offset[relative_frame_number + 1];
|
||||
+ if (relative_frame_number < frame_count) {
|
||||
+ next_offset = iso_td.offset[relative_frame_number + 1];
|
||||
+ } else {
|
||||
+ next_offset = iso_td.be;
|
||||
+ }
|
||||
|
||||
if (!(OHCI_BM(start_offset, TD_PSW_CC) & 0xe) ||
|
||||
((relative_frame_number < frame_count) &&
|
||||
@@ -764,7 +768,12 @@ static int ohci_service_iso_td(OHCIState *ohci, struct ohci_ed *ed,
|
||||
}
|
||||
} else {
|
||||
/* Last packet in the ISO TD */
|
||||
- end_addr = iso_td.be;
|
||||
+ end_addr = next_offset;
|
||||
+ }
|
||||
+
|
||||
+ if (start_addr > end_addr) {
|
||||
+ trace_usb_ohci_iso_td_bad_cc_overrun(start_addr, end_addr);
|
||||
+ return 1;
|
||||
}
|
||||
|
||||
if ((start_addr & OHCI_PAGE_MASK) != (end_addr & OHCI_PAGE_MASK)) {
|
||||
@@ -773,6 +782,9 @@ static int ohci_service_iso_td(OHCIState *ohci, struct ohci_ed *ed,
|
||||
} else {
|
||||
len = end_addr - start_addr + 1;
|
||||
}
|
||||
+ if (len > sizeof(ohci->usb_buf)) {
|
||||
+ len = sizeof(ohci->usb_buf);
|
||||
+ }
|
||||
|
||||
if (len && dir != OHCI_TD_DIR_IN) {
|
||||
if (ohci_copy_iso_td(ohci, start_addr, end_addr, ohci->usb_buf, len,
|
||||
@@ -975,8 +987,16 @@ static int ohci_service_td(OHCIState *ohci, struct ohci_ed *ed)
|
||||
if ((td.cbp & 0xfffff000) != (td.be & 0xfffff000)) {
|
||||
len = (td.be & 0xfff) + 0x1001 - (td.cbp & 0xfff);
|
||||
} else {
|
||||
+ if (td.cbp > td.be) {
|
||||
+ trace_usb_ohci_iso_td_bad_cc_overrun(td.cbp, td.be);
|
||||
+ ohci_die(ohci);
|
||||
+ return 1;
|
||||
+ }
|
||||
len = (td.be - td.cbp) + 1;
|
||||
}
|
||||
+ if (len > sizeof(ohci->usb_buf)) {
|
||||
+ len = sizeof(ohci->usb_buf);
|
||||
+ }
|
||||
|
||||
pktlen = len;
|
||||
if (len && dir != OHCI_TD_DIR_IN) {
|
||||
--
|
||||
2.25.1
|
||||
|
||||
42
meta/recipes-devtools/qemu/qemu/CVE-2020-25625.patch
Normal file
42
meta/recipes-devtools/qemu/qemu/CVE-2020-25625.patch
Normal file
@@ -0,0 +1,42 @@
|
||||
From 1be90ebecc95b09a2ee5af3f60c412b45a766c4f Mon Sep 17 00:00:00 2001
|
||||
From: Prasad J Pandit <pjp@fedoraproject.org>
|
||||
Date: Tue, 15 Sep 2020 23:52:59 +0530
|
||||
Subject: [PATCH] hw: usb: hcd-ohci: check for processed TD before retire
|
||||
|
||||
While servicing OHCI transfer descriptors(TD), ohci_service_iso_td
|
||||
retires a TD if it has passed its time frame. It does not check if
|
||||
the TD was already processed once and holds an error code in TD_CC.
|
||||
It may happen if the TD list has a loop. Add check to avoid an
|
||||
infinite loop condition.
|
||||
|
||||
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
|
||||
Reviewed-by: Li Qiang <liq3ea@gmail.com>
|
||||
Message-id: 20200915182259.68522-3-ppandit@redhat.com
|
||||
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
|
||||
|
||||
Upstream-Status: Backport
|
||||
CVE: CVE-2020-25625
|
||||
Signed-off-by: Armin Kuster <akuster@mvista.com>
|
||||
|
||||
---
|
||||
hw/usb/hcd-ohci.c | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/hw/usb/hcd-ohci.c b/hw/usb/hcd-ohci.c
|
||||
index 9dc59101f9..8b912e95d3 100644
|
||||
--- a/hw/usb/hcd-ohci.c
|
||||
+++ b/hw/usb/hcd-ohci.c
|
||||
@@ -691,6 +691,10 @@ static int ohci_service_iso_td(OHCIState *ohci, struct ohci_ed *ed,
|
||||
the next ISO TD of the same ED */
|
||||
trace_usb_ohci_iso_td_relative_frame_number_big(relative_frame_number,
|
||||
frame_count);
|
||||
+ if (OHCI_CC_DATAOVERRUN == OHCI_BM(iso_td.flags, TD_CC)) {
|
||||
+ /* avoid infinite loop */
|
||||
+ return 1;
|
||||
+ }
|
||||
OHCI_SET_BM(iso_td.flags, TD_CC, OHCI_CC_DATAOVERRUN);
|
||||
ed->head &= ~OHCI_DPTR_MASK;
|
||||
ed->head |= (iso_td.next & OHCI_DPTR_MASK);
|
||||
--
|
||||
2.25.1
|
||||
|
||||
45
meta/recipes-devtools/qemu/qemu/CVE-2020-29443.patch
Normal file
45
meta/recipes-devtools/qemu/qemu/CVE-2020-29443.patch
Normal file
@@ -0,0 +1,45 @@
|
||||
From 813212288970c39b1800f63e83ac6e96588095c6 Mon Sep 17 00:00:00 2001
|
||||
From: Paolo Bonzini <pbonzini@redhat.com>
|
||||
Date: Tue, 1 Dec 2020 13:09:26 +0100
|
||||
Subject: [PATCH] ide: atapi: assert that the buffer pointer is in range
|
||||
|
||||
A case was reported where s->io_buffer_index can be out of range.
|
||||
The report skimped on the details but it seems to be triggered
|
||||
by s->lba == -1 on the READ/READ CD paths (e.g. by sending an
|
||||
ATAPI command with LBA = 0xFFFFFFFF). For now paper over it
|
||||
with assertions. The first one ensures that there is no overflow
|
||||
when incrementing s->io_buffer_index, the second checks for the
|
||||
buffer overrun.
|
||||
|
||||
Note that the buffer overrun is only a read, so I am not sure
|
||||
if the assertion failure is actually less harmful than the overrun.
|
||||
|
||||
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
||||
Message-id: 20201201120926.56559-1-pbonzini@redhat.com
|
||||
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
|
||||
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
|
||||
|
||||
Upstream-Status: Backport
|
||||
CVE: CVE-2020-29443
|
||||
Signed-off-by: Armin Kuster <akuster@mvista.com>
|
||||
|
||||
---
|
||||
hw/ide/atapi.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/hw/ide/atapi.c b/hw/ide/atapi.c
|
||||
index 14a2b0bb2f..e79157863f 100644
|
||||
--- a/hw/ide/atapi.c
|
||||
+++ b/hw/ide/atapi.c
|
||||
@@ -276,6 +276,8 @@ void ide_atapi_cmd_reply_end(IDEState *s)
|
||||
s->packet_transfer_size -= size;
|
||||
s->elementary_transfer_size -= size;
|
||||
s->io_buffer_index += size;
|
||||
+ assert(size <= s->io_buffer_total_len);
|
||||
+ assert(s->io_buffer_index <= s->io_buffer_total_len);
|
||||
|
||||
/* Some adapters process PIO data right away. In that case, we need
|
||||
* to avoid mutual recursion between ide_transfer_start
|
||||
--
|
||||
2.25.1
|
||||
|
||||
81
meta/recipes-devtools/qemu/qemu/CVE-2021-20181.patch
Normal file
81
meta/recipes-devtools/qemu/qemu/CVE-2021-20181.patch
Normal file
@@ -0,0 +1,81 @@
|
||||
From c2d2d14e8deece958bbc4fc649d22c3564bc4e7e Mon Sep 17 00:00:00 2001
|
||||
From: Greg Kurz <groug@kaod.org>
|
||||
Date: Thu, 14 Jan 2021 17:04:12 +0100
|
||||
Subject: [PATCH] 9pfs: Fully restart unreclaim loop (CVE-2021-20181)
|
||||
|
||||
Depending on the client activity, the server can be asked to open a huge
|
||||
number of file descriptors and eventually hit RLIMIT_NOFILE. This is
|
||||
currently mitigated using a reclaim logic : the server closes the file
|
||||
descriptors of idle fids, based on the assumption that it will be able
|
||||
to re-open them later. This assumption doesn't hold of course if the
|
||||
client requests the file to be unlinked. In this case, we loop on the
|
||||
entire fid list and mark all related fids as unreclaimable (the reclaim
|
||||
logic will just ignore them) and, of course, we open or re-open their
|
||||
file descriptors if needed since we're about to unlink the file.
|
||||
|
||||
This is the purpose of v9fs_mark_fids_unreclaim(). Since the actual
|
||||
opening of a file can cause the coroutine to yield, another client
|
||||
request could possibly add a new fid that we may want to mark as
|
||||
non-reclaimable as well. The loop is thus restarted if the re-open
|
||||
request was actually transmitted to the backend. This is achieved
|
||||
by keeping a reference on the first fid (head) before traversing
|
||||
the list.
|
||||
|
||||
This is wrong in several ways:
|
||||
- a potential clunk request from the client could tear the first
|
||||
fid down and cause the reference to be stale. This leads to a
|
||||
use-after-free error that can be detected with ASAN, using a
|
||||
custom 9p client
|
||||
- fids are added at the head of the list : restarting from the
|
||||
previous head will always miss fids added by a some other
|
||||
potential request
|
||||
|
||||
All these problems could be avoided if fids were being added at the
|
||||
end of the list. This can be achieved with a QSIMPLEQ, but this is
|
||||
probably too much change for a bug fix. For now let's keep it
|
||||
simple and just restart the loop from the current head.
|
||||
|
||||
Fixes: CVE-2021-20181
|
||||
Buglink: https://bugs.launchpad.net/qemu/+bug/1911666
|
||||
Reported-by: Zero Day Initiative <zdi-disclosures@trendmicro.com>
|
||||
Reviewed-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
|
||||
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
|
||||
Message-Id: <161064025265.1838153.15185571283519390907.stgit@bahia.lan>
|
||||
Signed-off-by: Greg Kurz <groug@kaod.org>
|
||||
|
||||
Upstream-Status: Backport [89fbea8737e8f7b954745a1ffc4238d377055305]
|
||||
CVE: CVE-2021-20181
|
||||
|
||||
Signed-off-by: Sakib Sajal <sakib.sajal@windriver.com>
|
||||
---
|
||||
hw/9pfs/9p.c | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c
|
||||
index 94df440fc..6026b51a1 100644
|
||||
--- a/hw/9pfs/9p.c
|
||||
+++ b/hw/9pfs/9p.c
|
||||
@@ -502,9 +502,9 @@ static int coroutine_fn v9fs_mark_fids_unreclaim(V9fsPDU *pdu, V9fsPath *path)
|
||||
{
|
||||
int err;
|
||||
V9fsState *s = pdu->s;
|
||||
- V9fsFidState *fidp, head_fid;
|
||||
+ V9fsFidState *fidp;
|
||||
|
||||
- head_fid.next = s->fid_list;
|
||||
+again:
|
||||
for (fidp = s->fid_list; fidp; fidp = fidp->next) {
|
||||
if (fidp->path.size != path->size) {
|
||||
continue;
|
||||
@@ -524,7 +524,7 @@ static int coroutine_fn v9fs_mark_fids_unreclaim(V9fsPDU *pdu, V9fsPath *path)
|
||||
* switched to the worker thread
|
||||
*/
|
||||
if (err == 0) {
|
||||
- fidp = &head_fid;
|
||||
+ goto again;
|
||||
}
|
||||
}
|
||||
}
|
||||
--
|
||||
2.29.2
|
||||
|
||||
67
meta/recipes-devtools/qemu/qemu/CVE-2021-20221.patch
Normal file
67
meta/recipes-devtools/qemu/qemu/CVE-2021-20221.patch
Normal file
@@ -0,0 +1,67 @@
|
||||
From edfe2eb4360cde4ed5d95bda7777edcb3510f76a Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= <f4bug@amsat.org>
|
||||
Date: Sun, 31 Jan 2021 11:34:01 +0100
|
||||
Subject: [PATCH] hw/intc/arm_gic: Fix interrupt ID in GICD_SGIR register
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Per the ARM Generic Interrupt Controller Architecture specification
|
||||
(document "ARM IHI 0048B.b (ID072613)"), the SGIINTID field is 4 bit,
|
||||
not 10:
|
||||
|
||||
- 4.3 Distributor register descriptions
|
||||
- 4.3.15 Software Generated Interrupt Register, GICD_SG
|
||||
|
||||
- Table 4-21 GICD_SGIR bit assignments
|
||||
|
||||
The Interrupt ID of the SGI to forward to the specified CPU
|
||||
interfaces. The value of this field is the Interrupt ID, in
|
||||
the range 0-15, for example a value of 0b0011 specifies
|
||||
Interrupt ID 3.
|
||||
|
||||
Correct the irq mask to fix an undefined behavior (which eventually
|
||||
lead to a heap-buffer-overflow, see [Buglink]):
|
||||
|
||||
$ echo 'writel 0x8000f00 0xff4affb0' | qemu-system-aarch64 -M virt,accel=qtest -qtest stdio
|
||||
[I 1612088147.116987] OPENED
|
||||
[R +0.278293] writel 0x8000f00 0xff4affb0
|
||||
../hw/intc/arm_gic.c:1498:13: runtime error: index 944 out of bounds for type 'uint8_t [16][8]'
|
||||
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../hw/intc/arm_gic.c:1498:13
|
||||
|
||||
This fixes a security issue when running with KVM on Arm with
|
||||
kernel-irqchip=off. (The default is kernel-irqchip=on, which is
|
||||
unaffected, and which is also the correct choice for performance.)
|
||||
|
||||
Cc: qemu-stable@nongnu.org
|
||||
Fixes: CVE-2021-20221
|
||||
Fixes: 9ee6e8bb853 ("ARMv7 support.")
|
||||
Buglink: https://bugs.launchpad.net/qemu/+bug/1913916
|
||||
Buglink: https://bugs.launchpad.net/qemu/+bug/1913917
|
||||
Reported-by: Alexander Bulekov <alxndr@bu.edu>
|
||||
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
|
||||
Message-id: 20210131103401.217160-1-f4bug@amsat.org
|
||||
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
|
||||
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
|
||||
|
||||
Upstream-Status: Backport
|
||||
CVE: CVE-2021-20221
|
||||
Signed-off-by: Armin Kuster <akuster@mvista.com>
|
||||
|
||||
---
|
||||
hw/intc/arm_gic.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
Index: qemu-4.2.0/hw/intc/arm_gic.c
|
||||
===================================================================
|
||||
--- qemu-4.2.0.orig/hw/intc/arm_gic.c
|
||||
+++ qemu-4.2.0/hw/intc/arm_gic.c
|
||||
@@ -1455,7 +1455,7 @@ static void gic_dist_writel(void *opaque
|
||||
int target_cpu;
|
||||
|
||||
cpu = gic_get_current_cpu(s);
|
||||
- irq = value & 0x3ff;
|
||||
+ irq = value & 0xf;
|
||||
switch ((value >> 24) & 3) {
|
||||
case 0:
|
||||
mask = (value >> 16) & ALL_CPU_MASK;
|
||||
55
meta/recipes-devtools/qemu/qemu/CVE-2021-20257.patch
Normal file
55
meta/recipes-devtools/qemu/qemu/CVE-2021-20257.patch
Normal file
@@ -0,0 +1,55 @@
|
||||
From affdf476543405045c281a7c67d1eaedbcea8135 Mon Sep 17 00:00:00 2001
|
||||
From: Jason Wang <jasowang@redhat.com>
|
||||
Date: Wed, 24 Feb 2021 13:45:28 +0800
|
||||
Subject: [PATCH] e1000: fail early for evil descriptor
|
||||
|
||||
During procss_tx_desc(), driver can try to chain data descriptor with
|
||||
legacy descriptor, when will lead underflow for the following
|
||||
calculation in process_tx_desc() for bytes:
|
||||
|
||||
if (tp->size + bytes > msh)
|
||||
bytes = msh - tp->size;
|
||||
|
||||
This will lead a infinite loop. So check and fail early if tp->size if
|
||||
greater or equal to msh.
|
||||
|
||||
Reported-by: Alexander Bulekov <alxndr@bu.edu>
|
||||
Reported-by: Cheolwoo Myung <cwmyung@snu.ac.kr>
|
||||
Reported-by: Ruhr-University Bochum <bugs-syssec@rub.de>
|
||||
Cc: Prasad J Pandit <ppandit@redhat.com>
|
||||
Cc: qemu-stable@nongnu.org
|
||||
Signed-off-by: Jason Wang <jasowang@redhat.com>
|
||||
|
||||
Upstream-Status: Backport [3de46e6fc489c52c9431a8a832ad8170a7569bd8]
|
||||
CVE: CVE-2021-20257
|
||||
|
||||
Signed-off-by: Sakib Sajal <sakib.sajal@windriver.com>
|
||||
---
|
||||
hw/net/e1000.c | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/hw/net/e1000.c b/hw/net/e1000.c
|
||||
index cf22c4f07..c3564c7ce 100644
|
||||
--- a/hw/net/e1000.c
|
||||
+++ b/hw/net/e1000.c
|
||||
@@ -670,6 +670,9 @@ process_tx_desc(E1000State *s, struct e1000_tx_desc *dp)
|
||||
msh = tp->tso_props.hdr_len + tp->tso_props.mss;
|
||||
do {
|
||||
bytes = split_size;
|
||||
+ if (tp->size >= msh) {
|
||||
+ goto eop;
|
||||
+ }
|
||||
if (tp->size + bytes > msh)
|
||||
bytes = msh - tp->size;
|
||||
|
||||
@@ -695,6 +698,7 @@ process_tx_desc(E1000State *s, struct e1000_tx_desc *dp)
|
||||
tp->size += split_size;
|
||||
}
|
||||
|
||||
+eop:
|
||||
if (!(txd_lower & E1000_TXD_CMD_EOP))
|
||||
return;
|
||||
if (!(tp->cptse && tp->size < tp->tso_props.hdr_len)) {
|
||||
--
|
||||
2.29.2
|
||||
|
||||
177
meta/recipes-devtools/qemu/qemu/CVE-2021-3416_1.patch
Normal file
177
meta/recipes-devtools/qemu/qemu/CVE-2021-3416_1.patch
Normal file
@@ -0,0 +1,177 @@
|
||||
From 4b1988a29d67277d6c8ce1df52975f5616592913 Mon Sep 17 00:00:00 2001
|
||||
From: Jason Wang <jasowang@redhat.com>
|
||||
Date: Wed, 24 Feb 2021 11:44:36 +0800
|
||||
Subject: [PATCH 01/10] net: introduce qemu_receive_packet()
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Some NIC supports loopback mode and this is done by calling
|
||||
nc->info->receive() directly which in fact suppresses the effort of
|
||||
reentrancy check that is done in qemu_net_queue_send().
|
||||
|
||||
Unfortunately we can't use qemu_net_queue_send() here since for
|
||||
loopback there's no sender as peer, so this patch introduce a
|
||||
qemu_receive_packet() which is used for implementing loopback mode
|
||||
for a NIC with this check.
|
||||
|
||||
NIC that supports loopback mode will be converted to this helper.
|
||||
|
||||
This is intended to address CVE-2021-3416.
|
||||
|
||||
Cc: Prasad J Pandit <ppandit@redhat.com>
|
||||
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
|
||||
Cc: qemu-stable@nongnu.org
|
||||
Signed-off-by: Jason Wang <jasowang@redhat.com>
|
||||
|
||||
Upstream-Status: Backport [705df5466c98f3efdd2b68d3b31dad86858acad7]
|
||||
CVE: CVE-2021-3416
|
||||
|
||||
Signed-off-by: Sakib Sajal <sakib.sajal@windriver.com>
|
||||
---
|
||||
include/net/net.h | 5 +++++
|
||||
include/net/queue.h | 8 ++++++++
|
||||
net/net.c | 38 +++++++++++++++++++++++++++++++-------
|
||||
net/queue.c | 22 ++++++++++++++++++++++
|
||||
4 files changed, 66 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/include/net/net.h b/include/net/net.h
|
||||
index 778fc787c..03f058ecb 100644
|
||||
--- a/include/net/net.h
|
||||
+++ b/include/net/net.h
|
||||
@@ -143,12 +143,17 @@ void *qemu_get_nic_opaque(NetClientState *nc);
|
||||
void qemu_del_net_client(NetClientState *nc);
|
||||
typedef void (*qemu_nic_foreach)(NICState *nic, void *opaque);
|
||||
void qemu_foreach_nic(qemu_nic_foreach func, void *opaque);
|
||||
+int qemu_can_receive_packet(NetClientState *nc);
|
||||
int qemu_can_send_packet(NetClientState *nc);
|
||||
ssize_t qemu_sendv_packet(NetClientState *nc, const struct iovec *iov,
|
||||
int iovcnt);
|
||||
ssize_t qemu_sendv_packet_async(NetClientState *nc, const struct iovec *iov,
|
||||
int iovcnt, NetPacketSent *sent_cb);
|
||||
ssize_t qemu_send_packet(NetClientState *nc, const uint8_t *buf, int size);
|
||||
+ssize_t qemu_receive_packet(NetClientState *nc, const uint8_t *buf, int size);
|
||||
+ssize_t qemu_receive_packet_iov(NetClientState *nc,
|
||||
+ const struct iovec *iov,
|
||||
+ int iovcnt);
|
||||
ssize_t qemu_send_packet_raw(NetClientState *nc, const uint8_t *buf, int size);
|
||||
ssize_t qemu_send_packet_async(NetClientState *nc, const uint8_t *buf,
|
||||
int size, NetPacketSent *sent_cb);
|
||||
diff --git a/include/net/queue.h b/include/net/queue.h
|
||||
index c0269bb1d..9f2f289d7 100644
|
||||
--- a/include/net/queue.h
|
||||
+++ b/include/net/queue.h
|
||||
@@ -55,6 +55,14 @@ void qemu_net_queue_append_iov(NetQueue *queue,
|
||||
|
||||
void qemu_del_net_queue(NetQueue *queue);
|
||||
|
||||
+ssize_t qemu_net_queue_receive(NetQueue *queue,
|
||||
+ const uint8_t *data,
|
||||
+ size_t size);
|
||||
+
|
||||
+ssize_t qemu_net_queue_receive_iov(NetQueue *queue,
|
||||
+ const struct iovec *iov,
|
||||
+ int iovcnt);
|
||||
+
|
||||
ssize_t qemu_net_queue_send(NetQueue *queue,
|
||||
NetClientState *sender,
|
||||
unsigned flags,
|
||||
diff --git a/net/net.c b/net/net.c
|
||||
index 6a2c3d956..5e15e5d27 100644
|
||||
--- a/net/net.c
|
||||
+++ b/net/net.c
|
||||
@@ -528,6 +528,17 @@ int qemu_set_vnet_be(NetClientState *nc, bool is_be)
|
||||
#endif
|
||||
}
|
||||
|
||||
+int qemu_can_receive_packet(NetClientState *nc)
|
||||
+{
|
||||
+ if (nc->receive_disabled) {
|
||||
+ return 0;
|
||||
+ } else if (nc->info->can_receive &&
|
||||
+ !nc->info->can_receive(nc)) {
|
||||
+ return 0;
|
||||
+ }
|
||||
+ return 1;
|
||||
+}
|
||||
+
|
||||
int qemu_can_send_packet(NetClientState *sender)
|
||||
{
|
||||
int vm_running = runstate_is_running();
|
||||
@@ -540,13 +551,7 @@ int qemu_can_send_packet(NetClientState *sender)
|
||||
return 1;
|
||||
}
|
||||
|
||||
- if (sender->peer->receive_disabled) {
|
||||
- return 0;
|
||||
- } else if (sender->peer->info->can_receive &&
|
||||
- !sender->peer->info->can_receive(sender->peer)) {
|
||||
- return 0;
|
||||
- }
|
||||
- return 1;
|
||||
+ return qemu_can_receive_packet(sender->peer);
|
||||
}
|
||||
|
||||
static ssize_t filter_receive_iov(NetClientState *nc,
|
||||
@@ -679,6 +684,25 @@ ssize_t qemu_send_packet(NetClientState *nc, const uint8_t *buf, int size)
|
||||
return qemu_send_packet_async(nc, buf, size, NULL);
|
||||
}
|
||||
|
||||
+ssize_t qemu_receive_packet(NetClientState *nc, const uint8_t *buf, int size)
|
||||
+{
|
||||
+ if (!qemu_can_receive_packet(nc)) {
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ return qemu_net_queue_receive(nc->incoming_queue, buf, size);
|
||||
+}
|
||||
+
|
||||
+ssize_t qemu_receive_packet_iov(NetClientState *nc, const struct iovec *iov,
|
||||
+ int iovcnt)
|
||||
+{
|
||||
+ if (!qemu_can_receive_packet(nc)) {
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ return qemu_net_queue_receive_iov(nc->incoming_queue, iov, iovcnt);
|
||||
+}
|
||||
+
|
||||
ssize_t qemu_send_packet_raw(NetClientState *nc, const uint8_t *buf, int size)
|
||||
{
|
||||
return qemu_send_packet_async_with_flags(nc, QEMU_NET_PACKET_FLAG_RAW,
|
||||
diff --git a/net/queue.c b/net/queue.c
|
||||
index 19e32c80f..c872d51df 100644
|
||||
--- a/net/queue.c
|
||||
+++ b/net/queue.c
|
||||
@@ -182,6 +182,28 @@ static ssize_t qemu_net_queue_deliver_iov(NetQueue *queue,
|
||||
return ret;
|
||||
}
|
||||
|
||||
+ssize_t qemu_net_queue_receive(NetQueue *queue,
|
||||
+ const uint8_t *data,
|
||||
+ size_t size)
|
||||
+{
|
||||
+ if (queue->delivering) {
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ return qemu_net_queue_deliver(queue, NULL, 0, data, size);
|
||||
+}
|
||||
+
|
||||
+ssize_t qemu_net_queue_receive_iov(NetQueue *queue,
|
||||
+ const struct iovec *iov,
|
||||
+ int iovcnt)
|
||||
+{
|
||||
+ if (queue->delivering) {
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ return qemu_net_queue_deliver_iov(queue, NULL, 0, iov, iovcnt);
|
||||
+}
|
||||
+
|
||||
ssize_t qemu_net_queue_send(NetQueue *queue,
|
||||
NetClientState *sender,
|
||||
unsigned flags,
|
||||
--
|
||||
2.29.2
|
||||
|
||||
41
meta/recipes-devtools/qemu/qemu/CVE-2021-3416_10.patch
Normal file
41
meta/recipes-devtools/qemu/qemu/CVE-2021-3416_10.patch
Normal file
@@ -0,0 +1,41 @@
|
||||
From 65b851efd3d0280425c202f4e5880c48f8334dae Mon Sep 17 00:00:00 2001
|
||||
From: Alexander Bulekov <alxndr@bu.edu>
|
||||
Date: Mon, 1 Mar 2021 14:35:30 -0500
|
||||
Subject: [PATCH 10/10] lan9118: switch to use qemu_receive_packet() for
|
||||
loopback
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
This patch switches to use qemu_receive_packet() which can detect
|
||||
reentrancy and return early.
|
||||
|
||||
This is intended to address CVE-2021-3416.
|
||||
|
||||
Cc: Prasad J Pandit <ppandit@redhat.com>
|
||||
Cc: qemu-stable@nongnu.org
|
||||
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com
|
||||
Signed-off-by: Alexander Bulekov <alxndr@bu.edu>
|
||||
Signed-off-by: Jason Wang <jasowang@redhat.com>
|
||||
|
||||
Upstream-Status: Backport [37cee01784ff0df13e5209517e1b3594a5e792d1]
|
||||
CVE: CVE-2021-3416
|
||||
|
||||
Signed-off-by: Sakib Sajal <sakib.sajal@windriver.com>
|
||||
---
|
||||
hw/net/lan9118.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
Index: qemu-4.2.0/hw/net/lan9118.c
|
||||
===================================================================
|
||||
--- qemu-4.2.0.orig/hw/net/lan9118.c
|
||||
+++ qemu-4.2.0/hw/net/lan9118.c
|
||||
@@ -667,7 +667,7 @@ static void do_tx_packet(lan9118_state *
|
||||
/* FIXME: Honor TX disable, and allow queueing of packets. */
|
||||
if (s->phy_control & 0x4000) {
|
||||
/* This assumes the receive routine doesn't touch the VLANClient. */
|
||||
- lan9118_receive(qemu_get_queue(s->nic), s->txp->data, s->txp->len);
|
||||
+ qemu_receive_packet(qemu_get_queue(s->nic), s->txp->data, s->txp->len);
|
||||
} else {
|
||||
qemu_send_packet(qemu_get_queue(s->nic), s->txp->data, s->txp->len);
|
||||
}
|
||||
42
meta/recipes-devtools/qemu/qemu/CVE-2021-3416_2.patch
Normal file
42
meta/recipes-devtools/qemu/qemu/CVE-2021-3416_2.patch
Normal file
@@ -0,0 +1,42 @@
|
||||
From e2a48a3c7cc33dbbe89f896e0f07462cb04ff6b5 Mon Sep 17 00:00:00 2001
|
||||
From: Jason Wang <jasowang@redhat.com>
|
||||
Date: Wed, 24 Feb 2021 12:13:22 +0800
|
||||
Subject: [PATCH 02/10] e1000: switch to use qemu_receive_packet() for loopback
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
This patch switches to use qemu_receive_packet() which can detect
|
||||
reentrancy and return early.
|
||||
|
||||
This is intended to address CVE-2021-3416.
|
||||
|
||||
Cc: Prasad J Pandit <ppandit@redhat.com>
|
||||
Cc: qemu-stable@nongnu.org
|
||||
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
|
||||
Signed-off-by: Jason Wang <jasowang@redhat.com>
|
||||
|
||||
Upstream-Status: Backport [1caff0340f49c93d535c6558a5138d20d475315c]
|
||||
CVE: CVE-2021-3416
|
||||
|
||||
Signed-off-by: Sakib Sajal <sakib.sajal@windriver.com>
|
||||
---
|
||||
hw/net/e1000.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/hw/net/e1000.c b/hw/net/e1000.c
|
||||
index d7d05ae30..cf22c4f07 100644
|
||||
--- a/hw/net/e1000.c
|
||||
+++ b/hw/net/e1000.c
|
||||
@@ -546,7 +546,7 @@ e1000_send_packet(E1000State *s, const uint8_t *buf, int size)
|
||||
|
||||
NetClientState *nc = qemu_get_queue(s->nic);
|
||||
if (s->phy_reg[PHY_CTRL] & MII_CR_LOOPBACK) {
|
||||
- nc->info->receive(nc, buf, size);
|
||||
+ qemu_receive_packet(nc, buf, size);
|
||||
} else {
|
||||
qemu_send_packet(nc, buf, size);
|
||||
}
|
||||
--
|
||||
2.29.2
|
||||
|
||||
43
meta/recipes-devtools/qemu/qemu/CVE-2021-3416_3.patch
Normal file
43
meta/recipes-devtools/qemu/qemu/CVE-2021-3416_3.patch
Normal file
@@ -0,0 +1,43 @@
|
||||
From c041a4da1ff119715e0ccf2d4a7af62568f17b93 Mon Sep 17 00:00:00 2001
|
||||
From: Jason Wang <jasowang@redhat.com>
|
||||
Date: Wed, 24 Feb 2021 12:57:40 +0800
|
||||
Subject: [PATCH 03/10] dp8393x: switch to use qemu_receive_packet() for
|
||||
loopback packet
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
This patch switches to use qemu_receive_packet() which can detect
|
||||
reentrancy and return early.
|
||||
|
||||
This is intended to address CVE-2021-3416.
|
||||
|
||||
Cc: Prasad J Pandit <ppandit@redhat.com>
|
||||
Cc: qemu-stable@nongnu.org
|
||||
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com
|
||||
Signed-off-by: Jason Wang <jasowang@redhat.com>
|
||||
|
||||
Upstream-Status: Backport [331d2ac9ea307c990dc86e6493e8f0c48d14bb33]
|
||||
CVE: CVE-2021-3416
|
||||
|
||||
Signed-off-by: Sakib Sajal <sakib.sajal@windriver.com>
|
||||
---
|
||||
hw/net/dp8393x.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/hw/net/dp8393x.c b/hw/net/dp8393x.c
|
||||
index 205c0decc..533a8304d 100644
|
||||
--- a/hw/net/dp8393x.c
|
||||
+++ b/hw/net/dp8393x.c
|
||||
@@ -506,7 +506,7 @@ static void dp8393x_do_transmit_packets(dp8393xState *s)
|
||||
s->regs[SONIC_TCR] |= SONIC_TCR_CRSL;
|
||||
if (nc->info->can_receive(nc)) {
|
||||
s->loopback_packet = 1;
|
||||
- nc->info->receive(nc, s->tx_buffer, tx_len);
|
||||
+ qemu_receive_packet(nc, s->tx_buffer, tx_len);
|
||||
}
|
||||
} else {
|
||||
/* Transmit packet */
|
||||
--
|
||||
2.29.2
|
||||
|
||||
42
meta/recipes-devtools/qemu/qemu/CVE-2021-3416_5.patch
Normal file
42
meta/recipes-devtools/qemu/qemu/CVE-2021-3416_5.patch
Normal file
@@ -0,0 +1,42 @@
|
||||
From d465dc79c9ee729d91ef086b993e956b1935be69 Mon Sep 17 00:00:00 2001
|
||||
From: Jason Wang <jasowang@redhat.com>
|
||||
Date: Wed, 24 Feb 2021 13:14:35 +0800
|
||||
Subject: [PATCH 05/10] sungem: switch to use qemu_receive_packet() for
|
||||
loopback
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
This patch switches to use qemu_receive_packet() which can detect
|
||||
reentrancy and return early.
|
||||
|
||||
This is intended to address CVE-2021-3416.
|
||||
|
||||
Cc: Prasad J Pandit <ppandit@redhat.com>
|
||||
Cc: qemu-stable@nongnu.org
|
||||
Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
|
||||
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
|
||||
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
|
||||
Signed-off-by: Jason Wang <jasowang@redhat.com>
|
||||
|
||||
Upstream-Status: Backport [8c92060d3c0248bd4d515719a35922cd2391b9b4]
|
||||
CVE: CVE-2021-3416
|
||||
|
||||
Signed-off-by: Sakib Sajal <sakib.sajal@windriver.com>
|
||||
---
|
||||
hw/net/sungem.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
Index: qemu-4.2.0/hw/net/sungem.c
|
||||
===================================================================
|
||||
--- qemu-4.2.0.orig/hw/net/sungem.c
|
||||
+++ qemu-4.2.0/hw/net/sungem.c
|
||||
@@ -305,7 +305,7 @@ static void sungem_send_packet(SunGEMSta
|
||||
NetClientState *nc = qemu_get_queue(s->nic);
|
||||
|
||||
if (s->macregs[MAC_XIFCFG >> 2] & MAC_XIFCFG_LBCK) {
|
||||
- nc->info->receive(nc, buf, size);
|
||||
+ qemu_receive_packet(nc, buf, size);
|
||||
} else {
|
||||
qemu_send_packet(nc, buf, size);
|
||||
}
|
||||
40
meta/recipes-devtools/qemu/qemu/CVE-2021-3416_6.patch
Normal file
40
meta/recipes-devtools/qemu/qemu/CVE-2021-3416_6.patch
Normal file
@@ -0,0 +1,40 @@
|
||||
From c0010f9b2bafe866fe32e3c2688454bc24147136 Mon Sep 17 00:00:00 2001
|
||||
From: Jason Wang <jasowang@redhat.com>
|
||||
Date: Wed, 24 Feb 2021 13:27:52 +0800
|
||||
Subject: [PATCH 06/10] tx_pkt: switch to use qemu_receive_packet_iov() for
|
||||
loopback
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
This patch switches to use qemu_receive_receive_iov() which can detect
|
||||
reentrancy and return early.
|
||||
|
||||
This is intended to address CVE-2021-3416.
|
||||
|
||||
Cc: Prasad J Pandit <ppandit@redhat.com>
|
||||
Cc: qemu-stable@nongnu.org
|
||||
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
|
||||
Signed-off-by: Jason Wang <jasowang@redhat.com>
|
||||
|
||||
Upstream-Status: Backport [8c552542b81e56ff532dd27ec6e5328954bdda73]
|
||||
CVE: CVE-2021-3416
|
||||
|
||||
Signed-off-by: Sakib Sajal <sakib.sajal@windriver.com>
|
||||
---
|
||||
hw/net/net_tx_pkt.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
Index: qemu-4.2.0/hw/net/net_tx_pkt.c
|
||||
===================================================================
|
||||
--- qemu-4.2.0.orig/hw/net/net_tx_pkt.c
|
||||
+++ qemu-4.2.0/hw/net/net_tx_pkt.c
|
||||
@@ -544,7 +544,7 @@ static inline void net_tx_pkt_sendv(stru
|
||||
NetClientState *nc, const struct iovec *iov, int iov_cnt)
|
||||
{
|
||||
if (pkt->is_loopback) {
|
||||
- nc->info->receive_iov(nc, iov, iov_cnt);
|
||||
+ qemu_receive_packet_iov(nc, iov, iov_cnt);
|
||||
} else {
|
||||
qemu_sendv_packet(nc, iov, iov_cnt);
|
||||
}
|
||||
42
meta/recipes-devtools/qemu/qemu/CVE-2021-3416_7.patch
Normal file
42
meta/recipes-devtools/qemu/qemu/CVE-2021-3416_7.patch
Normal file
@@ -0,0 +1,42 @@
|
||||
From 64b38675c728354e4015e4bec3d975cd4cb8a981 Mon Sep 17 00:00:00 2001
|
||||
From: Alexander Bulekov <alxndr@bu.edu>
|
||||
Date: Fri, 26 Feb 2021 13:47:53 -0500
|
||||
Subject: [PATCH 07/10] rtl8139: switch to use qemu_receive_packet() for
|
||||
loopback
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
This patch switches to use qemu_receive_packet() which can detect
|
||||
reentrancy and return early.
|
||||
|
||||
This is intended to address CVE-2021-3416.
|
||||
|
||||
Cc: Prasad J Pandit <ppandit@redhat.com>
|
||||
Cc: qemu-stable@nongnu.org
|
||||
Buglink: https://bugs.launchpad.net/qemu/+bug/1910826
|
||||
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com
|
||||
Signed-off-by: Alexander Bulekov <alxndr@bu.edu>
|
||||
Signed-off-by: Jason Wang <jasowang@redhat.com>
|
||||
|
||||
Upstream-Status: Backport [5311fb805a4403bba024e83886fa0e7572265de4]
|
||||
CVE: CVE-2021-3416
|
||||
|
||||
Signed-off-by: Sakib Sajal <sakib.sajal@windriver.com>
|
||||
---
|
||||
hw/net/rtl8139.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
Index: qemu-4.2.0/hw/net/rtl8139.c
|
||||
===================================================================
|
||||
--- qemu-4.2.0.orig/hw/net/rtl8139.c
|
||||
+++ qemu-4.2.0/hw/net/rtl8139.c
|
||||
@@ -1793,7 +1793,7 @@ static void rtl8139_transfer_frame(RTL81
|
||||
}
|
||||
|
||||
DPRINTF("+++ transmit loopback mode\n");
|
||||
- rtl8139_do_receive(qemu_get_queue(s->nic), buf, size, do_interrupt);
|
||||
+ qemu_receive_packet(qemu_get_queue(s->nic), buf, size);
|
||||
|
||||
if (iov) {
|
||||
g_free(buf2);
|
||||
44
meta/recipes-devtools/qemu/qemu/CVE-2021-3416_8.patch
Normal file
44
meta/recipes-devtools/qemu/qemu/CVE-2021-3416_8.patch
Normal file
@@ -0,0 +1,44 @@
|
||||
From 023ce62f0a788ad3a8233c7a828554bceeafd031 Mon Sep 17 00:00:00 2001
|
||||
From: Alexander Bulekov <alxndr@bu.edu>
|
||||
Date: Mon, 1 Mar 2021 10:33:34 -0500
|
||||
Subject: [PATCH 08/10] pcnet: switch to use qemu_receive_packet() for loopback
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
This patch switches to use qemu_receive_packet() which can detect
|
||||
reentrancy and return early.
|
||||
|
||||
This is intended to address CVE-2021-3416.
|
||||
|
||||
Cc: Prasad J Pandit <ppandit@redhat.com>
|
||||
Cc: qemu-stable@nongnu.org
|
||||
Buglink: https://bugs.launchpad.net/qemu/+bug/1917085
|
||||
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com
|
||||
Signed-off-by: Alexander Bulekov <alxndr@bu.edu>
|
||||
Signed-off-by: Jason Wang <jasowang@redhat.com>
|
||||
|
||||
Upstream-Status: Backport [99ccfaa1edafd79f7a3a0ff7b58ae4da7c514928]
|
||||
CVE: CVE-2021-3416
|
||||
|
||||
Signed-off-by: Sakib Sajal <sakib.sajal@windriver.com>
|
||||
---
|
||||
hw/net/pcnet.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/hw/net/pcnet.c b/hw/net/pcnet.c
|
||||
index f3f18d859..dcd3fc494 100644
|
||||
--- a/hw/net/pcnet.c
|
||||
+++ b/hw/net/pcnet.c
|
||||
@@ -1250,7 +1250,7 @@ txagain:
|
||||
if (BCR_SWSTYLE(s) == 1)
|
||||
add_crc = !GET_FIELD(tmd.status, TMDS, NOFCS);
|
||||
s->looptest = add_crc ? PCNET_LOOPTEST_CRC : PCNET_LOOPTEST_NOCRC;
|
||||
- pcnet_receive(qemu_get_queue(s->nic), s->buffer, s->xmit_pos);
|
||||
+ qemu_receive_packet(qemu_get_queue(s->nic), s->buffer, s->xmit_pos);
|
||||
s->looptest = 0;
|
||||
} else {
|
||||
if (s->nic) {
|
||||
--
|
||||
2.29.2
|
||||
|
||||
41
meta/recipes-devtools/qemu/qemu/CVE-2021-3416_9.patch
Normal file
41
meta/recipes-devtools/qemu/qemu/CVE-2021-3416_9.patch
Normal file
@@ -0,0 +1,41 @@
|
||||
From ecf7e62bb2cb02c9bd40082504ae376f3e19ffd2 Mon Sep 17 00:00:00 2001
|
||||
From: Alexander Bulekov <alxndr@bu.edu>
|
||||
Date: Mon, 1 Mar 2021 14:33:43 -0500
|
||||
Subject: [PATCH 09/10] cadence_gem: switch to use qemu_receive_packet() for
|
||||
loopback
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
This patch switches to use qemu_receive_packet() which can detect
|
||||
reentrancy and return early.
|
||||
|
||||
This is intended to address CVE-2021-3416.
|
||||
|
||||
Cc: Prasad J Pandit <ppandit@redhat.com>
|
||||
Cc: qemu-stable@nongnu.org
|
||||
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
|
||||
Signed-off-by: Alexander Bulekov <alxndr@bu.edu>
|
||||
Signed-off-by: Jason Wang <jasowang@redhat.com>
|
||||
|
||||
Upstream-Status: Backport [e73adfbeec9d4e008630c814759052ed945c3fed]
|
||||
CVE: CVE-2021-3416
|
||||
|
||||
Signed-off-by: Sakib Sajal <sakib.sajal@windriver.com>
|
||||
---
|
||||
hw/net/cadence_gem.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
Index: qemu-4.2.0/hw/net/cadence_gem.c
|
||||
===================================================================
|
||||
--- qemu-4.2.0.orig/hw/net/cadence_gem.c
|
||||
+++ qemu-4.2.0/hw/net/cadence_gem.c
|
||||
@@ -1225,7 +1225,7 @@ static void gem_transmit(CadenceGEMState
|
||||
/* Send the packet somewhere */
|
||||
if (s->phy_loop || (s->regs[GEM_NWCTRL] &
|
||||
GEM_NWCTRL_LOCALLOOP)) {
|
||||
- gem_receive(qemu_get_queue(s->nic), tx_packet,
|
||||
+ qemu_receive_packet(qemu_get_queue(s->nic), tx_packet,
|
||||
total_bytes);
|
||||
} else {
|
||||
qemu_send_packet(qemu_get_queue(s->nic), tx_packet,
|
||||
42
meta/recipes-devtools/qemu/qemu/CVE-2021-3527-1.patch
Normal file
42
meta/recipes-devtools/qemu/qemu/CVE-2021-3527-1.patch
Normal file
@@ -0,0 +1,42 @@
|
||||
From 05a40b172e4d691371534828078be47e7fff524c Mon Sep 17 00:00:00 2001
|
||||
From: Gerd Hoffmann <kraxel@redhat.com>
|
||||
Date: Mon, 3 May 2021 15:29:15 +0200
|
||||
Subject: [PATCH] usb: limit combined packets to 1 MiB (CVE-2021-3527)
|
||||
|
||||
usb-host and usb-redirect try to batch bulk transfers by combining many
|
||||
small usb packets into a single, large transfer request, to reduce the
|
||||
overhead and improve performance.
|
||||
|
||||
This patch adds a size limit of 1 MiB for those combined packets to
|
||||
restrict the host resources the guest can bind that way.
|
||||
|
||||
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
|
||||
Message-Id: <20210503132915.2335822-6-kraxel@redhat.com>
|
||||
|
||||
Upstream-Status: Backport
|
||||
https://gitlab.com/qemu-project/qemu/-/commit/05a40b172e4d691371534828078be47e7fff524c
|
||||
CVE: CVE-2021-3527
|
||||
Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com>
|
||||
|
||||
---
|
||||
hw/usb/combined-packet.c | 4 +++-
|
||||
1 file changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/hw/usb/combined-packet.c b/hw/usb/combined-packet.c
|
||||
index 5d57e883dc..e56802f89a 100644
|
||||
--- a/hw/usb/combined-packet.c
|
||||
+++ b/hw/usb/combined-packet.c
|
||||
@@ -171,7 +171,9 @@ void usb_ep_combine_input_packets(USBEndpoint *ep)
|
||||
if ((p->iov.size % ep->max_packet_size) != 0 || !p->short_not_ok ||
|
||||
next == NULL ||
|
||||
/* Work around for Linux usbfs bulk splitting + migration */
|
||||
- (totalsize == (16 * KiB - 36) && p->int_req)) {
|
||||
+ (totalsize == (16 * KiB - 36) && p->int_req) ||
|
||||
+ /* Next package may grow combined package over 1MiB */
|
||||
+ totalsize > 1 * MiB - ep->max_packet_size) {
|
||||
usb_device_handle_data(ep->dev, first);
|
||||
assert(first->status == USB_RET_ASYNC);
|
||||
if (first->combined) {
|
||||
--
|
||||
GitLab
|
||||
|
||||
59
meta/recipes-devtools/qemu/qemu/CVE-2021-3527-2.patch
Normal file
59
meta/recipes-devtools/qemu/qemu/CVE-2021-3527-2.patch
Normal file
@@ -0,0 +1,59 @@
|
||||
From 7ec54f9eb62b5d177e30eb8b1cad795a5f8d8986 Mon Sep 17 00:00:00 2001
|
||||
From: Gerd Hoffmann <kraxel@redhat.com>
|
||||
Date: Mon, 3 May 2021 15:29:12 +0200
|
||||
Subject: [PATCH] usb/redir: avoid dynamic stack allocation (CVE-2021-3527)
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Use autofree heap allocation instead.
|
||||
|
||||
Fixes: 4f4321c11ff ("usb: use iovecs in USBPacket")
|
||||
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
|
||||
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
|
||||
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
|
||||
Message-Id: <20210503132915.2335822-3-kraxel@redhat.com>
|
||||
|
||||
Upstream-Status: Backport
|
||||
https://gitlab.com/qemu-project/qemu/-/commit/7ec54f9eb62b5d177e30eb8b1cad795a5f8d8986
|
||||
CVE: CVE-2021-3527
|
||||
Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com>
|
||||
|
||||
---
|
||||
hw/usb/redirect.c | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c
|
||||
index 17f06f3417..6a75b0dc4a 100644
|
||||
--- a/hw/usb/redirect.c
|
||||
+++ b/hw/usb/redirect.c
|
||||
@@ -620,7 +620,7 @@ static void usbredir_handle_iso_data(USBRedirDevice *dev, USBPacket *p,
|
||||
.endpoint = ep,
|
||||
.length = p->iov.size
|
||||
};
|
||||
- uint8_t buf[p->iov.size];
|
||||
+ g_autofree uint8_t *buf = g_malloc(p->iov.size);
|
||||
/* No id, we look at the ep when receiving a status back */
|
||||
usb_packet_copy(p, buf, p->iov.size);
|
||||
usbredirparser_send_iso_packet(dev->parser, 0, &iso_packet,
|
||||
@@ -818,7 +818,7 @@ static void usbredir_handle_bulk_data(USBRedirDevice *dev, USBPacket *p,
|
||||
usbredirparser_send_bulk_packet(dev->parser, p->id,
|
||||
&bulk_packet, NULL, 0);
|
||||
} else {
|
||||
- uint8_t buf[size];
|
||||
+ g_autofree uint8_t *buf = g_malloc(size);
|
||||
usb_packet_copy(p, buf, size);
|
||||
usbredir_log_data(dev, "bulk data out:", buf, size);
|
||||
usbredirparser_send_bulk_packet(dev->parser, p->id,
|
||||
@@ -923,7 +923,7 @@ static void usbredir_handle_interrupt_out_data(USBRedirDevice *dev,
|
||||
USBPacket *p, uint8_t ep)
|
||||
{
|
||||
struct usb_redir_interrupt_packet_header interrupt_packet;
|
||||
- uint8_t buf[p->iov.size];
|
||||
+ g_autofree uint8_t *buf = g_malloc(p->iov.size);
|
||||
|
||||
DPRINTF("interrupt-out ep %02X len %zd id %"PRIu64"\n", ep,
|
||||
p->iov.size, p->id);
|
||||
--
|
||||
GitLab
|
||||
|
||||
29
meta/recipes-devtools/qemu/qemu/CVE-2021-3544.patch
Normal file
29
meta/recipes-devtools/qemu/qemu/CVE-2021-3544.patch
Normal file
@@ -0,0 +1,29 @@
|
||||
vhost-user-gpu: fix resource leak in 'vg_resource_create_2d' (CVE-2021-3544)
|
||||
|
||||
Call 'vugbm_buffer_destroy' in error path to avoid resource leak.
|
||||
|
||||
Fixes: CVE-2021-3544
|
||||
Reported-by: default avatarLi Qiang <liq3ea@163.com>
|
||||
Reviewed-by: default avatarPrasad J Pandit <pjp@fedoraproject.org>
|
||||
Signed-off-by: default avatarLi Qiang <liq3ea@163.com>
|
||||
Reviewed-by: Marc-André Lureau's avatarMarc-André Lureau <marcandre.lureau@redhat.com>
|
||||
Message-Id: <20210516030403.107723-3-liq3ea@163.com>
|
||||
Signed-off-by: Gerd Hoffmann's avatarGerd Hoffmann <kraxel@redhat.com>
|
||||
|
||||
Upstream-Status: Backport
|
||||
[vhost-user-gpu does not exist in 4.2.0]
|
||||
CVE: CVE-2021-3544
|
||||
Signed-off-by: Armin Kuster <akuster@mvista.com>
|
||||
|
||||
Index: qemu-4.2.0/contrib/vhost-user-gpu/main.c
|
||||
===================================================================
|
||||
--- qemu-4.2.0.orig/contrib/vhost-user-gpu/main.c
|
||||
+++ qemu-4.2.0/contrib/vhost-user-gpu/main.c
|
||||
@@ -328,6 +328,7 @@ vg_resource_create_2d(VuGpu *g,
|
||||
g_critical("%s: resource creation failed %d %d %d",
|
||||
__func__, c2d.resource_id, c2d.width, c2d.height);
|
||||
g_free(res);
|
||||
+ vugbm_buffer_destroy(&res->buffer);
|
||||
cmd->error = VIRTIO_GPU_RESP_ERR_OUT_OF_MEMORY;
|
||||
return;
|
||||
}
|
||||
39
meta/recipes-devtools/qemu/qemu/CVE-2021-3544_2.patch
Normal file
39
meta/recipes-devtools/qemu/qemu/CVE-2021-3544_2.patch
Normal file
@@ -0,0 +1,39 @@
|
||||
vhost-user-gpu: fix memory leak in vg_resource_attach_backing (CVE-2021-3544)
|
||||
|
||||
|
||||
Check whether the 'res' has already been attach_backing to avoid
|
||||
memory leak.
|
||||
|
||||
Fixes: CVE-2021-3544
|
||||
Reported-by: default avatarLi Qiang <liq3ea@163.com>
|
||||
virtio-gpu fix: 204f01b3
|
||||
|
||||
("virtio-gpu: fix memory leak
|
||||
in resource attach backing")
|
||||
Signed-off-by: default avatarLi Qiang <liq3ea@163.com>
|
||||
Reviewed-by: Marc-André Lureau's avatarMarc-André Lureau <marcandre.lureau@redhat.com>
|
||||
Message-Id: <20210516030403.107723-4-liq3ea@163.com>
|
||||
Signed-off-by: Gerd Hoffmann's avatarGerd Hoffmann <kraxel@redhat.com>
|
||||
|
||||
Upstream-Status: Backport
|
||||
[vhost-user-gpu does not exist in 4.2.0 context]
|
||||
CVE: CVE-2021-3544
|
||||
Signed-off-by: Armin Kuster <akuster@mvista.com>
|
||||
|
||||
|
||||
Index: qemu-4.2.0/contrib/vhost-user-gpu/main.c
|
||||
===================================================================
|
||||
--- qemu-4.2.0.orig/contrib/vhost-user-gpu/main.c
|
||||
+++ qemu-4.2.0/contrib/vhost-user-gpu/main.c
|
||||
@@ -468,6 +468,11 @@ vg_resource_attach_backing(VuGpu *g,
|
||||
return;
|
||||
}
|
||||
|
||||
+ if (res->iov) {
|
||||
+ cmd->error = VIRTIO_GPU_RESP_ERR_UNSPEC;
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
ret = vg_create_mapping_iov(g, &ab, cmd, &res->iov);
|
||||
if (ret != 0) {
|
||||
cmd->error = VIRTIO_GPU_RESP_ERR_UNSPEC;
|
||||
39
meta/recipes-devtools/qemu/qemu/CVE-2021-3544_3.patch
Normal file
39
meta/recipes-devtools/qemu/qemu/CVE-2021-3544_3.patch
Normal file
@@ -0,0 +1,39 @@
|
||||
vhost-user-gpu: fix memory leak while calling 'vg_resource_unref' (CVE-2021-3544)
|
||||
|
||||
If the guest trigger following sequences, the attach_backing will be leaked:
|
||||
|
||||
vg_resource_create_2d
|
||||
vg_resource_attach_backing
|
||||
vg_resource_unref
|
||||
|
||||
This patch fix this by freeing 'res->iov' in vg_resource_destroy.
|
||||
|
||||
Fixes: CVE-2021-3544
|
||||
Reported-by: default avatarLi Qiang <liq3ea@163.com>
|
||||
virtio-gpu fix: 5e8e3c4c
|
||||
|
||||
("virtio-gpu: fix resource leak
|
||||
in virgl_cmd_resource_unref")
|
||||
Reviewed-by: default avatarPrasad J Pandit <pjp@fedoraproject.org>
|
||||
Signed-off-by: default avatarLi Qiang <liq3ea@163.com>
|
||||
Reviewed-by: Marc-André Lureau's avatarMarc-André Lureau <marcandre.lureau@redhat.com>
|
||||
Message-Id: <20210516030403.107723-5-liq3ea@163.com>
|
||||
Signed-off-by: Gerd Hoffmann's avatarGerd Hoffmann <kraxel@redhat.com>
|
||||
|
||||
Upstream-Status: Backport
|
||||
CVE: CVE-2021-3544
|
||||
[vhost-user-gpu does not exist in the 4.2.0]
|
||||
Signed-off-by: Armin Kuster <akuster@mvista.com>
|
||||
|
||||
Index: qemu-4.2.0/contrib/vhost-user-gpu/main.c
|
||||
===================================================================
|
||||
--- qemu-4.2.0.orig/contrib/vhost-user-gpu/main.c
|
||||
+++ qemu-4.2.0/contrib/vhost-user-gpu/main.c
|
||||
@@ -379,6 +379,7 @@ vg_resource_destroy(VuGpu *g,
|
||||
}
|
||||
|
||||
vugbm_buffer_destroy(&res->buffer);
|
||||
+ g_free(res->iov);
|
||||
pixman_image_unref(res->image);
|
||||
QTAILQ_REMOVE(&g->reslist, res, next);
|
||||
g_free(res);
|
||||
46
meta/recipes-devtools/qemu/qemu/CVE-2021-3544_4.patch
Normal file
46
meta/recipes-devtools/qemu/qemu/CVE-2021-3544_4.patch
Normal file
@@ -0,0 +1,46 @@
|
||||
vhost-user-gpu: fix memory leak in 'virgl_cmd_resource_unref' (CVE-2021-3544)
|
||||
|
||||
The 'res->iov' will be leaked if the guest trigger following sequences:
|
||||
|
||||
virgl_cmd_create_resource_2d
|
||||
virgl_resource_attach_backing
|
||||
virgl_cmd_resource_unref
|
||||
|
||||
This patch fixes this.
|
||||
|
||||
Fixes: CVE-2021-3544
|
||||
Reported-by: default avatarLi Qiang <liq3ea@163.com>
|
||||
virtio-gpu fix: 5e8e3c4c
|
||||
|
||||
("virtio-gpu: fix resource leak
|
||||
in virgl_cmd_resource_unref"
|
||||
Signed-off-by: default avatarLi Qiang <liq3ea@163.com>
|
||||
Reviewed-by: Marc-André Lureau's avatarMarc-André Lureau <marcandre.lureau@redhat.com>
|
||||
Message-Id: <20210516030403.107723-6-liq3ea@163.com>
|
||||
Signed-off-by: Gerd Hoffmann's avatarGerd Hoffmann <kraxel@redhat.com>
|
||||
|
||||
Upstream-Status: Backport
|
||||
CVE: CVE-2021-3544
|
||||
Signed-off-by: Armin Kuster <akuster@mvista.com>
|
||||
|
||||
Index: qemu-4.2.0/contrib/vhost-user-gpu/virgl.c
|
||||
===================================================================
|
||||
--- qemu-4.2.0.orig/contrib/vhost-user-gpu/virgl.c
|
||||
+++ qemu-4.2.0/contrib/vhost-user-gpu/virgl.c
|
||||
@@ -105,9 +105,16 @@ virgl_cmd_resource_unref(VuGpu *g,
|
||||
struct virtio_gpu_ctrl_command *cmd)
|
||||
{
|
||||
struct virtio_gpu_resource_unref unref;
|
||||
+ struct iovec *res_iovs = NULL;
|
||||
+ int num_iovs = 0;
|
||||
|
||||
VUGPU_FILL_CMD(unref);
|
||||
|
||||
+ virgl_renderer_resource_detach_iov(unref.resource_id,
|
||||
+ &res_iovs,
|
||||
+ &num_iovs);
|
||||
+ g_free(res_iovs);
|
||||
+
|
||||
virgl_renderer_resource_unref(unref.resource_id);
|
||||
}
|
||||
|
||||
47
meta/recipes-devtools/qemu/qemu/CVE-2021-3544_5.patch
Normal file
47
meta/recipes-devtools/qemu/qemu/CVE-2021-3544_5.patch
Normal file
@@ -0,0 +1,47 @@
|
||||
From 63736af5a6571d9def93769431e0d7e38c6677bf Mon Sep 17 00:00:00 2001
|
||||
From: Li Qiang <liq3ea@163.com>
|
||||
Date: Sat, 15 May 2021 20:04:01 -0700
|
||||
Subject: [PATCH] vhost-user-gpu: fix memory leak in
|
||||
'virgl_resource_attach_backing' (CVE-2021-3544)
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
If 'virgl_renderer_resource_attach_iov' failed, the 'res_iovs' will
|
||||
be leaked.
|
||||
|
||||
Fixes: CVE-2021-3544
|
||||
Reported-by: Li Qiang <liq3ea@163.com>
|
||||
virtio-gpu fix: 33243031da ("virtio-gpu-3d: fix memory leak
|
||||
in resource attach backing")
|
||||
|
||||
Signed-off-by: Li Qiang <liq3ea@163.com>
|
||||
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
|
||||
Message-Id: <20210516030403.107723-7-liq3ea@163.com>
|
||||
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
|
||||
|
||||
Upstream-Status: Backport
|
||||
CVE: CVE-2021-3544
|
||||
Signed-off-by: Armin Kuster <akuster@mvista.com>
|
||||
|
||||
---
|
||||
contrib/vhost-user-gpu/virgl.c | 5 ++++-
|
||||
1 file changed, 4 insertions(+), 1 deletion(-)
|
||||
|
||||
Index: qemu-4.2.0/contrib/vhost-user-gpu/virgl.c
|
||||
===================================================================
|
||||
--- qemu-4.2.0.orig/contrib/vhost-user-gpu/virgl.c
|
||||
+++ qemu-4.2.0/contrib/vhost-user-gpu/virgl.c
|
||||
@@ -283,8 +283,11 @@ virgl_resource_attach_backing(VuGpu *g,
|
||||
return;
|
||||
}
|
||||
|
||||
- virgl_renderer_resource_attach_iov(att_rb.resource_id,
|
||||
+ ret = virgl_renderer_resource_attach_iov(att_rb.resource_id,
|
||||
res_iovs, att_rb.nr_entries);
|
||||
+ if (ret != 0) {
|
||||
+ g_free(res_iovs);
|
||||
+ }
|
||||
}
|
||||
|
||||
static void
|
||||
41
meta/recipes-devtools/qemu/qemu/CVE-2021-3545.patch
Normal file
41
meta/recipes-devtools/qemu/qemu/CVE-2021-3545.patch
Normal file
@@ -0,0 +1,41 @@
|
||||
From 121841b25d72d13f8cad554363138c360f1250ea Mon Sep 17 00:00:00 2001
|
||||
From: Li Qiang <liq3ea@163.com>
|
||||
Date: Sat, 15 May 2021 20:03:56 -0700
|
||||
Subject: [PATCH] vhost-user-gpu: fix memory disclosure in
|
||||
virgl_cmd_get_capset_info (CVE-2021-3545)
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Otherwise some of the 'resp' will be leaked to guest.
|
||||
|
||||
Fixes: CVE-2021-3545
|
||||
Reported-by: Li Qiang <liq3ea@163.com>
|
||||
virtio-gpu fix: 42a8dadc74 ("virtio-gpu: fix information leak
|
||||
in getting capset info dispatch")
|
||||
|
||||
Signed-off-by: Li Qiang <liq3ea@163.com>
|
||||
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
|
||||
Message-Id: <20210516030403.107723-2-liq3ea@163.com>
|
||||
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
|
||||
|
||||
Upstream-Status: Backport
|
||||
CVE: CVE-2021-3545
|
||||
Signed-off-by: Armin Kuster <akuster@mvista.com>
|
||||
|
||||
---
|
||||
contrib/vhost-user-gpu/virgl.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
Index: qemu-4.2.0/contrib/vhost-user-gpu/virgl.c
|
||||
===================================================================
|
||||
--- qemu-4.2.0.orig/contrib/vhost-user-gpu/virgl.c
|
||||
+++ qemu-4.2.0/contrib/vhost-user-gpu/virgl.c
|
||||
@@ -132,6 +132,7 @@ virgl_cmd_get_capset_info(VuGpu *g,
|
||||
|
||||
VUGPU_FILL_CMD(info);
|
||||
|
||||
+ memset(&resp, 0, sizeof(resp));
|
||||
if (info.capset_index == 0) {
|
||||
resp.capset_id = VIRTIO_GPU_CAPSET_VIRGL;
|
||||
virgl_renderer_get_cap_set(resp.capset_id,
|
||||
47
meta/recipes-devtools/qemu/qemu/CVE-2021-3546.patch
Normal file
47
meta/recipes-devtools/qemu/qemu/CVE-2021-3546.patch
Normal file
@@ -0,0 +1,47 @@
|
||||
From 9f22893adcb02580aee5968f32baa2cd109b3ec2 Mon Sep 17 00:00:00 2001
|
||||
From: Li Qiang <liq3ea@163.com>
|
||||
Date: Sat, 15 May 2021 20:04:02 -0700
|
||||
Subject: [PATCH] vhost-user-gpu: fix OOB write in 'virgl_cmd_get_capset'
|
||||
(CVE-2021-3546)
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
If 'virgl_cmd_get_capset' set 'max_size' to 0,
|
||||
the 'virgl_renderer_fill_caps' will write the data after the 'resp'.
|
||||
This patch avoid this by checking the returned 'max_size'.
|
||||
|
||||
virtio-gpu fix: abd7f08b23 ("display: virtio-gpu-3d: check
|
||||
virgl capabilities max_size")
|
||||
|
||||
Fixes: CVE-2021-3546
|
||||
Reported-by: Li Qiang <liq3ea@163.com>
|
||||
Reviewed-by: Prasad J Pandit <pjp@fedoraproject.org>
|
||||
Signed-off-by: Li Qiang <liq3ea@163.com>
|
||||
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
|
||||
Message-Id: <20210516030403.107723-8-liq3ea@163.com>
|
||||
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
|
||||
|
||||
Upstream-Status: Backport
|
||||
CVE: CVE-2021-3546
|
||||
Signed-off-by: Armin Kuster <akuster@mvista.com>
|
||||
|
||||
---
|
||||
contrib/vhost-user-gpu/virgl.c | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
Index: qemu-4.2.0/contrib/vhost-user-gpu/virgl.c
|
||||
===================================================================
|
||||
--- qemu-4.2.0.orig/contrib/vhost-user-gpu/virgl.c
|
||||
+++ qemu-4.2.0/contrib/vhost-user-gpu/virgl.c
|
||||
@@ -174,6 +174,10 @@ virgl_cmd_get_capset(VuGpu *g,
|
||||
|
||||
virgl_renderer_get_cap_set(gc.capset_id, &max_ver,
|
||||
&max_size);
|
||||
+ if (!max_size) {
|
||||
+ cmd->error = VIRTIO_GPU_RESP_ERR_INVALID_PARAMETER;
|
||||
+ return;
|
||||
+ }
|
||||
resp = g_malloc0(sizeof(*resp) + max_size);
|
||||
|
||||
resp->hdr.type = VIRTIO_GPU_RESP_OK_CAPSET;
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user