mirror of
https://git.yoctoproject.org/poky
synced 2026-03-17 04:39:40 +01:00
Compare commits
177 Commits
gatesgarth
...
gatesgarth
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
13143ea85a | ||
|
|
686e2a9f47 | ||
|
|
bc71ec0f1d | ||
|
|
264a1c06d4 | ||
|
|
b0a2adf311 | ||
|
|
2a05cec305 | ||
|
|
cfe478f8d3 | ||
|
|
976f69ff1b | ||
|
|
0f6ea144a7 | ||
|
|
cec9cfb059 | ||
|
|
9c1e94752e | ||
|
|
779ca22928 | ||
|
|
f2d2136dbb | ||
|
|
7d3fb188bf | ||
|
|
6a751048e5 | ||
|
|
60c8482769 | ||
|
|
79c4792da2 | ||
|
|
ed4434939c | ||
|
|
1471ca2def | ||
|
|
2d61bddfa5 | ||
|
|
65368059b8 | ||
|
|
2f718bb3c3 | ||
|
|
454dcd199d | ||
|
|
5faaedd8e3 | ||
|
|
1c8bded8ed | ||
|
|
b492191d87 | ||
|
|
78c99742b8 | ||
|
|
d583c78d87 | ||
|
|
22d26f0759 | ||
|
|
3e8da09b5f | ||
|
|
7fbb685c63 | ||
|
|
9bcddff5ca | ||
|
|
912e5fcc4b | ||
|
|
8c373141b7 | ||
|
|
1da8912b03 | ||
|
|
4c9d9b7985 | ||
|
|
008f229249 | ||
|
|
580089c762 | ||
|
|
18cbfe6369 | ||
|
|
207c859da9 | ||
|
|
94a83886ed | ||
|
|
e302900997 | ||
|
|
8679e29df1 | ||
|
|
7594d55a1d | ||
|
|
7d2219bd53 | ||
|
|
5f8ab6eaa7 | ||
|
|
91e4a1c1e1 | ||
|
|
f841c22370 | ||
|
|
849ef02127 | ||
|
|
5aa9ae3984 | ||
|
|
2446ab2622 | ||
|
|
62402e177a | ||
|
|
786cd996ae | ||
|
|
a303c6e376 | ||
|
|
8a49013827 | ||
|
|
fb086586d8 | ||
|
|
ebd1ea905d | ||
|
|
7489588559 | ||
|
|
ee15a42fd0 | ||
|
|
0260fe4044 | ||
|
|
f477a14f9e | ||
|
|
ea4682c61d | ||
|
|
f1b820e368 | ||
|
|
a9b7ac5cf9 | ||
|
|
08665a81dc | ||
|
|
033e3715e6 | ||
|
|
430d1124c9 | ||
|
|
7d600f2169 | ||
|
|
65a55f99e7 | ||
|
|
19fc1d8c27 | ||
|
|
90882c04d5 | ||
|
|
a633251fc8 | ||
|
|
9b9bcb8443 | ||
|
|
03381dda4b | ||
|
|
1e73a6df2e | ||
|
|
c6a72c1cf0 | ||
|
|
9b73242941 | ||
|
|
4aaa1a4f94 | ||
|
|
2d88e1c209 | ||
|
|
ef8583231a | ||
|
|
b215bdfbde | ||
|
|
d5d99f8594 | ||
|
|
33747b73cc | ||
|
|
09cc67b9da | ||
|
|
7cd15f2e65 | ||
|
|
dee8235c61 | ||
|
|
e4720d0883 | ||
|
|
844a850e46 | ||
|
|
f484b4e183 | ||
|
|
a93d0c1f6d | ||
|
|
26d01d44fb | ||
|
|
867a2067b2 | ||
|
|
0ddc879d61 | ||
|
|
b1cfaaa574 | ||
|
|
6ed895d2b2 | ||
|
|
c3ed60b147 | ||
|
|
12d767f88c | ||
|
|
f943f43cc1 | ||
|
|
1c0cb223c5 | ||
|
|
d4717c095b | ||
|
|
b31f266193 | ||
|
|
bab310bf0f | ||
|
|
631940f199 | ||
|
|
22424ef670 | ||
|
|
02c47f0892 | ||
|
|
bd513ea099 | ||
|
|
edc8051bc0 | ||
|
|
e4f5e6a39b | ||
|
|
30d921b46a | ||
|
|
fce639f1eb | ||
|
|
09cb090549 | ||
|
|
f77d5bf0d4 | ||
|
|
c623e03ca8 | ||
|
|
94cd506ff2 | ||
|
|
f1249679ca | ||
|
|
adeda0b970 | ||
|
|
edb299e2ba | ||
|
|
8b9b189c2e | ||
|
|
0b0067e432 | ||
|
|
56d8cb8a97 | ||
|
|
e35f1eef03 | ||
|
|
6bf6d80b17 | ||
|
|
2f94f81479 | ||
|
|
462b40d819 | ||
|
|
45d0de3cdf | ||
|
|
591609738e | ||
|
|
adffa47daf | ||
|
|
37448a2251 | ||
|
|
3be4d4e2c3 | ||
|
|
8ae5a32559 | ||
|
|
f30d83ad4e | ||
|
|
fecf21863f | ||
|
|
aadac9ddbf | ||
|
|
4e4523aae4 | ||
|
|
2c69b69d69 | ||
|
|
3f2a97c3be | ||
|
|
d63c5f0d45 | ||
|
|
ebecd278de | ||
|
|
bb6ad86558 | ||
|
|
3a7c2e82d0 | ||
|
|
5386ab7aa4 | ||
|
|
ec877cbf3f | ||
|
|
0d87f87894 | ||
|
|
51c48e60f3 | ||
|
|
3c79df1465 | ||
|
|
75a7326f4e | ||
|
|
b876718823 | ||
|
|
0298de9a8a | ||
|
|
c8dc8687b7 | ||
|
|
6bc15eb887 | ||
|
|
4119c8e247 | ||
|
|
cd0fb6c0e7 | ||
|
|
b0a4a761aa | ||
|
|
ea1720b2fb | ||
|
|
ceb37a91c1 | ||
|
|
b43ba849f9 | ||
|
|
0d3ddf4ada | ||
|
|
af3a007ce2 | ||
|
|
d907873a54 | ||
|
|
1ff574dd16 | ||
|
|
94e5e60156 | ||
|
|
900b3f0782 | ||
|
|
95c5a1a2f6 | ||
|
|
2c2ce8063b | ||
|
|
ccfa84bf18 | ||
|
|
316333ec91 | ||
|
|
0b80065bea | ||
|
|
7bec49614c | ||
|
|
764b0f9f5e | ||
|
|
e3b307a4e3 | ||
|
|
dfd91796bd | ||
|
|
f651389dfa | ||
|
|
c0f7e0cf02 | ||
|
|
126fed5e60 | ||
|
|
c08762baeb | ||
|
|
e63e8599d8 | ||
|
|
1874f7f505 |
@@ -26,7 +26,7 @@ readypipeinfd = int(sys.argv[3])
|
||||
logfile = sys.argv[4]
|
||||
lockname = sys.argv[5]
|
||||
sockname = sys.argv[6]
|
||||
timeout = sys.argv[7]
|
||||
timeout = float(sys.argv[7])
|
||||
xmlrpcinterface = (sys.argv[8], int(sys.argv[9]))
|
||||
if xmlrpcinterface[0] == "None":
|
||||
xmlrpcinterface = (None, xmlrpcinterface[1])
|
||||
|
||||
@@ -49,7 +49,7 @@ class BBLoggerMixin(object):
|
||||
if not bb.event.worker_pid:
|
||||
if self.name in bb.msg.loggerDefaultDomains and loglevel > (bb.msg.loggerDefaultDomains[self.name]):
|
||||
return
|
||||
if loglevel > bb.msg.loggerDefaultLogLevel:
|
||||
if loglevel < bb.msg.loggerDefaultLogLevel:
|
||||
return
|
||||
return self.log(loglevel, msg, *args, **kwargs)
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ import re
|
||||
|
||||
logger = logging.getLogger("BitBake.Cache")
|
||||
|
||||
__cache_version__ = "153"
|
||||
__cache_version__ = "154"
|
||||
|
||||
def getCacheFile(path, filename, mc, data_hash):
|
||||
mcspec = ''
|
||||
@@ -94,6 +94,7 @@ class CoreRecipeInfo(RecipeInfoCommon):
|
||||
if not self.packages:
|
||||
self.packages.append(self.pn)
|
||||
self.packages_dynamic = self.listvar('PACKAGES_DYNAMIC', metadata)
|
||||
self.rprovides_pkg = self.pkgvar('RPROVIDES', self.packages, metadata)
|
||||
|
||||
self.skipreason = self.getvar('__SKIPPED', metadata)
|
||||
if self.skipreason:
|
||||
@@ -120,7 +121,6 @@ class CoreRecipeInfo(RecipeInfoCommon):
|
||||
self.depends = self.depvar('DEPENDS', metadata)
|
||||
self.rdepends = self.depvar('RDEPENDS', metadata)
|
||||
self.rrecommends = self.depvar('RRECOMMENDS', metadata)
|
||||
self.rprovides_pkg = self.pkgvar('RPROVIDES', self.packages, metadata)
|
||||
self.rdepends_pkg = self.pkgvar('RDEPENDS', self.packages, metadata)
|
||||
self.rrecommends_pkg = self.pkgvar('RRECOMMENDS', self.packages, metadata)
|
||||
self.inherits = self.getvar('__inherit_cache', metadata, expand=False)
|
||||
|
||||
@@ -73,7 +73,9 @@ class SkippedPackage:
|
||||
self.pn = info.pn
|
||||
self.skipreason = info.skipreason
|
||||
self.provides = info.provides
|
||||
self.rprovides = info.rprovides
|
||||
self.rprovides = info.packages + info.rprovides
|
||||
for package in info.packages:
|
||||
self.rprovides += info.rprovides_pkg[package]
|
||||
elif reason:
|
||||
self.skipreason = reason
|
||||
|
||||
@@ -2207,18 +2209,18 @@ class CookerParser(object):
|
||||
except bb.BBHandledException as exc:
|
||||
self.error += 1
|
||||
logger.error('Failed to parse recipe: %s' % exc.recipe)
|
||||
self.shutdown(clean=False)
|
||||
self.shutdown(clean=False, force=True)
|
||||
return False
|
||||
except ParsingFailure as exc:
|
||||
self.error += 1
|
||||
logger.error('Unable to parse %s: %s' %
|
||||
(exc.recipe, bb.exceptions.to_string(exc.realexception)))
|
||||
self.shutdown(clean=False)
|
||||
self.shutdown(clean=False, force=True)
|
||||
return False
|
||||
except bb.parse.ParseError as exc:
|
||||
self.error += 1
|
||||
logger.error(str(exc))
|
||||
self.shutdown(clean=False)
|
||||
self.shutdown(clean=False, force=True)
|
||||
return False
|
||||
except bb.data_smart.ExpansionError as exc:
|
||||
self.error += 1
|
||||
@@ -2227,7 +2229,7 @@ class CookerParser(object):
|
||||
tb = list(itertools.dropwhile(lambda e: e.filename.startswith(bbdir), exc.traceback))
|
||||
logger.error('ExpansionError during parsing %s', value.recipe,
|
||||
exc_info=(etype, value, tb))
|
||||
self.shutdown(clean=False)
|
||||
self.shutdown(clean=False, force=True)
|
||||
return False
|
||||
except Exception as exc:
|
||||
self.error += 1
|
||||
@@ -2239,7 +2241,7 @@ class CookerParser(object):
|
||||
# Most likely, an exception occurred during raising an exception
|
||||
import traceback
|
||||
logger.error('Exception during parse: %s' % traceback.format_exc())
|
||||
self.shutdown(clean=False)
|
||||
self.shutdown(clean=False, force=True)
|
||||
return False
|
||||
|
||||
self.current += 1
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -141,6 +141,10 @@ class Git(FetchMethod):
|
||||
ud.proto = 'file'
|
||||
else:
|
||||
ud.proto = "git"
|
||||
if ud.host == "github.com" and ud.proto == "git":
|
||||
# github stopped supporting git protocol
|
||||
# https://github.blog/2021-09-01-improving-git-protocol-security-github/#no-more-unauthenticated-git
|
||||
ud.proto = "https"
|
||||
|
||||
if not ud.proto in ('git', 'file', 'ssh', 'http', 'https', 'rsync'):
|
||||
raise bb.fetch2.ParameterError("Invalid protocol type", ud.url)
|
||||
@@ -389,7 +393,7 @@ class Git(FetchMethod):
|
||||
tmpdir = tempfile.mkdtemp(dir=d.getVar('DL_DIR'))
|
||||
try:
|
||||
# Do the checkout. This implicitly involves a Git LFS fetch.
|
||||
self.unpack(ud, tmpdir, d)
|
||||
Git.unpack(self, ud, tmpdir, d)
|
||||
|
||||
# Scoop up a copy of any stuff that Git LFS downloaded. Merge them into
|
||||
# the bare clonedir.
|
||||
|
||||
@@ -316,7 +316,7 @@ class Wget(FetchMethod):
|
||||
except (TypeError, ImportError, IOError, netrc.NetrcParseError):
|
||||
pass
|
||||
|
||||
with opener.open(r) as response:
|
||||
with opener.open(r, timeout=30) as response:
|
||||
pass
|
||||
except urllib.error.URLError as e:
|
||||
if try_again:
|
||||
|
||||
@@ -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.info("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.info("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)
|
||||
|
||||
|
||||
@@ -1942,6 +1942,10 @@ class RunQueueExecute:
|
||||
logger.error("Scenequeue had holdoff tasks: %s" % pprint.pformat(self.holdoff_tasks))
|
||||
err = True
|
||||
|
||||
for tid in self.scenequeue_covered.intersection(self.scenequeue_notcovered):
|
||||
# No task should end up in both covered and uncovered, that is a bug.
|
||||
logger.error("Setscene task %s in both covered and notcovered." % tid)
|
||||
|
||||
for tid in self.rqdata.runq_setscene_tids:
|
||||
if tid not in self.scenequeue_covered and tid not in self.scenequeue_notcovered:
|
||||
err = True
|
||||
@@ -2430,6 +2434,9 @@ class RunQueueExecute:
|
||||
|
||||
for dep in sorted(self.sqdata.sq_deps[task]):
|
||||
if fail and task in self.sqdata.sq_harddeps and dep in self.sqdata.sq_harddeps[task]:
|
||||
if dep in self.scenequeue_covered or dep in self.scenequeue_notcovered:
|
||||
# dependency could be already processed, e.g. noexec setscene task
|
||||
continue
|
||||
logger.debug(2, "%s was unavailable and is a hard dependency of %s so skipping" % (task, dep))
|
||||
self.sq_task_failoutright(dep)
|
||||
continue
|
||||
@@ -2791,6 +2798,7 @@ def update_scenequeue_data(tids, sqdata, rqdata, rq, cooker, stampcache, sqrq, s
|
||||
sqdata.valid |= rq.validate_hashes(tocheck, cooker.data, len(sqdata.stamppresent), False, summary=summary)
|
||||
|
||||
sqdata.hashes = {}
|
||||
sqrq.sq_deferred = {}
|
||||
for mc in sorted(sqdata.multiconfigs):
|
||||
for tid in sorted(sqdata.sq_revdeps):
|
||||
if mc_from_tid(tid) != mc:
|
||||
@@ -2803,6 +2811,9 @@ def update_scenequeue_data(tids, sqdata, rqdata, rq, cooker, stampcache, sqrq, s
|
||||
continue
|
||||
if tid in sqrq.scenequeue_notcovered:
|
||||
continue
|
||||
if tid in sqrq.scenequeue_covered:
|
||||
continue
|
||||
|
||||
sqdata.outrightfail.add(tid)
|
||||
|
||||
h = pending_hash_index(tid, rqdata)
|
||||
|
||||
@@ -509,7 +509,7 @@ class BitBakeServer(object):
|
||||
os.set_inheritable(self.bitbake_lock.fileno(), True)
|
||||
os.set_inheritable(self.readypipein, True)
|
||||
serverscript = os.path.realpath(os.path.dirname(__file__) + "/../../../bin/bitbake-server")
|
||||
os.execl(sys.executable, "bitbake-server", serverscript, "decafbad", str(self.bitbake_lock.fileno()), str(self.readypipein), self.logfile, self.bitbake_lock.name, self.sockname, str(self.server_timeout), str(self.xmlrpcinterface[0]), str(self.xmlrpcinterface[1]))
|
||||
os.execl(sys.executable, "bitbake-server", serverscript, "decafbad", str(self.bitbake_lock.fileno()), str(self.readypipein), self.logfile, self.bitbake_lock.name, self.sockname, str(self.server_timeout or 0), str(self.xmlrpcinterface[0]), str(self.xmlrpcinterface[1]))
|
||||
|
||||
def execServer(lockfd, readypipeinfd, lockname, sockname, server_timeout, xmlrpcinterface):
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -939,7 +939,7 @@ class FetcherNetworkTest(FetcherTest):
|
||||
|
||||
@skipIfNoNetwork()
|
||||
def test_git_submodule_CLI11(self):
|
||||
url = "gitsm://github.com/CLIUtils/CLI11;protocol=git;rev=bd4dc911847d0cde7a6b41dfa626a85aab213baf"
|
||||
url = "gitsm://github.com/CLIUtils/CLI11;protocol=git;rev=bd4dc911847d0cde7a6b41dfa626a85aab213baf;branch=main"
|
||||
fetcher = bb.fetch.Fetch([url], self.d)
|
||||
fetcher.download()
|
||||
# Previous cwd has been deleted
|
||||
@@ -954,12 +954,12 @@ class FetcherNetworkTest(FetcherTest):
|
||||
@skipIfNoNetwork()
|
||||
def test_git_submodule_update_CLI11(self):
|
||||
""" Prevent regression on update detection not finding missing submodule, or modules without needed commits """
|
||||
url = "gitsm://github.com/CLIUtils/CLI11;protocol=git;rev=cf6a99fa69aaefe477cc52e3ef4a7d2d7fa40714"
|
||||
url = "gitsm://github.com/CLIUtils/CLI11;protocol=git;rev=cf6a99fa69aaefe477cc52e3ef4a7d2d7fa40714;branch=main"
|
||||
fetcher = bb.fetch.Fetch([url], self.d)
|
||||
fetcher.download()
|
||||
|
||||
# CLI11 that pulls in a newer nlohmann-json
|
||||
url = "gitsm://github.com/CLIUtils/CLI11;protocol=git;rev=49ac989a9527ee9bb496de9ded7b4872c2e0e5ca"
|
||||
url = "gitsm://github.com/CLIUtils/CLI11;protocol=git;rev=49ac989a9527ee9bb496de9ded7b4872c2e0e5ca;branch=main"
|
||||
fetcher = bb.fetch.Fetch([url], self.d)
|
||||
fetcher.download()
|
||||
# Previous cwd has been deleted
|
||||
@@ -993,7 +993,7 @@ class FetcherNetworkTest(FetcherTest):
|
||||
""" Prevent regression on deeply nested submodules not being checked out properly, even though they were fetched. """
|
||||
|
||||
# This repository also has submodules where the module (name), path and url do not align
|
||||
url = "gitsm://github.com/azure/iotedge.git;protocol=git;rev=d76e0316c6f324345d77c48a83ce836d09392699"
|
||||
url = "gitsm://github.com/azure/iotedge.git;protocol=git;rev=d76e0316c6f324345d77c48a83ce836d09392699;branch=main"
|
||||
fetcher = bb.fetch.Fetch([url], self.d)
|
||||
fetcher.download()
|
||||
# Previous cwd has been deleted
|
||||
@@ -1180,7 +1180,7 @@ class FetchLatestVersionTest(FetcherTest):
|
||||
("presentproto", "git://git.yoctoproject.org/bbfetchtests-presentproto", "24f3a56e541b0a9e6c6ee76081f441221a120ef9", "")
|
||||
: "1.0",
|
||||
# version pattern "pkg_name-vX.Y.Z"
|
||||
("dtc", "git://git.qemu.org/dtc.git", "65cc4d2748a2c2e6f27f1cf39e07a5dbabd80ebf", "")
|
||||
("dtc", "git://git.yoctoproject.org/bbfetchtests-dtc.git", "65cc4d2748a2c2e6f27f1cf39e07a5dbabd80ebf", "")
|
||||
: "1.4.0",
|
||||
# combination version pattern
|
||||
("sysprof", "git://gitlab.gnome.org/GNOME/sysprof.git;protocol=https", "cd44ee6644c3641507fb53b8a2a69137f2971219", "")
|
||||
|
||||
@@ -15,8 +15,27 @@
|
||||
import os
|
||||
import sys
|
||||
import datetime
|
||||
try:
|
||||
import yaml
|
||||
except ImportError:
|
||||
sys.stderr.write("The Yocto Project Sphinx documentation requires PyYAML.\
|
||||
\nPlease make sure to install pyyaml python package.\n")
|
||||
sys.exit(1)
|
||||
|
||||
current_version = "3.2.1"
|
||||
# current_version = "dev"
|
||||
# bitbake_version = "" # Leave empty for development branch
|
||||
# Obtain versions from poky.yaml instead
|
||||
with open("poky.yaml") as data:
|
||||
buff = data.read()
|
||||
subst_vars = yaml.safe_load(buff)
|
||||
if "DOCCONF_VERSION" not in subst_vars:
|
||||
sys.stderr.write("Please set DOCCONF_VERSION in poky.yaml")
|
||||
sys.exit(1)
|
||||
current_version = subst_vars["DOCCONF_VERSION"]
|
||||
if "BITBAKE_SERIES" not in subst_vars:
|
||||
sys.stderr.write("Please set BITBAKE_SERIES in poky.yaml")
|
||||
sys.exit(1)
|
||||
bitbake_version = subst_vars["BITBAKE_SERIES"]
|
||||
|
||||
# String used in sidebar
|
||||
version = 'Version: ' + current_version
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
DISTRO : "3.2.1"
|
||||
DISTRO : "3.2.4"
|
||||
DISTRO_NAME_NO_CAP : "gatesgarth"
|
||||
DISTRO_NAME : "Gatesgarth"
|
||||
DISTRO_NAME_NO_CAP_MINUS_ONE : "dunfell"
|
||||
YOCTO_DOC_VERSION : "3.2.1"
|
||||
YOCTO_DOC_VERSION_MINUS_ONE : "3.1.3"
|
||||
DISTRO_REL_TAG : "yocto-3.2.1"
|
||||
POKYVERSION : "24.0.1"
|
||||
YOCTO_DOC_VERSION : "3.2.4"
|
||||
YOCTO_DOC_VERSION_MINUS_ONE : "3.1.7"
|
||||
DISTRO_REL_TAG : "yocto-3.2.4"
|
||||
DOCCONF_VERSION : "3.2.4"
|
||||
BITBAKE_SERIES : "1.48"
|
||||
POKYVERSION : "24.0.4"
|
||||
YOCTO_POKY : "poky-&DISTRO_NAME_NO_CAP;-&POKYVERSION;"
|
||||
YOCTO_DL_URL : "https://downloads.yoctoproject.org"
|
||||
YOCTO_AB_URL : "https://autobuilder.yoctoproject.org"
|
||||
|
||||
@@ -9,6 +9,10 @@
|
||||
*******************************
|
||||
|
||||
- :yocto_docs:`3.2 Documentation </3.2>`
|
||||
- :yocto_docs:`3.2.1 Documentation </3.2.1>`
|
||||
- :yocto_docs:`3.2.2 Documentation </3.2.2>`
|
||||
- :yocto_docs:`3.2.3 Documentation </3.2.3>`
|
||||
- :yocto_docs:`3.2.4 Documentation </3.2.4>`
|
||||
|
||||
****************************
|
||||
3.1 'dunfell' Release Series
|
||||
@@ -18,6 +22,10 @@
|
||||
- :yocto_docs:`3.1.1 Documentation </3.1.1>`
|
||||
- :yocto_docs:`3.1.2 Documentation </3.1.2>`
|
||||
- :yocto_docs:`3.1.3 Documentation </3.1.3>`
|
||||
- :yocto_docs:`3.1.4 Documentation </3.1.4>`
|
||||
- :yocto_docs:`3.1.5 Documentation </3.1.5>`
|
||||
- :yocto_docs:`3.1.6 Documentation </3.1.6>`
|
||||
- :yocto_docs:`3.1.7 Documentation </3.1.7>`
|
||||
|
||||
==========================
|
||||
Previous Release Manuals
|
||||
@@ -31,6 +39,7 @@
|
||||
- :yocto_docs:`3.0.1 Documentation </3.0.1>`
|
||||
- :yocto_docs:`3.0.2 Documentation </3.0.2>`
|
||||
- :yocto_docs:`3.0.3 Documentation </3.0.3>`
|
||||
- :yocto_docs:`3.0.4 Documentation </3.0.4>`
|
||||
|
||||
****************************
|
||||
2.7 'warrior' Release Series
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
DISTRO = "poky"
|
||||
DISTRO_NAME = "Poky (Yocto Project Reference Distro)"
|
||||
DISTRO_VERSION = "3.2.2"
|
||||
DISTRO_VERSION = "3.2.4"
|
||||
DISTRO_CODENAME = "gatesgarth"
|
||||
SDK_VENDOR = "-pokysdk"
|
||||
SDK_VERSION = "${@d.getVar('DISTRO_VERSION').replace('snapshot-${DATE}', 'snapshot')}"
|
||||
|
||||
@@ -7,8 +7,8 @@ KMACHINE_genericx86 ?= "common-pc"
|
||||
KMACHINE_genericx86-64 ?= "common-pc-64"
|
||||
KMACHINE_beaglebone-yocto ?= "beaglebone"
|
||||
|
||||
SRCREV_machine_genericx86 ?= "292d752af8e4015e40e7c523641983bac543e2b4"
|
||||
SRCREV_machine_genericx86-64 ?= "292d752af8e4015e40e7c523641983bac543e2b4"
|
||||
SRCREV_machine_genericx86 ?= "31db2b47ac7d8508080fbb7344399b501216de66"
|
||||
SRCREV_machine_genericx86-64 ?= "31db2b47ac7d8508080fbb7344399b501216de66"
|
||||
SRCREV_machine_edgerouter ?= "706efec4c1e270ec5dda92275898cd465dfdc7dd"
|
||||
SRCREV_machine_beaglebone-yocto ?= "706efec4c1e270ec5dda92275898cd465dfdc7dd"
|
||||
|
||||
@@ -17,7 +17,7 @@ COMPATIBLE_MACHINE_genericx86-64 = "genericx86-64"
|
||||
COMPATIBLE_MACHINE_edgerouter = "edgerouter"
|
||||
COMPATIBLE_MACHINE_beaglebone-yocto = "beaglebone-yocto"
|
||||
|
||||
LINUX_VERSION_genericx86 = "5.4.87"
|
||||
LINUX_VERSION_genericx86-64 = "5.4.87"
|
||||
LINUX_VERSION_genericx86 = "5.4.94"
|
||||
LINUX_VERSION_genericx86-64 = "5.4.94"
|
||||
LINUX_VERSION_edgerouter = "5.4.58"
|
||||
LINUX_VERSION_beaglebone-yocto = "5.4.58"
|
||||
|
||||
@@ -674,13 +674,16 @@ IMAGE_POSTPROCESS_COMMAND[vardepsexclude] += "buildhistory_get_imageinfo"
|
||||
POPULATE_SDK_POST_TARGET_COMMAND_append = " buildhistory_list_installed_sdk_target;"
|
||||
POPULATE_SDK_POST_TARGET_COMMAND_append = " buildhistory_get_sdk_installed_target;"
|
||||
POPULATE_SDK_POST_TARGET_COMMAND[vardepvalueexclude] .= "| buildhistory_list_installed_sdk_target;| buildhistory_get_sdk_installed_target;"
|
||||
POPULATE_SDK_POST_TARGET_COMMAND[vardepsexclude] += "buildhistory_list_installed_sdk_target buildhistory_get_sdk_installed_target"
|
||||
|
||||
POPULATE_SDK_POST_HOST_COMMAND_append = " buildhistory_list_installed_sdk_host;"
|
||||
POPULATE_SDK_POST_HOST_COMMAND_append = " buildhistory_get_sdk_installed_host;"
|
||||
POPULATE_SDK_POST_HOST_COMMAND[vardepvalueexclude] .= "| buildhistory_list_installed_sdk_host;| buildhistory_get_sdk_installed_host;"
|
||||
POPULATE_SDK_POST_HOST_COMMAND[vardepsexclude] += "buildhistory_list_installed_sdk_host buildhistory_get_sdk_installed_host"
|
||||
|
||||
SDK_POSTPROCESS_COMMAND_append = " buildhistory_get_sdkinfo ; buildhistory_get_extra_sdkinfo; "
|
||||
SDK_POSTPROCESS_COMMAND[vardepvalueexclude] .= "| buildhistory_get_sdkinfo ; buildhistory_get_extra_sdkinfo; "
|
||||
SDK_POSTPROCESS_COMMAND[vardepsexclude] += "buildhistory_get_sdkinfo buildhistory_get_extra_sdkinfo"
|
||||
|
||||
python buildhistory_write_sigs() {
|
||||
if not "task" in (d.getVar('BUILDHISTORY_FEATURES') or "").split():
|
||||
|
||||
@@ -53,6 +53,13 @@ CVE_CHECK_PN_WHITELIST ?= ""
|
||||
#
|
||||
CVE_CHECK_WHITELIST ?= ""
|
||||
|
||||
# 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 increament release
|
||||
CVE_VERSION_SUFFIX ??= ""
|
||||
|
||||
@@ -334,7 +341,20 @@ 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]
|
||||
|
||||
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://web.nvd.nist.gov/view/vuln/detail?vulnId="
|
||||
write_string = ""
|
||||
unpatched_cves = []
|
||||
@@ -344,6 +364,7 @@ def cve_write_data(d, patched, unpatched, whitelisted, cve_data):
|
||||
is_patched = cve in patched
|
||||
if is_patched and (d.getVar("CVE_CHECK_REPORT_PATCHED") != "1"):
|
||||
continue
|
||||
write_string += "LAYER: %s\n" % layer
|
||||
write_string += "PACKAGE NAME: %s\n" % d.getVar("PN")
|
||||
write_string += "PACKAGE VERSION: %s%s\n" % (d.getVar("EXTENDPE"), d.getVar("PV"))
|
||||
write_string += "CVE: %s\n" % cve
|
||||
|
||||
@@ -128,6 +128,7 @@ def devpyshell(d):
|
||||
more = i.runsource(source, "<pyshell>")
|
||||
if not more:
|
||||
buf = []
|
||||
sys.stderr.flush()
|
||||
prompt(more)
|
||||
except KeyboardInterrupt:
|
||||
i.write("\nKeyboardInterrupt\n")
|
||||
|
||||
@@ -68,6 +68,7 @@ python () {
|
||||
url_data = fetch.ud[url]
|
||||
parm = url_data.parm
|
||||
if (url_data.type == 'file' or
|
||||
url_data.type == 'npmsw' or
|
||||
'type' in parm and parm['type'] == 'kmeta'):
|
||||
local_srcuri.append(url)
|
||||
|
||||
@@ -219,11 +220,12 @@ def srctree_hash_files(d, srcdir=None):
|
||||
submodule_helper = subprocess.check_output(['git', 'submodule--helper', 'list'], cwd=s_dir, env=env).decode("utf-8")
|
||||
for line in submodule_helper.splitlines():
|
||||
module_dir = os.path.join(s_dir, line.rsplit(maxsplit=1)[1])
|
||||
proc = subprocess.Popen(['git', 'add', '-A', '.'], cwd=module_dir, env=env, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
|
||||
proc.communicate()
|
||||
proc = subprocess.Popen(['git', 'write-tree'], cwd=module_dir, env=env, stdout=subprocess.PIPE, stderr=subprocess.DEVNULL)
|
||||
stdout, _ = proc.communicate()
|
||||
git_sha1 += stdout.decode("utf-8")
|
||||
if os.path.isdir(module_dir):
|
||||
proc = subprocess.Popen(['git', 'add', '-A', '.'], cwd=module_dir, env=env, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
|
||||
proc.communicate()
|
||||
proc = subprocess.Popen(['git', 'write-tree'], cwd=module_dir, env=env, stdout=subprocess.PIPE, stderr=subprocess.DEVNULL)
|
||||
stdout, _ = proc.communicate()
|
||||
git_sha1 += stdout.decode("utf-8")
|
||||
sha1 = hashlib.sha1(git_sha1.encode("utf-8")).hexdigest()
|
||||
with open(oe_hash_file, 'w') as fobj:
|
||||
fobj.write(sha1)
|
||||
|
||||
@@ -30,7 +30,7 @@ do_bootimg[depends] += "dosfstools-native:do_populate_sysroot \
|
||||
virtual/kernel:do_deploy \
|
||||
${MLPREFIX}syslinux:do_populate_sysroot \
|
||||
syslinux-native:do_populate_sysroot \
|
||||
${PN}:do_image_${@d.getVar('LIVE_ROOTFS_TYPE').replace('-', '_')} \
|
||||
${@'%s:do_image_%s' % (d.getVar('PN'), d.getVar('LIVE_ROOTFS_TYPE').replace('-', '_')) if d.getVar('ROOTFS') else ''} \
|
||||
"
|
||||
|
||||
|
||||
|
||||
@@ -112,7 +112,7 @@ def rootfs_command_variables(d):
|
||||
'IMAGE_PREPROCESS_COMMAND','RPM_PREPROCESS_COMMANDS','RPM_POSTPROCESS_COMMANDS','DEB_PREPROCESS_COMMANDS','DEB_POSTPROCESS_COMMANDS']
|
||||
|
||||
python () {
|
||||
variables = rootfs_command_variables(d) + sdk_command_variables(d)
|
||||
variables = rootfs_command_variables(d)
|
||||
for var in variables:
|
||||
if d.getVar(var, False):
|
||||
d.setVarFlag(var, 'func', '1')
|
||||
@@ -180,6 +180,8 @@ IMAGE_LOCALES_ARCHIVE ?= '1'
|
||||
# aren't yet available.
|
||||
PSEUDO_PASSWD = "${IMAGE_ROOTFS}:${STAGING_DIR_NATIVE}"
|
||||
|
||||
PSEUDO_IGNORE_PATHS .= ",${WORKDIR}/intercept_scripts,${WORKDIR}/oe-rootfs-repo,${WORKDIR}/sstate-build-image_complete"
|
||||
|
||||
PACKAGE_EXCLUDE ??= ""
|
||||
PACKAGE_EXCLUDE[type] = "list"
|
||||
|
||||
|
||||
@@ -175,7 +175,7 @@ def package_qa_check_useless_rpaths(file, name, d, elf, messages):
|
||||
if rpath_eq(rpath, libdir) or rpath_eq(rpath, base_libdir):
|
||||
# The dynamic linker searches both these places anyway. There is no point in
|
||||
# looking there again.
|
||||
package_qa_add_message(messages, "useless-rpaths", "%s: %s contains probably-redundant RPATH %s" % (name, package_qa_clean_path(file, d), rpath))
|
||||
package_qa_add_message(messages, "useless-rpaths", "%s: %s contains probably-redundant RPATH %s" % (name, package_qa_clean_path(file, d, name), rpath))
|
||||
|
||||
QAPATHTEST[dev-so] = "package_qa_check_dev"
|
||||
def package_qa_check_dev(path, name, d, elf, messages):
|
||||
@@ -184,8 +184,8 @@ def package_qa_check_dev(path, name, d, elf, messages):
|
||||
"""
|
||||
|
||||
if not name.endswith("-dev") and not name.endswith("-dbg") and not name.endswith("-ptest") and not name.startswith("nativesdk-") and path.endswith(".so") and os.path.islink(path):
|
||||
package_qa_add_message(messages, "dev-so", "non -dev/-dbg/nativesdk- package contains symlink .so: %s path '%s'" % \
|
||||
(name, package_qa_clean_path(path,d)))
|
||||
package_qa_add_message(messages, "dev-so", "non -dev/-dbg/nativesdk- package %s contains symlink .so '%s'" % \
|
||||
(name, package_qa_clean_path(path, d, name)))
|
||||
|
||||
QAPATHTEST[dev-elf] = "package_qa_check_dev_elf"
|
||||
def package_qa_check_dev_elf(path, name, d, elf, messages):
|
||||
@@ -195,8 +195,8 @@ def package_qa_check_dev_elf(path, name, d, elf, messages):
|
||||
install link-time .so files that are linker scripts.
|
||||
"""
|
||||
if name.endswith("-dev") and path.endswith(".so") and not os.path.islink(path) and elf:
|
||||
package_qa_add_message(messages, "dev-elf", "-dev package contains non-symlink .so: %s path '%s'" % \
|
||||
(name, package_qa_clean_path(path,d)))
|
||||
package_qa_add_message(messages, "dev-elf", "-dev package %s contains non-symlink .so '%s'" % \
|
||||
(name, package_qa_clean_path(path, d, name)))
|
||||
|
||||
QAPATHTEST[staticdev] = "package_qa_check_staticdev"
|
||||
def package_qa_check_staticdev(path, name, d, elf, messages):
|
||||
@@ -209,7 +209,7 @@ def package_qa_check_staticdev(path, name, d, elf, messages):
|
||||
|
||||
if not name.endswith("-pic") and not name.endswith("-staticdev") and not name.endswith("-ptest") and path.endswith(".a") and not path.endswith("_nonshared.a") and not '/usr/lib/debug-static/' in path and not '/.debug-static/' in path:
|
||||
package_qa_add_message(messages, "staticdev", "non -staticdev package contains static .a library: %s path '%s'" % \
|
||||
(name, package_qa_clean_path(path,d)))
|
||||
(name, package_qa_clean_path(path,d, name)))
|
||||
|
||||
QAPATHTEST[mime] = "package_qa_check_mime"
|
||||
def package_qa_check_mime(path, name, d, elf, messages):
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
# Support for device tree generation
|
||||
PACKAGES_append = " \
|
||||
${KERNEL_PACKAGE_NAME}-devicetree \
|
||||
${@[d.getVar('KERNEL_PACKAGE_NAME') + '-image-zimage-bundle', ''][d.getVar('KERNEL_DEVICETREE_BUNDLE') != '1']} \
|
||||
"
|
||||
python () {
|
||||
if not bb.data.inherits_class('nopackages', d):
|
||||
d.appendVar("PACKAGES", " ${KERNEL_PACKAGE_NAME}-devicetree")
|
||||
if d.getVar('KERNEL_DEVICETREE_BUNDLE') == '1':
|
||||
d.appendVar("PACKAGES", " ${KERNEL_PACKAGE_NAME}-image-zimage-bundle")
|
||||
}
|
||||
|
||||
FILES_${KERNEL_PACKAGE_NAME}-devicetree = "/${KERNEL_IMAGEDEST}/*.dtb /${KERNEL_IMAGEDEST}/*.dtbo"
|
||||
FILES_${KERNEL_PACKAGE_NAME}-image-zimage-bundle = "/${KERNEL_IMAGEDEST}/zImage-*.dtb.bin"
|
||||
|
||||
|
||||
@@ -90,6 +90,8 @@ python __anonymous () {
|
||||
imagedest = d.getVar('KERNEL_IMAGEDEST')
|
||||
|
||||
for type in types.split():
|
||||
if bb.data.inherits_class('nopackages', d):
|
||||
continue
|
||||
typelower = type.lower()
|
||||
d.appendVar('PACKAGES', ' %s-image-%s' % (kname, typelower))
|
||||
d.setVar('FILES_' + kname + '-image-' + typelower, '/' + imagedest + '/' + type + '-${KERNEL_VERSION_NAME}' + ' /' + imagedest + '/' + type)
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
inherit python3native
|
||||
|
||||
DEPENDS_prepend = "nodejs-native "
|
||||
RDEPENDS_${PN}_prepend = "nodejs "
|
||||
RDEPENDS_${PN}_append_class-target = " nodejs"
|
||||
|
||||
NPM_INSTALL_DEV ?= "0"
|
||||
|
||||
|
||||
@@ -687,6 +687,7 @@ python do_package_rpm () {
|
||||
cmd = cmd + " --define '_binary_payload w6T.xzdio'"
|
||||
cmd = cmd + " --define '_source_payload w6T.xzdio'"
|
||||
cmd = cmd + " --define 'clamp_mtime_to_source_date_epoch 1'"
|
||||
cmd = cmd + " --define 'use_source_date_epoch_as_buildtime 1'"
|
||||
cmd = cmd + " --define '_buildhost reproducible'"
|
||||
if perfiledeps:
|
||||
cmd = cmd + " --define '__find_requires " + outdepends + "'"
|
||||
|
||||
@@ -178,7 +178,7 @@ do_populate_sdk[sstate-inputdirs] = "${SDKDEPLOYDIR}"
|
||||
do_populate_sdk[sstate-outputdirs] = "${SDK_DEPLOY}"
|
||||
do_populate_sdk[stamp-extra-info] = "${MACHINE_ARCH}${SDKMACHINE}"
|
||||
|
||||
PSEUDO_IGNORE_PATHS .= ",${SDKDEPLOYDIR}"
|
||||
PSEUDO_IGNORE_PATHS .= ",${SDKDEPLOYDIR},${WORKDIR}/oe-sdk-repo,${WORKDIR}/sstate-build-populate_sdk"
|
||||
|
||||
fakeroot create_sdk_files() {
|
||||
cp ${COREBASE}/scripts/relocate_sdk.py ${SDK_OUTPUT}/${SDKPATH}/
|
||||
@@ -329,6 +329,13 @@ def sdk_variables(d):
|
||||
|
||||
do_populate_sdk[vardeps] += "${@sdk_variables(d)}"
|
||||
|
||||
python () {
|
||||
variables = sdk_command_variables(d)
|
||||
for var in variables:
|
||||
if d.getVar(var, False):
|
||||
d.setVarFlag(var, 'func', '1')
|
||||
}
|
||||
|
||||
do_populate_sdk[file-checksums] += "${TOOLCHAIN_SHAR_REL_TMPL}:True \
|
||||
${TOOLCHAIN_SHAR_EXT_TMPL}:True"
|
||||
|
||||
|
||||
@@ -251,7 +251,9 @@ python copy_buildsystem () {
|
||||
|
||||
# Create a layer for new recipes / appends
|
||||
bbpath = d.getVar('BBPATH')
|
||||
bb.process.run(['devtool', '--bbpath', bbpath, '--basepath', baseoutpath, 'create-workspace', '--create-only', os.path.join(baseoutpath, 'workspace')])
|
||||
env = os.environ.copy()
|
||||
env['PYTHONDONTWRITEBYTECODE'] = '1'
|
||||
bb.process.run(['devtool', '--bbpath', bbpath, '--basepath', baseoutpath, 'create-workspace', '--create-only', os.path.join(baseoutpath, 'workspace')], env=env)
|
||||
|
||||
# Create bblayers.conf
|
||||
bb.utils.mkdirhier(baseoutpath + '/conf')
|
||||
@@ -364,6 +366,9 @@ python copy_buildsystem () {
|
||||
# Hide the config information from bitbake output (since it's fixed within the SDK)
|
||||
f.write('BUILDCFG_HEADER = ""\n\n')
|
||||
|
||||
# Write METADATA_REVISION
|
||||
f.write('METADATA_REVISION = "%s"\n\n' % d.getVar('METADATA_REVISION'))
|
||||
|
||||
f.write('# Provide a flag to indicate we are in the EXT_SDK Context\n')
|
||||
f.write('WITHIN_EXT_SDK = "1"\n\n')
|
||||
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
#
|
||||
# Licensed under the MIT license, see COPYING.MIT for details
|
||||
|
||||
inherit base
|
||||
|
||||
ERR_REPORT_DIR ?= "${LOG_DIR}/error-report"
|
||||
|
||||
def errorreport_getdata(e):
|
||||
@@ -64,6 +66,8 @@ python errorreport_handler () {
|
||||
data['failures'] = []
|
||||
data['component'] = " ".join(e.getPkgs())
|
||||
data['branch_commit'] = str(base_detect_branch(e.data)) + ": " + str(base_detect_revision(e.data))
|
||||
data['bitbake_version'] = e.data.getVar("BB_VERSION")
|
||||
data['layer_version'] = get_layers_branch_rev(e.data)
|
||||
data['local_conf'] = get_conf_data(e, 'local.conf')
|
||||
data['auto_conf'] = get_conf_data(e, 'auto.conf')
|
||||
lock = bb.utils.lockfile(datafile + '.lock')
|
||||
|
||||
@@ -32,4 +32,8 @@ python () {
|
||||
d.setVar('DEB_SDK_ARCH', 'amd64')
|
||||
elif darch == "arm":
|
||||
d.setVar('DEB_SDK_ARCH', 'armel')
|
||||
elif darch == "aarch64":
|
||||
d.setVar('DEB_SDK_ARCH', 'arm64')
|
||||
else:
|
||||
bb.fatal("Unhandled SDK_ARCH %s" % darch)
|
||||
}
|
||||
|
||||
@@ -882,13 +882,18 @@ def check_sanity_everybuild(status, d):
|
||||
except:
|
||||
pass
|
||||
|
||||
oeroot = d.getVar('COREBASE')
|
||||
if oeroot.find('+') != -1:
|
||||
status.addresult("Error, you have an invalid character (+) in your COREBASE directory path. Please move the installation to a directory which doesn't include any + characters.")
|
||||
if oeroot.find('@') != -1:
|
||||
status.addresult("Error, you have an invalid character (@) in your COREBASE directory path. Please move the installation to a directory which doesn't include any @ characters.")
|
||||
if oeroot.find(' ') != -1:
|
||||
status.addresult("Error, you have a space in your COREBASE directory path. Please move the installation to a directory which doesn't include a space since autotools doesn't support this.")
|
||||
for checkdir in ['COREBASE', 'TMPDIR']:
|
||||
val = d.getVar(checkdir)
|
||||
if val.find('..') != -1:
|
||||
status.addresult("Error, you have '..' in your %s directory path. Please ensure the variable contains an absolute path as this can break some recipe builds in obtuse ways." % checkdir)
|
||||
if val.find('+') != -1:
|
||||
status.addresult("Error, you have an invalid character (+) in your %s directory path. Please move the installation to a directory which doesn't include any + characters." % checkdir)
|
||||
if val.find('@') != -1:
|
||||
status.addresult("Error, you have an invalid character (@) in your %s directory path. Please move the installation to a directory which doesn't include any @ characters." % checkdir)
|
||||
if val.find(' ') != -1:
|
||||
status.addresult("Error, you have a space in your %s directory path. Please move the installation to a directory which doesn't include a space since autotools doesn't support this." % checkdir)
|
||||
if val.find('%') != -1:
|
||||
status.addresult("Error, you have an invalid character (%) in your %s directory path which causes problems with python string formatting. Please move the installation to a directory which doesn't include any % characters." % checkdir)
|
||||
|
||||
# Check the format of MIRRORS, PREMIRRORS and SSTATE_MIRRORS
|
||||
import re
|
||||
|
||||
@@ -685,7 +685,10 @@ SRC_URI = ""
|
||||
PSEUDO_LOCALSTATEDIR ?= "${WORKDIR}/pseudo/"
|
||||
PSEUDO_PASSWD ?= "${STAGING_DIR_TARGET}:${PSEUDO_SYSROOT}"
|
||||
PSEUDO_SYSROOT = "${COMPONENTS_DIR}/${BUILD_ARCH}/pseudo-native"
|
||||
PSEUDO_IGNORE_PATHS = "/usr/,/etc/,/lib,/dev/,/run/,${T},${WORKDIR}/recipe-sysroot,${SSTATE_DIR},${STAMPS_DIR},${WORKDIR}/pkgdata-sysroot,${TMPDIR}/sstate-control,${DEPLOY_DIR},${WORKDIR}/deploy-,${TMPDIR}/buildstats,${WORKDIR}/sstate-build-package_,${WORKDIR}/sstate-install-package_,${WORKDIR}/sstate-build-image_complete,${TMPDIR}/sysroots-components,${BUILDHISTORY_DIR},${TMPDIR}/pkgdata,${TOPDIR}/cache,${COREBASE}/scripts,${CCACHE_DIR}"
|
||||
PSEUDO_IGNORE_PATHS = "/usr/,/etc/,/lib,/dev/,/run/,${T},${WORKDIR}/recipe-sysroot,${SSTATE_DIR},${STAMPS_DIR}"
|
||||
PSEUDO_IGNORE_PATHS .= ",${TMPDIR}/sstate-control,${TMPDIR}/buildstats,${TMPDIR}/sysroots-components,${TMPDIR}/pkgdata"
|
||||
PSEUDO_IGNORE_PATHS .= ",${WORKDIR}/deploy-,${WORKDIR}/sstate-build-package_,${WORKDIR}/sstate-install-package_,${WORKDIR}/pkgdata-sysroot"
|
||||
PSEUDO_IGNORE_PATHS .= ",${DEPLOY_DIR},${BUILDHISTORY_DIR},${TOPDIR}/cache,${COREBASE}/scripts,${CCACHE_DIR}"
|
||||
|
||||
export PSEUDO_DISABLED = "1"
|
||||
#export PSEUDO_PREFIX = "${STAGING_DIR_NATIVE}${prefix_native}"
|
||||
@@ -696,6 +699,7 @@ FAKEROOTCMD = "${PSEUDO_SYSROOT}${bindir_native}/pseudo"
|
||||
FAKEROOTENV = "PSEUDO_PREFIX=${PSEUDO_SYSROOT}${prefix_native} PSEUDO_LOCALSTATEDIR=${PSEUDO_LOCALSTATEDIR} PSEUDO_PASSWD=${PSEUDO_PASSWD} PSEUDO_NOSYMLINKEXP=1 PSEUDO_IGNORE_PATHS=${@oe.path.canonicalize(d.getVar('PSEUDO_IGNORE_PATHS'))} PSEUDO_DISABLED=0"
|
||||
FAKEROOTNOENV = "PSEUDO_UNLOAD=1"
|
||||
FAKEROOTDIRS = "${PSEUDO_LOCALSTATEDIR}"
|
||||
FAKEROOTLOGS = "${WORKDIR}/pseudo/pseudo.log"
|
||||
PREFERRED_PROVIDER_virtual/fakeroot-native ?= "pseudo-native"
|
||||
|
||||
##################################################################
|
||||
|
||||
@@ -60,6 +60,7 @@ PTESTS_FAST_remove_mips64 = "qemu-ptest"
|
||||
# bash-ptest \ # Test outcomes are non-deterministic by design
|
||||
# ifupdown-ptest \ # Tested separately in lib/oeqa/selftest/cases/imagefeatures.py
|
||||
# mdadm-ptest \ # Tests rely on non-deterministic sleep() amounts
|
||||
# libinput-ptest \ # Tests need an unloaded system to be reliable
|
||||
#"
|
||||
|
||||
PTESTS_SLOW = "\
|
||||
@@ -72,7 +73,6 @@ PTESTS_SLOW = "\
|
||||
glib-2.0-ptest \
|
||||
gstreamer1.0-ptest \
|
||||
libevent-ptest \
|
||||
libinput-ptest \
|
||||
lttng-tools-ptest \
|
||||
openssh-ptest \
|
||||
openssl-ptest \
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
# to the distro running on the build machine.
|
||||
#
|
||||
|
||||
UNINATIVE_MAXGLIBCVERSION = "2.32"
|
||||
UNINATIVE_MAXGLIBCVERSION = "2.33"
|
||||
|
||||
UNINATIVE_URL ?= "http://downloads.yoctoproject.org/releases/uninative/2.10/"
|
||||
UNINATIVE_CHECKSUM[aarch64] ?= "645e5c50b2b48aabb8b10f783a9f94b4b7c5ddc7cfceb5386d43b86d30253202"
|
||||
UNINATIVE_CHECKSUM[i686] ?= "233e09b5ff30e15341232a0c16fa8448ff31dccb8f3f3e2ad3948cdac8c4a598"
|
||||
UNINATIVE_CHECKSUM[x86_64] ?= "04333677f81990ce2cf55c3bc256cd84a66085d18fc95ccddfab8581e4aec014"
|
||||
UNINATIVE_URL ?= "http://downloads.yoctoproject.org/releases/uninative/3.0/"
|
||||
UNINATIVE_CHECKSUM[aarch64] ?= "1c668909098c5b56132067adc69a249cb771f4560428e5822de903a12d97bf33"
|
||||
UNINATIVE_CHECKSUM[i686] ?= "e6cc2fc056234cffa6a2ff084cce27d544ea3f487a62b5e253351cefd4421900"
|
||||
UNINATIVE_CHECKSUM[x86_64] ?= "5ec5a9276046e7eceeac749a18b175667384e1f445cd4526300a41404d985a5b"
|
||||
|
||||
@@ -20,7 +20,7 @@ def _smart_copy(src, dest):
|
||||
mode = os.stat(src).st_mode
|
||||
if stat.S_ISDIR(mode):
|
||||
bb.utils.mkdirhier(dest)
|
||||
cmd = "tar --exclude='.git' --xattrs --xattrs-include='*' -chf - -C %s -p . \
|
||||
cmd = "tar --exclude='.git' --exclude='__pycache__' --xattrs --xattrs-include='*' -chf - -C %s -p . \
|
||||
| tar --xattrs --xattrs-include='*' -xf - -C %s" % (src, dest)
|
||||
subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT)
|
||||
else:
|
||||
@@ -259,7 +259,7 @@ def create_locked_sstate_cache(lockedsigs, input_sstate_cache, output_sstate_cac
|
||||
bb.note('Generating sstate-cache...')
|
||||
|
||||
nativelsbstring = d.getVar('NATIVELSBSTRING')
|
||||
bb.process.run("gen-lockedsig-cache %s %s %s %s %s" % (lockedsigs, input_sstate_cache, output_sstate_cache, nativelsbstring, filterfile or ''))
|
||||
bb.process.run("PYTHONDONTWRITEBYTECODE=1 gen-lockedsig-cache %s %s %s %s %s" % (lockedsigs, input_sstate_cache, output_sstate_cache, nativelsbstring, filterfile or ''))
|
||||
if fixedlsbstring and nativelsbstring != fixedlsbstring:
|
||||
nativedir = output_sstate_cache + '/' + nativelsbstring
|
||||
if os.path.isdir(nativedir):
|
||||
@@ -286,7 +286,7 @@ def check_sstate_task_list(d, targets, filteroutfile, cmdprefix='', cwd=None, lo
|
||||
logparam = '-l %s' % logfile
|
||||
else:
|
||||
logparam = ''
|
||||
cmd = "%sBB_SETSCENE_ENFORCE=1 PSEUDO_DISABLED=1 oe-check-sstate %s -s -o %s %s" % (cmdprefix, targets, filteroutfile, logparam)
|
||||
cmd = "%sPYTHONDONTWRITEBYTECODE=1 BB_SETSCENE_ENFORCE=1 PSEUDO_DISABLED=1 oe-check-sstate %s -s -o %s %s" % (cmdprefix, targets, filteroutfile, logparam)
|
||||
env = dict(d.getVar('BB_ORIGENV', False))
|
||||
env.pop('BUILDDIR', '')
|
||||
env.pop('BBPATH', '')
|
||||
|
||||
@@ -11,8 +11,13 @@ _Version = collections.namedtuple(
|
||||
class Version():
|
||||
|
||||
def __init__(self, version, suffix=None):
|
||||
|
||||
suffixes = ["alphabetical", "patch"]
|
||||
|
||||
if str(suffix) == "alphabetical":
|
||||
version_pattern = r"""r?v?(?:(?P<release>[0-9]+(?:[-\.][0-9]+)*)(?P<patch>[-_\.]?(?P<patch_l>[a-z]))?(?P<pre>[-_\.]?(?P<pre_l>(rc|alpha|beta|pre|preview|dev))[-_\.]?(?P<pre_v>[0-9]+)?)?)(.*)?"""
|
||||
elif str(suffix) == "patch":
|
||||
version_pattern = r"""r?v?(?:(?P<release>[0-9]+(?:[-\.][0-9]+)*)(?P<patch>[-_\.]?(p|patch)(?P<patch_l>[0-9]+))?(?P<pre>[-_\.]?(?P<pre_l>(rc|alpha|beta|pre|preview|dev))[-_\.]?(?P<pre_v>[0-9]+)?)?)(.*)?"""
|
||||
else:
|
||||
version_pattern = r"""r?v?(?:(?P<release>[0-9]+(?:[-\.][0-9]+)*)(?P<pre>[-_\.]?(?P<pre_l>(rc|alpha|beta|pre|preview|dev))[-_\.]?(?P<pre_v>[0-9]+)?)?)(.*)?"""
|
||||
regex = re.compile(r"^\s*" + version_pattern + r"\s*$", re.VERBOSE | re.IGNORECASE)
|
||||
@@ -23,7 +28,7 @@ class Version():
|
||||
|
||||
self._version = _Version(
|
||||
release=tuple(int(i) for i in match.group("release").replace("-",".").split(".")),
|
||||
patch_l=match.group("patch_l") if str(suffix) == "alphabetical" and match.group("patch_l") else "",
|
||||
patch_l=match.group("patch_l") if str(suffix) in suffixes and match.group("patch_l") else "",
|
||||
pre_l=match.group("pre_l"),
|
||||
pre_v=match.group("pre_v")
|
||||
)
|
||||
|
||||
@@ -189,7 +189,7 @@ class PackageManager(object, metaclass=ABCMeta):
|
||||
bb.utils.remove(self.intercepts_dir, True)
|
||||
bb.utils.mkdirhier(self.intercepts_dir)
|
||||
for intercept in postinst_intercepts:
|
||||
bb.utils.copyfile(intercept, os.path.join(self.intercepts_dir, os.path.basename(intercept)))
|
||||
shutil.copy(intercept, os.path.join(self.intercepts_dir, os.path.basename(intercept)))
|
||||
|
||||
@abstractmethod
|
||||
def _handle_intercept_failure(self, failed_script):
|
||||
|
||||
@@ -312,6 +312,12 @@ class DpkgPM(OpkgDpkgPM):
|
||||
if not pkgs:
|
||||
return
|
||||
|
||||
os.environ['D'] = self.target_rootfs
|
||||
os.environ['OFFLINE_ROOT'] = self.target_rootfs
|
||||
os.environ['IPKG_OFFLINE_ROOT'] = self.target_rootfs
|
||||
os.environ['OPKG_OFFLINE_ROOT'] = self.target_rootfs
|
||||
os.environ['INTERCEPT_DIR'] = self.intercepts_dir
|
||||
|
||||
if with_dependencies:
|
||||
os.environ['APT_CONFIG'] = self.apt_conf_file
|
||||
cmd = "%s purge %s" % (self.apt_get_cmd, ' '.join(pkgs))
|
||||
|
||||
@@ -65,6 +65,8 @@ class DpkgSdk(Sdk):
|
||||
|
||||
self.target_pm.install_complementary(self.d.getVar('SDKIMAGE_INSTALL_COMPLEMENTARY'))
|
||||
|
||||
self.target_pm.run_pre_post_installs()
|
||||
|
||||
self.target_pm.run_intercepts(populate_sdk='target')
|
||||
|
||||
execute_pre_post_process(self.d, self.d.getVar("POPULATE_SDK_POST_TARGET_COMMAND"))
|
||||
@@ -78,6 +80,8 @@ class DpkgSdk(Sdk):
|
||||
self._populate_sysroot(self.host_pm, self.host_manifest)
|
||||
self.install_locales(self.host_pm)
|
||||
|
||||
self.host_pm.run_pre_post_installs()
|
||||
|
||||
self.host_pm.run_intercepts(populate_sdk='host')
|
||||
|
||||
execute_pre_post_process(self.d, self.d.getVar("POPULATE_SDK_POST_HOST_COMMAND"))
|
||||
|
||||
@@ -409,7 +409,7 @@ def copy_recipe_files(d, tgt_dir, whole_dir=False, download=True, all_variants=F
|
||||
fetch.download()
|
||||
for pth in fetch.localpaths():
|
||||
if pth not in localpaths:
|
||||
localpaths.append(pth)
|
||||
localpaths.append(os.path.abspath(pth))
|
||||
uri_values.append(srcuri)
|
||||
|
||||
fetch_urls(d)
|
||||
|
||||
@@ -163,7 +163,12 @@ class Tmux(Terminal):
|
||||
# devshells, if it's already there, add a new window to it.
|
||||
window_name = 'devshell-%i' % os.getpid()
|
||||
|
||||
self.command = 'tmux new -c "{{cwd}}" -d -s {0} -n {0} "{{command}}"'.format(window_name)
|
||||
self.command = 'tmux new -c "{{cwd}}" -d -s {0} -n {0} "{{command}}"'
|
||||
if not check_tmux_version('1.9'):
|
||||
# `tmux new-session -c` was added in 1.9;
|
||||
# older versions fail with that flag
|
||||
self.command = 'tmux new -d -s {0} -n {0} "{{command}}"'
|
||||
self.command = self.command.format(window_name)
|
||||
Terminal.__init__(self, sh_cmd, title, env, d)
|
||||
|
||||
attach_cmd = 'tmux att -t {0}'.format(window_name)
|
||||
@@ -253,13 +258,18 @@ def spawn(name, sh_cmd, title=None, env=None, d=None):
|
||||
except OSError:
|
||||
return
|
||||
|
||||
def check_tmux_version(desired):
|
||||
vernum = check_terminal_version("tmux")
|
||||
if vernum and LooseVersion(vernum) < desired:
|
||||
return False
|
||||
return vernum
|
||||
|
||||
def check_tmux_pane_size(tmux):
|
||||
import subprocess as sub
|
||||
# On older tmux versions (<1.9), return false. The reason
|
||||
# is that there is no easy way to get the height of the active panel
|
||||
# on current window without nested formats (available from version 1.9)
|
||||
vernum = check_terminal_version("tmux")
|
||||
if vernum and LooseVersion(vernum) < '1.9':
|
||||
if not check_tmux_version('1.9'):
|
||||
return False
|
||||
try:
|
||||
p = sub.Popen('%s list-panes -F "#{?pane_active,#{pane_height},}"' % tmux,
|
||||
|
||||
@@ -4,12 +4,14 @@
|
||||
|
||||
from oeqa.runtime.case import OERuntimeTestCase
|
||||
from oeqa.core.decorator.depends import OETestDepends
|
||||
from oeqa.core.decorator.data import skipIfDataVar, skipIfInDataVar
|
||||
from oeqa.runtime.decorator.package import OEHasPackage
|
||||
|
||||
class DfTest(OERuntimeTestCase):
|
||||
|
||||
@OETestDepends(['ssh.SSHTest.test_ssh'])
|
||||
@OEHasPackage(['coreutils', 'busybox'])
|
||||
@skipIfInDataVar('IMAGE_FEATURES', 'read-only-rootfs', 'Test case df requires a writable rootfs')
|
||||
def test_df(self):
|
||||
cmd = "df -P / | sed -n '2p' | awk '{print $4}'"
|
||||
(status,output) = self.target.run(cmd)
|
||||
|
||||
@@ -8,11 +8,14 @@
|
||||
from oeqa.runtime.case import OERuntimeTestCase
|
||||
from oeqa.core.decorator.depends import OETestDepends
|
||||
from oeqa.core.decorator.data import skipIfNotFeature
|
||||
from oeqa.runtime.decorator.package import OEHasPackage
|
||||
|
||||
class PamBasicTest(OERuntimeTestCase):
|
||||
|
||||
@skipIfNotFeature('pam', 'Test requires pam to be in DISTRO_FEATURES')
|
||||
@OETestDepends(['ssh.SSHTest.test_ssh'])
|
||||
@OEHasPackage(['shadow'])
|
||||
@OEHasPackage(['shadow-base'])
|
||||
def test_pam(self):
|
||||
status, output = self.target.run('login --help')
|
||||
msg = ('login command does not work as expected. '
|
||||
|
||||
@@ -57,15 +57,15 @@ class ImageOptionsTests(OESelftestTestCase):
|
||||
class DiskMonTest(OESelftestTestCase):
|
||||
|
||||
def test_stoptask_behavior(self):
|
||||
self.write_config('BB_DISKMON_DIRS = "STOPTASKS,${TMPDIR},100000G,100K"')
|
||||
self.write_config('BB_DISKMON_DIRS = "STOPTASKS,${TMPDIR},100000G,100K"\nBB_HEARTBEAT_EVENT = "1"')
|
||||
res = bitbake("delay -c delay", ignore_status = True)
|
||||
self.assertTrue('ERROR: No new tasks can be executed since the disk space monitor action is "STOPTASKS"!' in res.output, msg = "Tasks should have stopped. Disk monitor is set to STOPTASK: %s" % res.output)
|
||||
self.assertEqual(res.status, 1, msg = "bitbake reported exit code %s. It should have been 1. Bitbake output: %s" % (str(res.status), res.output))
|
||||
self.write_config('BB_DISKMON_DIRS = "ABORT,${TMPDIR},100000G,100K"')
|
||||
self.write_config('BB_DISKMON_DIRS = "ABORT,${TMPDIR},100000G,100K"\nBB_HEARTBEAT_EVENT = "1"')
|
||||
res = bitbake("delay -c delay", ignore_status = True)
|
||||
self.assertTrue('ERROR: Immediately abort since the disk space monitor action is "ABORT"!' in res.output, "Tasks should have been aborted immediatelly. Disk monitor is set to ABORT: %s" % res.output)
|
||||
self.assertEqual(res.status, 1, msg = "bitbake reported exit code %s. It should have been 1. Bitbake output: %s" % (str(res.status), res.output))
|
||||
self.write_config('BB_DISKMON_DIRS = "WARN,${TMPDIR},100000G,100K"')
|
||||
self.write_config('BB_DISKMON_DIRS = "WARN,${TMPDIR},100000G,100K"\nBB_HEARTBEAT_EVENT = "1"')
|
||||
res = bitbake("delay -c delay")
|
||||
self.assertTrue('WARNING: The free space' in res.output, msg = "A warning should have been displayed for disk monitor is set to WARN: %s" %res.output)
|
||||
|
||||
|
||||
@@ -34,3 +34,11 @@ class CVECheck(OESelftestTestCase):
|
||||
self.assertTrue( result ,msg="Failed to compare version with suffix '1.0b' < '1.0r'")
|
||||
result = Version("1.0b","alphabetical") > Version("1.0","alphabetical")
|
||||
self.assertTrue( result ,msg="Failed to compare version with suffix '1.0b' > '1.0'")
|
||||
|
||||
# consider the trailing "p" and "patch" as patched released when comparing
|
||||
result = Version("1.0","patch") < Version("1.0p1","patch")
|
||||
self.assertTrue( result ,msg="Failed to compare version with suffix '1.0' < '1.0p1'")
|
||||
result = Version("1.0p2","patch") > Version("1.0p1","patch")
|
||||
self.assertTrue( result ,msg="Failed to compare version with suffix '1.0p2' > '1.0p1'")
|
||||
result = Version("1.0_patch2","patch") < Version("1.0_patch3","patch")
|
||||
self.assertTrue( result ,msg="Failed to compare version with suffix '1.0_patch2' < '1.0_patch3'")
|
||||
|
||||
@@ -68,7 +68,7 @@ def compare_file(reference, test, diffutils_sysroot):
|
||||
result.status = MISSING
|
||||
return result
|
||||
|
||||
r = runCmd(['cmp', '--quiet', reference, test], native_sysroot=diffutils_sysroot, ignore_status=True)
|
||||
r = runCmd(['cmp', '--quiet', reference, test], native_sysroot=diffutils_sysroot, ignore_status=True, sync=False)
|
||||
|
||||
if r.status:
|
||||
result.status = DIFFERENT
|
||||
@@ -184,9 +184,10 @@ class ReproducibleTests(OESelftestTestCase):
|
||||
# mirror, forcing a complete build from scratch
|
||||
config += textwrap.dedent('''\
|
||||
SSTATE_DIR = "${TMPDIR}/sstate"
|
||||
SSTATE_MIRROR = ""
|
||||
SSTATE_MIRRORS = ""
|
||||
''')
|
||||
|
||||
self.logger.info("Building %s (sstate%s allowed)..." % (name, '' if use_sstate else ' NOT'))
|
||||
self.write_config(config)
|
||||
d = get_bb_vars(capture_vars)
|
||||
bitbake(' '.join(self.images))
|
||||
@@ -213,6 +214,7 @@ class ReproducibleTests(OESelftestTestCase):
|
||||
self.logger.info('Non-reproducible packages will be copied to %s', save_dir)
|
||||
|
||||
vars_A = self.do_test_build('reproducibleA', self.build_from_sstate)
|
||||
|
||||
vars_B = self.do_test_build('reproducibleB', False)
|
||||
|
||||
# NOTE: The temp directories from the reproducible build are purposely
|
||||
@@ -227,6 +229,7 @@ class ReproducibleTests(OESelftestTestCase):
|
||||
deploy_A = vars_A['DEPLOY_DIR_' + c.upper()]
|
||||
deploy_B = vars_B['DEPLOY_DIR_' + c.upper()]
|
||||
|
||||
self.logger.info('Checking %s packages for differences...' % c)
|
||||
result = self.compare_packages(deploy_A, deploy_B, diffutils_sysroot)
|
||||
|
||||
self.logger.info('Reproducibility summary for %s: %s' % (c, result))
|
||||
|
||||
@@ -318,6 +318,7 @@ class Wic(WicTestCase):
|
||||
"--image-name=core-image-minimal "
|
||||
"-D -o %s" % self.resultdir)
|
||||
self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*.direct")))
|
||||
self.assertEqual(1, len(glob(self.resultdir + "tmp.wic*")))
|
||||
|
||||
def test_debug_long(self):
|
||||
"""Test --debug option"""
|
||||
@@ -325,6 +326,7 @@ class Wic(WicTestCase):
|
||||
"--image-name=core-image-minimal "
|
||||
"--debug -o %s" % self.resultdir)
|
||||
self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*.direct")))
|
||||
self.assertEqual(1, len(glob(self.resultdir + "tmp.wic*")))
|
||||
|
||||
def test_skip_build_check_short(self):
|
||||
"""Test -s option"""
|
||||
@@ -977,14 +979,18 @@ class Wic2(WicTestCase):
|
||||
@only_for_arch(['i586', 'i686', 'x86_64'])
|
||||
def test_rawcopy_plugin_qemu(self):
|
||||
"""Test rawcopy plugin in qemu"""
|
||||
# build ext4 and wic images
|
||||
for fstype in ("ext4", "wic"):
|
||||
config = 'IMAGE_FSTYPES = "%s"\nWKS_FILE = "test_rawcopy_plugin.wks.in"\n' % fstype
|
||||
self.append_config(config)
|
||||
self.assertEqual(0, bitbake('core-image-minimal').status)
|
||||
self.remove_config(config)
|
||||
# build ext4 and then use it for a wic image
|
||||
config = 'IMAGE_FSTYPES = "ext4"\n'
|
||||
self.append_config(config)
|
||||
self.assertEqual(0, bitbake('core-image-minimal').status)
|
||||
self.remove_config(config)
|
||||
|
||||
with runqemu('core-image-minimal', ssh=False, image_fstype='wic') as qemu:
|
||||
config = 'IMAGE_FSTYPES = "wic"\nWKS_FILE = "test_rawcopy_plugin.wks.in"\n'
|
||||
self.append_config(config)
|
||||
self.assertEqual(0, bitbake('core-image-minimal-mtdutils').status)
|
||||
self.remove_config(config)
|
||||
|
||||
with runqemu('core-image-minimal-mtdutils', ssh=False, image_fstype='wic') as qemu:
|
||||
cmd = "grep sda. /proc/partitions |wc -l"
|
||||
status, output = qemu.run_serial(cmd)
|
||||
self.assertEqual(1, status, 'Failed to run command "%s": %s' % (cmd, output))
|
||||
|
||||
@@ -125,11 +125,11 @@ class Command(object):
|
||||
|
||||
def stop(self):
|
||||
for thread in self.threads:
|
||||
if thread.isAlive():
|
||||
if thread.is_alive():
|
||||
self.process.terminate()
|
||||
# let's give it more time to terminate gracefully before killing it
|
||||
thread.join(5)
|
||||
if thread.isAlive():
|
||||
if thread.is_alive():
|
||||
self.process.kill()
|
||||
thread.join()
|
||||
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
From 5b671538216af78a0a7ef7464dc52ab2241ea7db Mon Sep 17 00:00:00 2001
|
||||
From: Minjae Kim <flowergom@gmail.com>
|
||||
Date: Tue, 2 Mar 2021 14:03:49 +0000
|
||||
Subject: [PATCH] BIND Operational Notification: Zone journal (.jnl) file
|
||||
incompatibility
|
||||
|
||||
Upstream-Status: Backport [https://downloads.isc.org/isc/bind9/9.16.12/patches/CVE-2020-8625.patch]
|
||||
CVE: CVE-2020-8625
|
||||
Signed-off-by: Minjae Kim <flowergom@gmail.com>
|
||||
---
|
||||
lib/dns/spnego.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/lib/dns/spnego.c b/lib/dns/spnego.c
|
||||
index 671838c..82fd49a 100644
|
||||
--- a/lib/dns/spnego.c
|
||||
+++ b/lib/dns/spnego.c
|
||||
@@ -846,7 +846,7 @@ der_get_oid(const unsigned char *p, size_t len, oid *data, size_t *size) {
|
||||
return (ASN1_OVERRUN);
|
||||
}
|
||||
|
||||
- data->components = malloc(len * sizeof(*data->components));
|
||||
+ data->components = malloc((len + 1) * sizeof(*data->components));
|
||||
if (data->components == NULL) {
|
||||
return (ENOMEM);
|
||||
}
|
||||
--
|
||||
2.17.1
|
||||
|
||||
@@ -17,6 +17,7 @@ SRC_URI = "https://ftp.isc.org/isc/bind9/${PV}/${BPN}-${PV}.tar.xz \
|
||||
file://bind-ensure-searching-for-json-headers-searches-sysr.patch \
|
||||
file://0001-named-lwresd-V-and-start-log-hide-build-options.patch \
|
||||
file://0001-avoid-start-failure-with-bind-user.patch \
|
||||
file://CVE-2020-8625.patch \
|
||||
"
|
||||
|
||||
SRC_URI[sha256sum] = "9f7d1812ebbd26a699f62b6fa8522d5dec57e4bf43af0042a0d60d39ed8314d1"
|
||||
|
||||
@@ -9,8 +9,7 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/network/${BPN}/${BP}.tar.xz \
|
||||
|
||||
SRC_URI_append_libc-musl = " file://0002-resolve-musl-does-not-implement-res_ninit.patch"
|
||||
|
||||
SRC_URI[md5sum] = "1ed8745354c7254bdfd4def54833ee94"
|
||||
SRC_URI[sha256sum] = "cb30aca97c2f79ccaed8802aa2909ac5100a3969de74c0af8a9d73b85fc4932b"
|
||||
SRC_URI[sha256sum] = "9f62a7169b7491c670a1ff2e335b0d966308fb2f62e285c781105eb90f181af3"
|
||||
|
||||
RRECOMMENDS_${PN} = "connman-conf"
|
||||
RCONFLICTS_${PN} = "networkmanager"
|
||||
@@ -0,0 +1,90 @@
|
||||
From b3855ff053f5078ec3d3c653cdaedefaa5fc362d Mon Sep 17 00:00:00 2001
|
||||
From: "djm@openbsd.org" <djm@openbsd.org>
|
||||
Date: Fri, 18 Sep 2020 05:23:03 +0000
|
||||
Subject: [PATCH] upstream: tweak the client hostkey preference ordering
|
||||
algorithm to
|
||||
|
||||
prefer the default ordering if the user has a key that matches the
|
||||
best-preference default algorithm.
|
||||
|
||||
feedback and ok markus@
|
||||
|
||||
OpenBSD-Commit-ID: a92dd7d7520ddd95c0a16786a7519e6d0167d35f
|
||||
|
||||
Upstream-Status: Backport
|
||||
[https://github.com/openssh/openssh-portable/commit/b3855ff053f5078ec3d3c653cdaedefaa5fc362d]
|
||||
CVE: CVE-2020-14145
|
||||
Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com>
|
||||
|
||||
---
|
||||
sshconnect2.c | 41 ++++++++++++++++++++++++++++++++++++++---
|
||||
1 file changed, 37 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/sshconnect2.c b/sshconnect2.c
|
||||
index 347e348c60..f64aae66af 100644
|
||||
--- a/sshconnect2.c
|
||||
+++ b/sshconnect2.c
|
||||
@@ -102,12 +102,25 @@ verify_host_key_callback(struct sshkey *hostkey, struct ssh *ssh)
|
||||
return 0;
|
||||
}
|
||||
|
||||
+/* Returns the first item from a comma-separated algorithm list */
|
||||
+static char *
|
||||
+first_alg(const char *algs)
|
||||
+{
|
||||
+ char *ret, *cp;
|
||||
+
|
||||
+ ret = xstrdup(algs);
|
||||
+ if ((cp = strchr(ret, ',')) != NULL)
|
||||
+ *cp = '\0';
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
static char *
|
||||
order_hostkeyalgs(char *host, struct sockaddr *hostaddr, u_short port)
|
||||
{
|
||||
- char *oavail, *avail, *first, *last, *alg, *hostname, *ret;
|
||||
+ char *oavail = NULL, *avail = NULL, *first = NULL, *last = NULL;
|
||||
+ char *alg = NULL, *hostname = NULL, *ret = NULL, *best = NULL;
|
||||
size_t maxlen;
|
||||
- struct hostkeys *hostkeys;
|
||||
+ struct hostkeys *hostkeys = NULL;
|
||||
int ktype;
|
||||
u_int i;
|
||||
|
||||
@@ -119,6 +132,26 @@ order_hostkeyalgs(char *host, struct sockaddr *hostaddr, u_short port)
|
||||
for (i = 0; i < options.num_system_hostfiles; i++)
|
||||
load_hostkeys(hostkeys, hostname, options.system_hostfiles[i]);
|
||||
|
||||
+ /*
|
||||
+ * If a plain public key exists that matches the type of the best
|
||||
+ * preference HostkeyAlgorithms, then use the whole list as is.
|
||||
+ * Note that we ignore whether the best preference algorithm is a
|
||||
+ * certificate type, as sshconnect.c will downgrade certs to
|
||||
+ * plain keys if necessary.
|
||||
+ */
|
||||
+ best = first_alg(options.hostkeyalgorithms);
|
||||
+ if (lookup_key_in_hostkeys_by_type(hostkeys,
|
||||
+ sshkey_type_plain(sshkey_type_from_name(best)), NULL)) {
|
||||
+ debug3("%s: have matching best-preference key type %s, "
|
||||
+ "using HostkeyAlgorithms verbatim", __func__, best);
|
||||
+ ret = xstrdup(options.hostkeyalgorithms);
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
+ /*
|
||||
+ * Otherwise, prefer the host key algorithms that match known keys
|
||||
+ * while keeping the ordering of HostkeyAlgorithms as much as possible.
|
||||
+ */
|
||||
oavail = avail = xstrdup(options.hostkeyalgorithms);
|
||||
maxlen = strlen(avail) + 1;
|
||||
first = xmalloc(maxlen);
|
||||
@@ -159,6 +192,8 @@ order_hostkeyalgs(char *host, struct sockaddr *hostaddr, u_short port)
|
||||
if (*first != '\0')
|
||||
debug3("%s: prefer hostkeyalgs: %s", __func__, first);
|
||||
|
||||
+ out:
|
||||
+ free(best);
|
||||
free(first);
|
||||
free(last);
|
||||
free(hostname);
|
||||
@@ -25,6 +25,7 @@ SRC_URI = "http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-${PV}.tar
|
||||
file://sshd_check_keys \
|
||||
file://add-test-support-for-busybox.patch \
|
||||
file://0f90440ca70abab947acbd77795e9f130967956c.patch \
|
||||
file://CVE-2020-14145.patch \
|
||||
"
|
||||
SRC_URI[sha256sum] = "f2befbe0472fe7eb75d23340eb17531cb6b3aac24075e2066b41f814e12387b2"
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ SRC_URI_append_class-nativesdk = " \
|
||||
file://environment.d-openssl.sh \
|
||||
"
|
||||
|
||||
SRC_URI[sha256sum] = "e8be6a35fe41d10603c3cc635e93289ed00bf34b79671a3a4de64fcee00d5242"
|
||||
SRC_URI[sha256sum] = "892a0875b9872acd04a9fde79b1f943075d5ea162415de3047c327df33fbaee5"
|
||||
|
||||
inherit lib_package multilib_header multilib_script ptest
|
||||
MULTILIB_SCRIPTS = "${PN}-bin:${bindir}/c_rehash"
|
||||
@@ -0,0 +1,45 @@
|
||||
From 947272febe24a8f0ea828b5b2f35f13c3821901e Mon Sep 17 00:00:00 2001
|
||||
From: Jouni Malinen <jouni@codeaurora.org>
|
||||
Date: Mon, 9 Nov 2020 11:43:12 +0200
|
||||
Subject: [PATCH] P2P: Fix copying of secondary device types for P2P group
|
||||
client
|
||||
|
||||
Parsing and copying of WPS secondary device types list was verifying
|
||||
that the contents is not too long for the internal maximum in the case
|
||||
of WPS messages, but similar validation was missing from the case of P2P
|
||||
group information which encodes this information in a different
|
||||
attribute. This could result in writing beyond the memory area assigned
|
||||
for these entries and corrupting memory within an instance of struct
|
||||
p2p_device. This could result in invalid operations and unexpected
|
||||
behavior when trying to free pointers from that corrupted memory.
|
||||
|
||||
Upstream-Status: Backport
|
||||
CVE: CVE-2021-0326
|
||||
|
||||
Reference to upstream patch:
|
||||
[https://w1.fi/cgit/hostap/commit/?id=947272febe24a8f0ea828b5b2f35f13c3821901e]
|
||||
|
||||
Credit to OSS-Fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=27269
|
||||
Fixes: e57ae6e19edf ("P2P: Keep track of secondary device types for peers")
|
||||
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
|
||||
Signed-off-by: Stefan Ghinea <stefan.ghinea@windriver.com>
|
||||
---
|
||||
src/p2p/p2p.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/src/p2p/p2p.c b/src/p2p/p2p.c
|
||||
index a08ba02..079270f 100644
|
||||
--- a/src/p2p/p2p.c
|
||||
+++ b/src/p2p/p2p.c
|
||||
@@ -453,6 +453,8 @@ static void p2p_copy_client_info(struct p2p_device *dev,
|
||||
dev->info.config_methods = cli->config_methods;
|
||||
os_memcpy(dev->info.pri_dev_type, cli->pri_dev_type, 8);
|
||||
dev->info.wps_sec_dev_type_list_len = 8 * cli->num_sec_dev_types;
|
||||
+ if (dev->info.wps_sec_dev_type_list_len > WPS_SEC_DEV_TYPE_MAX_LEN)
|
||||
+ dev->info.wps_sec_dev_type_list_len = WPS_SEC_DEV_TYPE_MAX_LEN;
|
||||
os_memcpy(dev->info.wps_sec_dev_type_list, cli->sec_dev_types,
|
||||
dev->info.wps_sec_dev_type_list_len);
|
||||
}
|
||||
--
|
||||
2.17.1
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
From 8460e3230988ef2ec13ce6b69b687e941f6cdb32 Mon Sep 17 00:00:00 2001
|
||||
From: Jouni Malinen <jouni@codeaurora.org>
|
||||
Date: Tue, 8 Dec 2020 23:52:50 +0200
|
||||
Subject: [PATCH] P2P: Fix a corner case in peer addition based on PD Request
|
||||
|
||||
p2p_add_device() may remove the oldest entry if there is no room in the
|
||||
peer table for a new peer. This would result in any pointer to that
|
||||
removed entry becoming stale. A corner case with an invalid PD Request
|
||||
frame could result in such a case ending up using (read+write) freed
|
||||
memory. This could only by triggered when the peer table has reached its
|
||||
maximum size and the PD Request frame is received from the P2P Device
|
||||
Address of the oldest remaining entry and the frame has incorrect P2P
|
||||
Device Address in the payload.
|
||||
|
||||
Fix this by fetching the dev pointer again after having called
|
||||
p2p_add_device() so that the stale pointer cannot be used.
|
||||
|
||||
Fixes: 17bef1e97a50 ("P2P: Add peer entry based on Provision Discovery Request")
|
||||
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
|
||||
|
||||
Upstream-Status: Backport
|
||||
CVE: CVE-2021-27803
|
||||
|
||||
Reference to upstream patch:
|
||||
[https://w1.fi/cgit/hostap/commit/?id=8460e3230988ef2ec13ce6b69b687e941f6cdb32]
|
||||
|
||||
Signed-off-by: Stefan Ghinea <stefan.ghinea@windriver.com>
|
||||
---
|
||||
src/p2p/p2p_pd.c | 12 +++++-------
|
||||
1 file changed, 5 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/src/p2p/p2p_pd.c b/src/p2p/p2p_pd.c
|
||||
index 3994ec0..05fd593 100644
|
||||
--- a/src/p2p/p2p_pd.c
|
||||
+++ b/src/p2p/p2p_pd.c
|
||||
@@ -595,14 +595,12 @@ void p2p_process_prov_disc_req(struct p2p_data *p2p, const u8 *sa,
|
||||
goto out;
|
||||
}
|
||||
|
||||
+ dev = p2p_get_device(p2p, sa);
|
||||
if (!dev) {
|
||||
- dev = p2p_get_device(p2p, sa);
|
||||
- if (!dev) {
|
||||
- p2p_dbg(p2p,
|
||||
- "Provision Discovery device not found "
|
||||
- MACSTR, MAC2STR(sa));
|
||||
- goto out;
|
||||
- }
|
||||
+ p2p_dbg(p2p,
|
||||
+ "Provision Discovery device not found "
|
||||
+ MACSTR, MAC2STR(sa));
|
||||
+ goto out;
|
||||
}
|
||||
} else if (msg.wfd_subelems) {
|
||||
wpabuf_free(dev->info.wfd_subelems);
|
||||
--
|
||||
2.17.1
|
||||
|
||||
@@ -0,0 +1,123 @@
|
||||
From a0541334a6394f8237a4393b7372693cd7e96f15 Mon Sep 17 00:00:00 2001
|
||||
From: Jouni Malinen <j@w1.fi>
|
||||
Date: Sat, 13 Mar 2021 18:19:31 +0200
|
||||
Subject: [PATCH] ASN.1: Validate DigestAlgorithmIdentifier parameters
|
||||
|
||||
The supported hash algorithms do not use AlgorithmIdentifier parameters.
|
||||
However, there are implementations that include NULL parameters in
|
||||
addition to ones that omit the parameters. Previous implementation did
|
||||
not check the parameters value at all which supported both these cases,
|
||||
but did not reject any other unexpected information.
|
||||
|
||||
Use strict validation of digest algorithm parameters and reject any
|
||||
unexpected value when validating a signature. This is needed to prevent
|
||||
potential forging attacks.
|
||||
|
||||
Signed-off-by: Jouni Malinen <j@w1.fi>
|
||||
|
||||
Upstream-Status: Backport
|
||||
CVE: CVE-2021-30004
|
||||
|
||||
Reference to upstream patch:
|
||||
[https://w1.fi/cgit/hostap/commit/?id=a0541334a6394f8237a4393b7372693cd7e96f15]
|
||||
|
||||
Signed-off-by: Stefan Ghinea <stefan.ghinea@windriver.com>
|
||||
---
|
||||
src/tls/pkcs1.c | 21 +++++++++++++++++++++
|
||||
src/tls/x509v3.c | 20 ++++++++++++++++++++
|
||||
2 files changed, 41 insertions(+)
|
||||
|
||||
diff --git a/src/tls/pkcs1.c b/src/tls/pkcs1.c
|
||||
index 141ac50..e09db07 100644
|
||||
--- a/src/tls/pkcs1.c
|
||||
+++ b/src/tls/pkcs1.c
|
||||
@@ -240,6 +240,8 @@ int pkcs1_v15_sig_ver(struct crypto_public_key *pk,
|
||||
os_free(decrypted);
|
||||
return -1;
|
||||
}
|
||||
+ wpa_hexdump(MSG_MSGDUMP, "PKCS #1: DigestInfo",
|
||||
+ hdr.payload, hdr.length);
|
||||
|
||||
pos = hdr.payload;
|
||||
end = pos + hdr.length;
|
||||
@@ -261,6 +263,8 @@ int pkcs1_v15_sig_ver(struct crypto_public_key *pk,
|
||||
os_free(decrypted);
|
||||
return -1;
|
||||
}
|
||||
+ wpa_hexdump(MSG_MSGDUMP, "PKCS #1: DigestAlgorithmIdentifier",
|
||||
+ hdr.payload, hdr.length);
|
||||
da_end = hdr.payload + hdr.length;
|
||||
|
||||
if (asn1_get_oid(hdr.payload, hdr.length, &oid, &next)) {
|
||||
@@ -269,6 +273,23 @@ int pkcs1_v15_sig_ver(struct crypto_public_key *pk,
|
||||
os_free(decrypted);
|
||||
return -1;
|
||||
}
|
||||
+ wpa_hexdump(MSG_MSGDUMP, "PKCS #1: Digest algorithm parameters",
|
||||
+ next, da_end - next);
|
||||
+
|
||||
+ /*
|
||||
+ * RFC 5754: The correct encoding for the SHA2 algorithms would be to
|
||||
+ * omit the parameters, but there are implementation that encode these
|
||||
+ * as a NULL element. Allow these two cases and reject anything else.
|
||||
+ */
|
||||
+ if (da_end > next &&
|
||||
+ (asn1_get_next(next, da_end - next, &hdr) < 0 ||
|
||||
+ !asn1_is_null(&hdr) ||
|
||||
+ hdr.payload + hdr.length != da_end)) {
|
||||
+ wpa_printf(MSG_DEBUG,
|
||||
+ "PKCS #1: Unexpected digest algorithm parameters");
|
||||
+ os_free(decrypted);
|
||||
+ return -1;
|
||||
+ }
|
||||
|
||||
if (!asn1_oid_equal(&oid, hash_alg)) {
|
||||
char txt[100], txt2[100];
|
||||
diff --git a/src/tls/x509v3.c b/src/tls/x509v3.c
|
||||
index 1bd5aa0..bf2289f 100644
|
||||
--- a/src/tls/x509v3.c
|
||||
+++ b/src/tls/x509v3.c
|
||||
@@ -1834,6 +1834,7 @@ int x509_check_signature(struct x509_certificate *issuer,
|
||||
os_free(data);
|
||||
return -1;
|
||||
}
|
||||
+ wpa_hexdump(MSG_MSGDUMP, "X509: DigestInfo", hdr.payload, hdr.length);
|
||||
|
||||
pos = hdr.payload;
|
||||
end = pos + hdr.length;
|
||||
@@ -1855,6 +1856,8 @@ int x509_check_signature(struct x509_certificate *issuer,
|
||||
os_free(data);
|
||||
return -1;
|
||||
}
|
||||
+ wpa_hexdump(MSG_MSGDUMP, "X509: DigestAlgorithmIdentifier",
|
||||
+ hdr.payload, hdr.length);
|
||||
da_end = hdr.payload + hdr.length;
|
||||
|
||||
if (asn1_get_oid(hdr.payload, hdr.length, &oid, &next)) {
|
||||
@@ -1862,6 +1865,23 @@ int x509_check_signature(struct x509_certificate *issuer,
|
||||
os_free(data);
|
||||
return -1;
|
||||
}
|
||||
+ wpa_hexdump(MSG_MSGDUMP, "X509: Digest algorithm parameters",
|
||||
+ next, da_end - next);
|
||||
+
|
||||
+ /*
|
||||
+ * RFC 5754: The correct encoding for the SHA2 algorithms would be to
|
||||
+ * omit the parameters, but there are implementation that encode these
|
||||
+ * as a NULL element. Allow these two cases and reject anything else.
|
||||
+ */
|
||||
+ if (da_end > next &&
|
||||
+ (asn1_get_next(next, da_end - next, &hdr) < 0 ||
|
||||
+ !asn1_is_null(&hdr) ||
|
||||
+ hdr.payload + hdr.length != da_end)) {
|
||||
+ wpa_printf(MSG_DEBUG,
|
||||
+ "X509: Unexpected digest algorithm parameters");
|
||||
+ os_free(data);
|
||||
+ return -1;
|
||||
+ }
|
||||
|
||||
if (x509_sha1_oid(&oid)) {
|
||||
if (signature->oid.oid[6] != 5 /* sha-1WithRSAEncryption */) {
|
||||
--
|
||||
2.17.1
|
||||
|
||||
@@ -29,6 +29,9 @@ SRC_URI = "http://w1.fi/releases/wpa_supplicant-${PV}.tar.gz \
|
||||
file://0001-WPS-UPnP-Do-not-allow-event-subscriptions-with-URLs-.patch \
|
||||
file://0002-WPS-UPnP-Fix-event-message-generation-using-a-long-U.patch \
|
||||
file://0003-WPS-UPnP-Handle-HTTP-initiation-failures-for-events-.patch \
|
||||
file://CVE-2021-0326.patch \
|
||||
file://CVE-2021-27803.patch \
|
||||
file://CVE-2021-30004.patch \
|
||||
"
|
||||
SRC_URI[md5sum] = "2d2958c782576dc9901092fbfecb4190"
|
||||
SRC_URI[sha256sum] = "fcbdee7b4a64bea8177973299c8c824419c413ec2e3a95db63dd6a5dc3541f17"
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
From fe791386ebc270219ca00406c9fdadc5130b64ee Mon Sep 17 00:00:00 2001
|
||||
From: Samuel Sapalski <samuel.sapalski@nokia.com>
|
||||
Date: Wed, 3 Mar 2021 16:31:22 +0100
|
||||
Subject: [PATCH] decompress_gunzip: Fix DoS if gzip is corrupt
|
||||
|
||||
On certain corrupt gzip files, huft_build will set the error bit on
|
||||
the result pointer. If afterwards abort_unzip is called huft_free
|
||||
might run into a segmentation fault or an invalid pointer to
|
||||
free(p).
|
||||
|
||||
In order to mitigate this, we check in huft_free if the error bit
|
||||
is set and clear it before the linked list is freed.
|
||||
|
||||
Signed-off-by: Samuel Sapalski <samuel.sapalski@nokia.com>
|
||||
Signed-off-by: Peter Kaestle <peter.kaestle@nokia.com>
|
||||
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
||||
|
||||
Upstream-Status: Backport
|
||||
CVE: CVE-2021-28831
|
||||
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
|
||||
---
|
||||
archival/libarchive/decompress_gunzip.c | 12 ++++++++++--
|
||||
1 file changed, 10 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/archival/libarchive/decompress_gunzip.c b/archival/libarchive/decompress_gunzip.c
|
||||
index eb3b64930..e93cd5005 100644
|
||||
--- a/archival/libarchive/decompress_gunzip.c
|
||||
+++ b/archival/libarchive/decompress_gunzip.c
|
||||
@@ -220,10 +220,20 @@ static const uint8_t border[] ALIGN1 = {
|
||||
* each table.
|
||||
* t: table to free
|
||||
*/
|
||||
+#define BAD_HUFT(p) ((uintptr_t)(p) & 1)
|
||||
+#define ERR_RET ((huft_t*)(uintptr_t)1)
|
||||
static void huft_free(huft_t *p)
|
||||
{
|
||||
huft_t *q;
|
||||
|
||||
+ /*
|
||||
+ * If 'p' has the error bit set we have to clear it, otherwise we might run
|
||||
+ * into a segmentation fault or an invalid pointer to free(p)
|
||||
+ */
|
||||
+ if (BAD_HUFT(p)) {
|
||||
+ p = (huft_t*)((uintptr_t)(p) ^ (uintptr_t)(ERR_RET));
|
||||
+ }
|
||||
+
|
||||
/* Go through linked list, freeing from the malloced (t[-1]) address. */
|
||||
while (p) {
|
||||
q = (--p)->v.t;
|
||||
@@ -289,8 +299,6 @@ static unsigned fill_bitbuffer(STATE_PARAM unsigned bitbuffer, unsigned *current
|
||||
* or a valid pointer to a Huffman table, ORed with 0x1 if incompete table
|
||||
* is given: "fixed inflate" decoder feeds us such data.
|
||||
*/
|
||||
-#define BAD_HUFT(p) ((uintptr_t)(p) & 1)
|
||||
-#define ERR_RET ((huft_t*)(uintptr_t)1)
|
||||
static huft_t* huft_build(const unsigned *b, const unsigned n,
|
||||
const unsigned s, const struct cp_ext *cp_ext,
|
||||
unsigned *m)
|
||||
@@ -46,7 +46,8 @@ SRC_URI = "https://busybox.net/downloads/busybox-${PV}.tar.bz2;name=tarball \
|
||||
file://0001-hwclock-make-glibc-2.31-compatible.patch \
|
||||
file://rev.cfg \
|
||||
file://pgrep.cfg \
|
||||
"
|
||||
file://0001-decompress_gunzip-Fix-DoS-if-gzip-is-corrupt.patch \
|
||||
"
|
||||
SRC_URI_append_libc-musl = " file://musl.cfg "
|
||||
|
||||
SRC_URI[tarball.md5sum] = "9576986f1a960da471d03b72a62f13c7"
|
||||
|
||||
1444
meta/recipes-core/glib-2.0/glib-2.0/CVE-2021-27219.patch
Normal file
1444
meta/recipes-core/glib-2.0/glib-2.0/CVE-2021-27219.patch
Normal file
File diff suppressed because it is too large
Load Diff
@@ -18,6 +18,7 @@ SRC_URI = "${GNOME_MIRROR}/glib/${SHRT_VER}/glib-${PV}.tar.xz \
|
||||
file://0001-gio-tests-resources.c-comment-out-a-build-host-only-.patch \
|
||||
file://tzdata-update.patch \
|
||||
file://CVE-2020-35457.patch \
|
||||
file://CVE-2021-27219.patch \
|
||||
"
|
||||
|
||||
SRC_URI_append_class-native = " file://relocate-modules.patch"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
SRCBRANCH ?= "release/2.32/master"
|
||||
PV = "2.32"
|
||||
SRCREV_glibc ?= "760e1d287825fa91d4d5a0cc921340c740d803e2"
|
||||
SRCREV_glibc ?= "44b395932961a29825da4ad025124a6760858d9c"
|
||||
SRCREV_localedef ?= "bd644c9e6f3e20c5504da1488448173c69c56c28"
|
||||
|
||||
GLIBC_GIT_URI ?= "git://sourceware.org/git/glibc.git"
|
||||
|
||||
@@ -2,7 +2,7 @@ require glibc.inc
|
||||
require glibc-version.inc
|
||||
|
||||
# whitelist CVE's with fixes in latest release/2.32/master branch
|
||||
CVE_CHECK_WHITELIST += "CVE-2019-25013 CVE-2020-10029 CVE-2020-27618"
|
||||
CVE_CHECK_WHITELIST += "CVE-2019-25013 CVE-2020-10029 CVE-2020-27618 CVE-2021-27645 CVE-2021-3326"
|
||||
|
||||
DEPENDS += "gperf-native bison-native make-native"
|
||||
|
||||
|
||||
@@ -22,9 +22,9 @@ APPEND += "rootfstype=ext4 quiet"
|
||||
DEPENDS = "zip-native python3-pip-native"
|
||||
IMAGE_FSTYPES = "wic.vmdk"
|
||||
|
||||
inherit core-image module-base setuptools3
|
||||
inherit core-image setuptools3
|
||||
|
||||
SRCREV ?= "3bd4bf96cce57d3e9286f75c0f12c8b36d706a1c"
|
||||
SRCREV ?= "79c4792da2b400431c09d9a2f53efd4443812281"
|
||||
SRC_URI = "git://git.yoctoproject.org/poky;branch=gatesgarth \
|
||||
file://Yocto_Build_Appliance.vmx \
|
||||
file://Yocto_Build_Appliance.vmxf \
|
||||
@@ -61,12 +61,6 @@ fakeroot do_populate_poky_src () {
|
||||
# Place the README_VirtualBox_Toaster file in builders home folder.
|
||||
cp ${WORKDIR}/README_VirtualBox_Toaster.txt ${IMAGE_ROOTFS}/home/builder/
|
||||
|
||||
# Create a symlink, needed for out-of-tree kernel modules build
|
||||
if [ ! -e ${IMAGE_ROOTFS}/lib/modules/${KERNEL_VERSION}/build ]; then
|
||||
rm -f ${IMAGE_ROOTFS}/lib/modules/${KERNEL_VERSION}/build
|
||||
lnr ${IMAGE_ROOTFS}${KERNEL_SRC_PATH} ${IMAGE_ROOTFS}/lib/modules/${KERNEL_VERSION}/build
|
||||
fi
|
||||
|
||||
echo "INHERIT += \"rm_work\"" >> ${IMAGE_ROOTFS}/home/builder/poky/build/conf/auto.conf
|
||||
echo "export LC_ALL=en_US.utf8" >> ${IMAGE_ROOTFS}/home/builder/.bashrc
|
||||
|
||||
|
||||
@@ -279,6 +279,11 @@ fi
|
||||
|
||||
umount /tgt_root
|
||||
|
||||
# copy any extra files needed for ESP
|
||||
if [ -d /run/media/$1/esp ]; then
|
||||
cp -r /run/media/$1/esp/* /boot
|
||||
fi
|
||||
|
||||
# Copy kernel artifacts. To add more artifacts just add to types
|
||||
# For now just support kernel types already being used by something in OE-core
|
||||
for types in bzImage zImage vmlinux vmlinuz fitImage; do
|
||||
|
||||
@@ -28,11 +28,21 @@ TOOLCHAIN_HOST_TASK += "\
|
||||
nativesdk-libtool \
|
||||
nativesdk-pkgconfig \
|
||||
nativesdk-glibc-utils \
|
||||
nativesdk-glibc-gconv-ibm850 \
|
||||
nativesdk-glibc-gconv-iso8859-1 \
|
||||
nativesdk-glibc-gconv-utf-16 \
|
||||
nativesdk-glibc-gconv-cp1250 \
|
||||
nativesdk-glibc-gconv-cp1251 \
|
||||
nativesdk-glibc-gconv-cp1252 \
|
||||
nativesdk-glibc-gconv-euc-jp \
|
||||
nativesdk-glibc-gconv-libjis \
|
||||
nativesdk-libxcrypt-dev \
|
||||
nativesdk-parted \
|
||||
nativesdk-dosfstools \
|
||||
nativesdk-gptfdisk \
|
||||
"
|
||||
# gconv-cp1250, cp1251 and euc-jp needed for iconv to work in vim builds
|
||||
# also copied list from uninative
|
||||
|
||||
TOOLCHAIN_OUTPUTNAME = "${SDK_ARCH}-buildtools-extended-nativesdk-standalone-${DISTRO_VERSION}"
|
||||
|
||||
|
||||
@@ -138,14 +138,24 @@ def parse_node_and_insert(c, node, cveId):
|
||||
for cpe in node.get('cpe_match', ()):
|
||||
if not cpe['vulnerable']:
|
||||
return
|
||||
cpe23 = cpe['cpe23Uri'].split(':')
|
||||
cpe23 = cpe.get('cpe23Uri')
|
||||
if not cpe23:
|
||||
return
|
||||
cpe23 = cpe23.split(':')
|
||||
if len(cpe23) < 6:
|
||||
return
|
||||
vendor = cpe23[3]
|
||||
product = cpe23[4]
|
||||
version = cpe23[5]
|
||||
|
||||
if cpe23[6] == '*' or cpe23[6] == '-':
|
||||
version_suffix = ""
|
||||
else:
|
||||
version_suffix = "_" + cpe23[6]
|
||||
|
||||
if version != '*' and version != '-':
|
||||
# Version is defined, this is a '=' match
|
||||
yield [cveId, vendor, product, version, '=', '', '']
|
||||
yield [cveId, vendor, product, version + version_suffix, '=', '', '']
|
||||
elif version == '-':
|
||||
# no version information is available
|
||||
yield [cveId, vendor, product, version, '', '', '']
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
[Match]
|
||||
Name=en* eth*
|
||||
KernelCommandLine=!nfsroot
|
||||
KernelCommandLine=!ip
|
||||
|
||||
[Network]
|
||||
DHCP=yes
|
||||
|
||||
@@ -23,9 +23,6 @@ do_install() {
|
||||
# Based on change from YP bug 8141, OE commit 5196d7bacaef1076c361adaa2867be31759c1b52
|
||||
do_install_append_qemuall() {
|
||||
install -D -m0644 ${WORKDIR}/system.conf-qemuall ${D}${systemd_unitdir}/system.conf.d/01-${PN}.conf
|
||||
|
||||
# Do not install wired.network for qemu bsps
|
||||
rm -rf ${D}${systemd_unitdir}/network
|
||||
}
|
||||
|
||||
PACKAGE_ARCH = "${MACHINE_ARCH}"
|
||||
|
||||
@@ -0,0 +1,227 @@
|
||||
From 150d9cade6d475570395cb418b824524dead9577 Mon Sep 17 00:00:00 2001
|
||||
From: Joshua Watt <JPEWhacker@gmail.com>
|
||||
Date: Fri, 30 Oct 2020 08:15:43 -0500
|
||||
Subject: [PATCH] logind: Restore chvt as non-root user without polkit
|
||||
|
||||
4acf0cfd2f ("logind: check PolicyKit before allowing VT switch") broke
|
||||
the ability to write user sessions that run graphical sessions (e.g.
|
||||
weston/X11). This was partially amended in 19bb87fbfa ("login: allow
|
||||
non-console sessions to change vt") by changing the default PolicyKit
|
||||
policy so that non-root users are again allowed to switch the VT. This
|
||||
makes the policy when PolKit is not enabled (as on many embedded
|
||||
systems) match the default PolKit policy and allows launching graphical
|
||||
sessions as a non-root user.
|
||||
|
||||
Closes #17473
|
||||
---
|
||||
src/login/logind-dbus.c | 11 ++-------
|
||||
src/login/logind-polkit.c | 26 +++++++++++++++++++++
|
||||
src/login/logind-polkit.h | 10 ++++++++
|
||||
src/login/logind-seat-dbus.c | 41 ++++-----------------------------
|
||||
src/login/logind-session-dbus.c | 11 ++-------
|
||||
src/login/meson.build | 1 +
|
||||
6 files changed, 46 insertions(+), 54 deletions(-)
|
||||
create mode 100644 src/login/logind-polkit.c
|
||||
create mode 100644 src/login/logind-polkit.h
|
||||
|
||||
diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c
|
||||
index 0f83ed99bc..a3765d88ba 100644
|
||||
--- a/src/login/logind-dbus.c
|
||||
+++ b/src/login/logind-dbus.c
|
||||
@@ -30,6 +30,7 @@
|
||||
#include "format-util.h"
|
||||
#include "fs-util.h"
|
||||
#include "logind-dbus.h"
|
||||
+#include "logind-polkit.h"
|
||||
#include "logind-seat-dbus.h"
|
||||
#include "logind-session-dbus.h"
|
||||
#include "logind-user-dbus.h"
|
||||
@@ -1047,15 +1048,7 @@ static int method_activate_session_on_seat(sd_bus_message *message, void *userda
|
||||
return sd_bus_error_setf(error, BUS_ERROR_SESSION_NOT_ON_SEAT,
|
||||
"Session %s not on seat %s", session_name, seat_name);
|
||||
|
||||
- r = bus_verify_polkit_async(
|
||||
- message,
|
||||
- CAP_SYS_ADMIN,
|
||||
- "org.freedesktop.login1.chvt",
|
||||
- NULL,
|
||||
- false,
|
||||
- UID_INVALID,
|
||||
- &m->polkit_registry,
|
||||
- error);
|
||||
+ r = check_polkit_chvt(message, m, error);
|
||||
if (r < 0)
|
||||
return r;
|
||||
if (r == 0)
|
||||
diff --git a/src/login/logind-polkit.c b/src/login/logind-polkit.c
|
||||
new file mode 100644
|
||||
index 0000000000..9072570cc6
|
||||
--- /dev/null
|
||||
+++ b/src/login/logind-polkit.c
|
||||
@@ -0,0 +1,26 @@
|
||||
+/* SPDX-License-Identifier: LGPL-2.1+ */
|
||||
+
|
||||
+#include "bus-polkit.h"
|
||||
+#include "logind-polkit.h"
|
||||
+#include "missing_capability.h"
|
||||
+#include "user-util.h"
|
||||
+
|
||||
+int check_polkit_chvt(sd_bus_message *message, Manager *manager, sd_bus_error *error) {
|
||||
+#if ENABLE_POLKIT
|
||||
+ return bus_verify_polkit_async(
|
||||
+ message,
|
||||
+ CAP_SYS_ADMIN,
|
||||
+ "org.freedesktop.login1.chvt",
|
||||
+ NULL,
|
||||
+ false,
|
||||
+ UID_INVALID,
|
||||
+ &manager->polkit_registry,
|
||||
+ error);
|
||||
+#else
|
||||
+ /* Allow chvt when polkit is not present. This allows a service to start a graphical session as a
|
||||
+ * non-root user when polkit is not compiled in, matching the default polkit policy */
|
||||
+ return 1;
|
||||
+#endif
|
||||
+}
|
||||
+
|
||||
+
|
||||
diff --git a/src/login/logind-polkit.h b/src/login/logind-polkit.h
|
||||
new file mode 100644
|
||||
index 0000000000..476c077a8a
|
||||
--- /dev/null
|
||||
+++ b/src/login/logind-polkit.h
|
||||
@@ -0,0 +1,10 @@
|
||||
+/* SPDX-License-Identifier: LGPL-2.1+ */
|
||||
+#pragma once
|
||||
+
|
||||
+#include "sd-bus.h"
|
||||
+
|
||||
+#include "bus-object.h"
|
||||
+#include "logind.h"
|
||||
+
|
||||
+int check_polkit_chvt(sd_bus_message *message, Manager *manager, sd_bus_error *error);
|
||||
+
|
||||
diff --git a/src/login/logind-seat-dbus.c b/src/login/logind-seat-dbus.c
|
||||
index a945132284..f22e9e2734 100644
|
||||
--- a/src/login/logind-seat-dbus.c
|
||||
+++ b/src/login/logind-seat-dbus.c
|
||||
@@ -9,6 +9,7 @@
|
||||
#include "bus-polkit.h"
|
||||
#include "bus-util.h"
|
||||
#include "logind-dbus.h"
|
||||
+#include "logind-polkit.h"
|
||||
#include "logind-seat-dbus.h"
|
||||
#include "logind-seat.h"
|
||||
#include "logind-session-dbus.h"
|
||||
@@ -179,15 +180,7 @@ static int method_activate_session(sd_bus_message *message, void *userdata, sd_b
|
||||
if (session->seat != s)
|
||||
return sd_bus_error_setf(error, BUS_ERROR_SESSION_NOT_ON_SEAT, "Session %s not on seat %s", name, s->id);
|
||||
|
||||
- r = bus_verify_polkit_async(
|
||||
- message,
|
||||
- CAP_SYS_ADMIN,
|
||||
- "org.freedesktop.login1.chvt",
|
||||
- NULL,
|
||||
- false,
|
||||
- UID_INVALID,
|
||||
- &s->manager->polkit_registry,
|
||||
- error);
|
||||
+ r = check_polkit_chvt(message, s->manager, error);
|
||||
if (r < 0)
|
||||
return r;
|
||||
if (r == 0)
|
||||
@@ -215,15 +208,7 @@ static int method_switch_to(sd_bus_message *message, void *userdata, sd_bus_erro
|
||||
if (to <= 0)
|
||||
return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid virtual terminal");
|
||||
|
||||
- r = bus_verify_polkit_async(
|
||||
- message,
|
||||
- CAP_SYS_ADMIN,
|
||||
- "org.freedesktop.login1.chvt",
|
||||
- NULL,
|
||||
- false,
|
||||
- UID_INVALID,
|
||||
- &s->manager->polkit_registry,
|
||||
- error);
|
||||
+ r = check_polkit_chvt(message, s->manager, error);
|
||||
if (r < 0)
|
||||
return r;
|
||||
if (r == 0)
|
||||
@@ -243,15 +228,7 @@ static int method_switch_to_next(sd_bus_message *message, void *userdata, sd_bus
|
||||
assert(message);
|
||||
assert(s);
|
||||
|
||||
- r = bus_verify_polkit_async(
|
||||
- message,
|
||||
- CAP_SYS_ADMIN,
|
||||
- "org.freedesktop.login1.chvt",
|
||||
- NULL,
|
||||
- false,
|
||||
- UID_INVALID,
|
||||
- &s->manager->polkit_registry,
|
||||
- error);
|
||||
+ r = check_polkit_chvt(message, s->manager, error);
|
||||
if (r < 0)
|
||||
return r;
|
||||
if (r == 0)
|
||||
@@ -271,15 +248,7 @@ static int method_switch_to_previous(sd_bus_message *message, void *userdata, sd
|
||||
assert(message);
|
||||
assert(s);
|
||||
|
||||
- r = bus_verify_polkit_async(
|
||||
- message,
|
||||
- CAP_SYS_ADMIN,
|
||||
- "org.freedesktop.login1.chvt",
|
||||
- NULL,
|
||||
- false,
|
||||
- UID_INVALID,
|
||||
- &s->manager->polkit_registry,
|
||||
- error);
|
||||
+ r = check_polkit_chvt(message, s->manager, error);
|
||||
if (r < 0)
|
||||
return r;
|
||||
if (r == 0)
|
||||
diff --git a/src/login/logind-session-dbus.c b/src/login/logind-session-dbus.c
|
||||
index ccc5ac8df2..57c8a4e900 100644
|
||||
--- a/src/login/logind-session-dbus.c
|
||||
+++ b/src/login/logind-session-dbus.c
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "fd-util.h"
|
||||
#include "logind-brightness.h"
|
||||
#include "logind-dbus.h"
|
||||
+#include "logind-polkit.h"
|
||||
#include "logind-seat-dbus.h"
|
||||
#include "logind-session-dbus.h"
|
||||
#include "logind-session-device.h"
|
||||
@@ -192,15 +193,7 @@ int bus_session_method_activate(sd_bus_message *message, void *userdata, sd_bus_
|
||||
assert(message);
|
||||
assert(s);
|
||||
|
||||
- r = bus_verify_polkit_async(
|
||||
- message,
|
||||
- CAP_SYS_ADMIN,
|
||||
- "org.freedesktop.login1.chvt",
|
||||
- NULL,
|
||||
- false,
|
||||
- UID_INVALID,
|
||||
- &s->manager->polkit_registry,
|
||||
- error);
|
||||
+ r = check_polkit_chvt(message, s->manager, error);
|
||||
if (r < 0)
|
||||
return r;
|
||||
if (r == 0)
|
||||
diff --git a/src/login/meson.build b/src/login/meson.build
|
||||
index 0a7d3d5440..7e46be2add 100644
|
||||
--- a/src/login/meson.build
|
||||
+++ b/src/login/meson.build
|
||||
@@ -26,6 +26,7 @@ liblogind_core_sources = files('''
|
||||
logind-device.h
|
||||
logind-inhibit.c
|
||||
logind-inhibit.h
|
||||
+ logind-polkit.c
|
||||
logind-seat-dbus.c
|
||||
logind-seat-dbus.h
|
||||
logind-seat.c
|
||||
--
|
||||
2.28.0
|
||||
|
||||
@@ -21,6 +21,7 @@ SRC_URI += "file://touchscreen.rules \
|
||||
file://0001-binfmt-Don-t-install-dependency-links-at-install-tim.patch \
|
||||
file://0003-implment-systemd-sysv-install-for-OE.patch \
|
||||
file://0001-systemd.pc.in-use-ROOTPREFIX-without-suffixed-slash.patch \
|
||||
file://0001-logind-Restore-chvt-as-non-root-user-without-polkit.patch \
|
||||
"
|
||||
|
||||
# patches needed by musl
|
||||
@@ -134,7 +135,7 @@ PACKAGECONFIG[hibernate] = "-Dhibernate=true,-Dhibernate=false"
|
||||
PACKAGECONFIG[hostnamed] = "-Dhostnamed=true,-Dhostnamed=false"
|
||||
PACKAGECONFIG[idn] = "-Didn=true,-Didn=false"
|
||||
PACKAGECONFIG[ima] = "-Dima=true,-Dima=false"
|
||||
# importd requires curl/xz/zlib/bzip2/gcrypt
|
||||
# importd requires journal-upload/xz/zlib/bzip2/gcrypt
|
||||
PACKAGECONFIG[importd] = "-Dimportd=true,-Dimportd=false"
|
||||
# Update NAT firewall rules
|
||||
PACKAGECONFIG[iptc] = "-Dlibiptc=true,-Dlibiptc=false,iptables"
|
||||
|
||||
@@ -44,5 +44,6 @@ SRC_URI = "\
|
||||
file://0017-gas-improve-reproducibility-for-stabs-debugging-data.patch \
|
||||
file://0001-aarch64-Return-an-error-on-conditional-branch-to-an-.patch \
|
||||
file://CVE-2020-35448.patch \
|
||||
file://0001-gold-ensure-file_counts_lock-is-initialized-before-u.patch \
|
||||
"
|
||||
S = "${WORKDIR}/git"
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
From de24fc96bf24fca470a9ca13176ad9ad9cc4d5a9 Mon Sep 17 00:00:00 2001
|
||||
From: Nick Gasson <nick.gasson@arm.com>
|
||||
Date: Mon, 2 Nov 2020 12:02:05 +0800
|
||||
Subject: [PATCH] gold: ensure file_counts_lock is initialized before using
|
||||
|
||||
Since upgrading to binutils 2.35 I've been experiencing random memory
|
||||
corruption related crashes with ld.gold --threads. It's caused by
|
||||
multiple threads concurrently pushing elements onto the shared
|
||||
std::vector in File_read::record_file_read(). This vector is supposed to
|
||||
be protected by file_counts_lock, but that is initialized lazily and
|
||||
might be NULL when File_read::open() is called, in which case
|
||||
Hold_optional_lock silently skips locking it.
|
||||
|
||||
Fix by calling the initialize() method before attempting to acquire the
|
||||
lock, the same as other places that use file_counts_lock.
|
||||
|
||||
PR 26827
|
||||
* fileread.cc (File_read::open): Ensure file_counts_lock is
|
||||
initialized.
|
||||
* testsuite/Makefile.am (check_PROGRAMS): Add a test that passes
|
||||
-Wl,--threads.
|
||||
* testsuite/Makefile.in: Regenerate.
|
||||
|
||||
Upstream-Status: Backport [af61e84fd2d from 2.36.0]
|
||||
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
|
||||
---
|
||||
gold/fileread.cc | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/gold/fileread.cc b/gold/fileread.cc
|
||||
index f5ca719360d..0b5228e2afd 100644
|
||||
--- a/gold/fileread.cc
|
||||
+++ b/gold/fileread.cc
|
||||
@@ -212,6 +212,7 @@ File_read::open(const Task* task, const std::string& name)
|
||||
gold_debug(DEBUG_FILES, "Attempt to open %s succeeded",
|
||||
this->name_.c_str());
|
||||
this->token_.add_writer(task);
|
||||
+ file_counts_initialize_lock.initialize();
|
||||
Hold_optional_lock hl(file_counts_lock);
|
||||
record_file_read(this->name_);
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
From 2a3db4e3b8d33bad5577c2fcfe124ee7a202ef4f Mon Sep 17 00:00:00 2001
|
||||
From: Joshua Watt <JPEWhacker@gmail.com>
|
||||
Date: Mon, 15 Feb 2021 20:39:57 -0600
|
||||
Subject: [PATCH] Use mapped file name for symbols
|
||||
|
||||
Applies the file name mapping before exporting it as a symbol. This
|
||||
allows the symbols to correctly respect the --file-prefix-map command
|
||||
line option.
|
||||
|
||||
Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
|
||||
Upstream-Status: Submitted [https://lists.gnu.org/archive/html/bison-patches/2021-02/msg00014.html]
|
||||
---
|
||||
src/muscle-tab.c | 4 +++-
|
||||
src/output.c | 8 ++++++--
|
||||
2 files changed, 9 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/muscle-tab.c b/src/muscle-tab.c
|
||||
index b610d0b8..3e7657ca 100644
|
||||
--- a/src/muscle-tab.c
|
||||
+++ b/src/muscle-tab.c
|
||||
@@ -204,8 +204,10 @@ static void
|
||||
muscle_syncline_grow (char const *key, location loc)
|
||||
{
|
||||
obstack_printf (&muscle_obstack, "]b4_syncline(%d, ", loc.start.line);
|
||||
+ char *f = map_file_name (loc.start.file);
|
||||
obstack_quote (&muscle_obstack,
|
||||
- quotearg_style (c_quoting_style, loc.start.file));
|
||||
+ quotearg_style (c_quoting_style, f));
|
||||
+ free (f);
|
||||
obstack_sgrow (&muscle_obstack, ")dnl\n[");
|
||||
char const *extension = obstack_finish0 (&muscle_obstack);
|
||||
muscle_grow (key, extension, "", "");
|
||||
diff --git a/src/output.c b/src/output.c
|
||||
index 391d8e65..34dbc671 100644
|
||||
--- a/src/output.c
|
||||
+++ b/src/output.c
|
||||
@@ -531,7 +531,9 @@ user_actions_output (FILE *out)
|
||||
{
|
||||
fprintf (out, "b4_syncline(%d, ",
|
||||
rules[r].action_loc.start.line);
|
||||
- string_output (out, rules[r].action_loc.start.file);
|
||||
+ char *f = map_file_name (rules[r].action_loc.start.file);
|
||||
+ string_output (out, f);
|
||||
+ free(f);
|
||||
fprintf (out, ")dnl\n");
|
||||
}
|
||||
fprintf (out, "[%*s%s]],\n[[",
|
||||
@@ -629,8 +631,10 @@ prepare_symbol_definitions (void)
|
||||
|
||||
if (p->code)
|
||||
{
|
||||
+ char *f = map_file_name (p->location.start.file);
|
||||
SET_KEY2 (pname, "file");
|
||||
- MUSCLE_INSERT_C_STRING (key, p->location.start.file);
|
||||
+ MUSCLE_INSERT_C_STRING (key, f);
|
||||
+ free (f);
|
||||
|
||||
SET_KEY2 (pname, "line");
|
||||
MUSCLE_INSERT_INT (key, p->location.start.line);
|
||||
--
|
||||
2.30.0
|
||||
|
||||
@@ -11,6 +11,7 @@ DEPENDS = "bison-native flex-native"
|
||||
|
||||
SRC_URI = "${GNU_MIRROR}/bison/bison-${PV}.tar.xz \
|
||||
file://add-with-bisonlocaledir.patch \
|
||||
file://0001-Use-mapped-file-name-for-symbols.patch \
|
||||
"
|
||||
SRC_URI[sha256sum] = "7948d193104d979c0fb0294a1854c73c89d72ae41acfc081826142578a78a91b"
|
||||
|
||||
|
||||
@@ -35,6 +35,11 @@ do_compile () {
|
||||
do_install () {
|
||||
cd ${B}/${TARGET_SYS}/libsanitizer/
|
||||
oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/${TARGET_SYS}/libsanitizer/ install
|
||||
if [ -d ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include ]; then
|
||||
install -d ${D}${libdir}/${TARGET_SYS}/${BINV}/include
|
||||
mv ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/* ${D}${libdir}/${TARGET_SYS}/${BINV}/include
|
||||
rmdir --ignore-fail-on-non-empty -p ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include
|
||||
fi
|
||||
if [ -d ${D}${infodir} ]; then
|
||||
rmdir --ignore-fail-on-non-empty -p ${D}${infodir}
|
||||
fi
|
||||
@@ -109,4 +114,4 @@ FILES_libtsan-dev += "\
|
||||
"
|
||||
FILES_libtsan-staticdev += "${libdir}/libtsan.a"
|
||||
|
||||
FILES_${PN} = "${libdir}/*.spec ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/sanitizer/*.h"
|
||||
FILES_${PN} = "${libdir}/*.spec ${libdir}/${TARGET_SYS}/${BINV}/include/sanitizer/*.h"
|
||||
|
||||
@@ -7,7 +7,10 @@ DEPENDS = "openssl curl zlib expat"
|
||||
PROVIDES_append_class-native = " git-replacement-native"
|
||||
|
||||
SRC_URI = "${KERNELORG_MIRROR}/software/scm/git/git-${PV}.tar.gz;name=tarball \
|
||||
${KERNELORG_MIRROR}/software/scm/git/git-manpages-${PV}.tar.gz;name=manpages"
|
||||
${KERNELORG_MIRROR}/software/scm/git/git-manpages-${PV}.tar.gz;name=manpages \
|
||||
file://fixsort.patch \
|
||||
file://CVE-2021-21300.patch \
|
||||
"
|
||||
|
||||
S = "${WORKDIR}/git-${PV}"
|
||||
|
||||
|
||||
304
meta/recipes-devtools/git/git/CVE-2021-21300.patch
Normal file
304
meta/recipes-devtools/git/git/CVE-2021-21300.patch
Normal file
@@ -0,0 +1,304 @@
|
||||
From ba07d31bd2140190c4d8c197c9b8a503544b4c29 Mon Sep 17 00:00:00 2001
|
||||
From: Minjae Kim <flowrgom@gmail.com>
|
||||
Date: Sat, 27 Mar 2021 14:05:56 +0900
|
||||
Subject: [PATCH] checkout: fix bug that makes checkout follow symlinks in
|
||||
leading path
|
||||
|
||||
Before checking out a file, we have to confirm that all of its leading
|
||||
components are real existing directories. And to reduce the number of
|
||||
lstat() calls in this process, we cache the last leading path known to
|
||||
contain only directories. However, when a path collision occurs (e.g.
|
||||
when checking out case-sensitive files in case-insensitive file
|
||||
systems), a cached path might have its file type changed on disk,
|
||||
leaving the cache on an invalid state. Normally, this doesn't bring
|
||||
any bad consequences as we usually check out files in index order, and
|
||||
therefore, by the time the cached path becomes outdated, we no longer
|
||||
need it anyway (because all files in that directory would have already
|
||||
been written).
|
||||
|
||||
But, there are some users of the checkout machinery that do not always
|
||||
follow the index order. In particular: checkout-index writes the paths
|
||||
in the same order that they appear on the CLI (or stdin); and the
|
||||
delayed checkout feature -- used when a long-running filter process
|
||||
replies with "status=delayed" -- postpones the checkout of some entries,
|
||||
thus modifying the checkout order.
|
||||
|
||||
When we have to check out an out-of-order entry and the lstat() cache is
|
||||
invalid (due to a previous path collision), checkout_entry() may end up
|
||||
using the invalid data and thrusting that the leading components are
|
||||
real directories when, in reality, they are not. In the best case
|
||||
scenario, where the directory was replaced by a regular file, the user
|
||||
will get an error: "fatal: unable to create file 'foo/bar': Not a
|
||||
directory". But if the directory was replaced by a symlink, checkout
|
||||
could actually end up following the symlink and writing the file at a
|
||||
wrong place, even outside the repository. Since delayed checkout is
|
||||
affected by this bug, it could be used by an attacker to write
|
||||
arbitrary files during the clone of a maliciously crafted repository.
|
||||
|
||||
Some candidate solutions considered were to disable the lstat() cache
|
||||
during unordered checkouts or sort the entries before passing them to
|
||||
the checkout machinery. But both ideas include some performance penalty
|
||||
and they don't future-proof the code against new unordered use cases.
|
||||
|
||||
Instead, we now manually reset the lstat cache whenever we successfully
|
||||
remove a directory. Note: We are not even checking whether the directory
|
||||
was the same as the lstat cache points to because we might face a
|
||||
scenario where the paths refer to the same location but differ due to
|
||||
case folding, precomposed UTF-8 issues, or the presence of `..`
|
||||
components in the path. Two regression tests, with case-collisions and
|
||||
utf8-collisions, are also added for both checkout-index and delayed
|
||||
checkout.
|
||||
|
||||
Note: to make the previously mentioned clone attack unfeasible, it would
|
||||
be sufficient to reset the lstat cache only after the remove_subtree()
|
||||
call inside checkout_entry(). This is the place where we would remove a
|
||||
directory whose path collides with the path of another entry that we are
|
||||
currently trying to check out (possibly a symlink). However, in the
|
||||
interest of a thorough fix that does not leave Git open to
|
||||
similar-but-not-identical attack vectors, we decided to intercept
|
||||
all `rmdir()` calls in one fell swoop.
|
||||
|
||||
This addresses CVE-2021-21300.
|
||||
|
||||
Co-authored-by: Johannes Schindelin <johannes.schindelin@gmx.de>
|
||||
Signed-off-by: Matheus Tavares <matheus.bernardino@usp.br>
|
||||
|
||||
Upstream-Status: Acepted [https://github.com/git/git/commit/684dd4c2b414bcf648505e74498a608f28de4592]
|
||||
CVE: CVE-2021-21300
|
||||
Signed-off-by: Minjae Kim <flowergom@gmail.com>
|
||||
---
|
||||
cache.h | 1 +
|
||||
compat/mingw.c | 2 ++
|
||||
git-compat-util.h | 5 +++++
|
||||
symlinks.c | 24 ++++++++++++++++++++
|
||||
t/t0021-conversion.sh | 39 ++++++++++++++++++++++++++++++++
|
||||
t/t0021/rot13-filter.pl | 21 ++++++++++++++---
|
||||
t/t2006-checkout-index-basic.sh | 40 +++++++++++++++++++++++++++++++++
|
||||
7 files changed, 129 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/cache.h b/cache.h
|
||||
index 6544264..64226c3 100644
|
||||
--- a/cache.h
|
||||
+++ b/cache.h
|
||||
@@ -1733,6 +1733,7 @@ int has_symlink_leading_path(const char *name, int len);
|
||||
int threaded_has_symlink_leading_path(struct cache_def *, const char *, int);
|
||||
int check_leading_path(const char *name, int len);
|
||||
int has_dirs_only_path(const char *name, int len, int prefix_len);
|
||||
+extern void invalidate_lstat_cache(void);
|
||||
void schedule_dir_for_removal(const char *name, int len);
|
||||
void remove_scheduled_dirs(void);
|
||||
|
||||
diff --git a/compat/mingw.c b/compat/mingw.c
|
||||
index 8ee0b64..be2b88e 100644
|
||||
--- a/compat/mingw.c
|
||||
+++ b/compat/mingw.c
|
||||
@@ -364,6 +364,8 @@ int mingw_rmdir(const char *pathname)
|
||||
ask_yes_no_if_possible("Deletion of directory '%s' failed. "
|
||||
"Should I try again?", pathname))
|
||||
ret = _wrmdir(wpathname);
|
||||
+ if (!ret)
|
||||
+ invalidate_lstat_cache();
|
||||
return ret;
|
||||
}
|
||||
|
||||
diff --git a/git-compat-util.h b/git-compat-util.h
|
||||
index 5637114..d983853 100644
|
||||
--- a/git-compat-util.h
|
||||
+++ b/git-compat-util.h
|
||||
@@ -345,6 +345,11 @@ static inline int noop_core_config(const char *var, const char *value, void *cb)
|
||||
#define platform_core_config noop_core_config
|
||||
#endif
|
||||
|
||||
+int lstat_cache_aware_rmdir(const char *path);
|
||||
+#if !defined(__MINGW32__) && !defined(_MSC_VER)
|
||||
+#define rmdir lstat_cache_aware_rmdir
|
||||
+#endif
|
||||
+
|
||||
#ifndef has_dos_drive_prefix
|
||||
static inline int git_has_dos_drive_prefix(const char *path)
|
||||
{
|
||||
diff --git a/symlinks.c b/symlinks.c
|
||||
index 69d458a..7dbb6b2 100644
|
||||
--- a/symlinks.c
|
||||
+++ b/symlinks.c
|
||||
@@ -267,6 +267,13 @@ int has_dirs_only_path(const char *name, int len, int prefix_len)
|
||||
*/
|
||||
static int threaded_has_dirs_only_path(struct cache_def *cache, const char *name, int len, int prefix_len)
|
||||
{
|
||||
+ /*
|
||||
+ * Note: this function is used by the checkout machinery, which also
|
||||
+ * takes care to properly reset the cache when it performs an operation
|
||||
+ * that would leave the cache outdated. If this function starts caching
|
||||
+ * anything else besides FL_DIR, remember to also invalidate the cache
|
||||
+ * when creating or deleting paths that might be in the cache.
|
||||
+ */
|
||||
return lstat_cache(cache, name, len,
|
||||
FL_DIR|FL_FULLPATH, prefix_len) &
|
||||
FL_DIR;
|
||||
@@ -321,3 +328,20 @@ void remove_scheduled_dirs(void)
|
||||
{
|
||||
do_remove_scheduled_dirs(0);
|
||||
}
|
||||
+
|
||||
+void invalidate_lstat_cache(void)
|
||||
+{
|
||||
+ reset_lstat_cache(&default_cache);
|
||||
+}
|
||||
+
|
||||
+#undef rmdir
|
||||
+int lstat_cache_aware_rmdir(const char *path)
|
||||
+{
|
||||
+ /* Any change in this function must be made also in `mingw_rmdir()` */
|
||||
+ int ret = rmdir(path);
|
||||
+
|
||||
+ if (!ret)
|
||||
+ invalidate_lstat_cache();
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
diff --git a/t/t0021-conversion.sh b/t/t0021-conversion.sh
|
||||
index 4bfffa9..c42f51e 100755
|
||||
--- a/t/t0021-conversion.sh
|
||||
+++ b/t/t0021-conversion.sh
|
||||
@@ -957,4 +957,43 @@ test_expect_success PERL 'invalid file in delayed checkout' '
|
||||
grep "error: external filter .* signaled that .unfiltered. is now available although it has not been delayed earlier" git-stderr.log
|
||||
'
|
||||
|
||||
+for mode in 'case' 'utf-8'
|
||||
+do
|
||||
+ case "$mode" in
|
||||
+ case) dir='A' symlink='a' mode_prereq='CASE_INSENSITIVE_FS' ;;
|
||||
+ utf-8)
|
||||
+ dir=$(printf "\141\314\210") symlink=$(printf "\303\244")
|
||||
+ mode_prereq='UTF8_NFD_TO_NFC' ;;
|
||||
+ esac
|
||||
+
|
||||
+ test_expect_success PERL,SYMLINKS,$mode_prereq \
|
||||
+ "delayed checkout with $mode-collision don't write to the wrong place" '
|
||||
+ test_config_global filter.delay.process \
|
||||
+ "\"$TEST_ROOT/rot13-filter.pl\" --always-delay delayed.log clean smudge delay" &&
|
||||
+ test_config_global filter.delay.required true &&
|
||||
+ git init $mode-collision &&
|
||||
+ (
|
||||
+ cd $mode-collision &&
|
||||
+ mkdir target-dir &&
|
||||
+ empty_oid=$(printf "" | git hash-object -w --stdin) &&
|
||||
+ symlink_oid=$(printf "%s" "$PWD/target-dir" | git hash-object -w --stdin) &&
|
||||
+ attr_oid=$(echo "$dir/z filter=delay" | git hash-object -w --stdin) &&
|
||||
+ cat >objs <<-EOF &&
|
||||
+ 100644 blob $empty_oid $dir/x
|
||||
+ 100644 blob $empty_oid $dir/y
|
||||
+ 100644 blob $empty_oid $dir/z
|
||||
+ 120000 blob $symlink_oid $symlink
|
||||
+ 100644 blob $attr_oid .gitattributes
|
||||
+ EOF
|
||||
+ git update-index --index-info <objs &&
|
||||
+ git commit -m "test commit"
|
||||
+ ) &&
|
||||
+ git clone $mode-collision $mode-collision-cloned &&
|
||||
+ # Make sure z was really delayed
|
||||
+ grep "IN: smudge $dir/z .* \\[DELAYED\\]" $mode-collision-cloned/delayed.log &&
|
||||
+ # Should not create $dir/z at $symlink/z
|
||||
+ test_path_is_missing $mode-collision/target-dir/z
|
||||
+ '
|
||||
+done
|
||||
+
|
||||
test_done
|
||||
diff --git a/t/t0021/rot13-filter.pl b/t/t0021/rot13-filter.pl
|
||||
index cd32a82..7bb9376 100644
|
||||
--- a/t/t0021/rot13-filter.pl
|
||||
+++ b/t/t0021/rot13-filter.pl
|
||||
@@ -2,9 +2,15 @@
|
||||
# Example implementation for the Git filter protocol version 2
|
||||
# See Documentation/gitattributes.txt, section "Filter Protocol"
|
||||
#
|
||||
-# The first argument defines a debug log file that the script write to.
|
||||
-# All remaining arguments define a list of supported protocol
|
||||
-# capabilities ("clean", "smudge", etc).
|
||||
+# Usage: rot13-filter.pl [--always-delay] <log path> <capabilities>
|
||||
+#
|
||||
+# Log path defines a debug log file that the script writes to. The
|
||||
+# subsequent arguments define a list of supported protocol capabilities
|
||||
+# ("clean", "smudge", etc).
|
||||
+#
|
||||
+# When --always-delay is given all pathnames with the "can-delay" flag
|
||||
+# that don't appear on the list bellow are delayed with a count of 1
|
||||
+# (see more below).
|
||||
#
|
||||
# This implementation supports special test cases:
|
||||
# (1) If data with the pathname "clean-write-fail.r" is processed with
|
||||
@@ -53,6 +59,13 @@ sub gitperllib {
|
||||
use Git::Packet;
|
||||
|
||||
my $MAX_PACKET_CONTENT_SIZE = 65516;
|
||||
+
|
||||
+my $always_delay = 0;
|
||||
+if ( $ARGV[0] eq '--always-delay' ) {
|
||||
+ $always_delay = 1;
|
||||
+ shift @ARGV;
|
||||
+}
|
||||
+
|
||||
my $log_file = shift @ARGV;
|
||||
my @capabilities = @ARGV;
|
||||
|
||||
@@ -134,6 +147,8 @@ sub rot13 {
|
||||
if ( $buffer eq "can-delay=1" ) {
|
||||
if ( exists $DELAY{$pathname} and $DELAY{$pathname}{"requested"} == 0 ) {
|
||||
$DELAY{$pathname}{"requested"} = 1;
|
||||
+ } elsif ( !exists $DELAY{$pathname} and $always_delay ) {
|
||||
+ $DELAY{$pathname} = { "requested" => 1, "count" => 1 };
|
||||
}
|
||||
} elsif ($buffer =~ /^(ref|treeish|blob)=/) {
|
||||
print $debug " $buffer";
|
||||
diff --git a/t/t2006-checkout-index-basic.sh b/t/t2006-checkout-index-basic.sh
|
||||
index 57cbdfe..f223a02 100755
|
||||
--- a/t/t2006-checkout-index-basic.sh
|
||||
+++ b/t/t2006-checkout-index-basic.sh
|
||||
@@ -21,4 +21,44 @@ test_expect_success 'checkout-index -h in broken repository' '
|
||||
test_i18ngrep "[Uu]sage" broken/usage
|
||||
'
|
||||
|
||||
+for mode in 'case' 'utf-8'
|
||||
+do
|
||||
+ case "$mode" in
|
||||
+ case) dir='A' symlink='a' mode_prereq='CASE_INSENSITIVE_FS' ;;
|
||||
+ utf-8)
|
||||
+ dir=$(printf "\141\314\210") symlink=$(printf "\303\244")
|
||||
+ mode_prereq='UTF8_NFD_TO_NFC' ;;
|
||||
+ esac
|
||||
+
|
||||
+ test_expect_success SYMLINKS,$mode_prereq \
|
||||
+ "checkout-index with $mode-collision don't write to the wrong place" '
|
||||
+ git init $mode-collision &&
|
||||
+ (
|
||||
+ cd $mode-collision &&
|
||||
+ mkdir target-dir &&
|
||||
+ empty_obj_hex=$(git hash-object -w --stdin </dev/null) &&
|
||||
+ symlink_hex=$(printf "%s" "$PWD/target-dir" | git hash-object -w --stdin) &&
|
||||
+ cat >objs <<-EOF &&
|
||||
+ 100644 blob ${empty_obj_hex} ${dir}/x
|
||||
+ 100644 blob ${empty_obj_hex} ${dir}/y
|
||||
+ 100644 blob ${empty_obj_hex} ${dir}/z
|
||||
+ 120000 blob ${symlink_hex} ${symlink}
|
||||
+ EOF
|
||||
+ git update-index --index-info <objs &&
|
||||
+ # Note: the order is important here to exercise the
|
||||
+ # case where the file at ${dir} has its type changed by
|
||||
+ # the time Git tries to check out ${dir}/z.
|
||||
+ #
|
||||
+ # Also, we use core.precomposeUnicode=false because we
|
||||
+ # want Git to treat the UTF-8 paths transparently on
|
||||
+ # Mac OS, matching what is in the index.
|
||||
+ #
|
||||
+ git -c core.precomposeUnicode=false checkout-index -f \
|
||||
+ ${dir}/x ${dir}/y ${symlink} ${dir}/z &&
|
||||
+ # Should not create ${dir}/z at ${symlink}/z
|
||||
+ test_path_is_missing target-dir/z
|
||||
+ )
|
||||
+ '
|
||||
+done
|
||||
+
|
||||
test_done
|
||||
--
|
||||
2.17.1
|
||||
|
||||
31
meta/recipes-devtools/git/git/fixsort.patch
Normal file
31
meta/recipes-devtools/git/git/fixsort.patch
Normal file
@@ -0,0 +1,31 @@
|
||||
[PATCH] generate-configlist.sh: Fix determinism issue
|
||||
|
||||
Currently git binaries are not entirely reproducible, at least partly
|
||||
due to config-list.h differing in order depending on the system's
|
||||
locale settings. Under different locales, the entries:
|
||||
|
||||
"sendemail.identity",
|
||||
"sendemail.<identity>.*",
|
||||
|
||||
would differ in order for example and this leads to differences in
|
||||
the debug symbols for the binaries.
|
||||
|
||||
This can be fixed by specifying the C locale for the sort in the
|
||||
shell script generating the header.
|
||||
|
||||
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
||||
Upstream-Status: Submitted [https://public-inbox.org/git/f029a942dd3d50d85e60bd37d8e454524987842f.camel@linuxfoundation.org/T/#u]
|
||||
|
||||
Index: git-2.30.0/generate-configlist.sh
|
||||
===================================================================
|
||||
--- git-2.30.0.orig/generate-configlist.sh
|
||||
+++ git-2.30.0/generate-configlist.sh
|
||||
@@ -9,7 +9,7 @@ static const char *config_name_list[] =
|
||||
EOF
|
||||
grep -h '^[a-zA-Z].*\..*::$' Documentation/*config.txt Documentation/config/*.txt |
|
||||
sed '/deprecated/d; s/::$//; s/, */\n/g' |
|
||||
- sort |
|
||||
+ LC_ALL=C sort |
|
||||
sed 's/^.*$/ "&",/'
|
||||
cat <<EOF
|
||||
NULL,
|
||||
@@ -1,7 +1,7 @@
|
||||
require go-common.inc
|
||||
|
||||
GO_BASEVERSION = "1.15"
|
||||
PV = "1.15.6"
|
||||
PV = "1.15.8"
|
||||
FILESEXTRAPATHS_prepend := "${FILE_DIRNAME}/go-${GO_BASEVERSION}:"
|
||||
|
||||
LIC_FILES_CHKSUM = "file://LICENSE;md5=5d4950ecb7b26d2c5e4e7b4e0dd74707"
|
||||
@@ -16,4 +16,4 @@ SRC_URI += "\
|
||||
file://0007-cmd-go-make-GOROOT-precious-by-default.patch \
|
||||
file://0008-use-GOBUILDMODE-to-set-buildmode.patch \
|
||||
"
|
||||
SRC_URI[main.sha256sum] = "890bba73c5e2b19ffb1180e385ea225059eb008eb91b694875dd86ea48675817"
|
||||
SRC_URI[main.sha256sum] = "540c0ab7781084d124991321ed1458e479982de94454a98afab6acadf38497c2"
|
||||
|
||||
@@ -8,8 +8,8 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=5d4950ecb7b26d2c5e4e7b4e0dd74707"
|
||||
PROVIDES = "go-native"
|
||||
|
||||
SRC_URI = "https://dl.google.com/go/go${PV}.${BUILD_GOOS}-${BUILD_GOARCH}.tar.gz;name=go_${BUILD_GOTUPLE}"
|
||||
SRC_URI[go_linux_amd64.sha256sum] = "3918e6cc85e7eaaa6f859f1bdbaac772e7a825b0eb423c63d3ae68b21f84b844"
|
||||
SRC_URI[go_linux_arm64.sha256sum] = "f87515b9744154ffe31182da9341d0a61eb0795551173d242c8cad209239e492"
|
||||
SRC_URI[go_linux_amd64.sha256sum] = "d3379c32a90fdf9382166f8f48034c459a8cc433730bc9476d39d9082c94583b"
|
||||
SRC_URI[go_linux_arm64.sha256sum] = "0e31ea4bf53496b0f0809730520dee98c0ae5c530f3701a19df0ba0a327bf3d2"
|
||||
|
||||
UPSTREAM_CHECK_URI = "https://golang.org/dl/"
|
||||
UPSTREAM_CHECK_REGEX = "go(?P<pver>\d+(\.\d+)+)\.linux"
|
||||
@@ -21,6 +21,7 @@ SRC_URI = "${GNU_MIRROR}/libtool/libtool-${PV}.tar.gz \
|
||||
file://unwind-opt-parsing.patch \
|
||||
file://0001-libtool-Fix-support-for-NIOS2-processor.patch \
|
||||
file://0001-libtool-Check-for-static-libs-for-internal-compiler-.patch \
|
||||
file://0001-Makefile.am-make-sure-autoheader-run-before-autoconf.patch \
|
||||
"
|
||||
|
||||
SRC_URI[md5sum] = "addf44b646ddb4e3919805aa88fa7c5e"
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
From dfbbbd359e43e0a55fbea06f2647279ad8761cb9 Mon Sep 17 00:00:00 2001
|
||||
From: Mingli Yu <mingli.yu@windriver.com>
|
||||
Date: Wed, 24 Mar 2021 03:04:13 +0000
|
||||
Subject: [PATCH] Makefile.am: make sure autoheader run before autoconf
|
||||
|
||||
autoheader will update ../libtool-2.4.6/libltdl/config-h.in which
|
||||
autoconf needs, so there comes a race sometimes as below:
|
||||
| configure.ac:45: error: required file 'config-h.in' not found
|
||||
| touch '../libtool-2.4.6/libltdl/config-h.in'
|
||||
|
||||
So make sure autoheader run before autoconf to avoid this race.
|
||||
|
||||
Upstream-Status: Submitted [libtool-patches@gnu.org maillist]
|
||||
|
||||
Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
|
||||
---
|
||||
Makefile.am | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/Makefile.am b/Makefile.am
|
||||
index 4142c90..fe1a9fc 100644
|
||||
--- a/Makefile.am
|
||||
+++ b/Makefile.am
|
||||
@@ -365,7 +365,7 @@ lt_configure_deps = $(lt_aclocal_m4) $(lt_aclocal_m4_deps)
|
||||
$(lt_aclocal_m4): $(lt_aclocal_m4_deps)
|
||||
$(AM_V_GEN)cd '$(srcdir)/$(ltdl_dir)' && $(ACLOCAL) -I ../m4
|
||||
|
||||
-$(lt_configure): $(lt_configure_deps)
|
||||
+$(lt_configure): $(lt_configure_deps) $(lt_config_h_in)
|
||||
$(AM_V_GEN)cd '$(srcdir)/$(ltdl_dir)' && $(AUTOCONF)
|
||||
|
||||
$(lt_config_h_in): $(lt_configure_deps)
|
||||
--
|
||||
2.29.2
|
||||
|
||||
@@ -42,11 +42,9 @@ ALTERNATIVE_PRIORITY = "100"
|
||||
ALTERNATIVE_${PN} = "flashcp flash_eraseall flash_lock flash_unlock nanddump nandwrite"
|
||||
ALTERNATIVE_${PN}-ubifs = "ubiattach ubidetach ubimkvol ubirename ubirmvol ubirsvol ubiupdatevol"
|
||||
|
||||
ALTERNATIVE_LINK_NAME[flash_eraseall] = "${sbindir}/flash_eraseall"
|
||||
ALTERNATIVE_LINK_NAME[nandwrite] = "${sbindir}/nandwrite"
|
||||
ALTERNATIVE_LINK_NAME[nanddump] = "${sbindir}/nanddump"
|
||||
ALTERNATIVE_LINK_NAME[ubiattach] = "${sbindir}/ubiattach"
|
||||
ALTERNATIVE_LINK_NAME[ubiattach] = "${sbindir}/ubiattach"
|
||||
ALTERNATIVE_LINK_NAME[ubidetach] = "${sbindir}/ubidetach"
|
||||
ALTERNATIVE_LINK_NAME[ubimkvol] = "${sbindir}/ubimkvol"
|
||||
ALTERNATIVE_LINK_NAME[ubirename] = "${sbindir}/ubirename"
|
||||
|
||||
24
meta/recipes-devtools/opkg/opkg/sourcedateepoch.patch
Normal file
24
meta/recipes-devtools/opkg/opkg/sourcedateepoch.patch
Normal file
@@ -0,0 +1,24 @@
|
||||
Having CLEAN_DATE come from the current date doesn't allow for build
|
||||
reproducibility. Add the option of using SOURCE_DATE_EPOCH if set
|
||||
which for OE, it will be.
|
||||
|
||||
Upstream-Status: Pending
|
||||
RP 2021/2/2
|
||||
|
||||
Index: opkg-0.4.4/configure.ac
|
||||
===================================================================
|
||||
--- opkg-0.4.4.orig/configure.ac
|
||||
+++ opkg-0.4.4/configure.ac
|
||||
@@ -281,7 +281,11 @@ AC_FUNC_UTIME_NULL
|
||||
AC_FUNC_VPRINTF
|
||||
AC_CHECK_FUNCS([memmove memset mkdir regcomp strchr strcspn strdup strerror strndup strrchr strstr strtol strtoul sysinfo utime])
|
||||
|
||||
-CLEAN_DATE=`date +"%B %Y" | tr -d '\n'`
|
||||
+if ! test -z "$SOURCE_DATE_EPOCH" ; then
|
||||
+ CLEAN_DATE=`LC_ALL=C date -d @$SOURCE_DATE_EPOCH +"%B %Y" | tr -d '\n'`
|
||||
+else
|
||||
+ CLEAN_DATE=`date +"%B %Y" | tr -d '\n'`
|
||||
+fi
|
||||
|
||||
AC_SUBST([CLEAN_DATE])
|
||||
|
||||
@@ -14,6 +14,7 @@ PE = "1"
|
||||
SRC_URI = "http://downloads.yoctoproject.org/releases/${BPN}/${BPN}-${PV}.tar.gz \
|
||||
file://opkg.conf \
|
||||
file://0001-opkg_conf-create-opkg.lock-in-run-instead-of-var-run.patch \
|
||||
file://sourcedateepoch.patch \
|
||||
file://run-ptest \
|
||||
"
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ SRC_URI = "git://git.yoctoproject.org/pseudo;branch=oe-core \
|
||||
file://fallback-group \
|
||||
"
|
||||
|
||||
SRCREV = "f332f5633b5dd73fa2b6e5d605eb33e4a446d7ad"
|
||||
SRCREV = "ee24ebec9e5a11dd5208c9be2870f35eab3b9e20"
|
||||
S = "${WORKDIR}/git"
|
||||
PV = "1.9.0+git${SRCPV}"
|
||||
|
||||
|
||||
@@ -7,6 +7,8 @@ SRC_URI[sha256sum] = "89aab215427ef59c34ad58735269eb58b1a5808103067f7bb9d5836c65
|
||||
|
||||
PYPI_PACKAGE = "Jinja2"
|
||||
|
||||
CVE_PRODUCT = "jinja2 jinja"
|
||||
|
||||
CLEANBROKEN = "1"
|
||||
|
||||
inherit pypi setuptools3
|
||||
|
||||
548
meta/recipes-devtools/python/python3/CVE-2021-23336.patch
Normal file
548
meta/recipes-devtools/python/python3/CVE-2021-23336.patch
Normal file
@@ -0,0 +1,548 @@
|
||||
From e3110c3cfbb7daa690d54d0eff6c264c870a71bf Mon Sep 17 00:00:00 2001
|
||||
From: Senthil Kumaran <senthil@uthcode.com>
|
||||
Date: Mon, 15 Feb 2021 10:15:02 -0800
|
||||
Subject: [PATCH] [3.8] bpo-42967: only use '&' as a query string separator
|
||||
(GH-24297) (#24529)
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
* bpo-42967: only use '&' as a query string separator (#24297)
|
||||
|
||||
bpo-42967: [security] Address a web cache-poisoning issue reported in
|
||||
urllib.parse.parse_qsl().
|
||||
|
||||
urllib.parse will only us "&" as query string separator by default
|
||||
instead of both ";" and "&" as allowed in earlier versions. An optional
|
||||
argument seperator with default value "&" is added to specify the
|
||||
separator.
|
||||
|
||||
Co-authored-by: Éric Araujo <merwok@netwok.org>
|
||||
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
|
||||
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
|
||||
Co-authored-by: Éric Araujo <merwok@netwok.org>
|
||||
(cherry picked from commit fcbe0cb04d35189401c0c880ebfb4311e952d776)
|
||||
|
||||
* [3.8] bpo-42967: only use '&' as a query string separator (GH-24297)
|
||||
|
||||
bpo-42967: [security] Address a web cache-poisoning issue reported in urllib.parse.parse_qsl().
|
||||
|
||||
urllib.parse will only us "&" as query string separator by default instead of both ";" and "&" as allowed in earlier versions. An optional argument seperator with default value "&" is added to specify the separator.
|
||||
|
||||
Co-authored-by: Éric Araujo <merwok@netwok.org>
|
||||
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
|
||||
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
|
||||
Co-authored-by: Éric Araujo <merwok@netwok.org>.
|
||||
(cherry picked from commit fcbe0cb04d35189401c0c880ebfb4311e952d776)
|
||||
|
||||
Co-authored-by: Adam Goldschmidt <adamgold7@gmail.com>
|
||||
|
||||
* Update correct version information.
|
||||
|
||||
* fix docs and make logic clearer
|
||||
|
||||
Co-authored-by: Adam Goldschmidt <adamgold7@gmail.com>
|
||||
Co-authored-by: Fidget-Spinner <28750310+Fidget-Spinner@users.noreply.github.com>
|
||||
|
||||
Upstream-Status: Backport [https://github.com/python/cpython/commit/e3110c3cfbb7daa690d54d0eff6c264c870a71bf]
|
||||
CVE: CVE-2020-23336
|
||||
Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com>
|
||||
|
||||
---
|
||||
Doc/library/cgi.rst | 11 ++-
|
||||
Doc/library/urllib.parse.rst | 22 +++++-
|
||||
Doc/whatsnew/3.6.rst | 13 ++++
|
||||
Doc/whatsnew/3.7.rst | 13 ++++
|
||||
Doc/whatsnew/3.8.rst | 13 ++++
|
||||
Lib/cgi.py | 23 ++++---
|
||||
Lib/test/test_cgi.py | 29 ++++++--
|
||||
Lib/test/test_urlparse.py | 68 +++++++++++++------
|
||||
Lib/urllib/parse.py | 19 ++++--
|
||||
.../2021-02-14-15-59-16.bpo-42967.YApqDS.rst | 1 +
|
||||
10 files changed, 166 insertions(+), 46 deletions(-)
|
||||
create mode 100644 Misc/NEWS.d/next/Security/2021-02-14-15-59-16.bpo-42967.YApqDS.rst
|
||||
|
||||
diff --git a/Doc/library/cgi.rst b/Doc/library/cgi.rst
|
||||
index 4048592e7361f..880074bed6026 100644
|
||||
--- a/Doc/library/cgi.rst
|
||||
+++ b/Doc/library/cgi.rst
|
||||
@@ -277,14 +277,16 @@ These are useful if you want more control, or if you want to employ some of the
|
||||
algorithms implemented in this module in other circumstances.
|
||||
|
||||
|
||||
-.. function:: parse(fp=None, environ=os.environ, keep_blank_values=False, strict_parsing=False)
|
||||
+.. function:: parse(fp=None, environ=os.environ, keep_blank_values=False, strict_parsing=False, separator="&")
|
||||
|
||||
Parse a query in the environment or from a file (the file defaults to
|
||||
- ``sys.stdin``). The *keep_blank_values* and *strict_parsing* parameters are
|
||||
+ ``sys.stdin``). The *keep_blank_values*, *strict_parsing* and *separator* parameters are
|
||||
passed to :func:`urllib.parse.parse_qs` unchanged.
|
||||
|
||||
+ .. versionchanged:: 3.8.8
|
||||
+ Added the *separator* parameter.
|
||||
|
||||
-.. function:: parse_multipart(fp, pdict, encoding="utf-8", errors="replace")
|
||||
+.. function:: parse_multipart(fp, pdict, encoding="utf-8", errors="replace", separator="&")
|
||||
|
||||
Parse input of type :mimetype:`multipart/form-data` (for file uploads).
|
||||
Arguments are *fp* for the input file, *pdict* for a dictionary containing
|
||||
@@ -303,6 +305,9 @@ algorithms implemented in this module in other circumstances.
|
||||
Added the *encoding* and *errors* parameters. For non-file fields, the
|
||||
value is now a list of strings, not bytes.
|
||||
|
||||
+ .. versionchanged:: 3.8.8
|
||||
+ Added the *separator* parameter.
|
||||
+
|
||||
|
||||
.. function:: parse_header(string)
|
||||
|
||||
diff --git a/Doc/library/urllib.parse.rst b/Doc/library/urllib.parse.rst
|
||||
index 25e5cc1a6ce0b..fcad7076e6c77 100644
|
||||
--- a/Doc/library/urllib.parse.rst
|
||||
+++ b/Doc/library/urllib.parse.rst
|
||||
@@ -165,7 +165,7 @@ or on combining URL components into a URL string.
|
||||
now raise :exc:`ValueError`.
|
||||
|
||||
|
||||
-.. function:: parse_qs(qs, keep_blank_values=False, strict_parsing=False, encoding='utf-8', errors='replace', max_num_fields=None)
|
||||
+.. function:: parse_qs(qs, keep_blank_values=False, strict_parsing=False, encoding='utf-8', errors='replace', max_num_fields=None, separator='&')
|
||||
|
||||
Parse a query string given as a string argument (data of type
|
||||
:mimetype:`application/x-www-form-urlencoded`). Data are returned as a
|
||||
@@ -190,6 +190,9 @@ or on combining URL components into a URL string.
|
||||
read. If set, then throws a :exc:`ValueError` if there are more than
|
||||
*max_num_fields* fields read.
|
||||
|
||||
+ The optional argument *separator* is the symbol to use for separating the
|
||||
+ query arguments. It defaults to ``&``.
|
||||
+
|
||||
Use the :func:`urllib.parse.urlencode` function (with the ``doseq``
|
||||
parameter set to ``True``) to convert such dictionaries into query
|
||||
strings.
|
||||
@@ -201,8 +204,14 @@ or on combining URL components into a URL string.
|
||||
.. versionchanged:: 3.8
|
||||
Added *max_num_fields* parameter.
|
||||
|
||||
+ .. versionchanged:: 3.8.8
|
||||
+ Added *separator* parameter with the default value of ``&``. Python
|
||||
+ versions earlier than Python 3.8.8 allowed using both ``;`` and ``&`` as
|
||||
+ query parameter separator. This has been changed to allow only a single
|
||||
+ separator key, with ``&`` as the default separator.
|
||||
+
|
||||
|
||||
-.. function:: parse_qsl(qs, keep_blank_values=False, strict_parsing=False, encoding='utf-8', errors='replace', max_num_fields=None)
|
||||
+.. function:: parse_qsl(qs, keep_blank_values=False, strict_parsing=False, encoding='utf-8', errors='replace', max_num_fields=None, separator='&')
|
||||
|
||||
Parse a query string given as a string argument (data of type
|
||||
:mimetype:`application/x-www-form-urlencoded`). Data are returned as a list of
|
||||
@@ -226,6 +235,9 @@ or on combining URL components into a URL string.
|
||||
read. If set, then throws a :exc:`ValueError` if there are more than
|
||||
*max_num_fields* fields read.
|
||||
|
||||
+ The optional argument *separator* is the symbol to use for separating the
|
||||
+ query arguments. It defaults to ``&``.
|
||||
+
|
||||
Use the :func:`urllib.parse.urlencode` function to convert such lists of pairs into
|
||||
query strings.
|
||||
|
||||
@@ -235,6 +247,12 @@ or on combining URL components into a URL string.
|
||||
.. versionchanged:: 3.8
|
||||
Added *max_num_fields* parameter.
|
||||
|
||||
+ .. versionchanged:: 3.8.8
|
||||
+ Added *separator* parameter with the default value of ``&``. Python
|
||||
+ versions earlier than Python 3.8.8 allowed using both ``;`` and ``&`` as
|
||||
+ query parameter separator. This has been changed to allow only a single
|
||||
+ separator key, with ``&`` as the default separator.
|
||||
+
|
||||
|
||||
.. function:: urlunparse(parts)
|
||||
|
||||
diff --git a/Doc/whatsnew/3.6.rst b/Doc/whatsnew/3.6.rst
|
||||
index 85a6657fdfbda..03a877a3d9178 100644
|
||||
--- a/Doc/whatsnew/3.6.rst
|
||||
+++ b/Doc/whatsnew/3.6.rst
|
||||
@@ -2443,3 +2443,16 @@ because of the behavior of the socket option ``SO_REUSEADDR`` in UDP. For more
|
||||
details, see the documentation for ``loop.create_datagram_endpoint()``.
|
||||
(Contributed by Kyle Stanley, Antoine Pitrou, and Yury Selivanov in
|
||||
:issue:`37228`.)
|
||||
+
|
||||
+Notable changes in Python 3.6.13
|
||||
+================================
|
||||
+
|
||||
+Earlier Python versions allowed using both ``;`` and ``&`` as
|
||||
+query parameter separators in :func:`urllib.parse.parse_qs` and
|
||||
+:func:`urllib.parse.parse_qsl`. Due to security concerns, and to conform with
|
||||
+newer W3C recommendations, this has been changed to allow only a single
|
||||
+separator key, with ``&`` as the default. This change also affects
|
||||
+:func:`cgi.parse` and :func:`cgi.parse_multipart` as they use the affected
|
||||
+functions internally. For more details, please see their respective
|
||||
+documentation.
|
||||
+(Contributed by Adam Goldschmidt, Senthil Kumaran and Ken Jin in :issue:`42967`.)
|
||||
diff --git a/Doc/whatsnew/3.7.rst b/Doc/whatsnew/3.7.rst
|
||||
index 4933cba3990b1..824dc13e0c6fd 100644
|
||||
--- a/Doc/whatsnew/3.7.rst
|
||||
+++ b/Doc/whatsnew/3.7.rst
|
||||
@@ -2556,3 +2556,16 @@ because of the behavior of the socket option ``SO_REUSEADDR`` in UDP. For more
|
||||
details, see the documentation for ``loop.create_datagram_endpoint()``.
|
||||
(Contributed by Kyle Stanley, Antoine Pitrou, and Yury Selivanov in
|
||||
:issue:`37228`.)
|
||||
+
|
||||
+Notable changes in Python 3.7.10
|
||||
+================================
|
||||
+
|
||||
+Earlier Python versions allowed using both ``;`` and ``&`` as
|
||||
+query parameter separators in :func:`urllib.parse.parse_qs` and
|
||||
+:func:`urllib.parse.parse_qsl`. Due to security concerns, and to conform with
|
||||
+newer W3C recommendations, this has been changed to allow only a single
|
||||
+separator key, with ``&`` as the default. This change also affects
|
||||
+:func:`cgi.parse` and :func:`cgi.parse_multipart` as they use the affected
|
||||
+functions internally. For more details, please see their respective
|
||||
+documentation.
|
||||
+(Contributed by Adam Goldschmidt, Senthil Kumaran and Ken Jin in :issue:`42967`.)
|
||||
diff --git a/Doc/whatsnew/3.8.rst b/Doc/whatsnew/3.8.rst
|
||||
index 1a192800b2f02..632ccc1f2c40a 100644
|
||||
--- a/Doc/whatsnew/3.8.rst
|
||||
+++ b/Doc/whatsnew/3.8.rst
|
||||
@@ -2251,3 +2251,16 @@ The constant values of future flags in the :mod:`__future__` module
|
||||
are updated in order to prevent collision with compiler flags. Previously
|
||||
``PyCF_ALLOW_TOP_LEVEL_AWAIT`` was clashing with ``CO_FUTURE_DIVISION``.
|
||||
(Contributed by Batuhan Taskaya in :issue:`39562`)
|
||||
+
|
||||
+Notable changes in Python 3.8.8
|
||||
+===============================
|
||||
+
|
||||
+Earlier Python versions allowed using both ``;`` and ``&`` as
|
||||
+query parameter separators in :func:`urllib.parse.parse_qs` and
|
||||
+:func:`urllib.parse.parse_qsl`. Due to security concerns, and to conform with
|
||||
+newer W3C recommendations, this has been changed to allow only a single
|
||||
+separator key, with ``&`` as the default. This change also affects
|
||||
+:func:`cgi.parse` and :func:`cgi.parse_multipart` as they use the affected
|
||||
+functions internally. For more details, please see their respective
|
||||
+documentation.
|
||||
+(Contributed by Adam Goldschmidt, Senthil Kumaran and Ken Jin in :issue:`42967`.)
|
||||
diff --git a/Lib/cgi.py b/Lib/cgi.py
|
||||
index 77ab703cc0360..1e880e51848af 100755
|
||||
--- a/Lib/cgi.py
|
||||
+++ b/Lib/cgi.py
|
||||
@@ -115,7 +115,8 @@ def closelog():
|
||||
# 0 ==> unlimited input
|
||||
maxlen = 0
|
||||
|
||||
-def parse(fp=None, environ=os.environ, keep_blank_values=0, strict_parsing=0):
|
||||
+def parse(fp=None, environ=os.environ, keep_blank_values=0,
|
||||
+ strict_parsing=0, separator='&'):
|
||||
"""Parse a query in the environment or from a file (default stdin)
|
||||
|
||||
Arguments, all optional:
|
||||
@@ -134,6 +135,9 @@ def parse(fp=None, environ=os.environ, keep_blank_values=0, strict_parsing=0):
|
||||
strict_parsing: flag indicating what to do with parsing errors.
|
||||
If false (the default), errors are silently ignored.
|
||||
If true, errors raise a ValueError exception.
|
||||
+
|
||||
+ separator: str. The symbol to use for separating the query arguments.
|
||||
+ Defaults to &.
|
||||
"""
|
||||
if fp is None:
|
||||
fp = sys.stdin
|
||||
@@ -154,7 +158,7 @@ def parse(fp=None, environ=os.environ, keep_blank_values=0, strict_parsing=0):
|
||||
if environ['REQUEST_METHOD'] == 'POST':
|
||||
ctype, pdict = parse_header(environ['CONTENT_TYPE'])
|
||||
if ctype == 'multipart/form-data':
|
||||
- return parse_multipart(fp, pdict)
|
||||
+ return parse_multipart(fp, pdict, separator=separator)
|
||||
elif ctype == 'application/x-www-form-urlencoded':
|
||||
clength = int(environ['CONTENT_LENGTH'])
|
||||
if maxlen and clength > maxlen:
|
||||
@@ -178,10 +182,10 @@ def parse(fp=None, environ=os.environ, keep_blank_values=0, strict_parsing=0):
|
||||
qs = ""
|
||||
environ['QUERY_STRING'] = qs # XXX Shouldn't, really
|
||||
return urllib.parse.parse_qs(qs, keep_blank_values, strict_parsing,
|
||||
- encoding=encoding)
|
||||
+ encoding=encoding, separator=separator)
|
||||
|
||||
|
||||
-def parse_multipart(fp, pdict, encoding="utf-8", errors="replace"):
|
||||
+def parse_multipart(fp, pdict, encoding="utf-8", errors="replace", separator='&'):
|
||||
"""Parse multipart input.
|
||||
|
||||
Arguments:
|
||||
@@ -205,7 +209,7 @@ def parse_multipart(fp, pdict, encoding="utf-8", errors="replace"):
|
||||
except KeyError:
|
||||
pass
|
||||
fs = FieldStorage(fp, headers=headers, encoding=encoding, errors=errors,
|
||||
- environ={'REQUEST_METHOD': 'POST'})
|
||||
+ environ={'REQUEST_METHOD': 'POST'}, separator=separator)
|
||||
return {k: fs.getlist(k) for k in fs}
|
||||
|
||||
def _parseparam(s):
|
||||
@@ -315,7 +319,7 @@ class FieldStorage:
|
||||
def __init__(self, fp=None, headers=None, outerboundary=b'',
|
||||
environ=os.environ, keep_blank_values=0, strict_parsing=0,
|
||||
limit=None, encoding='utf-8', errors='replace',
|
||||
- max_num_fields=None):
|
||||
+ max_num_fields=None, separator='&'):
|
||||
"""Constructor. Read multipart/* until last part.
|
||||
|
||||
Arguments, all optional:
|
||||
@@ -363,6 +367,7 @@ def __init__(self, fp=None, headers=None, outerboundary=b'',
|
||||
self.keep_blank_values = keep_blank_values
|
||||
self.strict_parsing = strict_parsing
|
||||
self.max_num_fields = max_num_fields
|
||||
+ self.separator = separator
|
||||
if 'REQUEST_METHOD' in environ:
|
||||
method = environ['REQUEST_METHOD'].upper()
|
||||
self.qs_on_post = None
|
||||
@@ -589,7 +594,7 @@ def read_urlencoded(self):
|
||||
query = urllib.parse.parse_qsl(
|
||||
qs, self.keep_blank_values, self.strict_parsing,
|
||||
encoding=self.encoding, errors=self.errors,
|
||||
- max_num_fields=self.max_num_fields)
|
||||
+ max_num_fields=self.max_num_fields, separator=self.separator)
|
||||
self.list = [MiniFieldStorage(key, value) for key, value in query]
|
||||
self.skip_lines()
|
||||
|
||||
@@ -605,7 +610,7 @@ def read_multi(self, environ, keep_blank_values, strict_parsing):
|
||||
query = urllib.parse.parse_qsl(
|
||||
self.qs_on_post, self.keep_blank_values, self.strict_parsing,
|
||||
encoding=self.encoding, errors=self.errors,
|
||||
- max_num_fields=self.max_num_fields)
|
||||
+ max_num_fields=self.max_num_fields, separator=self.separator)
|
||||
self.list.extend(MiniFieldStorage(key, value) for key, value in query)
|
||||
|
||||
klass = self.FieldStorageClass or self.__class__
|
||||
@@ -649,7 +654,7 @@ def read_multi(self, environ, keep_blank_values, strict_parsing):
|
||||
else self.limit - self.bytes_read
|
||||
part = klass(self.fp, headers, ib, environ, keep_blank_values,
|
||||
strict_parsing, limit,
|
||||
- self.encoding, self.errors, max_num_fields)
|
||||
+ self.encoding, self.errors, max_num_fields, self.separator)
|
||||
|
||||
if max_num_fields is not None:
|
||||
max_num_fields -= 1
|
||||
diff --git a/Lib/test/test_cgi.py b/Lib/test/test_cgi.py
|
||||
index 101942de947fb..4e1506a6468b9 100644
|
||||
--- a/Lib/test/test_cgi.py
|
||||
+++ b/Lib/test/test_cgi.py
|
||||
@@ -53,12 +53,9 @@ def do_test(buf, method):
|
||||
("", ValueError("bad query field: ''")),
|
||||
("&", ValueError("bad query field: ''")),
|
||||
("&&", ValueError("bad query field: ''")),
|
||||
- (";", ValueError("bad query field: ''")),
|
||||
- (";&;", ValueError("bad query field: ''")),
|
||||
# Should the next few really be valid?
|
||||
("=", {}),
|
||||
("=&=", {}),
|
||||
- ("=;=", {}),
|
||||
# This rest seem to make sense
|
||||
("=a", {'': ['a']}),
|
||||
("&=a", ValueError("bad query field: ''")),
|
||||
@@ -73,8 +70,6 @@ def do_test(buf, method):
|
||||
("a=a+b&b=b+c", {'a': ['a b'], 'b': ['b c']}),
|
||||
("a=a+b&a=b+a", {'a': ['a b', 'b a']}),
|
||||
("x=1&y=2.0&z=2-3.%2b0", {'x': ['1'], 'y': ['2.0'], 'z': ['2-3.+0']}),
|
||||
- ("x=1;y=2.0&z=2-3.%2b0", {'x': ['1'], 'y': ['2.0'], 'z': ['2-3.+0']}),
|
||||
- ("x=1;y=2.0;z=2-3.%2b0", {'x': ['1'], 'y': ['2.0'], 'z': ['2-3.+0']}),
|
||||
("Hbc5161168c542333633315dee1182227:key_store_seqid=400006&cuyer=r&view=bustomer&order_id=0bb2e248638833d48cb7fed300000f1b&expire=964546263&lobale=en-US&kid=130003.300038&ss=env",
|
||||
{'Hbc5161168c542333633315dee1182227:key_store_seqid': ['400006'],
|
||||
'cuyer': ['r'],
|
||||
@@ -201,6 +196,30 @@ def test_strict(self):
|
||||
else:
|
||||
self.assertEqual(fs.getvalue(key), expect_val[0])
|
||||
|
||||
+ def test_separator(self):
|
||||
+ parse_semicolon = [
|
||||
+ ("x=1;y=2.0", {'x': ['1'], 'y': ['2.0']}),
|
||||
+ ("x=1;y=2.0;z=2-3.%2b0", {'x': ['1'], 'y': ['2.0'], 'z': ['2-3.+0']}),
|
||||
+ (";", ValueError("bad query field: ''")),
|
||||
+ (";;", ValueError("bad query field: ''")),
|
||||
+ ("=;a", ValueError("bad query field: 'a'")),
|
||||
+ (";b=a", ValueError("bad query field: ''")),
|
||||
+ ("b;=a", ValueError("bad query field: 'b'")),
|
||||
+ ("a=a+b;b=b+c", {'a': ['a b'], 'b': ['b c']}),
|
||||
+ ("a=a+b;a=b+a", {'a': ['a b', 'b a']}),
|
||||
+ ]
|
||||
+ for orig, expect in parse_semicolon:
|
||||
+ env = {'QUERY_STRING': orig}
|
||||
+ fs = cgi.FieldStorage(separator=';', environ=env)
|
||||
+ if isinstance(expect, dict):
|
||||
+ for key in expect.keys():
|
||||
+ expect_val = expect[key]
|
||||
+ self.assertIn(key, fs)
|
||||
+ if len(expect_val) > 1:
|
||||
+ self.assertEqual(fs.getvalue(key), expect_val)
|
||||
+ else:
|
||||
+ self.assertEqual(fs.getvalue(key), expect_val[0])
|
||||
+
|
||||
def test_log(self):
|
||||
cgi.log("Testing")
|
||||
|
||||
diff --git a/Lib/test/test_urlparse.py b/Lib/test/test_urlparse.py
|
||||
index 4ae6ed33858ce..90c8d6922629e 100644
|
||||
--- a/Lib/test/test_urlparse.py
|
||||
+++ b/Lib/test/test_urlparse.py
|
||||
@@ -32,16 +32,10 @@
|
||||
(b"&a=b", [(b'a', b'b')]),
|
||||
(b"a=a+b&b=b+c", [(b'a', b'a b'), (b'b', b'b c')]),
|
||||
(b"a=1&a=2", [(b'a', b'1'), (b'a', b'2')]),
|
||||
- (";", []),
|
||||
- (";;", []),
|
||||
- (";a=b", [('a', 'b')]),
|
||||
- ("a=a+b;b=b+c", [('a', 'a b'), ('b', 'b c')]),
|
||||
- ("a=1;a=2", [('a', '1'), ('a', '2')]),
|
||||
- (b";", []),
|
||||
- (b";;", []),
|
||||
- (b";a=b", [(b'a', b'b')]),
|
||||
- (b"a=a+b;b=b+c", [(b'a', b'a b'), (b'b', b'b c')]),
|
||||
- (b"a=1;a=2", [(b'a', b'1'), (b'a', b'2')]),
|
||||
+ (";a=b", [(';a', 'b')]),
|
||||
+ ("a=a+b;b=b+c", [('a', 'a b;b=b c')]),
|
||||
+ (b";a=b", [(b';a', b'b')]),
|
||||
+ (b"a=a+b;b=b+c", [(b'a', b'a b;b=b c')]),
|
||||
]
|
||||
|
||||
# Each parse_qs testcase is a two-tuple that contains
|
||||
@@ -68,16 +62,10 @@
|
||||
(b"&a=b", {b'a': [b'b']}),
|
||||
(b"a=a+b&b=b+c", {b'a': [b'a b'], b'b': [b'b c']}),
|
||||
(b"a=1&a=2", {b'a': [b'1', b'2']}),
|
||||
- (";", {}),
|
||||
- (";;", {}),
|
||||
- (";a=b", {'a': ['b']}),
|
||||
- ("a=a+b;b=b+c", {'a': ['a b'], 'b': ['b c']}),
|
||||
- ("a=1;a=2", {'a': ['1', '2']}),
|
||||
- (b";", {}),
|
||||
- (b";;", {}),
|
||||
- (b";a=b", {b'a': [b'b']}),
|
||||
- (b"a=a+b;b=b+c", {b'a': [b'a b'], b'b': [b'b c']}),
|
||||
- (b"a=1;a=2", {b'a': [b'1', b'2']}),
|
||||
+ (";a=b", {';a': ['b']}),
|
||||
+ ("a=a+b;b=b+c", {'a': ['a b;b=b c']}),
|
||||
+ (b";a=b", {b';a': [b'b']}),
|
||||
+ (b"a=a+b;b=b+c", {b'a':[ b'a b;b=b c']}),
|
||||
]
|
||||
|
||||
class UrlParseTestCase(unittest.TestCase):
|
||||
@@ -884,10 +872,46 @@ def test_parse_qsl_encoding(self):
|
||||
def test_parse_qsl_max_num_fields(self):
|
||||
with self.assertRaises(ValueError):
|
||||
urllib.parse.parse_qs('&'.join(['a=a']*11), max_num_fields=10)
|
||||
- with self.assertRaises(ValueError):
|
||||
- urllib.parse.parse_qs(';'.join(['a=a']*11), max_num_fields=10)
|
||||
urllib.parse.parse_qs('&'.join(['a=a']*10), max_num_fields=10)
|
||||
|
||||
+ def test_parse_qs_separator(self):
|
||||
+ parse_qs_semicolon_cases = [
|
||||
+ (";", {}),
|
||||
+ (";;", {}),
|
||||
+ (";a=b", {'a': ['b']}),
|
||||
+ ("a=a+b;b=b+c", {'a': ['a b'], 'b': ['b c']}),
|
||||
+ ("a=1;a=2", {'a': ['1', '2']}),
|
||||
+ (b";", {}),
|
||||
+ (b";;", {}),
|
||||
+ (b";a=b", {b'a': [b'b']}),
|
||||
+ (b"a=a+b;b=b+c", {b'a': [b'a b'], b'b': [b'b c']}),
|
||||
+ (b"a=1;a=2", {b'a': [b'1', b'2']}),
|
||||
+ ]
|
||||
+ for orig, expect in parse_qs_semicolon_cases:
|
||||
+ with self.subTest(f"Original: {orig!r}, Expected: {expect!r}"):
|
||||
+ result = urllib.parse.parse_qs(orig, separator=';')
|
||||
+ self.assertEqual(result, expect, "Error parsing %r" % orig)
|
||||
+
|
||||
+
|
||||
+ def test_parse_qsl_separator(self):
|
||||
+ parse_qsl_semicolon_cases = [
|
||||
+ (";", []),
|
||||
+ (";;", []),
|
||||
+ (";a=b", [('a', 'b')]),
|
||||
+ ("a=a+b;b=b+c", [('a', 'a b'), ('b', 'b c')]),
|
||||
+ ("a=1;a=2", [('a', '1'), ('a', '2')]),
|
||||
+ (b";", []),
|
||||
+ (b";;", []),
|
||||
+ (b";a=b", [(b'a', b'b')]),
|
||||
+ (b"a=a+b;b=b+c", [(b'a', b'a b'), (b'b', b'b c')]),
|
||||
+ (b"a=1;a=2", [(b'a', b'1'), (b'a', b'2')]),
|
||||
+ ]
|
||||
+ for orig, expect in parse_qsl_semicolon_cases:
|
||||
+ with self.subTest(f"Original: {orig!r}, Expected: {expect!r}"):
|
||||
+ result = urllib.parse.parse_qsl(orig, separator=';')
|
||||
+ self.assertEqual(result, expect, "Error parsing %r" % orig)
|
||||
+
|
||||
+
|
||||
def test_urlencode_sequences(self):
|
||||
# Other tests incidentally urlencode things; test non-covered cases:
|
||||
# Sequence and object values.
|
||||
diff --git a/Lib/urllib/parse.py b/Lib/urllib/parse.py
|
||||
index 95be7181133b4..0c1c94f5fc986 100644
|
||||
--- a/Lib/urllib/parse.py
|
||||
+++ b/Lib/urllib/parse.py
|
||||
@@ -650,7 +650,7 @@ def unquote(string, encoding='utf-8', errors='replace'):
|
||||
|
||||
|
||||
def parse_qs(qs, keep_blank_values=False, strict_parsing=False,
|
||||
- encoding='utf-8', errors='replace', max_num_fields=None):
|
||||
+ encoding='utf-8', errors='replace', max_num_fields=None, separator='&'):
|
||||
"""Parse a query given as a string argument.
|
||||
|
||||
Arguments:
|
||||
@@ -674,12 +674,15 @@ def parse_qs(qs, keep_blank_values=False, strict_parsing=False,
|
||||
max_num_fields: int. If set, then throws a ValueError if there
|
||||
are more than n fields read by parse_qsl().
|
||||
|
||||
+ separator: str. The symbol to use for separating the query arguments.
|
||||
+ Defaults to &.
|
||||
+
|
||||
Returns a dictionary.
|
||||
"""
|
||||
parsed_result = {}
|
||||
pairs = parse_qsl(qs, keep_blank_values, strict_parsing,
|
||||
encoding=encoding, errors=errors,
|
||||
- max_num_fields=max_num_fields)
|
||||
+ max_num_fields=max_num_fields, separator=separator)
|
||||
for name, value in pairs:
|
||||
if name in parsed_result:
|
||||
parsed_result[name].append(value)
|
||||
@@ -689,7 +692,7 @@ def parse_qs(qs, keep_blank_values=False, strict_parsing=False,
|
||||
|
||||
|
||||
def parse_qsl(qs, keep_blank_values=False, strict_parsing=False,
|
||||
- encoding='utf-8', errors='replace', max_num_fields=None):
|
||||
+ encoding='utf-8', errors='replace', max_num_fields=None, separator='&'):
|
||||
"""Parse a query given as a string argument.
|
||||
|
||||
Arguments:
|
||||
@@ -712,19 +715,25 @@ def parse_qsl(qs, keep_blank_values=False, strict_parsing=False,
|
||||
max_num_fields: int. If set, then throws a ValueError
|
||||
if there are more than n fields read by parse_qsl().
|
||||
|
||||
+ separator: str. The symbol to use for separating the query arguments.
|
||||
+ Defaults to &.
|
||||
+
|
||||
Returns a list, as G-d intended.
|
||||
"""
|
||||
qs, _coerce_result = _coerce_args(qs)
|
||||
|
||||
+ if not separator or (not isinstance(separator, (str, bytes))):
|
||||
+ raise ValueError("Separator must be of type string or bytes.")
|
||||
+
|
||||
# If max_num_fields is defined then check that the number of fields
|
||||
# is less than max_num_fields. This prevents a memory exhaustion DOS
|
||||
# attack via post bodies with many fields.
|
||||
if max_num_fields is not None:
|
||||
- num_fields = 1 + qs.count('&') + qs.count(';')
|
||||
+ num_fields = 1 + qs.count(separator)
|
||||
if max_num_fields < num_fields:
|
||||
raise ValueError('Max number of fields exceeded')
|
||||
|
||||
- pairs = [s2 for s1 in qs.split('&') for s2 in s1.split(';')]
|
||||
+ pairs = [s1 for s1 in qs.split(separator)]
|
||||
r = []
|
||||
for name_value in pairs:
|
||||
if not name_value and not strict_parsing:
|
||||
diff --git a/Misc/NEWS.d/next/Security/2021-02-14-15-59-16.bpo-42967.YApqDS.rst b/Misc/NEWS.d/next/Security/2021-02-14-15-59-16.bpo-42967.YApqDS.rst
|
||||
new file mode 100644
|
||||
index 0000000000000..f08489b41494e
|
||||
--- /dev/null
|
||||
+++ b/Misc/NEWS.d/next/Security/2021-02-14-15-59-16.bpo-42967.YApqDS.rst
|
||||
@@ -0,0 +1 @@
|
||||
+Fix web cache poisoning vulnerability by defaulting the query args separator to ``&``, and allowing the user to choose a custom separator.
|
||||
@@ -34,6 +34,7 @@ SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.xz \
|
||||
file://0020-configure.ac-setup.py-do-not-add-a-curses-include-pa.patch \
|
||||
file://CVE-2020-27619.patch \
|
||||
file://CVE-2021-3177.patch \
|
||||
file://CVE-2021-23336.patch \
|
||||
"
|
||||
|
||||
SRC_URI_append_class-native = " \
|
||||
@@ -169,6 +170,10 @@ do_install_append() {
|
||||
}
|
||||
|
||||
do_install_append_class-nativesdk () {
|
||||
# Make sure we use /usr/bin/env python
|
||||
for PYTHSCRIPT in `grep -rIl ${bindir}/python ${D}${bindir}`; do
|
||||
sed -i -e '1s|^#!.*|#!/usr/bin/env python3|' $PYTHSCRIPT
|
||||
done
|
||||
create_wrapper ${D}${bindir}/python${PYTHON_MAJMIN} TERMINFO_DIRS='${sysconfdir}/terminfo:/etc/terminfo:/usr/share/terminfo:/usr/share/misc/terminfo:/lib/terminfo' PYTHONNOUSERSITE='1'
|
||||
}
|
||||
|
||||
|
||||
@@ -37,6 +37,9 @@ SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \
|
||||
file://CVE-2020-25624.patch \
|
||||
file://CVE-2020-25723.patch \
|
||||
file://CVE-2020-28916.patch \
|
||||
file://CVE-2020-35517.patch \
|
||||
file://CVE-2020-29443.patch \
|
||||
file://CVE-2021-20203.patch \
|
||||
"
|
||||
UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar"
|
||||
|
||||
|
||||
46
meta/recipes-devtools/qemu/qemu/CVE-2020-29443.patch
Normal file
46
meta/recipes-devtools/qemu/qemu/CVE-2020-29443.patch
Normal file
@@ -0,0 +1,46 @@
|
||||
|
||||
m 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 [https://git.qemu.org/?p=qemu.git;a=patch;h=813212288970c39b1800f63e83ac6e96588095c6]
|
||||
CVE: CVE-2020-29443
|
||||
Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com>
|
||||
|
||||
---
|
||||
hw/ide/atapi.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/hw/ide/atapi.c b/hw/ide/atapi.c
|
||||
index 14a2b0b..e791578 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
|
||||
--
|
||||
1.8.3.1
|
||||
|
||||
126
meta/recipes-devtools/qemu/qemu/CVE-2020-35517.patch
Normal file
126
meta/recipes-devtools/qemu/qemu/CVE-2020-35517.patch
Normal file
@@ -0,0 +1,126 @@
|
||||
From ebf101955ce8f8d72fba103b5151115a4335de2c Mon Sep 17 00:00:00 2001
|
||||
From: Stefan Hajnoczi <stefanha@redhat.com>
|
||||
Date: Tue, 6 Oct 2020 10:58:26 +0100
|
||||
Subject: [PATCH] virtiofsd: avoid /proc/self/fd tempdir
|
||||
|
||||
In order to prevent /proc/self/fd escapes a temporary directory is
|
||||
created where /proc/self/fd is bind-mounted. This doesn't work on
|
||||
read-only file systems.
|
||||
|
||||
Avoid the temporary directory by bind-mounting /proc/self/fd over /proc.
|
||||
This does not affect other processes since we remounted / with MS_REC |
|
||||
MS_SLAVE. /proc must exist and virtiofsd does not use it so it's safe to
|
||||
do this.
|
||||
|
||||
Path traversal can be tested with the following function:
|
||||
|
||||
static void test_proc_fd_escape(struct lo_data *lo)
|
||||
{
|
||||
int fd;
|
||||
int level = 0;
|
||||
ino_t last_ino = 0;
|
||||
|
||||
fd = lo->proc_self_fd;
|
||||
for (;;) {
|
||||
struct stat st;
|
||||
|
||||
if (fstat(fd, &st) != 0) {
|
||||
perror("fstat");
|
||||
return;
|
||||
}
|
||||
if (last_ino && st.st_ino == last_ino) {
|
||||
fprintf(stderr, "inode number unchanged, stopping\n");
|
||||
return;
|
||||
}
|
||||
last_ino = st.st_ino;
|
||||
|
||||
fprintf(stderr, "Level %d dev %lu ino %lu\n", level,
|
||||
(unsigned long)st.st_dev,
|
||||
(unsigned long)last_ino);
|
||||
fd = openat(fd, "..", O_PATH | O_DIRECTORY | O_NOFOLLOW);
|
||||
level++;
|
||||
}
|
||||
}
|
||||
|
||||
Before and after this patch only Level 0 is displayed. Without
|
||||
/proc/self/fd bind-mount protection it is possible to traverse parent
|
||||
directories.
|
||||
|
||||
Fixes: 397ae982f4df4 ("virtiofsd: jail lo->proc_self_fd")
|
||||
Cc: Miklos Szeredi <mszeredi@redhat.com>
|
||||
Cc: Jens Freimann <jfreimann@redhat.com>
|
||||
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
|
||||
Message-Id: <20201006095826.59813-1-stefanha@redhat.com>
|
||||
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
|
||||
Tested-by: Jens Freimann <jfreimann@redhat.com>
|
||||
Reviewed-by: Jens Freimann <jfreimann@redhat.com>
|
||||
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
|
||||
|
||||
|
||||
Upstream-Status: Backport
|
||||
[https://github.com/qemu/qemu/commit/ebf101955ce8f8d72fba103b5151115a4335de2c]
|
||||
CVE: CVE-2020-35517
|
||||
Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com>
|
||||
|
||||
---
|
||||
tools/virtiofsd/passthrough_ll.c | 34 +++++++++++---------------------
|
||||
1 file changed, 11 insertions(+), 23 deletions(-)
|
||||
|
||||
diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough_ll.c
|
||||
index 477e6ee0b53..ff53df44510 100644
|
||||
--- a/tools/virtiofsd/passthrough_ll.c
|
||||
+++ b/tools/virtiofsd/passthrough_ll.c
|
||||
@@ -2393,8 +2393,6 @@ static void setup_wait_parent_capabilities(void)
|
||||
static void setup_namespaces(struct lo_data *lo, struct fuse_session *se)
|
||||
{
|
||||
pid_t child;
|
||||
- char template[] = "virtiofsd-XXXXXX";
|
||||
- char *tmpdir;
|
||||
|
||||
/*
|
||||
* Create a new pid namespace for *child* processes. We'll have to
|
||||
@@ -2458,33 +2456,23 @@ static void setup_namespaces(struct lo_data *lo, struct fuse_session *se)
|
||||
exit(1);
|
||||
}
|
||||
|
||||
- tmpdir = mkdtemp(template);
|
||||
- if (!tmpdir) {
|
||||
- fuse_log(FUSE_LOG_ERR, "tmpdir(%s): %m\n", template);
|
||||
- exit(1);
|
||||
- }
|
||||
-
|
||||
- if (mount("/proc/self/fd", tmpdir, NULL, MS_BIND, NULL) < 0) {
|
||||
- fuse_log(FUSE_LOG_ERR, "mount(/proc/self/fd, %s, MS_BIND): %m\n",
|
||||
- tmpdir);
|
||||
+ /*
|
||||
+ * We only need /proc/self/fd. Prevent ".." from accessing parent
|
||||
+ * directories of /proc/self/fd by bind-mounting it over /proc. Since / was
|
||||
+ * previously remounted with MS_REC | MS_SLAVE this mount change only
|
||||
+ * affects our process.
|
||||
+ */
|
||||
+ if (mount("/proc/self/fd", "/proc", NULL, MS_BIND, NULL) < 0) {
|
||||
+ fuse_log(FUSE_LOG_ERR, "mount(/proc/self/fd, MS_BIND): %m\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
- /* Now we can get our /proc/self/fd directory file descriptor */
|
||||
- lo->proc_self_fd = open(tmpdir, O_PATH);
|
||||
+ /* Get the /proc (actually /proc/self/fd, see above) file descriptor */
|
||||
+ lo->proc_self_fd = open("/proc", O_PATH);
|
||||
if (lo->proc_self_fd == -1) {
|
||||
- fuse_log(FUSE_LOG_ERR, "open(%s, O_PATH): %m\n", tmpdir);
|
||||
+ fuse_log(FUSE_LOG_ERR, "open(/proc, O_PATH): %m\n");
|
||||
exit(1);
|
||||
}
|
||||
-
|
||||
- if (umount2(tmpdir, MNT_DETACH) < 0) {
|
||||
- fuse_log(FUSE_LOG_ERR, "umount2(%s, MNT_DETACH): %m\n", tmpdir);
|
||||
- exit(1);
|
||||
- }
|
||||
-
|
||||
- if (rmdir(tmpdir) < 0) {
|
||||
- fuse_log(FUSE_LOG_ERR, "rmdir(%s): %m\n", tmpdir);
|
||||
- }
|
||||
}
|
||||
|
||||
/*
|
||||
74
meta/recipes-devtools/qemu/qemu/CVE-2021-20203.patch
Normal file
74
meta/recipes-devtools/qemu/qemu/CVE-2021-20203.patch
Normal file
@@ -0,0 +1,74 @@
|
||||
From: Prasad J Pandit <pjp@fedoraproject.org>
|
||||
|
||||
While activating device in vmxnet3_acticate_device(), it does not
|
||||
validate guest supplied configuration values against predefined
|
||||
minimum - maximum limits. This may lead to integer overflow or
|
||||
OOB access issues. Add checks to avoid it.
|
||||
|
||||
Fixes: CVE-2021-20203
|
||||
Buglink: https://bugs.launchpad.net/qemu/+bug/1913873
|
||||
Reported-by: Gaoning Pan <pgn@zju.edu.cn>
|
||||
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
|
||||
|
||||
Upstream-Status: Acepted [https://lists.gnu.org/archive/html/qemu-devel/2021-01/msg07935.html]
|
||||
CVE: CVE-2021-20203
|
||||
Signed-off-by: Minjae Kim <flowergom@gmail.com>
|
||||
---
|
||||
hw/net/vmxnet3.c | 13 +++++++++++++
|
||||
1 file changed, 13 insertions(+)
|
||||
|
||||
diff --git a/hw/net/vmxnet3.c b/hw/net/vmxnet3.c
|
||||
index eff299f629..4a910ca971 100644
|
||||
--- a/hw/net/vmxnet3.c
|
||||
+++ b/hw/net/vmxnet3.c
|
||||
@@ -1420,6 +1420,7 @@ static void vmxnet3_activate_device(VMXNET3State *s)
|
||||
vmxnet3_setup_rx_filtering(s);
|
||||
/* Cache fields from shared memory */
|
||||
s->mtu = VMXNET3_READ_DRV_SHARED32(d, s->drv_shmem, devRead.misc.mtu);
|
||||
+ assert(VMXNET3_MIN_MTU <= s->mtu && s->mtu < VMXNET3_MAX_MTU);
|
||||
VMW_CFPRN("MTU is %u", s->mtu);
|
||||
|
||||
s->max_rx_frags =
|
||||
@@ -1473,6 +1474,9 @@ static void vmxnet3_activate_device(VMXNET3State *s)
|
||||
/* Read rings memory locations for TX queues */
|
||||
pa = VMXNET3_READ_TX_QUEUE_DESCR64(d, qdescr_pa, conf.txRingBasePA);
|
||||
size = VMXNET3_READ_TX_QUEUE_DESCR32(d, qdescr_pa, conf.txRingSize);
|
||||
+ if (size > VMXNET3_TX_RING_MAX_SIZE) {
|
||||
+ size = VMXNET3_TX_RING_MAX_SIZE;
|
||||
+ }
|
||||
|
||||
vmxnet3_ring_init(d, &s->txq_descr[i].tx_ring, pa, size,
|
||||
sizeof(struct Vmxnet3_TxDesc), false);
|
||||
@@ -1483,6 +1487,9 @@ static void vmxnet3_activate_device(VMXNET3State *s)
|
||||
/* TXC ring */
|
||||
pa = VMXNET3_READ_TX_QUEUE_DESCR64(d, qdescr_pa, conf.compRingBasePA);
|
||||
size = VMXNET3_READ_TX_QUEUE_DESCR32(d, qdescr_pa, conf.compRingSize);
|
||||
+ if (size > VMXNET3_TC_RING_MAX_SIZE) {
|
||||
+ size = VMXNET3_TC_RING_MAX_SIZE;
|
||||
+ }
|
||||
vmxnet3_ring_init(d, &s->txq_descr[i].comp_ring, pa, size,
|
||||
sizeof(struct Vmxnet3_TxCompDesc), true);
|
||||
VMXNET3_RING_DUMP(VMW_CFPRN, "TXC", i, &s->txq_descr[i].comp_ring);
|
||||
@@ -1524,6 +1531,9 @@ static void vmxnet3_activate_device(VMXNET3State *s)
|
||||
/* RX rings */
|
||||
pa = VMXNET3_READ_RX_QUEUE_DESCR64(d, qd_pa, conf.rxRingBasePA[j]);
|
||||
size = VMXNET3_READ_RX_QUEUE_DESCR32(d, qd_pa, conf.rxRingSize[j]);
|
||||
+ if (size > VMXNET3_RX_RING_MAX_SIZE) {
|
||||
+ size = VMXNET3_RX_RING_MAX_SIZE;
|
||||
+ }
|
||||
vmxnet3_ring_init(d, &s->rxq_descr[i].rx_ring[j], pa, size,
|
||||
sizeof(struct Vmxnet3_RxDesc), false);
|
||||
VMW_CFPRN("RX queue %d:%d: Base: %" PRIx64 ", Size: %d",
|
||||
@@ -1533,6 +1543,9 @@ static void vmxnet3_activate_device(VMXNET3State *s)
|
||||
/* RXC ring */
|
||||
pa = VMXNET3_READ_RX_QUEUE_DESCR64(d, qd_pa, conf.compRingBasePA);
|
||||
size = VMXNET3_READ_RX_QUEUE_DESCR32(d, qd_pa, conf.compRingSize);
|
||||
+ if (size > VMXNET3_RC_RING_MAX_SIZE) {
|
||||
+ size = VMXNET3_RC_RING_MAX_SIZE;
|
||||
+ }
|
||||
vmxnet3_ring_init(d, &s->rxq_descr[i].comp_ring, pa, size,
|
||||
sizeof(struct Vmxnet3_RxCompDesc), true);
|
||||
VMW_CFPRN("RXC queue %d: Base: %" PRIx64 ", Size: %d", i, pa, size);
|
||||
--
|
||||
2.29.2
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user
