summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbitbake/bin/bitbake-server2
-rw-r--r--bitbake/lib/bb/__init__.py2
-rw-r--r--bitbake/lib/bb/cache.py4
-rw-r--r--bitbake/lib/bb/cooker.py14
-rw-r--r--bitbake/lib/bb/data_smart.py14
-rw-r--r--bitbake/lib/bb/fetch2/git.py6
-rw-r--r--bitbake/lib/bb/fetch2/wget.py2
-rw-r--r--bitbake/lib/bb/parse/ast.py2
-rw-r--r--bitbake/lib/bb/parse/parse_py/BBHandler.py2
-rw-r--r--bitbake/lib/bb/parse/parse_py/ConfHandler.py2
-rw-r--r--bitbake/lib/bb/providers.py4
-rw-r--r--bitbake/lib/bb/runqueue.py11
-rw-r--r--bitbake/lib/bb/server/process.py2
-rw-r--r--bitbake/lib/bb/tests/codeparser.py4
-rw-r--r--bitbake/lib/bb/tests/fetch.py10
-rw-r--r--documentation/conf.py21
-rw-r--r--documentation/poky.yaml12
-rw-r--r--documentation/releases.rst9
-rw-r--r--meta-poky/conf/distro/poky.conf2
-rw-r--r--meta-yocto-bsp/recipes-kernel/linux/linux-yocto_5.4.bbappend8
-rw-r--r--meta/classes/buildhistory.bbclass3
-rw-r--r--meta/classes/cve-check.bbclass21
-rw-r--r--meta/classes/devshell.bbclass1
-rw-r--r--meta/classes/externalsrc.bbclass12
-rw-r--r--meta/classes/image-live.bbclass2
-rw-r--r--meta/classes/image.bbclass4
-rw-r--r--meta/classes/insane.bbclass12
-rw-r--r--meta/classes/kernel-devicetree.bbclass11
-rw-r--r--meta/classes/kernel.bbclass2
-rw-r--r--meta/classes/npm.bbclass2
-rw-r--r--meta/classes/package_rpm.bbclass1
-rw-r--r--meta/classes/populate_sdk_base.bbclass9
-rw-r--r--meta/classes/populate_sdk_ext.bbclass7
-rw-r--r--meta/classes/report-error.bbclass4
-rw-r--r--meta/classes/rootfs_deb.bbclass4
-rw-r--r--meta/classes/sanity.bbclass19
-rw-r--r--meta/conf/bitbake.conf6
-rw-r--r--meta/conf/distro/include/ptest-packagelists.inc2
-rw-r--r--meta/conf/distro/include/yocto-uninative.inc10
-rw-r--r--meta/lib/oe/copy_buildsystem.py6
-rw-r--r--meta/lib/oe/cve_check.py7
-rw-r--r--meta/lib/oe/package_manager/__init__.py2
-rw-r--r--meta/lib/oe/package_manager/deb/sdk.py4
-rw-r--r--meta/lib/oe/recipeutils.py2
-rw-r--r--meta/lib/oe/terminal.py16
-rw-r--r--meta/lib/oeqa/runtime/cases/df.py2
-rw-r--r--meta/lib/oeqa/runtime/cases/pam.py3
-rw-r--r--meta/lib/oeqa/selftest/cases/buildoptions.py6
-rw-r--r--meta/lib/oeqa/selftest/cases/cve_check.py8
-rw-r--r--meta/lib/oeqa/selftest/cases/reproducible.py2
-rw-r--r--meta/lib/oeqa/selftest/cases/wic.py18
-rw-r--r--meta/lib/oeqa/utils/commands.py4
-rw-r--r--meta/recipes-connectivity/bind/bind-9.16.7/CVE-2020-8625.patch29
-rw-r--r--meta/recipes-connectivity/bind/bind_9.16.7.bb1
-rw-r--r--meta/recipes-connectivity/openssl/openssl_1.1.1k.bb (renamed from meta/recipes-connectivity/openssl/openssl_1.1.1i.bb)2
-rw-r--r--meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/CVE-2021-0326.patch45
-rw-r--r--meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/CVE-2021-27803.patch58
-rw-r--r--meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/CVE-2021-30004.patch123
-rw-r--r--meta/recipes-connectivity/wpa-supplicant/wpa-supplicant_2.9.bb3
-rw-r--r--meta/recipes-core/busybox/busybox/0001-decompress_gunzip-Fix-DoS-if-gzip-is-corrupt.patch58
-rw-r--r--meta/recipes-core/busybox/busybox_1.32.0.bb3
-rw-r--r--meta/recipes-core/glib-2.0/glib-2.0/CVE-2021-27219.patch1444
-rw-r--r--meta/recipes-core/glib-2.0/glib-2.0_2.64.5.bb1
-rw-r--r--meta/recipes-core/glibc/glibc-version.inc2
-rw-r--r--meta/recipes-core/glibc/glibc_2.32.bb2
-rw-r--r--meta/recipes-core/images/build-appliance-image_15.0.0.bb10
-rw-r--r--meta/recipes-core/meta/cve-update-db-native.bb14
-rw-r--r--meta/recipes-core/systemd/systemd-conf/wired.network1
-rw-r--r--meta/recipes-core/systemd/systemd-conf_246.9.bb3
-rw-r--r--meta/recipes-core/systemd/systemd_246.9.bb2
-rw-r--r--meta/recipes-devtools/binutils/binutils-2.35.1.inc1
-rw-r--r--meta/recipes-devtools/binutils/binutils/0001-gold-ensure-file_counts_lock-is-initialized-before-u.patch41
-rw-r--r--meta/recipes-devtools/gcc/gcc-sanitizers.inc7
-rw-r--r--meta/recipes-devtools/git/git.inc5
-rw-r--r--meta/recipes-devtools/git/git/CVE-2021-21300.patch304
-rw-r--r--meta/recipes-devtools/git/git/fixsort.patch31
-rw-r--r--meta/recipes-devtools/go/go-1.15.inc4
-rw-r--r--meta/recipes-devtools/go/go-binary-native_1.15.8.bb (renamed from meta/recipes-devtools/go/go-binary-native_1.15.6.bb)4
-rw-r--r--meta/recipes-devtools/libtool/libtool-2.4.6.inc1
-rw-r--r--meta/recipes-devtools/libtool/libtool/0001-Makefile.am-make-sure-autoheader-run-before-autoconf.patch35
-rw-r--r--meta/recipes-devtools/mtd/mtd-utils_git.bb2
-rw-r--r--meta/recipes-devtools/pseudo/pseudo_git.bb2
-rw-r--r--meta/recipes-devtools/python/python3-jinja2_2.11.2.bb2
-rw-r--r--meta/recipes-devtools/python/python3/CVE-2021-23336.patch548
-rw-r--r--meta/recipes-devtools/python/python3_3.8.5.bb5
-rw-r--r--meta/recipes-devtools/qemu/qemu.inc1
-rw-r--r--meta/recipes-devtools/qemu/qemu/CVE-2021-20203.patch74
-rw-r--r--meta/recipes-devtools/rsync/files/0001-rsync-ssl-Verify-the-hostname-in-the-certificate-whe.patch31
-rw-r--r--meta/recipes-devtools/rsync/files/determism.patch28
-rw-r--r--meta/recipes-devtools/rsync/rsync_3.2.3.bb4
-rwxr-xr-xmeta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts10
-rw-r--r--meta/recipes-devtools/valgrind/valgrind/0001-gdbserver_tests-Disable-nlcontrolc.vgtest-for-x86-64.patch36
-rw-r--r--meta/recipes-devtools/valgrind/valgrind/0005-Modify-vg_test-wrapper-to-support-PTEST-formats.patch9
-rw-r--r--meta/recipes-devtools/valgrind/valgrind_3.16.1.bb1
-rw-r--r--meta/recipes-extended/asciidoc/asciidoc_9.0.2.bb2
-rw-r--r--meta/recipes-extended/cups/cups.inc3
-rw-r--r--meta/recipes-extended/cups/cups/CVE-2020-10001.patch74
-rw-r--r--meta/recipes-extended/groff/files/0001-Include-config.h.patch1026
-rw-r--r--meta/recipes-extended/groff/groff_1.22.4.bb11
-rw-r--r--meta/recipes-extended/parted/parted_3.3.bb1
-rw-r--r--meta/recipes-extended/screen/screen/CVE-2021-26937.patch68
-rw-r--r--meta/recipes-extended/screen/screen_4.8.0.bb1
-rw-r--r--meta/recipes-extended/shadow/shadow_4.8.1.bb5
-rw-r--r--meta/recipes-extended/sudo/sudo.inc2
-rw-r--r--meta/recipes-extended/tar/tar/CVE-2021-20193.patch133
-rw-r--r--meta/recipes-extended/tar/tar_1.32.bb1
-rw-r--r--meta/recipes-gnome/epiphany/epiphany_3.36.4.bb2
-rw-r--r--meta/recipes-gnome/epiphany/files/distributor.patch17
-rw-r--r--meta/recipes-gnome/epiphany/files/migrator.patch24
-rw-r--r--meta/recipes-gnome/gcr/gcr_3.36.0.bb10
-rw-r--r--meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/CVE-2021-20240.patch40
-rw-r--r--meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.40.0.bb1
-rw-r--r--meta/recipes-gnome/libsecret/libsecret/determinism.patch37
-rw-r--r--meta/recipes-gnome/libsecret/libsecret_0.20.3.bb3
-rw-r--r--meta/recipes-graphics/cairo/cairo/CVE-2020-35492.patch121
-rw-r--r--meta/recipes-graphics/cairo/cairo/bug-image-compositor.ref.pngbin0 -> 185 bytes
-rw-r--r--meta/recipes-graphics/cairo/cairo_1.16.0.bb11
-rw-r--r--meta/recipes-graphics/igt-gpu-tools/igt-gpu-tools/reproducibility.patch38
-rw-r--r--meta/recipes-graphics/igt-gpu-tools/igt-gpu-tools_git.bb5
-rw-r--r--meta/recipes-graphics/libsdl2/libsdl2/CVE-2020-14409-14410.patch79
-rw-r--r--meta/recipes-graphics/libsdl2/libsdl2_2.0.12.bb1
-rw-r--r--meta/recipes-graphics/wayland/libinput/run-ptest2
-rw-r--r--meta/recipes-graphics/xorg-font/xorg-minimal-fonts.bb8
-rw-r--r--meta/recipes-graphics/xorg-proto/xcb-proto_1.14.1.bb (renamed from meta/recipes-graphics/xorg-proto/xcb-proto_1.14.bb)4
-rw-r--r--meta/recipes-kernel/kmod/kmod.inc1
-rw-r--r--meta/recipes-kernel/linux-firmware/linux-firmware_20210208.bb (renamed from meta/recipes-kernel/linux-firmware/linux-firmware_20201218.bb)56
-rw-r--r--meta/recipes-kernel/linux/linux-yocto-rt_5.4.bb6
-rw-r--r--meta/recipes-kernel/linux/linux-yocto-tiny_5.4.bb8
-rw-r--r--meta/recipes-kernel/linux/linux-yocto_5.4.bb22
-rw-r--r--meta/recipes-kernel/lttng/babeltrace2_2.0.3.bb2
-rw-r--r--meta/recipes-multimedia/gstreamer/gstreamer1.0-python_1.16.3.bb2
-rw-r--r--meta/recipes-sato/webkit/wpebackend-fdo_1.7.1.bb3
-rw-r--r--meta/recipes-support/apr/apr-util_1.6.1.bb2
-rw-r--r--meta/recipes-support/ca-certificates/ca-certificates_20210119.bb6
-rw-r--r--meta/recipes-support/iso-codes/iso-codes_4.5.0.bb2
-rw-r--r--meta/recipes-support/libevdev/libevdev/determinism.patch3
-rwxr-xr-xscripts/contrib/documentation-audit.sh2
-rw-r--r--scripts/lib/devtool/standard.py7
-rw-r--r--scripts/lib/wic/canned-wks/common.wks.inc2
-rw-r--r--scripts/lib/wic/canned-wks/directdisk-gpt.wks2
-rw-r--r--scripts/lib/wic/canned-wks/mkefidisk.wks2
-rw-r--r--scripts/lib/wic/misc.py1
-rw-r--r--scripts/lib/wic/partition.py38
-rwxr-xr-xscripts/runqemu2
-rwxr-xr-xscripts/verify-bashisms2
-rwxr-xr-xscripts/yocto-check-layer3
146 files changed, 4033 insertions, 1203 deletions
diff --git a/bitbake/bin/bitbake-server b/bitbake/bin/bitbake-server
index ffbc7894ef..65796be747 100755
--- a/bitbake/bin/bitbake-server
+++ b/bitbake/bin/bitbake-server
@@ -26,7 +26,7 @@ readypipeinfd = int(sys.argv[3])
26logfile = sys.argv[4] 26logfile = sys.argv[4]
27lockname = sys.argv[5] 27lockname = sys.argv[5]
28sockname = sys.argv[6] 28sockname = sys.argv[6]
29timeout = sys.argv[7] 29timeout = float(sys.argv[7])
30xmlrpcinterface = (sys.argv[8], int(sys.argv[9])) 30xmlrpcinterface = (sys.argv[8], int(sys.argv[9]))
31if xmlrpcinterface[0] == "None": 31if xmlrpcinterface[0] == "None":
32 xmlrpcinterface = (None, xmlrpcinterface[1]) 32 xmlrpcinterface = (None, xmlrpcinterface[1])
diff --git a/bitbake/lib/bb/__init__.py b/bitbake/lib/bb/__init__.py
index 09e161fef1..c7bc372ec8 100644
--- a/bitbake/lib/bb/__init__.py
+++ b/bitbake/lib/bb/__init__.py
@@ -49,7 +49,7 @@ class BBLoggerMixin(object):
49 if not bb.event.worker_pid: 49 if not bb.event.worker_pid:
50 if self.name in bb.msg.loggerDefaultDomains and loglevel > (bb.msg.loggerDefaultDomains[self.name]): 50 if self.name in bb.msg.loggerDefaultDomains and loglevel > (bb.msg.loggerDefaultDomains[self.name]):
51 return 51 return
52 if loglevel > bb.msg.loggerDefaultLogLevel: 52 if loglevel < bb.msg.loggerDefaultLogLevel:
53 return 53 return
54 return self.log(loglevel, msg, *args, **kwargs) 54 return self.log(loglevel, msg, *args, **kwargs)
55 55
diff --git a/bitbake/lib/bb/cache.py b/bitbake/lib/bb/cache.py
index 9e0c931a07..029753fea0 100644
--- a/bitbake/lib/bb/cache.py
+++ b/bitbake/lib/bb/cache.py
@@ -26,7 +26,7 @@ import re
26 26
27logger = logging.getLogger("BitBake.Cache") 27logger = logging.getLogger("BitBake.Cache")
28 28
29__cache_version__ = "153" 29__cache_version__ = "154"
30 30
31def getCacheFile(path, filename, mc, data_hash): 31def getCacheFile(path, filename, mc, data_hash):
32 mcspec = '' 32 mcspec = ''
@@ -94,6 +94,7 @@ class CoreRecipeInfo(RecipeInfoCommon):
94 if not self.packages: 94 if not self.packages:
95 self.packages.append(self.pn) 95 self.packages.append(self.pn)
96 self.packages_dynamic = self.listvar('PACKAGES_DYNAMIC', metadata) 96 self.packages_dynamic = self.listvar('PACKAGES_DYNAMIC', metadata)
97 self.rprovides_pkg = self.pkgvar('RPROVIDES', self.packages, metadata)
97 98
98 self.skipreason = self.getvar('__SKIPPED', metadata) 99 self.skipreason = self.getvar('__SKIPPED', metadata)
99 if self.skipreason: 100 if self.skipreason:
@@ -120,7 +121,6 @@ class CoreRecipeInfo(RecipeInfoCommon):
120 self.depends = self.depvar('DEPENDS', metadata) 121 self.depends = self.depvar('DEPENDS', metadata)
121 self.rdepends = self.depvar('RDEPENDS', metadata) 122 self.rdepends = self.depvar('RDEPENDS', metadata)
122 self.rrecommends = self.depvar('RRECOMMENDS', metadata) 123 self.rrecommends = self.depvar('RRECOMMENDS', metadata)
123 self.rprovides_pkg = self.pkgvar('RPROVIDES', self.packages, metadata)
124 self.rdepends_pkg = self.pkgvar('RDEPENDS', self.packages, metadata) 124 self.rdepends_pkg = self.pkgvar('RDEPENDS', self.packages, metadata)
125 self.rrecommends_pkg = self.pkgvar('RRECOMMENDS', self.packages, metadata) 125 self.rrecommends_pkg = self.pkgvar('RRECOMMENDS', self.packages, metadata)
126 self.inherits = self.getvar('__inherit_cache', metadata, expand=False) 126 self.inherits = self.getvar('__inherit_cache', metadata, expand=False)
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index 1f4cc1e96d..4b5ef07eaa 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -73,7 +73,9 @@ class SkippedPackage:
73 self.pn = info.pn 73 self.pn = info.pn
74 self.skipreason = info.skipreason 74 self.skipreason = info.skipreason
75 self.provides = info.provides 75 self.provides = info.provides
76 self.rprovides = info.rprovides 76 self.rprovides = info.packages + info.rprovides
77 for package in info.packages:
78 self.rprovides += info.rprovides_pkg[package]
77 elif reason: 79 elif reason:
78 self.skipreason = reason 80 self.skipreason = reason
79 81
@@ -2207,18 +2209,18 @@ class CookerParser(object):
2207 except bb.BBHandledException as exc: 2209 except bb.BBHandledException as exc:
2208 self.error += 1 2210 self.error += 1
2209 logger.error('Failed to parse recipe: %s' % exc.recipe) 2211 logger.error('Failed to parse recipe: %s' % exc.recipe)
2210 self.shutdown(clean=False) 2212 self.shutdown(clean=False, force=True)
2211 return False 2213 return False
2212 except ParsingFailure as exc: 2214 except ParsingFailure as exc:
2213 self.error += 1 2215 self.error += 1
2214 logger.error('Unable to parse %s: %s' % 2216 logger.error('Unable to parse %s: %s' %
2215 (exc.recipe, bb.exceptions.to_string(exc.realexception))) 2217 (exc.recipe, bb.exceptions.to_string(exc.realexception)))
2216 self.shutdown(clean=False) 2218 self.shutdown(clean=False, force=True)
2217 return False 2219 return False
2218 except bb.parse.ParseError as exc: 2220 except bb.parse.ParseError as exc:
2219 self.error += 1 2221 self.error += 1
2220 logger.error(str(exc)) 2222 logger.error(str(exc))
2221 self.shutdown(clean=False) 2223 self.shutdown(clean=False, force=True)
2222 return False 2224 return False
2223 except bb.data_smart.ExpansionError as exc: 2225 except bb.data_smart.ExpansionError as exc:
2224 self.error += 1 2226 self.error += 1
@@ -2227,7 +2229,7 @@ class CookerParser(object):
2227 tb = list(itertools.dropwhile(lambda e: e.filename.startswith(bbdir), exc.traceback)) 2229 tb = list(itertools.dropwhile(lambda e: e.filename.startswith(bbdir), exc.traceback))
2228 logger.error('ExpansionError during parsing %s', value.recipe, 2230 logger.error('ExpansionError during parsing %s', value.recipe,
2229 exc_info=(etype, value, tb)) 2231 exc_info=(etype, value, tb))
2230 self.shutdown(clean=False) 2232 self.shutdown(clean=False, force=True)
2231 return False 2233 return False
2232 except Exception as exc: 2234 except Exception as exc:
2233 self.error += 1 2235 self.error += 1
@@ -2239,7 +2241,7 @@ class CookerParser(object):
2239 # Most likely, an exception occurred during raising an exception 2241 # Most likely, an exception occurred during raising an exception
2240 import traceback 2242 import traceback
2241 logger.error('Exception during parse: %s' % traceback.format_exc()) 2243 logger.error('Exception during parse: %s' % traceback.format_exc())
2242 self.shutdown(clean=False) 2244 self.shutdown(clean=False, force=True)
2243 return False 2245 return False
2244 2246
2245 self.current += 1 2247 self.current += 1
diff --git a/bitbake/lib/bb/data_smart.py b/bitbake/lib/bb/data_smart.py
index 2328c334ac..b4ed62a4e5 100644
--- a/bitbake/lib/bb/data_smart.py
+++ b/bitbake/lib/bb/data_smart.py
@@ -28,7 +28,7 @@ logger = logging.getLogger("BitBake.Data")
28 28
29__setvar_keyword__ = ["_append", "_prepend", "_remove"] 29__setvar_keyword__ = ["_append", "_prepend", "_remove"]
30__setvar_regexp__ = re.compile(r'(?P<base>.*?)(?P<keyword>_append|_prepend|_remove)(_(?P<add>[^A-Z]*))?$') 30__setvar_regexp__ = re.compile(r'(?P<base>.*?)(?P<keyword>_append|_prepend|_remove)(_(?P<add>[^A-Z]*))?$')
31__expand_var_regexp__ = re.compile(r"\${[a-zA-Z0-9\-_+./~]+?}") 31__expand_var_regexp__ = re.compile(r"\${[a-zA-Z0-9\-_+./~:]+?}")
32__expand_python_regexp__ = re.compile(r"\${@.+?}") 32__expand_python_regexp__ = re.compile(r"\${@.+?}")
33__whitespace_split__ = re.compile(r'(\s)') 33__whitespace_split__ = re.compile(r'(\s)')
34__override_regexp__ = re.compile(r'[a-z0-9]+') 34__override_regexp__ = re.compile(r'[a-z0-9]+')
@@ -481,6 +481,7 @@ class DataSmart(MutableMapping):
481 481
482 def setVar(self, var, value, **loginfo): 482 def setVar(self, var, value, **loginfo):
483 #print("var=" + str(var) + " val=" + str(value)) 483 #print("var=" + str(var) + " val=" + str(value))
484 var = var.replace(":", "_")
484 self.expand_cache = {} 485 self.expand_cache = {}
485 parsing=False 486 parsing=False
486 if 'parsing' in loginfo: 487 if 'parsing' in loginfo:
@@ -589,6 +590,8 @@ class DataSmart(MutableMapping):
589 """ 590 """
590 Rename the variable key to newkey 591 Rename the variable key to newkey
591 """ 592 """
593 key = key.replace(":", "_")
594 newkey = newkey.replace(":", "_")
592 if key == newkey: 595 if key == newkey:
593 bb.warn("Calling renameVar with equivalent keys (%s) is invalid" % key) 596 bb.warn("Calling renameVar with equivalent keys (%s) is invalid" % key)
594 return 597 return
@@ -637,6 +640,7 @@ class DataSmart(MutableMapping):
637 self.setVar(var + "_prepend", value, ignore=True, parsing=True) 640 self.setVar(var + "_prepend", value, ignore=True, parsing=True)
638 641
639 def delVar(self, var, **loginfo): 642 def delVar(self, var, **loginfo):
643 var = var.replace(":", "_")
640 self.expand_cache = {} 644 self.expand_cache = {}
641 645
642 loginfo['detail'] = "" 646 loginfo['detail'] = ""
@@ -664,6 +668,7 @@ class DataSmart(MutableMapping):
664 override = None 668 override = None
665 669
666 def setVarFlag(self, var, flag, value, **loginfo): 670 def setVarFlag(self, var, flag, value, **loginfo):
671 var = var.replace(":", "_")
667 self.expand_cache = {} 672 self.expand_cache = {}
668 673
669 if 'op' not in loginfo: 674 if 'op' not in loginfo:
@@ -687,6 +692,7 @@ class DataSmart(MutableMapping):
687 self.dict["__exportlist"]["_content"].add(var) 692 self.dict["__exportlist"]["_content"].add(var)
688 693
689 def getVarFlag(self, var, flag, expand=True, noweakdefault=False, parsing=False, retparser=False): 694 def getVarFlag(self, var, flag, expand=True, noweakdefault=False, parsing=False, retparser=False):
695 var = var.replace(":", "_")
690 if flag == "_content": 696 if flag == "_content":
691 cachename = var 697 cachename = var
692 else: 698 else:
@@ -814,6 +820,7 @@ class DataSmart(MutableMapping):
814 return value 820 return value
815 821
816 def delVarFlag(self, var, flag, **loginfo): 822 def delVarFlag(self, var, flag, **loginfo):
823 var = var.replace(":", "_")
817 self.expand_cache = {} 824 self.expand_cache = {}
818 825
819 local_var, _ = self._findVar(var) 826 local_var, _ = self._findVar(var)
@@ -831,6 +838,7 @@ class DataSmart(MutableMapping):
831 del self.dict[var][flag] 838 del self.dict[var][flag]
832 839
833 def appendVarFlag(self, var, flag, value, **loginfo): 840 def appendVarFlag(self, var, flag, value, **loginfo):
841 var = var.replace(":", "_")
834 loginfo['op'] = 'append' 842 loginfo['op'] = 'append'
835 loginfo['flag'] = flag 843 loginfo['flag'] = flag
836 self.varhistory.record(**loginfo) 844 self.varhistory.record(**loginfo)
@@ -838,6 +846,7 @@ class DataSmart(MutableMapping):
838 self.setVarFlag(var, flag, newvalue, ignore=True) 846 self.setVarFlag(var, flag, newvalue, ignore=True)
839 847
840 def prependVarFlag(self, var, flag, value, **loginfo): 848 def prependVarFlag(self, var, flag, value, **loginfo):
849 var = var.replace(":", "_")
841 loginfo['op'] = 'prepend' 850 loginfo['op'] = 'prepend'
842 loginfo['flag'] = flag 851 loginfo['flag'] = flag
843 self.varhistory.record(**loginfo) 852 self.varhistory.record(**loginfo)
@@ -845,6 +854,7 @@ class DataSmart(MutableMapping):
845 self.setVarFlag(var, flag, newvalue, ignore=True) 854 self.setVarFlag(var, flag, newvalue, ignore=True)
846 855
847 def setVarFlags(self, var, flags, **loginfo): 856 def setVarFlags(self, var, flags, **loginfo):
857 var = var.replace(":", "_")
848 self.expand_cache = {} 858 self.expand_cache = {}
849 infer_caller_details(loginfo) 859 infer_caller_details(loginfo)
850 if not var in self.dict: 860 if not var in self.dict:
@@ -859,6 +869,7 @@ class DataSmart(MutableMapping):
859 self.dict[var][i] = flags[i] 869 self.dict[var][i] = flags[i]
860 870
861 def getVarFlags(self, var, expand = False, internalflags=False): 871 def getVarFlags(self, var, expand = False, internalflags=False):
872 var = var.replace(":", "_")
862 local_var, _ = self._findVar(var) 873 local_var, _ = self._findVar(var)
863 flags = {} 874 flags = {}
864 875
@@ -875,6 +886,7 @@ class DataSmart(MutableMapping):
875 886
876 887
877 def delVarFlags(self, var, **loginfo): 888 def delVarFlags(self, var, **loginfo):
889 var = var.replace(":", "_")
878 self.expand_cache = {} 890 self.expand_cache = {}
879 if not var in self.dict: 891 if not var in self.dict:
880 self._makeShadowCopy(var) 892 self._makeShadowCopy(var)
diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py
index b59a7cdc84..f2cc02258e 100644
--- a/bitbake/lib/bb/fetch2/git.py
+++ b/bitbake/lib/bb/fetch2/git.py
@@ -141,6 +141,10 @@ class Git(FetchMethod):
141 ud.proto = 'file' 141 ud.proto = 'file'
142 else: 142 else:
143 ud.proto = "git" 143 ud.proto = "git"
144 if ud.host == "github.com" and ud.proto == "git":
145 # github stopped supporting git protocol
146 # https://github.blog/2021-09-01-improving-git-protocol-security-github/#no-more-unauthenticated-git
147 ud.proto = "https"
144 148
145 if not ud.proto in ('git', 'file', 'ssh', 'http', 'https', 'rsync'): 149 if not ud.proto in ('git', 'file', 'ssh', 'http', 'https', 'rsync'):
146 raise bb.fetch2.ParameterError("Invalid protocol type", ud.url) 150 raise bb.fetch2.ParameterError("Invalid protocol type", ud.url)
@@ -389,7 +393,7 @@ class Git(FetchMethod):
389 tmpdir = tempfile.mkdtemp(dir=d.getVar('DL_DIR')) 393 tmpdir = tempfile.mkdtemp(dir=d.getVar('DL_DIR'))
390 try: 394 try:
391 # Do the checkout. This implicitly involves a Git LFS fetch. 395 # Do the checkout. This implicitly involves a Git LFS fetch.
392 self.unpack(ud, tmpdir, d) 396 Git.unpack(self, ud, tmpdir, d)
393 397
394 # Scoop up a copy of any stuff that Git LFS downloaded. Merge them into 398 # Scoop up a copy of any stuff that Git LFS downloaded. Merge them into
395 # the bare clonedir. 399 # the bare clonedir.
diff --git a/bitbake/lib/bb/fetch2/wget.py b/bitbake/lib/bb/fetch2/wget.py
index e6d9f528d0..83acd85bae 100644
--- a/bitbake/lib/bb/fetch2/wget.py
+++ b/bitbake/lib/bb/fetch2/wget.py
@@ -316,7 +316,7 @@ class Wget(FetchMethod):
316 except (TypeError, ImportError, IOError, netrc.NetrcParseError): 316 except (TypeError, ImportError, IOError, netrc.NetrcParseError):
317 pass 317 pass
318 318
319 with opener.open(r) as response: 319 with opener.open(r, timeout=30) as response:
320 pass 320 pass
321 except urllib.error.URLError as e: 321 except urllib.error.URLError as e:
322 if try_again: 322 if try_again:
diff --git a/bitbake/lib/bb/parse/ast.py b/bitbake/lib/bb/parse/ast.py
index 0714296af2..c8802c0587 100644
--- a/bitbake/lib/bb/parse/ast.py
+++ b/bitbake/lib/bb/parse/ast.py
@@ -97,6 +97,7 @@ class DataNode(AstNode):
97 def eval(self, data): 97 def eval(self, data):
98 groupd = self.groupd 98 groupd = self.groupd
99 key = groupd["var"] 99 key = groupd["var"]
100 key = key.replace(":", "_")
100 loginfo = { 101 loginfo = {
101 'variable': key, 102 'variable': key,
102 'file': self.filename, 103 'file': self.filename,
@@ -207,6 +208,7 @@ class ExportFuncsNode(AstNode):
207 def eval(self, data): 208 def eval(self, data):
208 209
209 for func in self.n: 210 for func in self.n:
211 func = func.replace(":", "_")
210 calledfunc = self.classname + "_" + func 212 calledfunc = self.classname + "_" + func
211 213
212 if data.getVar(func, False) and not data.getVarFlag(func, 'export_func', False): 214 if data.getVar(func, False) and not data.getVarFlag(func, 'export_func', False):
diff --git a/bitbake/lib/bb/parse/parse_py/BBHandler.py b/bitbake/lib/bb/parse/parse_py/BBHandler.py
index 215f940b60..12a78b6502 100644
--- a/bitbake/lib/bb/parse/parse_py/BBHandler.py
+++ b/bitbake/lib/bb/parse/parse_py/BBHandler.py
@@ -22,7 +22,7 @@ from .ConfHandler import include, init
22# For compatibility 22# For compatibility
23bb.deprecate_import(__name__, "bb.parse", ["vars_from_file"]) 23bb.deprecate_import(__name__, "bb.parse", ["vars_from_file"])
24 24
25__func_start_regexp__ = re.compile(r"(((?P<py>python)|(?P<fr>fakeroot))\s*)*(?P<func>[\w\.\-\+\{\}\$]+)?\s*\(\s*\)\s*{$" ) 25__func_start_regexp__ = re.compile(r"(((?P<py>python(?=(\s|\()))|(?P<fr>fakeroot(?=\s)))\s*)*(?P<func>[\w\.\-\+\{\}\$:]+)?\s*\(\s*\)\s*{$" )
26__inherit_regexp__ = re.compile(r"inherit\s+(.+)" ) 26__inherit_regexp__ = re.compile(r"inherit\s+(.+)" )
27__export_func_regexp__ = re.compile(r"EXPORT_FUNCTIONS\s+(.+)" ) 27__export_func_regexp__ = re.compile(r"EXPORT_FUNCTIONS\s+(.+)" )
28__addtask_regexp__ = re.compile(r"addtask\s+(?P<func>\w+)\s*((before\s*(?P<before>((.*(?=after))|(.*))))|(after\s*(?P<after>((.*(?=before))|(.*)))))*") 28__addtask_regexp__ = re.compile(r"addtask\s+(?P<func>\w+)\s*((before\s*(?P<before>((.*(?=after))|(.*))))|(after\s*(?P<after>((.*(?=before))|(.*)))))*")
diff --git a/bitbake/lib/bb/parse/parse_py/ConfHandler.py b/bitbake/lib/bb/parse/parse_py/ConfHandler.py
index af64d3446e..a7e81bd6ad 100644
--- a/bitbake/lib/bb/parse/parse_py/ConfHandler.py
+++ b/bitbake/lib/bb/parse/parse_py/ConfHandler.py
@@ -20,7 +20,7 @@ from bb.parse import ParseError, resolve_file, ast, logger, handle
20__config_regexp__ = re.compile( r""" 20__config_regexp__ = re.compile( r"""
21 ^ 21 ^
22 (?P<exp>export\s+)? 22 (?P<exp>export\s+)?
23 (?P<var>[a-zA-Z0-9\-_+.${}/~]+?) 23 (?P<var>[a-zA-Z0-9\-_+.${}/~:]+?)
24 (\[(?P<flag>[a-zA-Z0-9\-_+.]+)\])? 24 (\[(?P<flag>[a-zA-Z0-9\-_+.]+)\])?
25 25
26 \s* ( 26 \s* (
diff --git a/bitbake/lib/bb/providers.py b/bitbake/lib/bb/providers.py
index 81459c36d5..484e1ea4f3 100644
--- a/bitbake/lib/bb/providers.py
+++ b/bitbake/lib/bb/providers.py
@@ -151,7 +151,7 @@ def findPreferredProvider(pn, cfgData, dataCache, pkg_pn = None, item = None):
151 if item: 151 if item:
152 itemstr = " (for item %s)" % item 152 itemstr = " (for item %s)" % item
153 if preferred_file is None: 153 if preferred_file is None:
154 logger.info("preferred version %s of %s not available%s", pv_str, pn, itemstr) 154 logger.warning("preferred version %s of %s not available%s", pv_str, pn, itemstr)
155 available_vers = [] 155 available_vers = []
156 for file_set in pkg_pn: 156 for file_set in pkg_pn:
157 for f in file_set: 157 for f in file_set:
@@ -163,7 +163,7 @@ def findPreferredProvider(pn, cfgData, dataCache, pkg_pn = None, item = None):
163 available_vers.append(ver_str) 163 available_vers.append(ver_str)
164 if available_vers: 164 if available_vers:
165 available_vers.sort() 165 available_vers.sort()
166 logger.info("versions of %s available: %s", pn, ' '.join(available_vers)) 166 logger.warning("versions of %s available: %s", pn, ' '.join(available_vers))
167 else: 167 else:
168 logger.debug(1, "selecting %s as PREFERRED_VERSION %s of package %s%s", preferred_file, pv_str, pn, itemstr) 168 logger.debug(1, "selecting %s as PREFERRED_VERSION %s of package %s%s", preferred_file, pv_str, pn, itemstr)
169 169
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py
index 28bdadb45e..aa1d6b2711 100644
--- a/bitbake/lib/bb/runqueue.py
+++ b/bitbake/lib/bb/runqueue.py
@@ -1942,6 +1942,10 @@ class RunQueueExecute:
1942 logger.error("Scenequeue had holdoff tasks: %s" % pprint.pformat(self.holdoff_tasks)) 1942 logger.error("Scenequeue had holdoff tasks: %s" % pprint.pformat(self.holdoff_tasks))
1943 err = True 1943 err = True
1944 1944
1945 for tid in self.scenequeue_covered.intersection(self.scenequeue_notcovered):
1946 # No task should end up in both covered and uncovered, that is a bug.
1947 logger.error("Setscene task %s in both covered and notcovered." % tid)
1948
1945 for tid in self.rqdata.runq_setscene_tids: 1949 for tid in self.rqdata.runq_setscene_tids:
1946 if tid not in self.scenequeue_covered and tid not in self.scenequeue_notcovered: 1950 if tid not in self.scenequeue_covered and tid not in self.scenequeue_notcovered:
1947 err = True 1951 err = True
@@ -2430,6 +2434,9 @@ class RunQueueExecute:
2430 2434
2431 for dep in sorted(self.sqdata.sq_deps[task]): 2435 for dep in sorted(self.sqdata.sq_deps[task]):
2432 if fail and task in self.sqdata.sq_harddeps and dep in self.sqdata.sq_harddeps[task]: 2436 if fail and task in self.sqdata.sq_harddeps and dep in self.sqdata.sq_harddeps[task]:
2437 if dep in self.scenequeue_covered or dep in self.scenequeue_notcovered:
2438 # dependency could be already processed, e.g. noexec setscene task
2439 continue
2433 logger.debug(2, "%s was unavailable and is a hard dependency of %s so skipping" % (task, dep)) 2440 logger.debug(2, "%s was unavailable and is a hard dependency of %s so skipping" % (task, dep))
2434 self.sq_task_failoutright(dep) 2441 self.sq_task_failoutright(dep)
2435 continue 2442 continue
@@ -2791,6 +2798,7 @@ def update_scenequeue_data(tids, sqdata, rqdata, rq, cooker, stampcache, sqrq, s
2791 sqdata.valid |= rq.validate_hashes(tocheck, cooker.data, len(sqdata.stamppresent), False, summary=summary) 2798 sqdata.valid |= rq.validate_hashes(tocheck, cooker.data, len(sqdata.stamppresent), False, summary=summary)
2792 2799
2793 sqdata.hashes = {} 2800 sqdata.hashes = {}
2801 sqrq.sq_deferred = {}
2794 for mc in sorted(sqdata.multiconfigs): 2802 for mc in sorted(sqdata.multiconfigs):
2795 for tid in sorted(sqdata.sq_revdeps): 2803 for tid in sorted(sqdata.sq_revdeps):
2796 if mc_from_tid(tid) != mc: 2804 if mc_from_tid(tid) != mc:
@@ -2803,6 +2811,9 @@ def update_scenequeue_data(tids, sqdata, rqdata, rq, cooker, stampcache, sqrq, s
2803 continue 2811 continue
2804 if tid in sqrq.scenequeue_notcovered: 2812 if tid in sqrq.scenequeue_notcovered:
2805 continue 2813 continue
2814 if tid in sqrq.scenequeue_covered:
2815 continue
2816
2806 sqdata.outrightfail.add(tid) 2817 sqdata.outrightfail.add(tid)
2807 2818
2808 h = pending_hash_index(tid, rqdata) 2819 h = pending_hash_index(tid, rqdata)
diff --git a/bitbake/lib/bb/server/process.py b/bitbake/lib/bb/server/process.py
index b27b4aefe0..3e99bcef8f 100644
--- a/bitbake/lib/bb/server/process.py
+++ b/bitbake/lib/bb/server/process.py
@@ -509,7 +509,7 @@ class BitBakeServer(object):
509 os.set_inheritable(self.bitbake_lock.fileno(), True) 509 os.set_inheritable(self.bitbake_lock.fileno(), True)
510 os.set_inheritable(self.readypipein, True) 510 os.set_inheritable(self.readypipein, True)
511 serverscript = os.path.realpath(os.path.dirname(__file__) + "/../../../bin/bitbake-server") 511 serverscript = os.path.realpath(os.path.dirname(__file__) + "/../../../bin/bitbake-server")
512 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])) 512 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]))
513 513
514def execServer(lockfd, readypipeinfd, lockname, sockname, server_timeout, xmlrpcinterface): 514def execServer(lockfd, readypipeinfd, lockname, sockname, server_timeout, xmlrpcinterface):
515 515
diff --git a/bitbake/lib/bb/tests/codeparser.py b/bitbake/lib/bb/tests/codeparser.py
index 826a2d2f6d..f485204791 100644
--- a/bitbake/lib/bb/tests/codeparser.py
+++ b/bitbake/lib/bb/tests/codeparser.py
@@ -111,9 +111,9 @@ ${D}${libdir}/pkgconfig/*.pc
111 self.assertExecs(set(["sed"])) 111 self.assertExecs(set(["sed"]))
112 112
113 def test_parameter_expansion_modifiers(self): 113 def test_parameter_expansion_modifiers(self):
114 # - and + are also valid modifiers for parameter expansion, but are 114 # -,+ and : are also valid modifiers for parameter expansion, but are
115 # valid characters in bitbake variable names, so are not included here 115 # valid characters in bitbake variable names, so are not included here
116 for i in ('=', ':-', ':=', '?', ':?', ':+', '#', '%', '##', '%%'): 116 for i in ('=', '?', '#', '%', '##', '%%'):
117 name = "foo%sbar" % i 117 name = "foo%sbar" % i
118 self.parseExpression("${%s}" % name) 118 self.parseExpression("${%s}" % name)
119 self.assertNotIn(name, self.references) 119 self.assertNotIn(name, self.references)
diff --git a/bitbake/lib/bb/tests/fetch.py b/bitbake/lib/bb/tests/fetch.py
index 5b70ee810f..4671532f2b 100644
--- a/bitbake/lib/bb/tests/fetch.py
+++ b/bitbake/lib/bb/tests/fetch.py
@@ -939,7 +939,7 @@ class FetcherNetworkTest(FetcherTest):
939 939
940 @skipIfNoNetwork() 940 @skipIfNoNetwork()
941 def test_git_submodule_CLI11(self): 941 def test_git_submodule_CLI11(self):
942 url = "gitsm://github.com/CLIUtils/CLI11;protocol=git;rev=bd4dc911847d0cde7a6b41dfa626a85aab213baf" 942 url = "gitsm://github.com/CLIUtils/CLI11;protocol=git;rev=bd4dc911847d0cde7a6b41dfa626a85aab213baf;branch=main"
943 fetcher = bb.fetch.Fetch([url], self.d) 943 fetcher = bb.fetch.Fetch([url], self.d)
944 fetcher.download() 944 fetcher.download()
945 # Previous cwd has been deleted 945 # Previous cwd has been deleted
@@ -954,12 +954,12 @@ class FetcherNetworkTest(FetcherTest):
954 @skipIfNoNetwork() 954 @skipIfNoNetwork()
955 def test_git_submodule_update_CLI11(self): 955 def test_git_submodule_update_CLI11(self):
956 """ Prevent regression on update detection not finding missing submodule, or modules without needed commits """ 956 """ Prevent regression on update detection not finding missing submodule, or modules without needed commits """
957 url = "gitsm://github.com/CLIUtils/CLI11;protocol=git;rev=cf6a99fa69aaefe477cc52e3ef4a7d2d7fa40714" 957 url = "gitsm://github.com/CLIUtils/CLI11;protocol=git;rev=cf6a99fa69aaefe477cc52e3ef4a7d2d7fa40714;branch=main"
958 fetcher = bb.fetch.Fetch([url], self.d) 958 fetcher = bb.fetch.Fetch([url], self.d)
959 fetcher.download() 959 fetcher.download()
960 960
961 # CLI11 that pulls in a newer nlohmann-json 961 # CLI11 that pulls in a newer nlohmann-json
962 url = "gitsm://github.com/CLIUtils/CLI11;protocol=git;rev=49ac989a9527ee9bb496de9ded7b4872c2e0e5ca" 962 url = "gitsm://github.com/CLIUtils/CLI11;protocol=git;rev=49ac989a9527ee9bb496de9ded7b4872c2e0e5ca;branch=main"
963 fetcher = bb.fetch.Fetch([url], self.d) 963 fetcher = bb.fetch.Fetch([url], self.d)
964 fetcher.download() 964 fetcher.download()
965 # Previous cwd has been deleted 965 # Previous cwd has been deleted
@@ -993,7 +993,7 @@ class FetcherNetworkTest(FetcherTest):
993 """ Prevent regression on deeply nested submodules not being checked out properly, even though they were fetched. """ 993 """ Prevent regression on deeply nested submodules not being checked out properly, even though they were fetched. """
994 994
995 # This repository also has submodules where the module (name), path and url do not align 995 # This repository also has submodules where the module (name), path and url do not align
996 url = "gitsm://github.com/azure/iotedge.git;protocol=git;rev=d76e0316c6f324345d77c48a83ce836d09392699" 996 url = "gitsm://github.com/azure/iotedge.git;protocol=git;rev=d76e0316c6f324345d77c48a83ce836d09392699;branch=main"
997 fetcher = bb.fetch.Fetch([url], self.d) 997 fetcher = bb.fetch.Fetch([url], self.d)
998 fetcher.download() 998 fetcher.download()
999 # Previous cwd has been deleted 999 # Previous cwd has been deleted
@@ -1180,7 +1180,7 @@ class FetchLatestVersionTest(FetcherTest):
1180 ("presentproto", "git://git.yoctoproject.org/bbfetchtests-presentproto", "24f3a56e541b0a9e6c6ee76081f441221a120ef9", "") 1180 ("presentproto", "git://git.yoctoproject.org/bbfetchtests-presentproto", "24f3a56e541b0a9e6c6ee76081f441221a120ef9", "")
1181 : "1.0", 1181 : "1.0",
1182 # version pattern "pkg_name-vX.Y.Z" 1182 # version pattern "pkg_name-vX.Y.Z"
1183 ("dtc", "git://git.qemu.org/dtc.git", "65cc4d2748a2c2e6f27f1cf39e07a5dbabd80ebf", "") 1183 ("dtc", "git://git.yoctoproject.org/bbfetchtests-dtc.git", "65cc4d2748a2c2e6f27f1cf39e07a5dbabd80ebf", "")
1184 : "1.4.0", 1184 : "1.4.0",
1185 # combination version pattern 1185 # combination version pattern
1186 ("sysprof", "git://gitlab.gnome.org/GNOME/sysprof.git;protocol=https", "cd44ee6644c3641507fb53b8a2a69137f2971219", "") 1186 ("sysprof", "git://gitlab.gnome.org/GNOME/sysprof.git;protocol=https", "cd44ee6644c3641507fb53b8a2a69137f2971219", "")
diff --git a/documentation/conf.py b/documentation/conf.py
index 44f1e43a8a..fe27e3e0d2 100644
--- a/documentation/conf.py
+++ b/documentation/conf.py
@@ -15,8 +15,27 @@
15import os 15import os
16import sys 16import sys
17import datetime 17import datetime
18try:
19 import yaml
20except ImportError:
21 sys.stderr.write("The Yocto Project Sphinx documentation requires PyYAML.\
22 \nPlease make sure to install pyyaml python package.\n")
23 sys.exit(1)
18 24
19current_version = "3.2.1" 25# current_version = "dev"
26# bitbake_version = "" # Leave empty for development branch
27# Obtain versions from poky.yaml instead
28with open("poky.yaml") as data:
29 buff = data.read()
30 subst_vars = yaml.safe_load(buff)
31 if "DOCCONF_VERSION" not in subst_vars:
32 sys.stderr.write("Please set DOCCONF_VERSION in poky.yaml")
33 sys.exit(1)
34 current_version = subst_vars["DOCCONF_VERSION"]
35 if "BITBAKE_SERIES" not in subst_vars:
36 sys.stderr.write("Please set BITBAKE_SERIES in poky.yaml")
37 sys.exit(1)
38 bitbake_version = subst_vars["BITBAKE_SERIES"]
20 39
21# String used in sidebar 40# String used in sidebar
22version = 'Version: ' + current_version 41version = 'Version: ' + current_version
diff --git a/documentation/poky.yaml b/documentation/poky.yaml
index ef63d6eb73..fb567a11dc 100644
--- a/documentation/poky.yaml
+++ b/documentation/poky.yaml
@@ -1,11 +1,13 @@
1DISTRO : "3.2.1" 1DISTRO : "3.2.4"
2DISTRO_NAME_NO_CAP : "gatesgarth" 2DISTRO_NAME_NO_CAP : "gatesgarth"
3DISTRO_NAME : "Gatesgarth" 3DISTRO_NAME : "Gatesgarth"
4DISTRO_NAME_NO_CAP_MINUS_ONE : "dunfell" 4DISTRO_NAME_NO_CAP_MINUS_ONE : "dunfell"
5YOCTO_DOC_VERSION : "3.2.1" 5YOCTO_DOC_VERSION : "3.2.4"
6YOCTO_DOC_VERSION_MINUS_ONE : "3.1.3" 6YOCTO_DOC_VERSION_MINUS_ONE : "3.1.7"
7DISTRO_REL_TAG : "yocto-3.2.1" 7DISTRO_REL_TAG : "yocto-3.2.4"
8POKYVERSION : "24.0.1" 8DOCCONF_VERSION : "3.2.4"
9BITBAKE_SERIES : "1.48"
10POKYVERSION : "24.0.4"
9YOCTO_POKY : "poky-&DISTRO_NAME_NO_CAP;-&POKYVERSION;" 11YOCTO_POKY : "poky-&DISTRO_NAME_NO_CAP;-&POKYVERSION;"
10YOCTO_DL_URL : "https://downloads.yoctoproject.org" 12YOCTO_DL_URL : "https://downloads.yoctoproject.org"
11YOCTO_AB_URL : "https://autobuilder.yoctoproject.org" 13YOCTO_AB_URL : "https://autobuilder.yoctoproject.org"
diff --git a/documentation/releases.rst b/documentation/releases.rst
index dbdc173a0f..3e95ab9e23 100644
--- a/documentation/releases.rst
+++ b/documentation/releases.rst
@@ -9,6 +9,10 @@
9******************************* 9*******************************
10 10
11- :yocto_docs:`3.2 Documentation </3.2>` 11- :yocto_docs:`3.2 Documentation </3.2>`
12- :yocto_docs:`3.2.1 Documentation </3.2.1>`
13- :yocto_docs:`3.2.2 Documentation </3.2.2>`
14- :yocto_docs:`3.2.3 Documentation </3.2.3>`
15- :yocto_docs:`3.2.4 Documentation </3.2.4>`
12 16
13**************************** 17****************************
143.1 'dunfell' Release Series 183.1 'dunfell' Release Series
@@ -18,6 +22,10 @@
18- :yocto_docs:`3.1.1 Documentation </3.1.1>` 22- :yocto_docs:`3.1.1 Documentation </3.1.1>`
19- :yocto_docs:`3.1.2 Documentation </3.1.2>` 23- :yocto_docs:`3.1.2 Documentation </3.1.2>`
20- :yocto_docs:`3.1.3 Documentation </3.1.3>` 24- :yocto_docs:`3.1.3 Documentation </3.1.3>`
25- :yocto_docs:`3.1.4 Documentation </3.1.4>`
26- :yocto_docs:`3.1.5 Documentation </3.1.5>`
27- :yocto_docs:`3.1.6 Documentation </3.1.6>`
28- :yocto_docs:`3.1.7 Documentation </3.1.7>`
21 29
22========================== 30==========================
23 Previous Release Manuals 31 Previous Release Manuals
@@ -31,6 +39,7 @@
31- :yocto_docs:`3.0.1 Documentation </3.0.1>` 39- :yocto_docs:`3.0.1 Documentation </3.0.1>`
32- :yocto_docs:`3.0.2 Documentation </3.0.2>` 40- :yocto_docs:`3.0.2 Documentation </3.0.2>`
33- :yocto_docs:`3.0.3 Documentation </3.0.3>` 41- :yocto_docs:`3.0.3 Documentation </3.0.3>`
42- :yocto_docs:`3.0.4 Documentation </3.0.4>`
34 43
35**************************** 44****************************
362.7 'warrior' Release Series 452.7 'warrior' Release Series
diff --git a/meta-poky/conf/distro/poky.conf b/meta-poky/conf/distro/poky.conf
index 4351dccfcb..ccfbf6dba4 100644
--- a/meta-poky/conf/distro/poky.conf
+++ b/meta-poky/conf/distro/poky.conf
@@ -1,6 +1,6 @@
1DISTRO = "poky" 1DISTRO = "poky"
2DISTRO_NAME = "Poky (Yocto Project Reference Distro)" 2DISTRO_NAME = "Poky (Yocto Project Reference Distro)"
3DISTRO_VERSION = "3.2.2" 3DISTRO_VERSION = "3.2.4"
4DISTRO_CODENAME = "gatesgarth" 4DISTRO_CODENAME = "gatesgarth"
5SDK_VENDOR = "-pokysdk" 5SDK_VENDOR = "-pokysdk"
6SDK_VERSION = "${@d.getVar('DISTRO_VERSION').replace('snapshot-${DATE}', 'snapshot')}" 6SDK_VERSION = "${@d.getVar('DISTRO_VERSION').replace('snapshot-${DATE}', 'snapshot')}"
diff --git a/meta-yocto-bsp/recipes-kernel/linux/linux-yocto_5.4.bbappend b/meta-yocto-bsp/recipes-kernel/linux/linux-yocto_5.4.bbappend
index 91500b8e9c..35147d2da8 100644
--- a/meta-yocto-bsp/recipes-kernel/linux/linux-yocto_5.4.bbappend
+++ b/meta-yocto-bsp/recipes-kernel/linux/linux-yocto_5.4.bbappend
@@ -7,8 +7,8 @@ KMACHINE_genericx86 ?= "common-pc"
7KMACHINE_genericx86-64 ?= "common-pc-64" 7KMACHINE_genericx86-64 ?= "common-pc-64"
8KMACHINE_beaglebone-yocto ?= "beaglebone" 8KMACHINE_beaglebone-yocto ?= "beaglebone"
9 9
10SRCREV_machine_genericx86 ?= "292d752af8e4015e40e7c523641983bac543e2b4" 10SRCREV_machine_genericx86 ?= "31db2b47ac7d8508080fbb7344399b501216de66"
11SRCREV_machine_genericx86-64 ?= "292d752af8e4015e40e7c523641983bac543e2b4" 11SRCREV_machine_genericx86-64 ?= "31db2b47ac7d8508080fbb7344399b501216de66"
12SRCREV_machine_edgerouter ?= "706efec4c1e270ec5dda92275898cd465dfdc7dd" 12SRCREV_machine_edgerouter ?= "706efec4c1e270ec5dda92275898cd465dfdc7dd"
13SRCREV_machine_beaglebone-yocto ?= "706efec4c1e270ec5dda92275898cd465dfdc7dd" 13SRCREV_machine_beaglebone-yocto ?= "706efec4c1e270ec5dda92275898cd465dfdc7dd"
14 14
@@ -17,7 +17,7 @@ COMPATIBLE_MACHINE_genericx86-64 = "genericx86-64"
17COMPATIBLE_MACHINE_edgerouter = "edgerouter" 17COMPATIBLE_MACHINE_edgerouter = "edgerouter"
18COMPATIBLE_MACHINE_beaglebone-yocto = "beaglebone-yocto" 18COMPATIBLE_MACHINE_beaglebone-yocto = "beaglebone-yocto"
19 19
20LINUX_VERSION_genericx86 = "5.4.87" 20LINUX_VERSION_genericx86 = "5.4.94"
21LINUX_VERSION_genericx86-64 = "5.4.87" 21LINUX_VERSION_genericx86-64 = "5.4.94"
22LINUX_VERSION_edgerouter = "5.4.58" 22LINUX_VERSION_edgerouter = "5.4.58"
23LINUX_VERSION_beaglebone-yocto = "5.4.58" 23LINUX_VERSION_beaglebone-yocto = "5.4.58"
diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass
index 3a6780da34..726f17a946 100644
--- a/meta/classes/buildhistory.bbclass
+++ b/meta/classes/buildhistory.bbclass
@@ -674,13 +674,16 @@ IMAGE_POSTPROCESS_COMMAND[vardepsexclude] += "buildhistory_get_imageinfo"
674POPULATE_SDK_POST_TARGET_COMMAND_append = " buildhistory_list_installed_sdk_target;" 674POPULATE_SDK_POST_TARGET_COMMAND_append = " buildhistory_list_installed_sdk_target;"
675POPULATE_SDK_POST_TARGET_COMMAND_append = " buildhistory_get_sdk_installed_target;" 675POPULATE_SDK_POST_TARGET_COMMAND_append = " buildhistory_get_sdk_installed_target;"
676POPULATE_SDK_POST_TARGET_COMMAND[vardepvalueexclude] .= "| buildhistory_list_installed_sdk_target;| buildhistory_get_sdk_installed_target;" 676POPULATE_SDK_POST_TARGET_COMMAND[vardepvalueexclude] .= "| buildhistory_list_installed_sdk_target;| buildhistory_get_sdk_installed_target;"
677POPULATE_SDK_POST_TARGET_COMMAND[vardepsexclude] += "buildhistory_list_installed_sdk_target buildhistory_get_sdk_installed_target"
677 678
678POPULATE_SDK_POST_HOST_COMMAND_append = " buildhistory_list_installed_sdk_host;" 679POPULATE_SDK_POST_HOST_COMMAND_append = " buildhistory_list_installed_sdk_host;"
679POPULATE_SDK_POST_HOST_COMMAND_append = " buildhistory_get_sdk_installed_host;" 680POPULATE_SDK_POST_HOST_COMMAND_append = " buildhistory_get_sdk_installed_host;"
680POPULATE_SDK_POST_HOST_COMMAND[vardepvalueexclude] .= "| buildhistory_list_installed_sdk_host;| buildhistory_get_sdk_installed_host;" 681POPULATE_SDK_POST_HOST_COMMAND[vardepvalueexclude] .= "| buildhistory_list_installed_sdk_host;| buildhistory_get_sdk_installed_host;"
682POPULATE_SDK_POST_HOST_COMMAND[vardepsexclude] += "buildhistory_list_installed_sdk_host buildhistory_get_sdk_installed_host"
681 683
682SDK_POSTPROCESS_COMMAND_append = " buildhistory_get_sdkinfo ; buildhistory_get_extra_sdkinfo; " 684SDK_POSTPROCESS_COMMAND_append = " buildhistory_get_sdkinfo ; buildhistory_get_extra_sdkinfo; "
683SDK_POSTPROCESS_COMMAND[vardepvalueexclude] .= "| buildhistory_get_sdkinfo ; buildhistory_get_extra_sdkinfo; " 685SDK_POSTPROCESS_COMMAND[vardepvalueexclude] .= "| buildhistory_get_sdkinfo ; buildhistory_get_extra_sdkinfo; "
686SDK_POSTPROCESS_COMMAND[vardepsexclude] += "buildhistory_get_sdkinfo buildhistory_get_extra_sdkinfo"
684 687
685python buildhistory_write_sigs() { 688python buildhistory_write_sigs() {
686 if not "task" in (d.getVar('BUILDHISTORY_FEATURES') or "").split(): 689 if not "task" in (d.getVar('BUILDHISTORY_FEATURES') or "").split():
diff --git a/meta/classes/cve-check.bbclass b/meta/classes/cve-check.bbclass
index ed86403b6b..112ee3379d 100644
--- a/meta/classes/cve-check.bbclass
+++ b/meta/classes/cve-check.bbclass
@@ -53,6 +53,13 @@ CVE_CHECK_PN_WHITELIST ?= ""
53# 53#
54CVE_CHECK_WHITELIST ?= "" 54CVE_CHECK_WHITELIST ?= ""
55 55
56# Layers to be excluded
57CVE_CHECK_LAYER_EXCLUDELIST ??= ""
58
59# Layers to be included
60CVE_CHECK_LAYER_INCLUDELIST ??= ""
61
62
56# set to "alphabetical" for version using single alphabetical character as increament release 63# set to "alphabetical" for version using single alphabetical character as increament release
57CVE_VERSION_SUFFIX ??= "" 64CVE_VERSION_SUFFIX ??= ""
58 65
@@ -334,7 +341,20 @@ def cve_write_data(d, patched, unpatched, whitelisted, cve_data):
334 CVE manifest if enabled. 341 CVE manifest if enabled.
335 """ 342 """
336 343
344
337 cve_file = d.getVar("CVE_CHECK_LOG") 345 cve_file = d.getVar("CVE_CHECK_LOG")
346 fdir_name = d.getVar("FILE_DIRNAME")
347 layer = fdir_name.split("/")[-3]
348
349 include_layers = d.getVar("CVE_CHECK_LAYER_INCLUDELIST").split()
350 exclude_layers = d.getVar("CVE_CHECK_LAYER_EXCLUDELIST").split()
351
352 if exclude_layers and layer in exclude_layers:
353 return
354
355 if include_layers and layer not in include_layers:
356 return
357
338 nvd_link = "https://web.nvd.nist.gov/view/vuln/detail?vulnId=" 358 nvd_link = "https://web.nvd.nist.gov/view/vuln/detail?vulnId="
339 write_string = "" 359 write_string = ""
340 unpatched_cves = [] 360 unpatched_cves = []
@@ -344,6 +364,7 @@ def cve_write_data(d, patched, unpatched, whitelisted, cve_data):
344 is_patched = cve in patched 364 is_patched = cve in patched
345 if is_patched and (d.getVar("CVE_CHECK_REPORT_PATCHED") != "1"): 365 if is_patched and (d.getVar("CVE_CHECK_REPORT_PATCHED") != "1"):
346 continue 366 continue
367 write_string += "LAYER: %s\n" % layer
347 write_string += "PACKAGE NAME: %s\n" % d.getVar("PN") 368 write_string += "PACKAGE NAME: %s\n" % d.getVar("PN")
348 write_string += "PACKAGE VERSION: %s%s\n" % (d.getVar("EXTENDPE"), d.getVar("PV")) 369 write_string += "PACKAGE VERSION: %s%s\n" % (d.getVar("EXTENDPE"), d.getVar("PV"))
349 write_string += "CVE: %s\n" % cve 370 write_string += "CVE: %s\n" % cve
diff --git a/meta/classes/devshell.bbclass b/meta/classes/devshell.bbclass
index fdf7dc100f..76dd0b42ee 100644
--- a/meta/classes/devshell.bbclass
+++ b/meta/classes/devshell.bbclass
@@ -128,6 +128,7 @@ def devpyshell(d):
128 more = i.runsource(source, "<pyshell>") 128 more = i.runsource(source, "<pyshell>")
129 if not more: 129 if not more:
130 buf = [] 130 buf = []
131 sys.stderr.flush()
131 prompt(more) 132 prompt(more)
132 except KeyboardInterrupt: 133 except KeyboardInterrupt:
133 i.write("\nKeyboardInterrupt\n") 134 i.write("\nKeyboardInterrupt\n")
diff --git a/meta/classes/externalsrc.bbclass b/meta/classes/externalsrc.bbclass
index 64e94e3301..3d6b80bee2 100644
--- a/meta/classes/externalsrc.bbclass
+++ b/meta/classes/externalsrc.bbclass
@@ -68,6 +68,7 @@ python () {
68 url_data = fetch.ud[url] 68 url_data = fetch.ud[url]
69 parm = url_data.parm 69 parm = url_data.parm
70 if (url_data.type == 'file' or 70 if (url_data.type == 'file' or
71 url_data.type == 'npmsw' or
71 'type' in parm and parm['type'] == 'kmeta'): 72 'type' in parm and parm['type'] == 'kmeta'):
72 local_srcuri.append(url) 73 local_srcuri.append(url)
73 74
@@ -219,11 +220,12 @@ def srctree_hash_files(d, srcdir=None):
219 submodule_helper = subprocess.check_output(['git', 'submodule--helper', 'list'], cwd=s_dir, env=env).decode("utf-8") 220 submodule_helper = subprocess.check_output(['git', 'submodule--helper', 'list'], cwd=s_dir, env=env).decode("utf-8")
220 for line in submodule_helper.splitlines(): 221 for line in submodule_helper.splitlines():
221 module_dir = os.path.join(s_dir, line.rsplit(maxsplit=1)[1]) 222 module_dir = os.path.join(s_dir, line.rsplit(maxsplit=1)[1])
222 proc = subprocess.Popen(['git', 'add', '-A', '.'], cwd=module_dir, env=env, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) 223 if os.path.isdir(module_dir):
223 proc.communicate() 224 proc = subprocess.Popen(['git', 'add', '-A', '.'], cwd=module_dir, env=env, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
224 proc = subprocess.Popen(['git', 'write-tree'], cwd=module_dir, env=env, stdout=subprocess.PIPE, stderr=subprocess.DEVNULL) 225 proc.communicate()
225 stdout, _ = proc.communicate() 226 proc = subprocess.Popen(['git', 'write-tree'], cwd=module_dir, env=env, stdout=subprocess.PIPE, stderr=subprocess.DEVNULL)
226 git_sha1 += stdout.decode("utf-8") 227 stdout, _ = proc.communicate()
228 git_sha1 += stdout.decode("utf-8")
227 sha1 = hashlib.sha1(git_sha1.encode("utf-8")).hexdigest() 229 sha1 = hashlib.sha1(git_sha1.encode("utf-8")).hexdigest()
228 with open(oe_hash_file, 'w') as fobj: 230 with open(oe_hash_file, 'w') as fobj:
229 fobj.write(sha1) 231 fobj.write(sha1)
diff --git a/meta/classes/image-live.bbclass b/meta/classes/image-live.bbclass
index 9ea5ddc312..47c44b4aad 100644
--- a/meta/classes/image-live.bbclass
+++ b/meta/classes/image-live.bbclass
@@ -30,7 +30,7 @@ do_bootimg[depends] += "dosfstools-native:do_populate_sysroot \
30 virtual/kernel:do_deploy \ 30 virtual/kernel:do_deploy \
31 ${MLPREFIX}syslinux:do_populate_sysroot \ 31 ${MLPREFIX}syslinux:do_populate_sysroot \
32 syslinux-native:do_populate_sysroot \ 32 syslinux-native:do_populate_sysroot \
33 ${PN}:do_image_${@d.getVar('LIVE_ROOTFS_TYPE').replace('-', '_')} \ 33 ${@'%s:do_image_%s' % (d.getVar('PN'), d.getVar('LIVE_ROOTFS_TYPE').replace('-', '_')) if d.getVar('ROOTFS') else ''} \
34 " 34 "
35 35
36 36
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index 045f4494c8..2f1d5cfb46 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -112,7 +112,7 @@ def rootfs_command_variables(d):
112 'IMAGE_PREPROCESS_COMMAND','RPM_PREPROCESS_COMMANDS','RPM_POSTPROCESS_COMMANDS','DEB_PREPROCESS_COMMANDS','DEB_POSTPROCESS_COMMANDS'] 112 'IMAGE_PREPROCESS_COMMAND','RPM_PREPROCESS_COMMANDS','RPM_POSTPROCESS_COMMANDS','DEB_PREPROCESS_COMMANDS','DEB_POSTPROCESS_COMMANDS']
113 113
114python () { 114python () {
115 variables = rootfs_command_variables(d) + sdk_command_variables(d) 115 variables = rootfs_command_variables(d)
116 for var in variables: 116 for var in variables:
117 if d.getVar(var, False): 117 if d.getVar(var, False):
118 d.setVarFlag(var, 'func', '1') 118 d.setVarFlag(var, 'func', '1')
@@ -180,6 +180,8 @@ IMAGE_LOCALES_ARCHIVE ?= '1'
180# aren't yet available. 180# aren't yet available.
181PSEUDO_PASSWD = "${IMAGE_ROOTFS}:${STAGING_DIR_NATIVE}" 181PSEUDO_PASSWD = "${IMAGE_ROOTFS}:${STAGING_DIR_NATIVE}"
182 182
183PSEUDO_IGNORE_PATHS .= ",${WORKDIR}/intercept_scripts,${WORKDIR}/oe-rootfs-repo,${WORKDIR}/sstate-build-image_complete"
184
183PACKAGE_EXCLUDE ??= "" 185PACKAGE_EXCLUDE ??= ""
184PACKAGE_EXCLUDE[type] = "list" 186PACKAGE_EXCLUDE[type] = "list"
185 187
diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
index c6dff9659c..44dbed875b 100644
--- a/meta/classes/insane.bbclass
+++ b/meta/classes/insane.bbclass
@@ -175,7 +175,7 @@ def package_qa_check_useless_rpaths(file, name, d, elf, messages):
175 if rpath_eq(rpath, libdir) or rpath_eq(rpath, base_libdir): 175 if rpath_eq(rpath, libdir) or rpath_eq(rpath, base_libdir):
176 # The dynamic linker searches both these places anyway. There is no point in 176 # The dynamic linker searches both these places anyway. There is no point in
177 # looking there again. 177 # looking there again.
178 package_qa_add_message(messages, "useless-rpaths", "%s: %s contains probably-redundant RPATH %s" % (name, package_qa_clean_path(file, d), rpath)) 178 package_qa_add_message(messages, "useless-rpaths", "%s: %s contains probably-redundant RPATH %s" % (name, package_qa_clean_path(file, d, name), rpath))
179 179
180QAPATHTEST[dev-so] = "package_qa_check_dev" 180QAPATHTEST[dev-so] = "package_qa_check_dev"
181def package_qa_check_dev(path, name, d, elf, messages): 181def package_qa_check_dev(path, name, d, elf, messages):
@@ -184,8 +184,8 @@ def package_qa_check_dev(path, name, d, elf, messages):
184 """ 184 """
185 185
186 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): 186 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):
187 package_qa_add_message(messages, "dev-so", "non -dev/-dbg/nativesdk- package contains symlink .so: %s path '%s'" % \ 187 package_qa_add_message(messages, "dev-so", "non -dev/-dbg/nativesdk- package %s contains symlink .so '%s'" % \
188 (name, package_qa_clean_path(path,d))) 188 (name, package_qa_clean_path(path, d, name)))
189 189
190QAPATHTEST[dev-elf] = "package_qa_check_dev_elf" 190QAPATHTEST[dev-elf] = "package_qa_check_dev_elf"
191def package_qa_check_dev_elf(path, name, d, elf, messages): 191def 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):
195 install link-time .so files that are linker scripts. 195 install link-time .so files that are linker scripts.
196 """ 196 """
197 if name.endswith("-dev") and path.endswith(".so") and not os.path.islink(path) and elf: 197 if name.endswith("-dev") and path.endswith(".so") and not os.path.islink(path) and elf:
198 package_qa_add_message(messages, "dev-elf", "-dev package contains non-symlink .so: %s path '%s'" % \ 198 package_qa_add_message(messages, "dev-elf", "-dev package %s contains non-symlink .so '%s'" % \
199 (name, package_qa_clean_path(path,d))) 199 (name, package_qa_clean_path(path, d, name)))
200 200
201QAPATHTEST[staticdev] = "package_qa_check_staticdev" 201QAPATHTEST[staticdev] = "package_qa_check_staticdev"
202def package_qa_check_staticdev(path, name, d, elf, messages): 202def package_qa_check_staticdev(path, name, d, elf, messages):
@@ -209,7 +209,7 @@ def package_qa_check_staticdev(path, name, d, elf, messages):
209 209
210 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: 210 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:
211 package_qa_add_message(messages, "staticdev", "non -staticdev package contains static .a library: %s path '%s'" % \ 211 package_qa_add_message(messages, "staticdev", "non -staticdev package contains static .a library: %s path '%s'" % \
212 (name, package_qa_clean_path(path,d))) 212 (name, package_qa_clean_path(path,d, name)))
213 213
214QAPATHTEST[mime] = "package_qa_check_mime" 214QAPATHTEST[mime] = "package_qa_check_mime"
215def package_qa_check_mime(path, name, d, elf, messages): 215def package_qa_check_mime(path, name, d, elf, messages):
diff --git a/meta/classes/kernel-devicetree.bbclass b/meta/classes/kernel-devicetree.bbclass
index 81dda8003f..3c5def1041 100644
--- a/meta/classes/kernel-devicetree.bbclass
+++ b/meta/classes/kernel-devicetree.bbclass
@@ -1,8 +1,11 @@
1# Support for device tree generation 1# Support for device tree generation
2PACKAGES_append = " \ 2python () {
3 ${KERNEL_PACKAGE_NAME}-devicetree \ 3 if not bb.data.inherits_class('nopackages', d):
4 ${@[d.getVar('KERNEL_PACKAGE_NAME') + '-image-zimage-bundle', ''][d.getVar('KERNEL_DEVICETREE_BUNDLE') != '1']} \ 4 d.appendVar("PACKAGES", " ${KERNEL_PACKAGE_NAME}-devicetree")
5" 5 if d.getVar('KERNEL_DEVICETREE_BUNDLE') == '1':
6 d.appendVar("PACKAGES", " ${KERNEL_PACKAGE_NAME}-image-zimage-bundle")
7}
8
6FILES_${KERNEL_PACKAGE_NAME}-devicetree = "/${KERNEL_IMAGEDEST}/*.dtb /${KERNEL_IMAGEDEST}/*.dtbo" 9FILES_${KERNEL_PACKAGE_NAME}-devicetree = "/${KERNEL_IMAGEDEST}/*.dtb /${KERNEL_IMAGEDEST}/*.dtbo"
7FILES_${KERNEL_PACKAGE_NAME}-image-zimage-bundle = "/${KERNEL_IMAGEDEST}/zImage-*.dtb.bin" 10FILES_${KERNEL_PACKAGE_NAME}-image-zimage-bundle = "/${KERNEL_IMAGEDEST}/zImage-*.dtb.bin"
8 11
diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index f405b6e523..b03a286ed4 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -90,6 +90,8 @@ python __anonymous () {
90 imagedest = d.getVar('KERNEL_IMAGEDEST') 90 imagedest = d.getVar('KERNEL_IMAGEDEST')
91 91
92 for type in types.split(): 92 for type in types.split():
93 if bb.data.inherits_class('nopackages', d):
94 continue
93 typelower = type.lower() 95 typelower = type.lower()
94 d.appendVar('PACKAGES', ' %s-image-%s' % (kname, typelower)) 96 d.appendVar('PACKAGES', ' %s-image-%s' % (kname, typelower))
95 d.setVar('FILES_' + kname + '-image-' + typelower, '/' + imagedest + '/' + type + '-${KERNEL_VERSION_NAME}' + ' /' + imagedest + '/' + type) 97 d.setVar('FILES_' + kname + '-image-' + typelower, '/' + imagedest + '/' + type + '-${KERNEL_VERSION_NAME}' + ' /' + imagedest + '/' + type)
diff --git a/meta/classes/npm.bbclass b/meta/classes/npm.bbclass
index 79f55febcc..55a6985fb0 100644
--- a/meta/classes/npm.bbclass
+++ b/meta/classes/npm.bbclass
@@ -20,7 +20,7 @@
20inherit python3native 20inherit python3native
21 21
22DEPENDS_prepend = "nodejs-native " 22DEPENDS_prepend = "nodejs-native "
23RDEPENDS_${PN}_prepend = "nodejs " 23RDEPENDS_${PN}_append_class-target = " nodejs"
24 24
25NPM_INSTALL_DEV ?= "0" 25NPM_INSTALL_DEV ?= "0"
26 26
diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
index 53b4700cdd..89b4c6bbfc 100644
--- a/meta/classes/package_rpm.bbclass
+++ b/meta/classes/package_rpm.bbclass
@@ -687,6 +687,7 @@ python do_package_rpm () {
687 cmd = cmd + " --define '_binary_payload w6T.xzdio'" 687 cmd = cmd + " --define '_binary_payload w6T.xzdio'"
688 cmd = cmd + " --define '_source_payload w6T.xzdio'" 688 cmd = cmd + " --define '_source_payload w6T.xzdio'"
689 cmd = cmd + " --define 'clamp_mtime_to_source_date_epoch 1'" 689 cmd = cmd + " --define 'clamp_mtime_to_source_date_epoch 1'"
690 cmd = cmd + " --define 'use_source_date_epoch_as_buildtime 1'"
690 cmd = cmd + " --define '_buildhost reproducible'" 691 cmd = cmd + " --define '_buildhost reproducible'"
691 if perfiledeps: 692 if perfiledeps:
692 cmd = cmd + " --define '__find_requires " + outdepends + "'" 693 cmd = cmd + " --define '__find_requires " + outdepends + "'"
diff --git a/meta/classes/populate_sdk_base.bbclass b/meta/classes/populate_sdk_base.bbclass
index 49b1833265..635b3a6b80 100644
--- a/meta/classes/populate_sdk_base.bbclass
+++ b/meta/classes/populate_sdk_base.bbclass
@@ -178,7 +178,7 @@ do_populate_sdk[sstate-inputdirs] = "${SDKDEPLOYDIR}"
178do_populate_sdk[sstate-outputdirs] = "${SDK_DEPLOY}" 178do_populate_sdk[sstate-outputdirs] = "${SDK_DEPLOY}"
179do_populate_sdk[stamp-extra-info] = "${MACHINE_ARCH}${SDKMACHINE}" 179do_populate_sdk[stamp-extra-info] = "${MACHINE_ARCH}${SDKMACHINE}"
180 180
181PSEUDO_IGNORE_PATHS .= ",${SDKDEPLOYDIR}" 181PSEUDO_IGNORE_PATHS .= ",${SDKDEPLOYDIR},${WORKDIR}/oe-sdk-repo,${WORKDIR}/sstate-build-populate_sdk"
182 182
183fakeroot create_sdk_files() { 183fakeroot create_sdk_files() {
184 cp ${COREBASE}/scripts/relocate_sdk.py ${SDK_OUTPUT}/${SDKPATH}/ 184 cp ${COREBASE}/scripts/relocate_sdk.py ${SDK_OUTPUT}/${SDKPATH}/
@@ -329,6 +329,13 @@ def sdk_variables(d):
329 329
330do_populate_sdk[vardeps] += "${@sdk_variables(d)}" 330do_populate_sdk[vardeps] += "${@sdk_variables(d)}"
331 331
332python () {
333 variables = sdk_command_variables(d)
334 for var in variables:
335 if d.getVar(var, False):
336 d.setVarFlag(var, 'func', '1')
337}
338
332do_populate_sdk[file-checksums] += "${TOOLCHAIN_SHAR_REL_TMPL}:True \ 339do_populate_sdk[file-checksums] += "${TOOLCHAIN_SHAR_REL_TMPL}:True \
333 ${TOOLCHAIN_SHAR_EXT_TMPL}:True" 340 ${TOOLCHAIN_SHAR_EXT_TMPL}:True"
334 341
diff --git a/meta/classes/populate_sdk_ext.bbclass b/meta/classes/populate_sdk_ext.bbclass
index e6bf27cf38..14689ec6ac 100644
--- a/meta/classes/populate_sdk_ext.bbclass
+++ b/meta/classes/populate_sdk_ext.bbclass
@@ -251,7 +251,9 @@ python copy_buildsystem () {
251 251
252 # Create a layer for new recipes / appends 252 # Create a layer for new recipes / appends
253 bbpath = d.getVar('BBPATH') 253 bbpath = d.getVar('BBPATH')
254 bb.process.run(['devtool', '--bbpath', bbpath, '--basepath', baseoutpath, 'create-workspace', '--create-only', os.path.join(baseoutpath, 'workspace')]) 254 env = os.environ.copy()
255 env['PYTHONDONTWRITEBYTECODE'] = '1'
256 bb.process.run(['devtool', '--bbpath', bbpath, '--basepath', baseoutpath, 'create-workspace', '--create-only', os.path.join(baseoutpath, 'workspace')], env=env)
255 257
256 # Create bblayers.conf 258 # Create bblayers.conf
257 bb.utils.mkdirhier(baseoutpath + '/conf') 259 bb.utils.mkdirhier(baseoutpath + '/conf')
@@ -364,6 +366,9 @@ python copy_buildsystem () {
364 # Hide the config information from bitbake output (since it's fixed within the SDK) 366 # Hide the config information from bitbake output (since it's fixed within the SDK)
365 f.write('BUILDCFG_HEADER = ""\n\n') 367 f.write('BUILDCFG_HEADER = ""\n\n')
366 368
369 # Write METADATA_REVISION
370 f.write('METADATA_REVISION = "%s"\n\n' % d.getVar('METADATA_REVISION'))
371
367 f.write('# Provide a flag to indicate we are in the EXT_SDK Context\n') 372 f.write('# Provide a flag to indicate we are in the EXT_SDK Context\n')
368 f.write('WITHIN_EXT_SDK = "1"\n\n') 373 f.write('WITHIN_EXT_SDK = "1"\n\n')
369 374
diff --git a/meta/classes/report-error.bbclass b/meta/classes/report-error.bbclass
index 1a12db1206..9cb6b0bd31 100644
--- a/meta/classes/report-error.bbclass
+++ b/meta/classes/report-error.bbclass
@@ -6,6 +6,8 @@
6# 6#
7# Licensed under the MIT license, see COPYING.MIT for details 7# Licensed under the MIT license, see COPYING.MIT for details
8 8
9inherit base
10
9ERR_REPORT_DIR ?= "${LOG_DIR}/error-report" 11ERR_REPORT_DIR ?= "${LOG_DIR}/error-report"
10 12
11def errorreport_getdata(e): 13def errorreport_getdata(e):
@@ -64,6 +66,8 @@ python errorreport_handler () {
64 data['failures'] = [] 66 data['failures'] = []
65 data['component'] = " ".join(e.getPkgs()) 67 data['component'] = " ".join(e.getPkgs())
66 data['branch_commit'] = str(base_detect_branch(e.data)) + ": " + str(base_detect_revision(e.data)) 68 data['branch_commit'] = str(base_detect_branch(e.data)) + ": " + str(base_detect_revision(e.data))
69 data['bitbake_version'] = e.data.getVar("BB_VERSION")
70 data['layer_version'] = get_layers_branch_rev(e.data)
67 data['local_conf'] = get_conf_data(e, 'local.conf') 71 data['local_conf'] = get_conf_data(e, 'local.conf')
68 data['auto_conf'] = get_conf_data(e, 'auto.conf') 72 data['auto_conf'] = get_conf_data(e, 'auto.conf')
69 lock = bb.utils.lockfile(datafile + '.lock') 73 lock = bb.utils.lockfile(datafile + '.lock')
diff --git a/meta/classes/rootfs_deb.bbclass b/meta/classes/rootfs_deb.bbclass
index ef616da229..0469ba7059 100644
--- a/meta/classes/rootfs_deb.bbclass
+++ b/meta/classes/rootfs_deb.bbclass
@@ -32,4 +32,8 @@ python () {
32 d.setVar('DEB_SDK_ARCH', 'amd64') 32 d.setVar('DEB_SDK_ARCH', 'amd64')
33 elif darch == "arm": 33 elif darch == "arm":
34 d.setVar('DEB_SDK_ARCH', 'armel') 34 d.setVar('DEB_SDK_ARCH', 'armel')
35 elif darch == "aarch64":
36 d.setVar('DEB_SDK_ARCH', 'arm64')
37 else:
38 bb.fatal("Unhandled SDK_ARCH %s" % darch)
35} 39}
diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass
index 01c5434f0d..03a9792f68 100644
--- a/meta/classes/sanity.bbclass
+++ b/meta/classes/sanity.bbclass
@@ -882,13 +882,18 @@ def check_sanity_everybuild(status, d):
882 except: 882 except:
883 pass 883 pass
884 884
885 oeroot = d.getVar('COREBASE') 885 for checkdir in ['COREBASE', 'TMPDIR']:
886 if oeroot.find('+') != -1: 886 val = d.getVar(checkdir)
887 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.") 887 if val.find('..') != -1:
888 if oeroot.find('@') != -1: 888 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)
889 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.") 889 if val.find('+') != -1:
890 if oeroot.find(' ') != -1: 890 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)
891 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.") 891 if val.find('@') != -1:
892 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)
893 if val.find(' ') != -1:
894 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)
895 if val.find('%') != -1:
896 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)
892 897
893 # Check the format of MIRRORS, PREMIRRORS and SSTATE_MIRRORS 898 # Check the format of MIRRORS, PREMIRRORS and SSTATE_MIRRORS
894 import re 899 import re
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index 8e0a0ec4b4..eb282d1741 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -685,7 +685,10 @@ SRC_URI = ""
685PSEUDO_LOCALSTATEDIR ?= "${WORKDIR}/pseudo/" 685PSEUDO_LOCALSTATEDIR ?= "${WORKDIR}/pseudo/"
686PSEUDO_PASSWD ?= "${STAGING_DIR_TARGET}:${PSEUDO_SYSROOT}" 686PSEUDO_PASSWD ?= "${STAGING_DIR_TARGET}:${PSEUDO_SYSROOT}"
687PSEUDO_SYSROOT = "${COMPONENTS_DIR}/${BUILD_ARCH}/pseudo-native" 687PSEUDO_SYSROOT = "${COMPONENTS_DIR}/${BUILD_ARCH}/pseudo-native"
688PSEUDO_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}" 688PSEUDO_IGNORE_PATHS = "/usr/,/etc/,/lib,/dev/,/run/,${T},${WORKDIR}/recipe-sysroot,${SSTATE_DIR},${STAMPS_DIR}"
689PSEUDO_IGNORE_PATHS .= ",${TMPDIR}/sstate-control,${TMPDIR}/buildstats,${TMPDIR}/sysroots-components,${TMPDIR}/pkgdata"
690PSEUDO_IGNORE_PATHS .= ",${WORKDIR}/deploy-,${WORKDIR}/sstate-build-package_,${WORKDIR}/sstate-install-package_,${WORKDIR}/pkgdata-sysroot"
691PSEUDO_IGNORE_PATHS .= ",${DEPLOY_DIR},${BUILDHISTORY_DIR},${TOPDIR}/cache,${COREBASE}/scripts,${CCACHE_DIR}"
689 692
690export PSEUDO_DISABLED = "1" 693export PSEUDO_DISABLED = "1"
691#export PSEUDO_PREFIX = "${STAGING_DIR_NATIVE}${prefix_native}" 694#export PSEUDO_PREFIX = "${STAGING_DIR_NATIVE}${prefix_native}"
@@ -696,6 +699,7 @@ FAKEROOTCMD = "${PSEUDO_SYSROOT}${bindir_native}/pseudo"
696FAKEROOTENV = "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" 699FAKEROOTENV = "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"
697FAKEROOTNOENV = "PSEUDO_UNLOAD=1" 700FAKEROOTNOENV = "PSEUDO_UNLOAD=1"
698FAKEROOTDIRS = "${PSEUDO_LOCALSTATEDIR}" 701FAKEROOTDIRS = "${PSEUDO_LOCALSTATEDIR}"
702FAKEROOTLOGS = "${WORKDIR}/pseudo/pseudo.log"
699PREFERRED_PROVIDER_virtual/fakeroot-native ?= "pseudo-native" 703PREFERRED_PROVIDER_virtual/fakeroot-native ?= "pseudo-native"
700 704
701################################################################## 705##################################################################
diff --git a/meta/conf/distro/include/ptest-packagelists.inc b/meta/conf/distro/include/ptest-packagelists.inc
index ce13368c2e..e0a876dbdc 100644
--- a/meta/conf/distro/include/ptest-packagelists.inc
+++ b/meta/conf/distro/include/ptest-packagelists.inc
@@ -60,6 +60,7 @@ PTESTS_FAST_remove_mips64 = "qemu-ptest"
60# bash-ptest \ # Test outcomes are non-deterministic by design 60# bash-ptest \ # Test outcomes are non-deterministic by design
61# ifupdown-ptest \ # Tested separately in lib/oeqa/selftest/cases/imagefeatures.py 61# ifupdown-ptest \ # Tested separately in lib/oeqa/selftest/cases/imagefeatures.py
62# mdadm-ptest \ # Tests rely on non-deterministic sleep() amounts 62# mdadm-ptest \ # Tests rely on non-deterministic sleep() amounts
63# libinput-ptest \ # Tests need an unloaded system to be reliable
63#" 64#"
64 65
65PTESTS_SLOW = "\ 66PTESTS_SLOW = "\
@@ -72,7 +73,6 @@ PTESTS_SLOW = "\
72 glib-2.0-ptest \ 73 glib-2.0-ptest \
73 gstreamer1.0-ptest \ 74 gstreamer1.0-ptest \
74 libevent-ptest \ 75 libevent-ptest \
75 libinput-ptest \
76 lttng-tools-ptest \ 76 lttng-tools-ptest \
77 openssh-ptest \ 77 openssh-ptest \
78 openssl-ptest \ 78 openssl-ptest \
diff --git a/meta/conf/distro/include/yocto-uninative.inc b/meta/conf/distro/include/yocto-uninative.inc
index 85336014b1..a2a2dd18ec 100644
--- a/meta/conf/distro/include/yocto-uninative.inc
+++ b/meta/conf/distro/include/yocto-uninative.inc
@@ -6,9 +6,9 @@
6# to the distro running on the build machine. 6# to the distro running on the build machine.
7# 7#
8 8
9UNINATIVE_MAXGLIBCVERSION = "2.32" 9UNINATIVE_MAXGLIBCVERSION = "2.33"
10 10
11UNINATIVE_URL ?= "http://downloads.yoctoproject.org/releases/uninative/2.10/" 11UNINATIVE_URL ?= "http://downloads.yoctoproject.org/releases/uninative/3.0/"
12UNINATIVE_CHECKSUM[aarch64] ?= "645e5c50b2b48aabb8b10f783a9f94b4b7c5ddc7cfceb5386d43b86d30253202" 12UNINATIVE_CHECKSUM[aarch64] ?= "1c668909098c5b56132067adc69a249cb771f4560428e5822de903a12d97bf33"
13UNINATIVE_CHECKSUM[i686] ?= "233e09b5ff30e15341232a0c16fa8448ff31dccb8f3f3e2ad3948cdac8c4a598" 13UNINATIVE_CHECKSUM[i686] ?= "e6cc2fc056234cffa6a2ff084cce27d544ea3f487a62b5e253351cefd4421900"
14UNINATIVE_CHECKSUM[x86_64] ?= "04333677f81990ce2cf55c3bc256cd84a66085d18fc95ccddfab8581e4aec014" 14UNINATIVE_CHECKSUM[x86_64] ?= "5ec5a9276046e7eceeac749a18b175667384e1f445cd4526300a41404d985a5b"
diff --git a/meta/lib/oe/copy_buildsystem.py b/meta/lib/oe/copy_buildsystem.py
index 31a84f5b06..d97bf9d1b9 100644
--- a/meta/lib/oe/copy_buildsystem.py
+++ b/meta/lib/oe/copy_buildsystem.py
@@ -20,7 +20,7 @@ def _smart_copy(src, dest):
20 mode = os.stat(src).st_mode 20 mode = os.stat(src).st_mode
21 if stat.S_ISDIR(mode): 21 if stat.S_ISDIR(mode):
22 bb.utils.mkdirhier(dest) 22 bb.utils.mkdirhier(dest)
23 cmd = "tar --exclude='.git' --xattrs --xattrs-include='*' -chf - -C %s -p . \ 23 cmd = "tar --exclude='.git' --exclude='__pycache__' --xattrs --xattrs-include='*' -chf - -C %s -p . \
24 | tar --xattrs --xattrs-include='*' -xf - -C %s" % (src, dest) 24 | tar --xattrs --xattrs-include='*' -xf - -C %s" % (src, dest)
25 subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT) 25 subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT)
26 else: 26 else:
@@ -259,7 +259,7 @@ def create_locked_sstate_cache(lockedsigs, input_sstate_cache, output_sstate_cac
259 bb.note('Generating sstate-cache...') 259 bb.note('Generating sstate-cache...')
260 260
261 nativelsbstring = d.getVar('NATIVELSBSTRING') 261 nativelsbstring = d.getVar('NATIVELSBSTRING')
262 bb.process.run("gen-lockedsig-cache %s %s %s %s %s" % (lockedsigs, input_sstate_cache, output_sstate_cache, nativelsbstring, filterfile or '')) 262 bb.process.run("PYTHONDONTWRITEBYTECODE=1 gen-lockedsig-cache %s %s %s %s %s" % (lockedsigs, input_sstate_cache, output_sstate_cache, nativelsbstring, filterfile or ''))
263 if fixedlsbstring and nativelsbstring != fixedlsbstring: 263 if fixedlsbstring and nativelsbstring != fixedlsbstring:
264 nativedir = output_sstate_cache + '/' + nativelsbstring 264 nativedir = output_sstate_cache + '/' + nativelsbstring
265 if os.path.isdir(nativedir): 265 if os.path.isdir(nativedir):
@@ -286,7 +286,7 @@ def check_sstate_task_list(d, targets, filteroutfile, cmdprefix='', cwd=None, lo
286 logparam = '-l %s' % logfile 286 logparam = '-l %s' % logfile
287 else: 287 else:
288 logparam = '' 288 logparam = ''
289 cmd = "%sBB_SETSCENE_ENFORCE=1 PSEUDO_DISABLED=1 oe-check-sstate %s -s -o %s %s" % (cmdprefix, targets, filteroutfile, logparam) 289 cmd = "%sPYTHONDONTWRITEBYTECODE=1 BB_SETSCENE_ENFORCE=1 PSEUDO_DISABLED=1 oe-check-sstate %s -s -o %s %s" % (cmdprefix, targets, filteroutfile, logparam)
290 env = dict(d.getVar('BB_ORIGENV', False)) 290 env = dict(d.getVar('BB_ORIGENV', False))
291 env.pop('BUILDDIR', '') 291 env.pop('BUILDDIR', '')
292 env.pop('BBPATH', '') 292 env.pop('BBPATH', '')
diff --git a/meta/lib/oe/cve_check.py b/meta/lib/oe/cve_check.py
index ce755f940a..a1d7c292af 100644
--- a/meta/lib/oe/cve_check.py
+++ b/meta/lib/oe/cve_check.py
@@ -11,8 +11,13 @@ _Version = collections.namedtuple(
11class Version(): 11class Version():
12 12
13 def __init__(self, version, suffix=None): 13 def __init__(self, version, suffix=None):
14
15 suffixes = ["alphabetical", "patch"]
16
14 if str(suffix) == "alphabetical": 17 if str(suffix) == "alphabetical":
15 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]+)?)?)(.*)?""" 18 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]+)?)?)(.*)?"""
19 elif str(suffix) == "patch":
20 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]+)?)?)(.*)?"""
16 else: 21 else:
17 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]+)?)?)(.*)?""" 22 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]+)?)?)(.*)?"""
18 regex = re.compile(r"^\s*" + version_pattern + r"\s*$", re.VERBOSE | re.IGNORECASE) 23 regex = re.compile(r"^\s*" + version_pattern + r"\s*$", re.VERBOSE | re.IGNORECASE)
@@ -23,7 +28,7 @@ class Version():
23 28
24 self._version = _Version( 29 self._version = _Version(
25 release=tuple(int(i) for i in match.group("release").replace("-",".").split(".")), 30 release=tuple(int(i) for i in match.group("release").replace("-",".").split(".")),
26 patch_l=match.group("patch_l") if str(suffix) == "alphabetical" and match.group("patch_l") else "", 31 patch_l=match.group("patch_l") if str(suffix) in suffixes and match.group("patch_l") else "",
27 pre_l=match.group("pre_l"), 32 pre_l=match.group("pre_l"),
28 pre_v=match.group("pre_v") 33 pre_v=match.group("pre_v")
29 ) 34 )
diff --git a/meta/lib/oe/package_manager/__init__.py b/meta/lib/oe/package_manager/__init__.py
index 42225a3b2e..26f9f82aaa 100644
--- a/meta/lib/oe/package_manager/__init__.py
+++ b/meta/lib/oe/package_manager/__init__.py
@@ -189,7 +189,7 @@ class PackageManager(object, metaclass=ABCMeta):
189 bb.utils.remove(self.intercepts_dir, True) 189 bb.utils.remove(self.intercepts_dir, True)
190 bb.utils.mkdirhier(self.intercepts_dir) 190 bb.utils.mkdirhier(self.intercepts_dir)
191 for intercept in postinst_intercepts: 191 for intercept in postinst_intercepts:
192 bb.utils.copyfile(intercept, os.path.join(self.intercepts_dir, os.path.basename(intercept))) 192 shutil.copy(intercept, os.path.join(self.intercepts_dir, os.path.basename(intercept)))
193 193
194 @abstractmethod 194 @abstractmethod
195 def _handle_intercept_failure(self, failed_script): 195 def _handle_intercept_failure(self, failed_script):
diff --git a/meta/lib/oe/package_manager/deb/sdk.py b/meta/lib/oe/package_manager/deb/sdk.py
index b25eb70b00..76548b06f0 100644
--- a/meta/lib/oe/package_manager/deb/sdk.py
+++ b/meta/lib/oe/package_manager/deb/sdk.py
@@ -65,6 +65,8 @@ class DpkgSdk(Sdk):
65 65
66 self.target_pm.install_complementary(self.d.getVar('SDKIMAGE_INSTALL_COMPLEMENTARY')) 66 self.target_pm.install_complementary(self.d.getVar('SDKIMAGE_INSTALL_COMPLEMENTARY'))
67 67
68 self.target_pm.run_pre_post_installs()
69
68 self.target_pm.run_intercepts(populate_sdk='target') 70 self.target_pm.run_intercepts(populate_sdk='target')
69 71
70 execute_pre_post_process(self.d, self.d.getVar("POPULATE_SDK_POST_TARGET_COMMAND")) 72 execute_pre_post_process(self.d, self.d.getVar("POPULATE_SDK_POST_TARGET_COMMAND"))
@@ -78,6 +80,8 @@ class DpkgSdk(Sdk):
78 self._populate_sysroot(self.host_pm, self.host_manifest) 80 self._populate_sysroot(self.host_pm, self.host_manifest)
79 self.install_locales(self.host_pm) 81 self.install_locales(self.host_pm)
80 82
83 self.host_pm.run_pre_post_installs()
84
81 self.host_pm.run_intercepts(populate_sdk='host') 85 self.host_pm.run_intercepts(populate_sdk='host')
82 86
83 execute_pre_post_process(self.d, self.d.getVar("POPULATE_SDK_POST_HOST_COMMAND")) 87 execute_pre_post_process(self.d, self.d.getVar("POPULATE_SDK_POST_HOST_COMMAND"))
diff --git a/meta/lib/oe/recipeutils.py b/meta/lib/oe/recipeutils.py
index ef69ef207f..407d168894 100644
--- a/meta/lib/oe/recipeutils.py
+++ b/meta/lib/oe/recipeutils.py
@@ -409,7 +409,7 @@ def copy_recipe_files(d, tgt_dir, whole_dir=False, download=True, all_variants=F
409 fetch.download() 409 fetch.download()
410 for pth in fetch.localpaths(): 410 for pth in fetch.localpaths():
411 if pth not in localpaths: 411 if pth not in localpaths:
412 localpaths.append(pth) 412 localpaths.append(os.path.abspath(pth))
413 uri_values.append(srcuri) 413 uri_values.append(srcuri)
414 414
415 fetch_urls(d) 415 fetch_urls(d)
diff --git a/meta/lib/oe/terminal.py b/meta/lib/oe/terminal.py
index eb10a6e33e..2ac39df9e1 100644
--- a/meta/lib/oe/terminal.py
+++ b/meta/lib/oe/terminal.py
@@ -163,7 +163,12 @@ class Tmux(Terminal):
163 # devshells, if it's already there, add a new window to it. 163 # devshells, if it's already there, add a new window to it.
164 window_name = 'devshell-%i' % os.getpid() 164 window_name = 'devshell-%i' % os.getpid()
165 165
166 self.command = 'tmux new -c "{{cwd}}" -d -s {0} -n {0} "{{command}}"'.format(window_name) 166 self.command = 'tmux new -c "{{cwd}}" -d -s {0} -n {0} "{{command}}"'
167 if not check_tmux_version('1.9'):
168 # `tmux new-session -c` was added in 1.9;
169 # older versions fail with that flag
170 self.command = 'tmux new -d -s {0} -n {0} "{{command}}"'
171 self.command = self.command.format(window_name)
167 Terminal.__init__(self, sh_cmd, title, env, d) 172 Terminal.__init__(self, sh_cmd, title, env, d)
168 173
169 attach_cmd = 'tmux att -t {0}'.format(window_name) 174 attach_cmd = 'tmux att -t {0}'.format(window_name)
@@ -253,13 +258,18 @@ def spawn(name, sh_cmd, title=None, env=None, d=None):
253 except OSError: 258 except OSError:
254 return 259 return
255 260
261def check_tmux_version(desired):
262 vernum = check_terminal_version("tmux")
263 if vernum and LooseVersion(vernum) < desired:
264 return False
265 return vernum
266
256def check_tmux_pane_size(tmux): 267def check_tmux_pane_size(tmux):
257 import subprocess as sub 268 import subprocess as sub
258 # On older tmux versions (<1.9), return false. The reason 269 # On older tmux versions (<1.9), return false. The reason
259 # is that there is no easy way to get the height of the active panel 270 # is that there is no easy way to get the height of the active panel
260 # on current window without nested formats (available from version 1.9) 271 # on current window without nested formats (available from version 1.9)
261 vernum = check_terminal_version("tmux") 272 if not check_tmux_version('1.9'):
262 if vernum and LooseVersion(vernum) < '1.9':
263 return False 273 return False
264 try: 274 try:
265 p = sub.Popen('%s list-panes -F "#{?pane_active,#{pane_height},}"' % tmux, 275 p = sub.Popen('%s list-panes -F "#{?pane_active,#{pane_height},}"' % tmux,
diff --git a/meta/lib/oeqa/runtime/cases/df.py b/meta/lib/oeqa/runtime/cases/df.py
index 89fd0fb901..bb155c9cf9 100644
--- a/meta/lib/oeqa/runtime/cases/df.py
+++ b/meta/lib/oeqa/runtime/cases/df.py
@@ -4,12 +4,14 @@
4 4
5from oeqa.runtime.case import OERuntimeTestCase 5from oeqa.runtime.case import OERuntimeTestCase
6from oeqa.core.decorator.depends import OETestDepends 6from oeqa.core.decorator.depends import OETestDepends
7from oeqa.core.decorator.data import skipIfDataVar, skipIfInDataVar
7from oeqa.runtime.decorator.package import OEHasPackage 8from oeqa.runtime.decorator.package import OEHasPackage
8 9
9class DfTest(OERuntimeTestCase): 10class DfTest(OERuntimeTestCase):
10 11
11 @OETestDepends(['ssh.SSHTest.test_ssh']) 12 @OETestDepends(['ssh.SSHTest.test_ssh'])
12 @OEHasPackage(['coreutils', 'busybox']) 13 @OEHasPackage(['coreutils', 'busybox'])
14 @skipIfInDataVar('IMAGE_FEATURES', 'read-only-rootfs', 'Test case df requires a writable rootfs')
13 def test_df(self): 15 def test_df(self):
14 cmd = "df -P / | sed -n '2p' | awk '{print $4}'" 16 cmd = "df -P / | sed -n '2p' | awk '{print $4}'"
15 (status,output) = self.target.run(cmd) 17 (status,output) = self.target.run(cmd)
diff --git a/meta/lib/oeqa/runtime/cases/pam.py b/meta/lib/oeqa/runtime/cases/pam.py
index 271a1943e3..a482ded945 100644
--- a/meta/lib/oeqa/runtime/cases/pam.py
+++ b/meta/lib/oeqa/runtime/cases/pam.py
@@ -8,11 +8,14 @@
8from oeqa.runtime.case import OERuntimeTestCase 8from oeqa.runtime.case import OERuntimeTestCase
9from oeqa.core.decorator.depends import OETestDepends 9from oeqa.core.decorator.depends import OETestDepends
10from oeqa.core.decorator.data import skipIfNotFeature 10from oeqa.core.decorator.data import skipIfNotFeature
11from oeqa.runtime.decorator.package import OEHasPackage
11 12
12class PamBasicTest(OERuntimeTestCase): 13class PamBasicTest(OERuntimeTestCase):
13 14
14 @skipIfNotFeature('pam', 'Test requires pam to be in DISTRO_FEATURES') 15 @skipIfNotFeature('pam', 'Test requires pam to be in DISTRO_FEATURES')
15 @OETestDepends(['ssh.SSHTest.test_ssh']) 16 @OETestDepends(['ssh.SSHTest.test_ssh'])
17 @OEHasPackage(['shadow'])
18 @OEHasPackage(['shadow-base'])
16 def test_pam(self): 19 def test_pam(self):
17 status, output = self.target.run('login --help') 20 status, output = self.target.run('login --help')
18 msg = ('login command does not work as expected. ' 21 msg = ('login command does not work as expected. '
diff --git a/meta/lib/oeqa/selftest/cases/buildoptions.py b/meta/lib/oeqa/selftest/cases/buildoptions.py
index e91f0bd18f..b1b9ea7e55 100644
--- a/meta/lib/oeqa/selftest/cases/buildoptions.py
+++ b/meta/lib/oeqa/selftest/cases/buildoptions.py
@@ -57,15 +57,15 @@ class ImageOptionsTests(OESelftestTestCase):
57class DiskMonTest(OESelftestTestCase): 57class DiskMonTest(OESelftestTestCase):
58 58
59 def test_stoptask_behavior(self): 59 def test_stoptask_behavior(self):
60 self.write_config('BB_DISKMON_DIRS = "STOPTASKS,${TMPDIR},100000G,100K"') 60 self.write_config('BB_DISKMON_DIRS = "STOPTASKS,${TMPDIR},100000G,100K"\nBB_HEARTBEAT_EVENT = "1"')
61 res = bitbake("delay -c delay", ignore_status = True) 61 res = bitbake("delay -c delay", ignore_status = True)
62 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) 62 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)
63 self.assertEqual(res.status, 1, msg = "bitbake reported exit code %s. It should have been 1. Bitbake output: %s" % (str(res.status), res.output)) 63 self.assertEqual(res.status, 1, msg = "bitbake reported exit code %s. It should have been 1. Bitbake output: %s" % (str(res.status), res.output))
64 self.write_config('BB_DISKMON_DIRS = "ABORT,${TMPDIR},100000G,100K"') 64 self.write_config('BB_DISKMON_DIRS = "ABORT,${TMPDIR},100000G,100K"\nBB_HEARTBEAT_EVENT = "1"')
65 res = bitbake("delay -c delay", ignore_status = True) 65 res = bitbake("delay -c delay", ignore_status = True)
66 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) 66 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)
67 self.assertEqual(res.status, 1, msg = "bitbake reported exit code %s. It should have been 1. Bitbake output: %s" % (str(res.status), res.output)) 67 self.assertEqual(res.status, 1, msg = "bitbake reported exit code %s. It should have been 1. Bitbake output: %s" % (str(res.status), res.output))
68 self.write_config('BB_DISKMON_DIRS = "WARN,${TMPDIR},100000G,100K"') 68 self.write_config('BB_DISKMON_DIRS = "WARN,${TMPDIR},100000G,100K"\nBB_HEARTBEAT_EVENT = "1"')
69 res = bitbake("delay -c delay") 69 res = bitbake("delay -c delay")
70 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) 70 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)
71 71
diff --git a/meta/lib/oeqa/selftest/cases/cve_check.py b/meta/lib/oeqa/selftest/cases/cve_check.py
index 3f343a2841..d1947baffc 100644
--- a/meta/lib/oeqa/selftest/cases/cve_check.py
+++ b/meta/lib/oeqa/selftest/cases/cve_check.py
@@ -34,3 +34,11 @@ class CVECheck(OESelftestTestCase):
34 self.assertTrue( result ,msg="Failed to compare version with suffix '1.0b' < '1.0r'") 34 self.assertTrue( result ,msg="Failed to compare version with suffix '1.0b' < '1.0r'")
35 result = Version("1.0b","alphabetical") > Version("1.0","alphabetical") 35 result = Version("1.0b","alphabetical") > Version("1.0","alphabetical")
36 self.assertTrue( result ,msg="Failed to compare version with suffix '1.0b' > '1.0'") 36 self.assertTrue( result ,msg="Failed to compare version with suffix '1.0b' > '1.0'")
37
38 # consider the trailing "p" and "patch" as patched released when comparing
39 result = Version("1.0","patch") < Version("1.0p1","patch")
40 self.assertTrue( result ,msg="Failed to compare version with suffix '1.0' < '1.0p1'")
41 result = Version("1.0p2","patch") > Version("1.0p1","patch")
42 self.assertTrue( result ,msg="Failed to compare version with suffix '1.0p2' > '1.0p1'")
43 result = Version("1.0_patch2","patch") < Version("1.0_patch3","patch")
44 self.assertTrue( result ,msg="Failed to compare version with suffix '1.0_patch2' < '1.0_patch3'")
diff --git a/meta/lib/oeqa/selftest/cases/reproducible.py b/meta/lib/oeqa/selftest/cases/reproducible.py
index 4f9adaf301..cd7be7d436 100644
--- a/meta/lib/oeqa/selftest/cases/reproducible.py
+++ b/meta/lib/oeqa/selftest/cases/reproducible.py
@@ -68,7 +68,7 @@ def compare_file(reference, test, diffutils_sysroot):
68 result.status = MISSING 68 result.status = MISSING
69 return result 69 return result
70 70
71 r = runCmd(['cmp', '--quiet', reference, test], native_sysroot=diffutils_sysroot, ignore_status=True) 71 r = runCmd(['cmp', '--quiet', reference, test], native_sysroot=diffutils_sysroot, ignore_status=True, sync=False)
72 72
73 if r.status: 73 if r.status:
74 result.status = DIFFERENT 74 result.status = DIFFERENT
diff --git a/meta/lib/oeqa/selftest/cases/wic.py b/meta/lib/oeqa/selftest/cases/wic.py
index df2d2d225e..39c6828f59 100644
--- a/meta/lib/oeqa/selftest/cases/wic.py
+++ b/meta/lib/oeqa/selftest/cases/wic.py
@@ -979,14 +979,18 @@ class Wic2(WicTestCase):
979 @only_for_arch(['i586', 'i686', 'x86_64']) 979 @only_for_arch(['i586', 'i686', 'x86_64'])
980 def test_rawcopy_plugin_qemu(self): 980 def test_rawcopy_plugin_qemu(self):
981 """Test rawcopy plugin in qemu""" 981 """Test rawcopy plugin in qemu"""
982 # build ext4 and wic images 982 # build ext4 and then use it for a wic image
983 for fstype in ("ext4", "wic"): 983 config = 'IMAGE_FSTYPES = "ext4"\n'
984 config = 'IMAGE_FSTYPES = "%s"\nWKS_FILE = "test_rawcopy_plugin.wks.in"\n' % fstype 984 self.append_config(config)
985 self.append_config(config) 985 self.assertEqual(0, bitbake('core-image-minimal').status)
986 self.assertEqual(0, bitbake('core-image-minimal').status) 986 self.remove_config(config)
987 self.remove_config(config)
988 987
989 with runqemu('core-image-minimal', ssh=False, image_fstype='wic') as qemu: 988 config = 'IMAGE_FSTYPES = "wic"\nWKS_FILE = "test_rawcopy_plugin.wks.in"\n'
989 self.append_config(config)
990 self.assertEqual(0, bitbake('core-image-minimal-mtdutils').status)
991 self.remove_config(config)
992
993 with runqemu('core-image-minimal-mtdutils', ssh=False, image_fstype='wic') as qemu:
990 cmd = "grep sda. /proc/partitions |wc -l" 994 cmd = "grep sda. /proc/partitions |wc -l"
991 status, output = qemu.run_serial(cmd) 995 status, output = qemu.run_serial(cmd)
992 self.assertEqual(1, status, 'Failed to run command "%s": %s' % (cmd, output)) 996 self.assertEqual(1, status, 'Failed to run command "%s": %s' % (cmd, output))
diff --git a/meta/lib/oeqa/utils/commands.py b/meta/lib/oeqa/utils/commands.py
index 8b3e12038d..a71c16ab14 100644
--- a/meta/lib/oeqa/utils/commands.py
+++ b/meta/lib/oeqa/utils/commands.py
@@ -125,11 +125,11 @@ class Command(object):
125 125
126 def stop(self): 126 def stop(self):
127 for thread in self.threads: 127 for thread in self.threads:
128 if thread.isAlive(): 128 if thread.is_alive():
129 self.process.terminate() 129 self.process.terminate()
130 # let's give it more time to terminate gracefully before killing it 130 # let's give it more time to terminate gracefully before killing it
131 thread.join(5) 131 thread.join(5)
132 if thread.isAlive(): 132 if thread.is_alive():
133 self.process.kill() 133 self.process.kill()
134 thread.join() 134 thread.join()
135 135
diff --git a/meta/recipes-connectivity/bind/bind-9.16.7/CVE-2020-8625.patch b/meta/recipes-connectivity/bind/bind-9.16.7/CVE-2020-8625.patch
new file mode 100644
index 0000000000..98b8623139
--- /dev/null
+++ b/meta/recipes-connectivity/bind/bind-9.16.7/CVE-2020-8625.patch
@@ -0,0 +1,29 @@
1From 5b671538216af78a0a7ef7464dc52ab2241ea7db Mon Sep 17 00:00:00 2001
2From: Minjae Kim <flowergom@gmail.com>
3Date: Tue, 2 Mar 2021 14:03:49 +0000
4Subject: [PATCH] BIND Operational Notification: Zone journal (.jnl) file
5 incompatibility
6
7Upstream-Status: Backport [https://downloads.isc.org/isc/bind9/9.16.12/patches/CVE-2020-8625.patch]
8CVE: CVE-2020-8625
9Signed-off-by: Minjae Kim <flowergom@gmail.com>
10---
11 lib/dns/spnego.c | 2 +-
12 1 file changed, 1 insertion(+), 1 deletion(-)
13
14diff --git a/lib/dns/spnego.c b/lib/dns/spnego.c
15index 671838c..82fd49a 100644
16--- a/lib/dns/spnego.c
17+++ b/lib/dns/spnego.c
18@@ -846,7 +846,7 @@ der_get_oid(const unsigned char *p, size_t len, oid *data, size_t *size) {
19 return (ASN1_OVERRUN);
20 }
21
22- data->components = malloc(len * sizeof(*data->components));
23+ data->components = malloc((len + 1) * sizeof(*data->components));
24 if (data->components == NULL) {
25 return (ENOMEM);
26 }
27--
282.17.1
29
diff --git a/meta/recipes-connectivity/bind/bind_9.16.7.bb b/meta/recipes-connectivity/bind/bind_9.16.7.bb
index 5fc2c1d3cd..82c1bb66df 100644
--- a/meta/recipes-connectivity/bind/bind_9.16.7.bb
+++ b/meta/recipes-connectivity/bind/bind_9.16.7.bb
@@ -17,6 +17,7 @@ SRC_URI = "https://ftp.isc.org/isc/bind9/${PV}/${BPN}-${PV}.tar.xz \
17 file://bind-ensure-searching-for-json-headers-searches-sysr.patch \ 17 file://bind-ensure-searching-for-json-headers-searches-sysr.patch \
18 file://0001-named-lwresd-V-and-start-log-hide-build-options.patch \ 18 file://0001-named-lwresd-V-and-start-log-hide-build-options.patch \
19 file://0001-avoid-start-failure-with-bind-user.patch \ 19 file://0001-avoid-start-failure-with-bind-user.patch \
20 file://CVE-2020-8625.patch \
20 " 21 "
21 22
22SRC_URI[sha256sum] = "9f7d1812ebbd26a699f62b6fa8522d5dec57e4bf43af0042a0d60d39ed8314d1" 23SRC_URI[sha256sum] = "9f7d1812ebbd26a699f62b6fa8522d5dec57e4bf43af0042a0d60d39ed8314d1"
diff --git a/meta/recipes-connectivity/openssl/openssl_1.1.1i.bb b/meta/recipes-connectivity/openssl/openssl_1.1.1k.bb
index 5d22c511aa..5f281197c9 100644
--- a/meta/recipes-connectivity/openssl/openssl_1.1.1i.bb
+++ b/meta/recipes-connectivity/openssl/openssl_1.1.1k.bb
@@ -23,7 +23,7 @@ SRC_URI_append_class-nativesdk = " \
23 file://environment.d-openssl.sh \ 23 file://environment.d-openssl.sh \
24 " 24 "
25 25
26SRC_URI[sha256sum] = "e8be6a35fe41d10603c3cc635e93289ed00bf34b79671a3a4de64fcee00d5242" 26SRC_URI[sha256sum] = "892a0875b9872acd04a9fde79b1f943075d5ea162415de3047c327df33fbaee5"
27 27
28inherit lib_package multilib_header multilib_script ptest 28inherit lib_package multilib_header multilib_script ptest
29MULTILIB_SCRIPTS = "${PN}-bin:${bindir}/c_rehash" 29MULTILIB_SCRIPTS = "${PN}-bin:${bindir}/c_rehash"
diff --git a/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/CVE-2021-0326.patch b/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/CVE-2021-0326.patch
new file mode 100644
index 0000000000..8c90fa3421
--- /dev/null
+++ b/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/CVE-2021-0326.patch
@@ -0,0 +1,45 @@
1From 947272febe24a8f0ea828b5b2f35f13c3821901e Mon Sep 17 00:00:00 2001
2From: Jouni Malinen <jouni@codeaurora.org>
3Date: Mon, 9 Nov 2020 11:43:12 +0200
4Subject: [PATCH] P2P: Fix copying of secondary device types for P2P group
5 client
6
7Parsing and copying of WPS secondary device types list was verifying
8that the contents is not too long for the internal maximum in the case
9of WPS messages, but similar validation was missing from the case of P2P
10group information which encodes this information in a different
11attribute. This could result in writing beyond the memory area assigned
12for these entries and corrupting memory within an instance of struct
13p2p_device. This could result in invalid operations and unexpected
14behavior when trying to free pointers from that corrupted memory.
15
16Upstream-Status: Backport
17CVE: CVE-2021-0326
18
19Reference to upstream patch:
20[https://w1.fi/cgit/hostap/commit/?id=947272febe24a8f0ea828b5b2f35f13c3821901e]
21
22Credit to OSS-Fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=27269
23Fixes: e57ae6e19edf ("P2P: Keep track of secondary device types for peers")
24Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
25Signed-off-by: Stefan Ghinea <stefan.ghinea@windriver.com>
26---
27 src/p2p/p2p.c | 2 ++
28 1 file changed, 2 insertions(+)
29
30diff --git a/src/p2p/p2p.c b/src/p2p/p2p.c
31index a08ba02..079270f 100644
32--- a/src/p2p/p2p.c
33+++ b/src/p2p/p2p.c
34@@ -453,6 +453,8 @@ static void p2p_copy_client_info(struct p2p_device *dev,
35 dev->info.config_methods = cli->config_methods;
36 os_memcpy(dev->info.pri_dev_type, cli->pri_dev_type, 8);
37 dev->info.wps_sec_dev_type_list_len = 8 * cli->num_sec_dev_types;
38+ if (dev->info.wps_sec_dev_type_list_len > WPS_SEC_DEV_TYPE_MAX_LEN)
39+ dev->info.wps_sec_dev_type_list_len = WPS_SEC_DEV_TYPE_MAX_LEN;
40 os_memcpy(dev->info.wps_sec_dev_type_list, cli->sec_dev_types,
41 dev->info.wps_sec_dev_type_list_len);
42 }
43--
442.17.1
45
diff --git a/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/CVE-2021-27803.patch b/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/CVE-2021-27803.patch
new file mode 100644
index 0000000000..004b1dbd19
--- /dev/null
+++ b/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/CVE-2021-27803.patch
@@ -0,0 +1,58 @@
1From 8460e3230988ef2ec13ce6b69b687e941f6cdb32 Mon Sep 17 00:00:00 2001
2From: Jouni Malinen <jouni@codeaurora.org>
3Date: Tue, 8 Dec 2020 23:52:50 +0200
4Subject: [PATCH] P2P: Fix a corner case in peer addition based on PD Request
5
6p2p_add_device() may remove the oldest entry if there is no room in the
7peer table for a new peer. This would result in any pointer to that
8removed entry becoming stale. A corner case with an invalid PD Request
9frame could result in such a case ending up using (read+write) freed
10memory. This could only by triggered when the peer table has reached its
11maximum size and the PD Request frame is received from the P2P Device
12Address of the oldest remaining entry and the frame has incorrect P2P
13Device Address in the payload.
14
15Fix this by fetching the dev pointer again after having called
16p2p_add_device() so that the stale pointer cannot be used.
17
18Fixes: 17bef1e97a50 ("P2P: Add peer entry based on Provision Discovery Request")
19Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
20
21Upstream-Status: Backport
22CVE: CVE-2021-27803
23
24Reference to upstream patch:
25[https://w1.fi/cgit/hostap/commit/?id=8460e3230988ef2ec13ce6b69b687e941f6cdb32]
26
27Signed-off-by: Stefan Ghinea <stefan.ghinea@windriver.com>
28---
29 src/p2p/p2p_pd.c | 12 +++++-------
30 1 file changed, 5 insertions(+), 7 deletions(-)
31
32diff --git a/src/p2p/p2p_pd.c b/src/p2p/p2p_pd.c
33index 3994ec0..05fd593 100644
34--- a/src/p2p/p2p_pd.c
35+++ b/src/p2p/p2p_pd.c
36@@ -595,14 +595,12 @@ void p2p_process_prov_disc_req(struct p2p_data *p2p, const u8 *sa,
37 goto out;
38 }
39
40+ dev = p2p_get_device(p2p, sa);
41 if (!dev) {
42- dev = p2p_get_device(p2p, sa);
43- if (!dev) {
44- p2p_dbg(p2p,
45- "Provision Discovery device not found "
46- MACSTR, MAC2STR(sa));
47- goto out;
48- }
49+ p2p_dbg(p2p,
50+ "Provision Discovery device not found "
51+ MACSTR, MAC2STR(sa));
52+ goto out;
53 }
54 } else if (msg.wfd_subelems) {
55 wpabuf_free(dev->info.wfd_subelems);
56--
572.17.1
58
diff --git a/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/CVE-2021-30004.patch b/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/CVE-2021-30004.patch
new file mode 100644
index 0000000000..e2540fc26b
--- /dev/null
+++ b/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/CVE-2021-30004.patch
@@ -0,0 +1,123 @@
1From a0541334a6394f8237a4393b7372693cd7e96f15 Mon Sep 17 00:00:00 2001
2From: Jouni Malinen <j@w1.fi>
3Date: Sat, 13 Mar 2021 18:19:31 +0200
4Subject: [PATCH] ASN.1: Validate DigestAlgorithmIdentifier parameters
5
6The supported hash algorithms do not use AlgorithmIdentifier parameters.
7However, there are implementations that include NULL parameters in
8addition to ones that omit the parameters. Previous implementation did
9not check the parameters value at all which supported both these cases,
10but did not reject any other unexpected information.
11
12Use strict validation of digest algorithm parameters and reject any
13unexpected value when validating a signature. This is needed to prevent
14potential forging attacks.
15
16Signed-off-by: Jouni Malinen <j@w1.fi>
17
18Upstream-Status: Backport
19CVE: CVE-2021-30004
20
21Reference to upstream patch:
22[https://w1.fi/cgit/hostap/commit/?id=a0541334a6394f8237a4393b7372693cd7e96f15]
23
24Signed-off-by: Stefan Ghinea <stefan.ghinea@windriver.com>
25---
26 src/tls/pkcs1.c | 21 +++++++++++++++++++++
27 src/tls/x509v3.c | 20 ++++++++++++++++++++
28 2 files changed, 41 insertions(+)
29
30diff --git a/src/tls/pkcs1.c b/src/tls/pkcs1.c
31index 141ac50..e09db07 100644
32--- a/src/tls/pkcs1.c
33+++ b/src/tls/pkcs1.c
34@@ -240,6 +240,8 @@ int pkcs1_v15_sig_ver(struct crypto_public_key *pk,
35 os_free(decrypted);
36 return -1;
37 }
38+ wpa_hexdump(MSG_MSGDUMP, "PKCS #1: DigestInfo",
39+ hdr.payload, hdr.length);
40
41 pos = hdr.payload;
42 end = pos + hdr.length;
43@@ -261,6 +263,8 @@ int pkcs1_v15_sig_ver(struct crypto_public_key *pk,
44 os_free(decrypted);
45 return -1;
46 }
47+ wpa_hexdump(MSG_MSGDUMP, "PKCS #1: DigestAlgorithmIdentifier",
48+ hdr.payload, hdr.length);
49 da_end = hdr.payload + hdr.length;
50
51 if (asn1_get_oid(hdr.payload, hdr.length, &oid, &next)) {
52@@ -269,6 +273,23 @@ int pkcs1_v15_sig_ver(struct crypto_public_key *pk,
53 os_free(decrypted);
54 return -1;
55 }
56+ wpa_hexdump(MSG_MSGDUMP, "PKCS #1: Digest algorithm parameters",
57+ next, da_end - next);
58+
59+ /*
60+ * RFC 5754: The correct encoding for the SHA2 algorithms would be to
61+ * omit the parameters, but there are implementation that encode these
62+ * as a NULL element. Allow these two cases and reject anything else.
63+ */
64+ if (da_end > next &&
65+ (asn1_get_next(next, da_end - next, &hdr) < 0 ||
66+ !asn1_is_null(&hdr) ||
67+ hdr.payload + hdr.length != da_end)) {
68+ wpa_printf(MSG_DEBUG,
69+ "PKCS #1: Unexpected digest algorithm parameters");
70+ os_free(decrypted);
71+ return -1;
72+ }
73
74 if (!asn1_oid_equal(&oid, hash_alg)) {
75 char txt[100], txt2[100];
76diff --git a/src/tls/x509v3.c b/src/tls/x509v3.c
77index 1bd5aa0..bf2289f 100644
78--- a/src/tls/x509v3.c
79+++ b/src/tls/x509v3.c
80@@ -1834,6 +1834,7 @@ int x509_check_signature(struct x509_certificate *issuer,
81 os_free(data);
82 return -1;
83 }
84+ wpa_hexdump(MSG_MSGDUMP, "X509: DigestInfo", hdr.payload, hdr.length);
85
86 pos = hdr.payload;
87 end = pos + hdr.length;
88@@ -1855,6 +1856,8 @@ int x509_check_signature(struct x509_certificate *issuer,
89 os_free(data);
90 return -1;
91 }
92+ wpa_hexdump(MSG_MSGDUMP, "X509: DigestAlgorithmIdentifier",
93+ hdr.payload, hdr.length);
94 da_end = hdr.payload + hdr.length;
95
96 if (asn1_get_oid(hdr.payload, hdr.length, &oid, &next)) {
97@@ -1862,6 +1865,23 @@ int x509_check_signature(struct x509_certificate *issuer,
98 os_free(data);
99 return -1;
100 }
101+ wpa_hexdump(MSG_MSGDUMP, "X509: Digest algorithm parameters",
102+ next, da_end - next);
103+
104+ /*
105+ * RFC 5754: The correct encoding for the SHA2 algorithms would be to
106+ * omit the parameters, but there are implementation that encode these
107+ * as a NULL element. Allow these two cases and reject anything else.
108+ */
109+ if (da_end > next &&
110+ (asn1_get_next(next, da_end - next, &hdr) < 0 ||
111+ !asn1_is_null(&hdr) ||
112+ hdr.payload + hdr.length != da_end)) {
113+ wpa_printf(MSG_DEBUG,
114+ "X509: Unexpected digest algorithm parameters");
115+ os_free(data);
116+ return -1;
117+ }
118
119 if (x509_sha1_oid(&oid)) {
120 if (signature->oid.oid[6] != 5 /* sha-1WithRSAEncryption */) {
121--
1222.17.1
123
diff --git a/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant_2.9.bb b/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant_2.9.bb
index 7cc03fef7d..915b326b81 100644
--- a/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant_2.9.bb
+++ b/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant_2.9.bb
@@ -29,6 +29,9 @@ SRC_URI = "http://w1.fi/releases/wpa_supplicant-${PV}.tar.gz \
29 file://0001-WPS-UPnP-Do-not-allow-event-subscriptions-with-URLs-.patch \ 29 file://0001-WPS-UPnP-Do-not-allow-event-subscriptions-with-URLs-.patch \
30 file://0002-WPS-UPnP-Fix-event-message-generation-using-a-long-U.patch \ 30 file://0002-WPS-UPnP-Fix-event-message-generation-using-a-long-U.patch \
31 file://0003-WPS-UPnP-Handle-HTTP-initiation-failures-for-events-.patch \ 31 file://0003-WPS-UPnP-Handle-HTTP-initiation-failures-for-events-.patch \
32 file://CVE-2021-0326.patch \
33 file://CVE-2021-27803.patch \
34 file://CVE-2021-30004.patch \
32 " 35 "
33SRC_URI[md5sum] = "2d2958c782576dc9901092fbfecb4190" 36SRC_URI[md5sum] = "2d2958c782576dc9901092fbfecb4190"
34SRC_URI[sha256sum] = "fcbdee7b4a64bea8177973299c8c824419c413ec2e3a95db63dd6a5dc3541f17" 37SRC_URI[sha256sum] = "fcbdee7b4a64bea8177973299c8c824419c413ec2e3a95db63dd6a5dc3541f17"
diff --git a/meta/recipes-core/busybox/busybox/0001-decompress_gunzip-Fix-DoS-if-gzip-is-corrupt.patch b/meta/recipes-core/busybox/busybox/0001-decompress_gunzip-Fix-DoS-if-gzip-is-corrupt.patch
new file mode 100644
index 0000000000..67c9f189cc
--- /dev/null
+++ b/meta/recipes-core/busybox/busybox/0001-decompress_gunzip-Fix-DoS-if-gzip-is-corrupt.patch
@@ -0,0 +1,58 @@
1From fe791386ebc270219ca00406c9fdadc5130b64ee Mon Sep 17 00:00:00 2001
2From: Samuel Sapalski <samuel.sapalski@nokia.com>
3Date: Wed, 3 Mar 2021 16:31:22 +0100
4Subject: [PATCH] decompress_gunzip: Fix DoS if gzip is corrupt
5
6On certain corrupt gzip files, huft_build will set the error bit on
7the result pointer. If afterwards abort_unzip is called huft_free
8might run into a segmentation fault or an invalid pointer to
9free(p).
10
11In order to mitigate this, we check in huft_free if the error bit
12is set and clear it before the linked list is freed.
13
14Signed-off-by: Samuel Sapalski <samuel.sapalski@nokia.com>
15Signed-off-by: Peter Kaestle <peter.kaestle@nokia.com>
16Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
17
18Upstream-Status: Backport
19CVE: CVE-2021-28831
20Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
21---
22 archival/libarchive/decompress_gunzip.c | 12 ++++++++++--
23 1 file changed, 10 insertions(+), 2 deletions(-)
24
25diff --git a/archival/libarchive/decompress_gunzip.c b/archival/libarchive/decompress_gunzip.c
26index eb3b64930..e93cd5005 100644
27--- a/archival/libarchive/decompress_gunzip.c
28+++ b/archival/libarchive/decompress_gunzip.c
29@@ -220,10 +220,20 @@ static const uint8_t border[] ALIGN1 = {
30 * each table.
31 * t: table to free
32 */
33+#define BAD_HUFT(p) ((uintptr_t)(p) & 1)
34+#define ERR_RET ((huft_t*)(uintptr_t)1)
35 static void huft_free(huft_t *p)
36 {
37 huft_t *q;
38
39+ /*
40+ * If 'p' has the error bit set we have to clear it, otherwise we might run
41+ * into a segmentation fault or an invalid pointer to free(p)
42+ */
43+ if (BAD_HUFT(p)) {
44+ p = (huft_t*)((uintptr_t)(p) ^ (uintptr_t)(ERR_RET));
45+ }
46+
47 /* Go through linked list, freeing from the malloced (t[-1]) address. */
48 while (p) {
49 q = (--p)->v.t;
50@@ -289,8 +299,6 @@ static unsigned fill_bitbuffer(STATE_PARAM unsigned bitbuffer, unsigned *current
51 * or a valid pointer to a Huffman table, ORed with 0x1 if incompete table
52 * is given: "fixed inflate" decoder feeds us such data.
53 */
54-#define BAD_HUFT(p) ((uintptr_t)(p) & 1)
55-#define ERR_RET ((huft_t*)(uintptr_t)1)
56 static huft_t* huft_build(const unsigned *b, const unsigned n,
57 const unsigned s, const struct cp_ext *cp_ext,
58 unsigned *m)
diff --git a/meta/recipes-core/busybox/busybox_1.32.0.bb b/meta/recipes-core/busybox/busybox_1.32.0.bb
index 8e23b0d4a2..b91f7cf711 100644
--- a/meta/recipes-core/busybox/busybox_1.32.0.bb
+++ b/meta/recipes-core/busybox/busybox_1.32.0.bb
@@ -46,7 +46,8 @@ SRC_URI = "https://busybox.net/downloads/busybox-${PV}.tar.bz2;name=tarball \
46 file://0001-hwclock-make-glibc-2.31-compatible.patch \ 46 file://0001-hwclock-make-glibc-2.31-compatible.patch \
47 file://rev.cfg \ 47 file://rev.cfg \
48 file://pgrep.cfg \ 48 file://pgrep.cfg \
49" 49 file://0001-decompress_gunzip-Fix-DoS-if-gzip-is-corrupt.patch \
50 "
50SRC_URI_append_libc-musl = " file://musl.cfg " 51SRC_URI_append_libc-musl = " file://musl.cfg "
51 52
52SRC_URI[tarball.md5sum] = "9576986f1a960da471d03b72a62f13c7" 53SRC_URI[tarball.md5sum] = "9576986f1a960da471d03b72a62f13c7"
diff --git a/meta/recipes-core/glib-2.0/glib-2.0/CVE-2021-27219.patch b/meta/recipes-core/glib-2.0/glib-2.0/CVE-2021-27219.patch
new file mode 100644
index 0000000000..a4ec01134a
--- /dev/null
+++ b/meta/recipes-core/glib-2.0/glib-2.0/CVE-2021-27219.patch
@@ -0,0 +1,1444 @@
1commit b70039028b4a39ea071f6ed368a58ad5b5b90ba3
2Author: Anatol Belski <anbelski@microsoft.com>
3Date: Sun Mar 14 17:51:53 2021 +0000
4
5 backport: 2.64.5_CVE-2021-27219
6
7CVE: CVE-2021-27219
8Upstream-Status: Backport
9[https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1926]
10
11Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
12
13diff --git a/docs/reference/glib/meson.build b/docs/reference/glib/meson.build
14index 62d95f78d..7eebb04ac 100644
15--- a/docs/reference/glib/meson.build
16+++ b/docs/reference/glib/meson.build
17@@ -22,6 +22,7 @@ if get_option('gtk_doc')
18 'gprintfint.h',
19 'gmirroringtable.h',
20 'gscripttable.h',
21+ 'gstrfuncsprivate.h',
22 'glib-mirroring-tab',
23 'gnulib',
24 'pcre',
25diff --git a/gio/gdatainputstream.c b/gio/gdatainputstream.c
26index 2e7750cb5..2cdcbda19 100644
27--- a/gio/gdatainputstream.c
28+++ b/gio/gdatainputstream.c
29@@ -27,6 +27,7 @@
30 #include "gioenumtypes.h"
31 #include "gioerror.h"
32 #include "glibintl.h"
33+#include "gstrfuncsprivate.h"
34
35 #include <string.h>
36
37@@ -856,7 +857,7 @@ static gssize
38 scan_for_chars (GDataInputStream *stream,
39 gsize *checked_out,
40 const char *stop_chars,
41- gssize stop_chars_len)
42+ gsize stop_chars_len)
43 {
44 GBufferedInputStream *bstream;
45 const char *buffer;
46@@ -952,7 +953,7 @@ typedef struct
47 gsize checked;
48
49 gchar *stop_chars;
50- gssize stop_chars_len;
51+ gsize stop_chars_len;
52 gsize length;
53 } GDataInputStreamReadData;
54
55@@ -1078,12 +1079,17 @@ g_data_input_stream_read_async (GDataInputStream *stream,
56 {
57 GDataInputStreamReadData *data;
58 GTask *task;
59+ gsize stop_chars_len_unsigned;
60
61 data = g_slice_new0 (GDataInputStreamReadData);
62- if (stop_chars_len == -1)
63- stop_chars_len = strlen (stop_chars);
64- data->stop_chars = g_memdup (stop_chars, stop_chars_len);
65- data->stop_chars_len = stop_chars_len;
66+
67+ if (stop_chars_len < 0)
68+ stop_chars_len_unsigned = strlen (stop_chars);
69+ else
70+ stop_chars_len_unsigned = (gsize) stop_chars_len;
71+
72+ data->stop_chars = g_memdup2 (stop_chars, stop_chars_len_unsigned);
73+ data->stop_chars_len = stop_chars_len_unsigned;
74 data->last_saw_cr = FALSE;
75
76 task = g_task_new (stream, cancellable, callback, user_data);
77@@ -1338,17 +1344,20 @@ g_data_input_stream_read_upto (GDataInputStream *stream,
78 gssize found_pos;
79 gssize res;
80 char *data_until;
81+ gsize stop_chars_len_unsigned;
82
83 g_return_val_if_fail (G_IS_DATA_INPUT_STREAM (stream), NULL);
84
85 if (stop_chars_len < 0)
86- stop_chars_len = strlen (stop_chars);
87+ stop_chars_len_unsigned = strlen (stop_chars);
88+ else
89+ stop_chars_len_unsigned = (gsize) stop_chars_len;
90
91 bstream = G_BUFFERED_INPUT_STREAM (stream);
92
93 checked = 0;
94
95- while ((found_pos = scan_for_chars (stream, &checked, stop_chars, stop_chars_len)) == -1)
96+ while ((found_pos = scan_for_chars (stream, &checked, stop_chars, stop_chars_len_unsigned)) == -1)
97 {
98 if (g_buffered_input_stream_get_available (bstream) ==
99 g_buffered_input_stream_get_buffer_size (bstream))
100diff --git a/gio/gdbusconnection.c b/gio/gdbusconnection.c
101index 1a4dae3bd..9de661bde 100644
102--- a/gio/gdbusconnection.c
103+++ b/gio/gdbusconnection.c
104@@ -110,6 +110,7 @@
105 #include "gasyncinitable.h"
106 #include "giostream.h"
107 #include "gasyncresult.h"
108+#include "gstrfuncsprivate.h"
109 #include "gtask.h"
110 #include "gmarshal-internal.h"
111
112@@ -4007,7 +4008,7 @@ _g_dbus_interface_vtable_copy (const GDBusInterfaceVTable *vtable)
113 /* Don't waste memory by copying padding - remember to update this
114 * when changing struct _GDBusInterfaceVTable in gdbusconnection.h
115 */
116- return g_memdup ((gconstpointer) vtable, 3 * sizeof (gpointer));
117+ return g_memdup2 ((gconstpointer) vtable, 3 * sizeof (gpointer));
118 }
119
120 static void
121@@ -4024,7 +4025,7 @@ _g_dbus_subtree_vtable_copy (const GDBusSubtreeVTable *vtable)
122 /* Don't waste memory by copying padding - remember to update this
123 * when changing struct _GDBusSubtreeVTable in gdbusconnection.h
124 */
125- return g_memdup ((gconstpointer) vtable, 3 * sizeof (gpointer));
126+ return g_memdup2 ((gconstpointer) vtable, 3 * sizeof (gpointer));
127 }
128
129 static void
130diff --git a/gio/gdbusinterfaceskeleton.c b/gio/gdbusinterfaceskeleton.c
131index 4a06516c1..4a4b719a5 100644
132--- a/gio/gdbusinterfaceskeleton.c
133+++ b/gio/gdbusinterfaceskeleton.c
134@@ -28,6 +28,7 @@
135 #include "gdbusmethodinvocation.h"
136 #include "gdbusconnection.h"
137 #include "gmarshal-internal.h"
138+#include "gstrfuncsprivate.h"
139 #include "gtask.h"
140 #include "gioerror.h"
141
142@@ -701,7 +702,7 @@ add_connection_locked (GDBusInterfaceSkeleton *interface_,
143 * properly before building the hooked_vtable, so we create it
144 * once at the last minute.
145 */
146- interface_->priv->hooked_vtable = g_memdup (g_dbus_interface_skeleton_get_vtable (interface_), sizeof (GDBusInterfaceVTable));
147+ interface_->priv->hooked_vtable = g_memdup2 (g_dbus_interface_skeleton_get_vtable (interface_), sizeof (GDBusInterfaceVTable));
148 interface_->priv->hooked_vtable->method_call = skeleton_intercept_handle_method_call;
149 }
150
151diff --git a/gio/gfile.c b/gio/gfile.c
152index a2ded14ea..25930435f 100644
153--- a/gio/gfile.c
154+++ b/gio/gfile.c
155@@ -60,6 +60,7 @@
156 #include "gasyncresult.h"
157 #include "gioerror.h"
158 #include "glibintl.h"
159+#include "gstrfuncsprivate.h"
160
161
162 /**
163@@ -7854,7 +7855,7 @@ measure_disk_usage_progress (gboolean reporting,
164 g_main_context_invoke_full (g_task_get_context (task),
165 g_task_get_priority (task),
166 measure_disk_usage_invoke_progress,
167- g_memdup (&progress, sizeof progress),
168+ g_memdup2 (&progress, sizeof progress),
169 g_free);
170 }
171
172@@ -7872,7 +7873,7 @@ measure_disk_usage_thread (GTask *task,
173 data->progress_callback ? measure_disk_usage_progress : NULL, task,
174 &result.disk_usage, &result.num_dirs, &result.num_files,
175 &error))
176- g_task_return_pointer (task, g_memdup (&result, sizeof result), g_free);
177+ g_task_return_pointer (task, g_memdup2 (&result, sizeof result), g_free);
178 else
179 g_task_return_error (task, error);
180 }
181@@ -7896,7 +7897,7 @@ g_file_real_measure_disk_usage_async (GFile *file,
182
183 task = g_task_new (file, cancellable, callback, user_data);
184 g_task_set_source_tag (task, g_file_real_measure_disk_usage_async);
185- g_task_set_task_data (task, g_memdup (&data, sizeof data), g_free);
186+ g_task_set_task_data (task, g_memdup2 (&data, sizeof data), g_free);
187 g_task_set_priority (task, io_priority);
188
189 g_task_run_in_thread (task, measure_disk_usage_thread);
190diff --git a/gio/giowin32-private.c b/gio/giowin32-private.c
191index 7120ae0ea..47e840805 100644
192--- a/gio/giowin32-private.c
193+++ b/gio/giowin32-private.c
194@@ -16,11 +16,12 @@
195 * along with this library; if not, see <http://www.gnu.org/licenses/>.
196 */
197
198+#include "gstrfuncsprivate.h"
199
200-static gssize
201+static gsize
202 g_utf16_len (const gunichar2 *str)
203 {
204- gssize result;
205+ gsize result;
206
207 for (result = 0; str[0] != 0; str++, result++)
208 ;
209@@ -31,17 +32,20 @@ g_utf16_len (const gunichar2 *str)
210 static gunichar2 *
211 g_wcsdup (const gunichar2 *str, gssize str_len)
212 {
213- gssize str_size;
214+ gsize str_len_unsigned;
215+ gsize str_size;
216
217 g_return_val_if_fail (str != NULL, NULL);
218
219- if (str_len == -1)
220- str_len = g_utf16_len (str);
221+ if (str_len < 0)
222+ str_len_unsigned = g_utf16_len (str);
223+ else
224+ str_len_unsigned = (gsize) str_len;
225
226- g_assert (str_len <= G_MAXSIZE / sizeof (gunichar2) - 1);
227- str_size = (str_len + 1) * sizeof (gunichar2);
228+ g_assert (str_len_unsigned <= G_MAXSIZE / sizeof (gunichar2) - 1);
229+ str_size = (str_len_unsigned + 1) * sizeof (gunichar2);
230
231- return g_memdup (str, str_size);
232+ return g_memdup2 (str, str_size);
233 }
234
235 static const gunichar2 *
236diff --git a/gio/gkeyfilesettingsbackend.c b/gio/gkeyfilesettingsbackend.c
237index cd5765afd..de216e615 100644
238--- a/gio/gkeyfilesettingsbackend.c
239+++ b/gio/gkeyfilesettingsbackend.c
240@@ -33,6 +33,7 @@
241 #include "gfilemonitor.h"
242 #include "gsimplepermission.h"
243 #include "gsettingsbackendinternal.h"
244+#include "gstrfuncsprivate.h"
245 #include "giomodule-priv.h"
246 #include "gportalsupport.h"
247
248@@ -145,8 +146,8 @@ convert_path (GKeyfileSettingsBackend *kfsb,
249 gchar **group,
250 gchar **basename)
251 {
252- gint key_len = strlen (key);
253- gint i;
254+ gsize key_len = strlen (key);
255+ const gchar *last_slash;
256
257 if (key_len < kfsb->prefix_len ||
258 memcmp (key, kfsb->prefix, kfsb->prefix_len) != 0)
259@@ -155,38 +156,48 @@ convert_path (GKeyfileSettingsBackend *kfsb,
260 key_len -= kfsb->prefix_len;
261 key += kfsb->prefix_len;
262
263- for (i = key_len; i >= 0; i--)
264- if (key[i] == '/')
265- break;
266+ last_slash = strrchr (key, '/');
267+
268+ /* Disallow empty group names or key names */
269+ if (key_len == 0 ||
270+ (last_slash != NULL &&
271+ (*(last_slash + 1) == '\0' ||
272+ last_slash == key)))
273+ return FALSE;
274
275 if (kfsb->root_group)
276 {
277 /* if a root_group was specified, make sure the user hasn't given
278 * a path that ghosts that group name
279 */
280- if (i == kfsb->root_group_len && memcmp (key, kfsb->root_group, i) == 0)
281+ if (last_slash != NULL && (last_slash - key) == kfsb->root_group_len && memcmp (key, kfsb->root_group, last_slash - key) == 0)
282 return FALSE;
283 }
284 else
285 {
286 /* if no root_group was given, ensure that the user gave a path */
287- if (i == -1)
288+ if (last_slash == NULL)
289 return FALSE;
290 }
291
292 if (group)
293 {
294- if (i >= 0)
295+ if (last_slash != NULL)
296 {
297- *group = g_memdup (key, i + 1);
298- (*group)[i] = '\0';
299+ *group = g_memdup2 (key, (last_slash - key) + 1);
300+ (*group)[(last_slash - key)] = '\0';
301 }
302 else
303 *group = g_strdup (kfsb->root_group);
304 }
305
306 if (basename)
307- *basename = g_memdup (key + i + 1, key_len - i);
308+ {
309+ if (last_slash != NULL)
310+ *basename = g_memdup2 (last_slash + 1, key_len - (last_slash - key));
311+ else
312+ *basename = g_strdup (key);
313+ }
314
315 return TRUE;
316 }
317diff --git a/gio/gsettingsschema.c b/gio/gsettingsschema.c
318index 0b94f76f6..eb5a3b846 100644
319--- a/gio/gsettingsschema.c
320+++ b/gio/gsettingsschema.c
321@@ -20,6 +20,7 @@
322
323 #include "gsettingsschema-internal.h"
324 #include "gsettings.h"
325+#include "gstrfuncsprivate.h"
326
327 #include "gvdb/gvdb-reader.h"
328 #include "strinfo.c"
329@@ -1067,9 +1068,9 @@ g_settings_schema_list_children (GSettingsSchema *schema)
330
331 if (g_str_has_suffix (key, "/"))
332 {
333- gint length = strlen (key);
334+ gsize length = strlen (key);
335
336- strv[j] = g_memdup (key, length);
337+ strv[j] = g_memdup2 (key, length);
338 strv[j][length - 1] = '\0';
339 j++;
340 }
341diff --git a/gio/gsocket.c b/gio/gsocket.c
342index 2a15bdd22..554af026b 100644
343--- a/gio/gsocket.c
344+++ b/gio/gsocket.c
345@@ -75,6 +75,7 @@
346 #include "gcredentialsprivate.h"
347 #include "glibintl.h"
348 #include "gioprivate.h"
349+#include "gstrfuncsprivate.h"
350
351 #ifdef G_OS_WIN32
352 /* For Windows XP runtime compatibility, but use the system's if_nametoindex() if available */
353@@ -174,7 +175,7 @@ static gboolean g_socket_datagram_based_condition_wait (GDatagramBased
354 GError **error);
355
356 static GSocketAddress *
357-cache_recv_address (GSocket *socket, struct sockaddr *native, int native_len);
358+cache_recv_address (GSocket *socket, struct sockaddr *native, size_t native_len);
359
360 static gssize
361 g_socket_receive_message_with_timeout (GSocket *socket,
362@@ -260,7 +261,7 @@ struct _GSocketPrivate
363 struct {
364 GSocketAddress *addr;
365 struct sockaddr *native;
366- gint native_len;
367+ gsize native_len;
368 guint64 last_used;
369 } recv_addr_cache[RECV_ADDR_CACHE_SIZE];
370 };
371@@ -5259,14 +5260,14 @@ g_socket_send_messages_with_timeout (GSocket *socket,
372 }
373
374 static GSocketAddress *
375-cache_recv_address (GSocket *socket, struct sockaddr *native, int native_len)
376+cache_recv_address (GSocket *socket, struct sockaddr *native, size_t native_len)
377 {
378 GSocketAddress *saddr;
379 gint i;
380 guint64 oldest_time = G_MAXUINT64;
381 gint oldest_index = 0;
382
383- if (native_len <= 0)
384+ if (native_len == 0)
385 return NULL;
386
387 saddr = NULL;
388@@ -5274,7 +5275,7 @@ cache_recv_address (GSocket *socket, struct sockaddr *native, int native_len)
389 {
390 GSocketAddress *tmp = socket->priv->recv_addr_cache[i].addr;
391 gpointer tmp_native = socket->priv->recv_addr_cache[i].native;
392- gint tmp_native_len = socket->priv->recv_addr_cache[i].native_len;
393+ gsize tmp_native_len = socket->priv->recv_addr_cache[i].native_len;
394
395 if (!tmp)
396 continue;
397@@ -5304,7 +5305,7 @@ cache_recv_address (GSocket *socket, struct sockaddr *native, int native_len)
398 g_free (socket->priv->recv_addr_cache[oldest_index].native);
399 }
400
401- socket->priv->recv_addr_cache[oldest_index].native = g_memdup (native, native_len);
402+ socket->priv->recv_addr_cache[oldest_index].native = g_memdup2 (native, native_len);
403 socket->priv->recv_addr_cache[oldest_index].native_len = native_len;
404 socket->priv->recv_addr_cache[oldest_index].addr = g_object_ref (saddr);
405 socket->priv->recv_addr_cache[oldest_index].last_used = g_get_monotonic_time ();
406@@ -5452,6 +5453,9 @@ g_socket_receive_message_with_timeout (GSocket *socket,
407 /* do it */
408 while (1)
409 {
410+ /* addrlen has to be of type int because that’s how WSARecvFrom() is defined */
411+ G_STATIC_ASSERT (sizeof addr <= G_MAXINT);
412+
413 addrlen = sizeof addr;
414 if (address)
415 result = WSARecvFrom (socket->priv->fd,
416diff --git a/gio/gtlspassword.c b/gio/gtlspassword.c
417index 1e437a7b6..bd86a6dfe 100644
418--- a/gio/gtlspassword.c
419+++ b/gio/gtlspassword.c
420@@ -23,6 +23,7 @@
421 #include "glibintl.h"
422
423 #include "gioenumtypes.h"
424+#include "gstrfuncsprivate.h"
425 #include "gtlspassword.h"
426
427 #include <string.h>
428@@ -287,9 +288,14 @@ g_tls_password_set_value (GTlsPassword *password,
429 g_return_if_fail (G_IS_TLS_PASSWORD (password));
430
431 if (length < 0)
432- length = strlen ((gchar *)value);
433+ {
434+ /* FIXME: g_tls_password_set_value_full() doesn’t support unsigned gsize */
435+ gsize length_unsigned = strlen ((gchar *) value);
436+ g_return_if_fail (length_unsigned <= G_MAXSSIZE);
437+ length = (gssize) length_unsigned;
438+ }
439
440- g_tls_password_set_value_full (password, g_memdup (value, length), length, g_free);
441+ g_tls_password_set_value_full (password, g_memdup2 (value, (gsize) length), length, g_free);
442 }
443
444 /**
445diff --git a/gio/gwin32registrykey.c b/gio/gwin32registrykey.c
446index aa7819294..efb9ae713 100644
447--- a/gio/gwin32registrykey.c
448+++ b/gio/gwin32registrykey.c
449@@ -28,6 +28,8 @@
450 #include <ntstatus.h>
451 #include <winternl.h>
452
453+#include "gstrfuncsprivate.h"
454+
455 #ifndef _WDMDDK_
456 typedef enum _KEY_INFORMATION_CLASS {
457 KeyBasicInformation,
458@@ -125,16 +127,34 @@ typedef enum
459 G_WIN32_REGISTRY_UPDATED_PATH = 1,
460 } GWin32RegistryKeyUpdateFlag;
461
462+static gsize
463+g_utf16_len (const gunichar2 *str)
464+{
465+ gsize result;
466+
467+ for (result = 0; str[0] != 0; str++, result++)
468+ ;
469+
470+ return result;
471+}
472+
473 static gunichar2 *
474-g_wcsdup (const gunichar2 *str,
475- gssize str_size)
476+g_wcsdup (const gunichar2 *str, gssize str_len)
477 {
478- if (str_size == -1)
479- {
480- str_size = wcslen (str) + 1;
481- str_size *= sizeof (gunichar2);
482- }
483- return g_memdup (str, str_size);
484+ gsize str_len_unsigned;
485+ gsize str_size;
486+
487+ g_return_val_if_fail (str != NULL, NULL);
488+
489+ if (str_len < 0)
490+ str_len_unsigned = g_utf16_len (str);
491+ else
492+ str_len_unsigned = (gsize) str_len;
493+
494+ g_assert (str_len_unsigned <= G_MAXSIZE / sizeof (gunichar2) - 1);
495+ str_size = (str_len_unsigned + 1) * sizeof (gunichar2);
496+
497+ return g_memdup2 (str, str_size);
498 }
499
500 /**
501@@ -247,7 +267,7 @@ g_win32_registry_value_iter_copy (const GWin32RegistryValueIter *iter)
502 new_iter->value_name_size = iter->value_name_size;
503
504 if (iter->value_data != NULL)
505- new_iter->value_data = g_memdup (iter->value_data, iter->value_data_size);
506+ new_iter->value_data = g_memdup2 (iter->value_data, iter->value_data_size);
507
508 new_iter->value_data_size = iter->value_data_size;
509
510@@ -268,8 +288,8 @@ g_win32_registry_value_iter_copy (const GWin32RegistryValueIter *iter)
511 new_iter->value_data_expanded_charsize = iter->value_data_expanded_charsize;
512
513 if (iter->value_data_expanded_u8 != NULL)
514- new_iter->value_data_expanded_u8 = g_memdup (iter->value_data_expanded_u8,
515- iter->value_data_expanded_charsize);
516+ new_iter->value_data_expanded_u8 = g_memdup2 (iter->value_data_expanded_u8,
517+ iter->value_data_expanded_charsize);
518
519 new_iter->value_data_expanded_u8_size = iter->value_data_expanded_charsize;
520
521diff --git a/gio/tests/async-close-output-stream.c b/gio/tests/async-close-output-stream.c
522index 5f6620275..d3f97a119 100644
523--- a/gio/tests/async-close-output-stream.c
524+++ b/gio/tests/async-close-output-stream.c
525@@ -24,6 +24,8 @@
526 #include <stdlib.h>
527 #include <string.h>
528
529+#include "gstrfuncsprivate.h"
530+
531 #define DATA_TO_WRITE "Hello world\n"
532
533 typedef struct
534@@ -147,9 +149,9 @@ prepare_data (SetupData *data,
535
536 data->expected_size = g_memory_output_stream_get_data_size (G_MEMORY_OUTPUT_STREAM (data->data_stream));
537
538- g_assert_cmpint (data->expected_size, >, 0);
539+ g_assert_cmpuint (data->expected_size, >, 0);
540
541- data->expected_output = g_memdup (written, (guint)data->expected_size);
542+ data->expected_output = g_memdup2 (written, data->expected_size);
543
544 /* then recreate the streams and prepare them for the asynchronous close */
545 destroy_streams (data);
546diff --git a/gio/tests/gdbus-export.c b/gio/tests/gdbus-export.c
547index fda654c44..10dd6d82f 100644
548--- a/gio/tests/gdbus-export.c
549+++ b/gio/tests/gdbus-export.c
550@@ -23,6 +23,7 @@
551 #include <string.h>
552
553 #include "gdbus-tests.h"
554+#include "gstrfuncsprivate.h"
555
556 /* all tests rely on a shared mainloop */
557 static GMainLoop *loop = NULL;
558@@ -671,7 +672,7 @@ subtree_introspect (GDBusConnection *connection,
559 g_assert_not_reached ();
560 }
561
562- return g_memdup (interfaces, 2 * sizeof (void *));
563+ return g_memdup2 (interfaces, 2 * sizeof (void *));
564 }
565
566 static const GDBusInterfaceVTable *
567@@ -727,7 +728,7 @@ dynamic_subtree_introspect (GDBusConnection *connection,
568 {
569 const GDBusInterfaceInfo *interfaces[2] = { &dyna_interface_info, NULL };
570
571- return g_memdup (interfaces, 2 * sizeof (void *));
572+ return g_memdup2 (interfaces, 2 * sizeof (void *));
573 }
574
575 static const GDBusInterfaceVTable *
576diff --git a/gio/tests/gsettings.c b/gio/tests/gsettings.c
577index baadca8f5..afe594a23 100644
578--- a/gio/tests/gsettings.c
579+++ b/gio/tests/gsettings.c
580@@ -1,3 +1,4 @@
581+#include <errno.h>
582 #include <stdlib.h>
583 #include <locale.h>
584 #include <libintl.h>
585@@ -1740,6 +1741,14 @@ key_changed_cb (GSettings *settings, const gchar *key, gpointer data)
586 (*b) = TRUE;
587 }
588
589+typedef struct
590+{
591+ const gchar *path;
592+ const gchar *root_group;
593+ const gchar *keyfile_group;
594+ const gchar *root_path;
595+} KeyfileTestData;
596+
597 /*
598 * Test that using a keyfile works
599 */
600@@ -1834,7 +1843,11 @@ test_keyfile (Fixture *fixture,
601 g_free (str);
602
603 g_settings_set (settings, "farewell", "s", "cheerio");
604-
605+
606+ /* Check that empty keys/groups are not allowed. */
607+ g_assert_false (g_settings_is_writable (settings, ""));
608+ g_assert_false (g_settings_is_writable (settings, "/"));
609+
610 /* When executing as root, changing the mode of the keyfile will have
611 * no effect on the writability of the settings.
612 */
613@@ -1866,6 +1879,149 @@ test_keyfile (Fixture *fixture,
614 g_free (keyfile_path);
615 }
616
617+/*
618+ * Test that using a keyfile works with a schema with no path set.
619+ */
620+static void
621+test_keyfile_no_path (Fixture *fixture,
622+ gconstpointer user_data)
623+{
624+ const KeyfileTestData *test_data = user_data;
625+ GSettingsBackend *kf_backend;
626+ GSettings *settings;
627+ GKeyFile *keyfile;
628+ gboolean writable;
629+ gchar *key = NULL;
630+ GError *error = NULL;
631+ gchar *keyfile_path = NULL, *store_path = NULL;
632+
633+ keyfile_path = g_build_filename (fixture->tmp_dir, "keyfile", NULL);
634+ store_path = g_build_filename (keyfile_path, "gsettings.store", NULL);
635+ kf_backend = g_keyfile_settings_backend_new (store_path, test_data->root_path, test_data->root_group);
636+ settings = g_settings_new_with_backend_and_path ("org.gtk.test.no-path", kf_backend, test_data->path);
637+ g_object_unref (kf_backend);
638+
639+ g_settings_reset (settings, "test-boolean");
640+ g_assert_true (g_settings_get_boolean (settings, "test-boolean"));
641+
642+ writable = g_settings_is_writable (settings, "test-boolean");
643+ g_assert_true (writable);
644+ g_settings_set (settings, "test-boolean", "b", FALSE);
645+
646+ g_assert_false (g_settings_get_boolean (settings, "test-boolean"));
647+
648+ g_settings_delay (settings);
649+ g_settings_set (settings, "test-boolean", "b", TRUE);
650+ g_settings_apply (settings);
651+
652+ keyfile = g_key_file_new ();
653+ g_assert_true (g_key_file_load_from_file (keyfile, store_path, 0, NULL));
654+
655+ g_assert_true (g_key_file_get_boolean (keyfile, test_data->keyfile_group, "test-boolean", NULL));
656+
657+ g_key_file_free (keyfile);
658+
659+ g_settings_reset (settings, "test-boolean");
660+ g_settings_apply (settings);
661+ keyfile = g_key_file_new ();
662+ g_assert_true (g_key_file_load_from_file (keyfile, store_path, 0, NULL));
663+
664+ g_assert_false (g_key_file_get_string (keyfile, test_data->keyfile_group, "test-boolean", &error));
665+ g_assert_error (error, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_KEY_NOT_FOUND);
666+ g_clear_error (&error);
667+
668+ /* Check that empty keys/groups are not allowed. */
669+ g_assert_false (g_settings_is_writable (settings, ""));
670+ g_assert_false (g_settings_is_writable (settings, "/"));
671+
672+ /* Keys which ghost the root group name are not allowed. This can only be
673+ * tested when the path is `/` as otherwise it acts as a prefix and prevents
674+ * any ghosting. */
675+ if (g_str_equal (test_data->path, "/"))
676+ {
677+ key = g_strdup_printf ("%s/%s", test_data->root_group, "");
678+ g_assert_false (g_settings_is_writable (settings, key));
679+ g_free (key);
680+
681+ key = g_strdup_printf ("%s/%s", test_data->root_group, "/");
682+ g_assert_false (g_settings_is_writable (settings, key));
683+ g_free (key);
684+
685+ key = g_strdup_printf ("%s/%s", test_data->root_group, "test-boolean");
686+ g_assert_false (g_settings_is_writable (settings, key));
687+ g_free (key);
688+ }
689+
690+ g_key_file_free (keyfile);
691+ g_object_unref (settings);
692+
693+ /* Clean up the temporary directory. */
694+ g_assert_cmpint (g_chmod (keyfile_path, 0777) == 0 ? 0 : errno, ==, 0);
695+ g_assert_cmpint (g_remove (store_path) == 0 ? 0 : errno, ==, 0);
696+ g_assert_cmpint (g_rmdir (keyfile_path) == 0 ? 0 : errno, ==, 0);
697+ g_free (store_path);
698+ g_free (keyfile_path);
699+}
700+
701+/*
702+ * Test that a keyfile rejects writes to keys outside its root path.
703+ */
704+static void
705+test_keyfile_outside_root_path (Fixture *fixture,
706+ gconstpointer user_data)
707+{
708+ GSettingsBackend *kf_backend;
709+ GSettings *settings;
710+ gchar *keyfile_path = NULL, *store_path = NULL;
711+
712+ keyfile_path = g_build_filename (fixture->tmp_dir, "keyfile", NULL);
713+ store_path = g_build_filename (keyfile_path, "gsettings.store", NULL);
714+ kf_backend = g_keyfile_settings_backend_new (store_path, "/tests/basic-types/", "root");
715+ settings = g_settings_new_with_backend_and_path ("org.gtk.test.no-path", kf_backend, "/tests/");
716+ g_object_unref (kf_backend);
717+
718+ g_assert_false (g_settings_is_writable (settings, "test-boolean"));
719+
720+ g_object_unref (settings);
721+
722+ /* Clean up the temporary directory. The keyfile probably doesn’t exist, so
723+ * don’t error on failure. */
724+ g_remove (store_path);
725+ g_assert_cmpint (g_rmdir (keyfile_path) == 0 ? 0 : errno, ==, 0);
726+ g_free (store_path);
727+ g_free (keyfile_path);
728+}
729+
730+/*
731+ * Test that a keyfile rejects writes to keys in the root if no root group is set.
732+ */
733+static void
734+test_keyfile_no_root_group (Fixture *fixture,
735+ gconstpointer user_data)
736+{
737+ GSettingsBackend *kf_backend;
738+ GSettings *settings;
739+ gchar *keyfile_path = NULL, *store_path = NULL;
740+
741+ keyfile_path = g_build_filename (fixture->tmp_dir, "keyfile", NULL);
742+ store_path = g_build_filename (keyfile_path, "gsettings.store", NULL);
743+ kf_backend = g_keyfile_settings_backend_new (store_path, "/", NULL);
744+ settings = g_settings_new_with_backend_and_path ("org.gtk.test.no-path", kf_backend, "/");
745+ g_object_unref (kf_backend);
746+
747+ g_assert_false (g_settings_is_writable (settings, "test-boolean"));
748+ g_assert_true (g_settings_is_writable (settings, "child/test-boolean"));
749+
750+ g_object_unref (settings);
751+
752+ /* Clean up the temporary directory. The keyfile probably doesn’t exist, so
753+ * don’t error on failure. */
754+ g_remove (store_path);
755+ g_assert_cmpint (g_rmdir (keyfile_path) == 0 ? 0 : errno, ==, 0);
756+ g_free (store_path);
757+ g_free (keyfile_path);
758+}
759+
760 /* Test that getting child schemas works
761 */
762 static void
763@@ -2844,6 +3000,14 @@ main (int argc, char *argv[])
764 gchar *override_text;
765 gchar *enums;
766 gint result;
767+ const KeyfileTestData keyfile_test_data_explicit_path = { "/tests/", "root", "tests", "/" };
768+ const KeyfileTestData keyfile_test_data_empty_path = { "/", "root", "root", "/" };
769+ const KeyfileTestData keyfile_test_data_long_path = {
770+ "/tests/path/is/very/long/and/this/makes/some/comparisons/take/a/different/branch/",
771+ "root",
772+ "tests/path/is/very/long/and/this/makes/some/comparisons/take/a/different/branch",
773+ "/"
774+ };
775
776 /* Meson build sets this */
777 #ifdef TEST_LOCALE_PATH
778@@ -2967,6 +3131,11 @@ main (int argc, char *argv[])
779 }
780
781 g_test_add ("/gsettings/keyfile", Fixture, NULL, setup, test_keyfile, teardown);
782+ g_test_add ("/gsettings/keyfile/explicit-path", Fixture, &keyfile_test_data_explicit_path, setup, test_keyfile_no_path, teardown);
783+ g_test_add ("/gsettings/keyfile/empty-path", Fixture, &keyfile_test_data_empty_path, setup, test_keyfile_no_path, teardown);
784+ g_test_add ("/gsettings/keyfile/long-path", Fixture, &keyfile_test_data_long_path, setup, test_keyfile_no_path, teardown);
785+ g_test_add ("/gsettings/keyfile/outside-root-path", Fixture, NULL, setup, test_keyfile_outside_root_path, teardown);
786+ g_test_add ("/gsettings/keyfile/no-root-group", Fixture, NULL, setup, test_keyfile_no_root_group, teardown);
787 g_test_add_func ("/gsettings/child-schema", test_child_schema);
788 g_test_add_func ("/gsettings/strinfo", test_strinfo);
789 g_test_add_func ("/gsettings/enums", test_enums);
790diff --git a/gio/tests/tls-interaction.c b/gio/tests/tls-interaction.c
791index 4f0737d7e..5661e8e0d 100644
792--- a/gio/tests/tls-interaction.c
793+++ b/gio/tests/tls-interaction.c
794@@ -174,6 +174,38 @@ test_interaction_ask_password_finish_failure (GTlsInteraction *interaction,
795 }
796
797
798+/* Return a copy of @str that is allocated in a silly way, to exercise
799+ * custom free-functions. The returned pointer points to a copy of @str
800+ * in a buffer of the form "BEFORE \0 str \0 AFTER". */
801+static guchar *
802+special_dup (const char *str)
803+{
804+ GString *buf = g_string_new ("BEFORE");
805+ guchar *ret;
806+
807+ g_string_append_c (buf, '\0');
808+ g_string_append (buf, str);
809+ g_string_append_c (buf, '\0');
810+ g_string_append (buf, "AFTER");
811+ ret = (guchar *) g_string_free (buf, FALSE);
812+ return ret + strlen ("BEFORE") + 1;
813+}
814+
815+
816+/* Free a copy of @str that was made with special_dup(), after asserting
817+ * that it has not been corrupted. */
818+static void
819+special_free (gpointer p)
820+{
821+ gchar *s = p;
822+ gchar *buf = s - strlen ("BEFORE") - 1;
823+
824+ g_assert_cmpstr (buf, ==, "BEFORE");
825+ g_assert_cmpstr (s + strlen (s) + 1, ==, "AFTER");
826+ g_free (buf);
827+}
828+
829+
830 static GTlsInteractionResult
831 test_interaction_ask_password_sync_success (GTlsInteraction *interaction,
832 GTlsPassword *password,
833@@ -181,6 +213,8 @@ test_interaction_ask_password_sync_success (GTlsInteraction *interaction,
834 GError **error)
835 {
836 TestInteraction *self;
837+ const guchar *value;
838+ gsize len;
839
840 g_assert (TEST_IS_INTERACTION (interaction));
841 self = TEST_INTERACTION (interaction);
842@@ -192,6 +226,27 @@ test_interaction_ask_password_sync_success (GTlsInteraction *interaction,
843 g_assert (error != NULL);
844 g_assert (*error == NULL);
845
846+ /* Exercise different ways to set the value */
847+ g_tls_password_set_value (password, (const guchar *) "foo", 4);
848+ len = 0;
849+ value = g_tls_password_get_value (password, &len);
850+ g_assert_cmpmem (value, len, "foo", 4);
851+
852+ g_tls_password_set_value (password, (const guchar *) "bar", -1);
853+ len = 0;
854+ value = g_tls_password_get_value (password, &len);
855+ g_assert_cmpmem (value, len, "bar", 3);
856+
857+ g_tls_password_set_value_full (password, special_dup ("baa"), 4, special_free);
858+ len = 0;
859+ value = g_tls_password_get_value (password, &len);
860+ g_assert_cmpmem (value, len, "baa", 4);
861+
862+ g_tls_password_set_value_full (password, special_dup ("baz"), -1, special_free);
863+ len = 0;
864+ value = g_tls_password_get_value (password, &len);
865+ g_assert_cmpmem (value, len, "baz", 3);
866+
867 /* Don't do this in real life. Include a null terminator for testing */
868 g_tls_password_set_value (password, (const guchar *)"the password", 13);
869 return G_TLS_INTERACTION_HANDLED;
870diff --git a/gio/win32/gwinhttpfile.c b/gio/win32/gwinhttpfile.c
871index cf5eed31d..246ec0578 100644
872--- a/gio/win32/gwinhttpfile.c
873+++ b/gio/win32/gwinhttpfile.c
874@@ -29,6 +29,7 @@
875 #include "gio/gfile.h"
876 #include "gio/gfileattribute.h"
877 #include "gio/gfileinfo.h"
878+#include "gstrfuncsprivate.h"
879 #include "gwinhttpfile.h"
880 #include "gwinhttpfileinputstream.h"
881 #include "gwinhttpfileoutputstream.h"
882@@ -393,10 +394,10 @@ g_winhttp_file_resolve_relative_path (GFile *file,
883 child = g_object_new (G_TYPE_WINHTTP_FILE, NULL);
884 child->vfs = winhttp_file->vfs;
885 child->url = winhttp_file->url;
886- child->url.lpszScheme = g_memdup (winhttp_file->url.lpszScheme, (winhttp_file->url.dwSchemeLength+1)*2);
887- child->url.lpszHostName = g_memdup (winhttp_file->url.lpszHostName, (winhttp_file->url.dwHostNameLength+1)*2);
888- child->url.lpszUserName = g_memdup (winhttp_file->url.lpszUserName, (winhttp_file->url.dwUserNameLength+1)*2);
889- child->url.lpszPassword = g_memdup (winhttp_file->url.lpszPassword, (winhttp_file->url.dwPasswordLength+1)*2);
890+ child->url.lpszScheme = g_memdup2 (winhttp_file->url.lpszScheme, ((gsize) winhttp_file->url.dwSchemeLength + 1) * 2);
891+ child->url.lpszHostName = g_memdup2 (winhttp_file->url.lpszHostName, ((gsize) winhttp_file->url.dwHostNameLength + 1) * 2);
892+ child->url.lpszUserName = g_memdup2 (winhttp_file->url.lpszUserName, ((gsize) winhttp_file->url.dwUserNameLength + 1) * 2);
893+ child->url.lpszPassword = g_memdup2 (winhttp_file->url.lpszPassword, ((gsize) winhttp_file->url.dwPasswordLength + 1) * 2);
894 child->url.lpszUrlPath = wnew_path;
895 child->url.dwUrlPathLength = wcslen (wnew_path);
896 child->url.lpszExtraInfo = NULL;
897diff --git a/glib/gbytes.c b/glib/gbytes.c
898index ec6923188..6f17d104c 100644
899--- a/glib/gbytes.c
900+++ b/glib/gbytes.c
901@@ -34,6 +34,8 @@
902
903 #include <string.h>
904
905+#include "gstrfuncsprivate.h"
906+
907 /**
908 * GBytes:
909 *
910@@ -95,7 +97,7 @@ g_bytes_new (gconstpointer data,
911 {
912 g_return_val_if_fail (data != NULL || size == 0, NULL);
913
914- return g_bytes_new_take (g_memdup (data, size), size);
915+ return g_bytes_new_take (g_memdup2 (data, size), size);
916 }
917
918 /**
919@@ -499,7 +501,7 @@ g_bytes_unref_to_data (GBytes *bytes,
920 * Copy: Non g_malloc (or compatible) allocator, or static memory,
921 * so we have to copy, and then unref.
922 */
923- result = g_memdup (bytes->data, bytes->size);
924+ result = g_memdup2 (bytes->data, bytes->size);
925 *size = bytes->size;
926 g_bytes_unref (bytes);
927 }
928diff --git a/glib/gdir.c b/glib/gdir.c
929index 6b85e99c8..6747a8c6f 100644
930--- a/glib/gdir.c
931+++ b/glib/gdir.c
932@@ -37,6 +37,7 @@
933 #include "gconvert.h"
934 #include "gfileutils.h"
935 #include "gstrfuncs.h"
936+#include "gstrfuncsprivate.h"
937 #include "gtestutils.h"
938 #include "glibintl.h"
939
940@@ -112,7 +113,7 @@ g_dir_open_with_errno (const gchar *path,
941 return NULL;
942 #endif
943
944- return g_memdup (&dir, sizeof dir);
945+ return g_memdup2 (&dir, sizeof dir);
946 }
947
948 /**
949diff --git a/glib/ghash.c b/glib/ghash.c
950index 0f1562a06..c1e15c957 100644
951--- a/glib/ghash.c
952+++ b/glib/ghash.c
953@@ -34,6 +34,7 @@
954 #include "gmacros.h"
955 #include "glib-private.h"
956 #include "gstrfuncs.h"
957+#include "gstrfuncsprivate.h"
958 #include "gatomic.h"
959 #include "gtestutils.h"
960 #include "gslice.h"
961@@ -962,7 +963,7 @@ g_hash_table_ensure_keyval_fits (GHashTable *hash_table, gpointer key, gpointer
962 if (hash_table->have_big_keys)
963 {
964 if (key != value)
965- hash_table->values = g_memdup (hash_table->keys, sizeof (gpointer) * hash_table->size);
966+ hash_table->values = g_memdup2 (hash_table->keys, sizeof (gpointer) * hash_table->size);
967 /* Keys and values are both big now, so no need for further checks */
968 return;
969 }
970@@ -970,7 +971,7 @@ g_hash_table_ensure_keyval_fits (GHashTable *hash_table, gpointer key, gpointer
971 {
972 if (key != value)
973 {
974- hash_table->values = g_memdup (hash_table->keys, sizeof (guint) * hash_table->size);
975+ hash_table->values = g_memdup2 (hash_table->keys, sizeof (guint) * hash_table->size);
976 is_a_set = FALSE;
977 }
978 }
979@@ -998,7 +999,7 @@ g_hash_table_ensure_keyval_fits (GHashTable *hash_table, gpointer key, gpointer
980
981 /* Just split if necessary */
982 if (is_a_set && key != value)
983- hash_table->values = g_memdup (hash_table->keys, sizeof (gpointer) * hash_table->size);
984+ hash_table->values = g_memdup2 (hash_table->keys, sizeof (gpointer) * hash_table->size);
985
986 #endif
987 }
988diff --git a/glib/giochannel.c b/glib/giochannel.c
989index d16399846..b41381d38 100644
990--- a/glib/giochannel.c
991+++ b/glib/giochannel.c
992@@ -37,6 +37,7 @@
993 #include "giochannel.h"
994
995 #include "gstrfuncs.h"
996+#include "gstrfuncsprivate.h"
997 #include "gtestutils.h"
998 #include "glibintl.h"
999
1000@@ -886,17 +887,26 @@ g_io_channel_set_line_term (GIOChannel *channel,
1001 const gchar *line_term,
1002 gint length)
1003 {
1004+ guint length_unsigned;
1005+
1006 g_return_if_fail (channel != NULL);
1007 g_return_if_fail (line_term == NULL || length != 0); /* Disallow "" */
1008
1009 if (line_term == NULL)
1010- length = 0;
1011- else if (length < 0)
1012- length = strlen (line_term);
1013+ length_unsigned = 0;
1014+ else if (length >= 0)
1015+ length_unsigned = (guint) length;
1016+ else
1017+ {
1018+ /* FIXME: We’re constrained by line_term_len being a guint here */
1019+ gsize length_size = strlen (line_term);
1020+ g_return_if_fail (length_size <= G_MAXUINT);
1021+ length_unsigned = (guint) length_size;
1022+ }
1023
1024 g_free (channel->line_term);
1025- channel->line_term = line_term ? g_memdup (line_term, length) : NULL;
1026- channel->line_term_len = length;
1027+ channel->line_term = line_term ? g_memdup2 (line_term, length_unsigned) : NULL;
1028+ channel->line_term_len = length_unsigned;
1029 }
1030
1031 /**
1032@@ -1673,10 +1683,10 @@ g_io_channel_read_line (GIOChannel *channel,
1033
1034 /* Copy the read bytes (including any embedded nuls) and nul-terminate.
1035 * `USE_BUF (channel)->str` is guaranteed to be nul-terminated as it’s a
1036- * #GString, so it’s safe to call g_memdup() with +1 length to allocate
1037+ * #GString, so it’s safe to call g_memdup2() with +1 length to allocate
1038 * a nul-terminator. */
1039 g_assert (USE_BUF (channel));
1040- line = g_memdup (USE_BUF (channel)->str, got_length + 1);
1041+ line = g_memdup2 (USE_BUF (channel)->str, got_length + 1);
1042 line[got_length] = '\0';
1043 *str_return = g_steal_pointer (&line);
1044 g_string_erase (USE_BUF (channel), 0, got_length);
1045diff --git a/glib/gslice.c b/glib/gslice.c
1046index 4c758c3be..bcdbb8853 100644
1047--- a/glib/gslice.c
1048+++ b/glib/gslice.c
1049@@ -41,6 +41,7 @@
1050 #include "gmain.h"
1051 #include "gmem.h" /* gslice.h */
1052 #include "gstrfuncs.h"
1053+#include "gstrfuncsprivate.h"
1054 #include "gutils.h"
1055 #include "gtrashstack.h"
1056 #include "gtestutils.h"
1057@@ -350,7 +351,7 @@ g_slice_get_config_state (GSliceConfig ckey,
1058 array[i++] = allocator->contention_counters[address];
1059 array[i++] = allocator_get_magazine_threshold (allocator, address);
1060 *n_values = i;
1061- return g_memdup (array, sizeof (array[0]) * *n_values);
1062+ return g_memdup2 (array, sizeof (array[0]) * *n_values);
1063 default:
1064 return NULL;
1065 }
1066diff --git a/glib/gstrfuncsprivate.h b/glib/gstrfuncsprivate.h
1067new file mode 100644
1068index 000000000..85c88328a
1069--- /dev/null
1070+++ b/glib/gstrfuncsprivate.h
1071@@ -0,0 +1,55 @@
1072+/* GLIB - Library of useful routines for C programming
1073+ * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
1074+ *
1075+ * This library is free software; you can redistribute it and/or
1076+ * modify it under the terms of the GNU Lesser General Public
1077+ * License as published by the Free Software Foundation; either
1078+ * version 2.1 of the License, or (at your option) any later version.
1079+ *
1080+ * This library is distributed in the hope that it will be useful,
1081+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
1082+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1083+ * Lesser General Public License for more details.
1084+ *
1085+ * You should have received a copy of the GNU Lesser General Public
1086+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
1087+ */
1088+
1089+#include <glib.h>
1090+#include <string.h>
1091+
1092+/*
1093+ * g_memdup2:
1094+ * @mem: (nullable): the memory to copy.
1095+ * @byte_size: the number of bytes to copy.
1096+ *
1097+ * Allocates @byte_size bytes of memory, and copies @byte_size bytes into it
1098+ * from @mem. If @mem is %NULL it returns %NULL.
1099+ *
1100+ * This replaces g_memdup(), which was prone to integer overflows when
1101+ * converting the argument from a #gsize to a #guint.
1102+ *
1103+ * This static inline version is a backport of the new public API from
1104+ * GLib 2.68, kept internal to GLib for backport to older stable releases.
1105+ * See https://gitlab.gnome.org/GNOME/glib/-/issues/2319.
1106+ *
1107+ * Returns: (nullable): a pointer to the newly-allocated copy of the memory,
1108+ * or %NULL if @mem is %NULL.
1109+ * Since: 2.68
1110+ */
1111+static inline gpointer
1112+g_memdup2 (gconstpointer mem,
1113+ gsize byte_size)
1114+{
1115+ gpointer new_mem;
1116+
1117+ if (mem && byte_size != 0)
1118+ {
1119+ new_mem = g_malloc (byte_size);
1120+ memcpy (new_mem, mem, byte_size);
1121+ }
1122+ else
1123+ new_mem = NULL;
1124+
1125+ return new_mem;
1126+}
1127diff --git a/glib/gtestutils.c b/glib/gtestutils.c
1128index 18b117285..26d46ad75 100644
1129--- a/glib/gtestutils.c
1130+++ b/glib/gtestutils.c
1131@@ -49,6 +49,7 @@
1132 #include "gpattern.h"
1133 #include "grand.h"
1134 #include "gstrfuncs.h"
1135+#include "gstrfuncsprivate.h"
1136 #include "gtimer.h"
1137 #include "gslice.h"
1138 #include "gspawn.h"
1139@@ -3803,7 +3804,7 @@ g_test_log_extract (GTestLogBuffer *tbuffer)
1140 if (p <= tbuffer->data->str + mlength)
1141 {
1142 g_string_erase (tbuffer->data, 0, mlength);
1143- tbuffer->msgs = g_slist_prepend (tbuffer->msgs, g_memdup (&msg, sizeof (msg)));
1144+ tbuffer->msgs = g_slist_prepend (tbuffer->msgs, g_memdup2 (&msg, sizeof (msg)));
1145 return TRUE;
1146 }
1147
1148diff --git a/glib/gvariant.c b/glib/gvariant.c
1149index 77d7e746b..ef4257f6d 100644
1150--- a/glib/gvariant.c
1151+++ b/glib/gvariant.c
1152@@ -33,6 +33,7 @@
1153
1154 #include <string.h>
1155
1156+#include "gstrfuncsprivate.h"
1157
1158 /**
1159 * SECTION:gvariant
1160@@ -725,7 +726,7 @@ g_variant_new_variant (GVariant *value)
1161 g_variant_ref_sink (value);
1162
1163 return g_variant_new_from_children (G_VARIANT_TYPE_VARIANT,
1164- g_memdup (&value, sizeof value),
1165+ g_memdup2 (&value, sizeof value),
1166 1, g_variant_is_trusted (value));
1167 }
1168
1169@@ -1229,7 +1230,7 @@ g_variant_new_fixed_array (const GVariantType *element_type,
1170 return NULL;
1171 }
1172
1173- data = g_memdup (elements, n_elements * element_size);
1174+ data = g_memdup2 (elements, n_elements * element_size);
1175 value = g_variant_new_from_data (array_type, data,
1176 n_elements * element_size,
1177 FALSE, g_free, data);
1178@@ -1908,7 +1909,7 @@ g_variant_dup_bytestring (GVariant *value,
1179 if (length)
1180 *length = size;
1181
1182- return g_memdup (original, size + 1);
1183+ return g_memdup2 (original, size + 1);
1184 }
1185
1186 /**
1187diff --git a/glib/gvarianttype.c b/glib/gvarianttype.c
1188index c46f1a2c6..585e29ab2 100644
1189--- a/glib/gvarianttype.c
1190+++ b/glib/gvarianttype.c
1191@@ -28,6 +28,7 @@
1192
1193 #include <string.h>
1194
1195+#include "gstrfuncsprivate.h"
1196
1197 /**
1198 * SECTION:gvarianttype
1199@@ -1181,7 +1182,7 @@ g_variant_type_new_tuple (const GVariantType * const *items,
1200 g_assert (offset < sizeof buffer);
1201 buffer[offset++] = ')';
1202
1203- return (GVariantType *) g_memdup (buffer, offset);
1204+ return (GVariantType *) g_memdup2 (buffer, offset);
1205 }
1206
1207 /**
1208diff --git a/glib/meson.build b/glib/meson.build
1209index 456e0c2a1..2e5cd77bb 100644
1210--- a/glib/meson.build
1211+++ b/glib/meson.build
1212@@ -268,6 +268,7 @@ glib_sources = files(
1213 'gslist.c',
1214 'gstdio.c',
1215 'gstrfuncs.c',
1216+ 'gstrfuncsprivate.h',
1217 'gstring.c',
1218 'gstringchunk.c',
1219 'gtestutils.c',
1220diff --git a/glib/tests/array-test.c b/glib/tests/array-test.c
1221index 1da514a3e..88f22de80 100644
1222--- a/glib/tests/array-test.c
1223+++ b/glib/tests/array-test.c
1224@@ -29,6 +29,8 @@
1225 #include <string.h>
1226 #include "glib.h"
1227
1228+#include "gstrfuncsprivate.h"
1229+
1230 /* Test data to be passed to any function which calls g_array_new(), providing
1231 * the parameters for that call. Most #GArray tests should be repeated for all
1232 * possible values of #ArrayTestData. */
1233@@ -1917,7 +1919,7 @@ byte_array_new_take (void)
1234 GByteArray *gbarray;
1235 guint8 *data;
1236
1237- data = g_memdup ("woooweeewow", 11);
1238+ data = g_memdup2 ("woooweeewow", 11);
1239 gbarray = g_byte_array_new_take (data, 11);
1240 g_assert (gbarray->data == data);
1241 g_assert_cmpuint (gbarray->len, ==, 11);
1242diff --git a/glib/tests/io-channel.c b/glib/tests/io-channel.c
1243index ff53fcef7..4a1b10876 100644
1244--- a/glib/tests/io-channel.c
1245+++ b/glib/tests/io-channel.c
1246@@ -49,8 +49,10 @@ test_read_line_embedded_nuls (void)
1247 channel = g_io_channel_new_file (filename, "r", &local_error);
1248 g_assert_no_error (local_error);
1249
1250- /* Only break on newline characters, not nuls. */
1251- g_io_channel_set_line_term (channel, "\n", 1);
1252+ /* Only break on newline characters, not nuls.
1253+ * Use length -1 here to exercise glib#2323; the case where length > 0
1254+ * is covered in glib/tests/protocol.c. */
1255+ g_io_channel_set_line_term (channel, "\n", -1);
1256 g_io_channel_set_encoding (channel, NULL, &local_error);
1257 g_assert_no_error (local_error);
1258
1259diff --git a/glib/tests/option-context.c b/glib/tests/option-context.c
1260index 149d22353..88d2b80d1 100644
1261--- a/glib/tests/option-context.c
1262+++ b/glib/tests/option-context.c
1263@@ -27,6 +27,8 @@
1264 #include <string.h>
1265 #include <locale.h>
1266
1267+#include "gstrfuncsprivate.h"
1268+
1269 static GOptionEntry main_entries[] = {
1270 { "main-switch", 0, 0,
1271 G_OPTION_ARG_NONE, NULL,
1272@@ -256,7 +258,7 @@ join_stringv (int argc, char **argv)
1273 static char **
1274 copy_stringv (char **argv, int argc)
1275 {
1276- return g_memdup (argv, sizeof (char *) * (argc + 1));
1277+ return g_memdup2 (argv, sizeof (char *) * (argc + 1));
1278 }
1279
1280 static void
1281@@ -2323,7 +2325,7 @@ test_group_parse (void)
1282 g_option_context_add_group (context, group);
1283
1284 argv = split_string ("program --test arg1 -f arg2 --group-test arg3 --frob arg4 -z arg5", &argc);
1285- orig_argv = g_memdup (argv, (argc + 1) * sizeof (char *));
1286+ orig_argv = g_memdup2 (argv, (argc + 1) * sizeof (char *));
1287
1288 retval = g_option_context_parse (context, &argc, &argv, &error);
1289
1290diff --git a/glib/tests/strfuncs.c b/glib/tests/strfuncs.c
1291index e1f9619c7..d968afff9 100644
1292--- a/glib/tests/strfuncs.c
1293+++ b/glib/tests/strfuncs.c
1294@@ -32,6 +32,8 @@
1295 #include <string.h>
1296 #include "glib.h"
1297
1298+#include "gstrfuncsprivate.h"
1299+
1300 #if defined (_MSC_VER) && (_MSC_VER <= 1800)
1301 #define isnan(x) _isnan(x)
1302
1303@@ -219,6 +221,26 @@ test_memdup (void)
1304 g_free (str_dup);
1305 }
1306
1307+/* Testing g_memdup2() function with various positive and negative cases */
1308+static void
1309+test_memdup2 (void)
1310+{
1311+ gchar *str_dup = NULL;
1312+ const gchar *str = "The quick brown fox jumps over the lazy dog";
1313+
1314+ /* Testing negative cases */
1315+ g_assert_null (g_memdup2 (NULL, 1024));
1316+ g_assert_null (g_memdup2 (str, 0));
1317+ g_assert_null (g_memdup2 (NULL, 0));
1318+
1319+ /* Testing normal usage cases */
1320+ str_dup = g_memdup2 (str, strlen (str) + 1);
1321+ g_assert_nonnull (str_dup);
1322+ g_assert_cmpstr (str, ==, str_dup);
1323+
1324+ g_free (str_dup);
1325+}
1326+
1327 /* Testing g_strpcpy() function with various positive and negative cases */
1328 static void
1329 test_stpcpy (void)
1330@@ -2523,6 +2545,7 @@ main (int argc,
1331 g_test_add_func ("/strfuncs/has-prefix", test_has_prefix);
1332 g_test_add_func ("/strfuncs/has-suffix", test_has_suffix);
1333 g_test_add_func ("/strfuncs/memdup", test_memdup);
1334+ g_test_add_func ("/strfuncs/memdup2", test_memdup2);
1335 g_test_add_func ("/strfuncs/stpcpy", test_stpcpy);
1336 g_test_add_func ("/strfuncs/str_match_string", test_str_match_string);
1337 g_test_add_func ("/strfuncs/str_tokenize_and_fold", test_str_tokenize_and_fold);
1338diff --git a/gobject/gsignal.c b/gobject/gsignal.c
1339index 45effa92d..effbfec62 100644
1340--- a/gobject/gsignal.c
1341+++ b/gobject/gsignal.c
1342@@ -28,6 +28,7 @@
1343 #include <signal.h>
1344
1345 #include "gsignal.h"
1346+#include "gstrfuncsprivate.h"
1347 #include "gtype-private.h"
1348 #include "gbsearcharray.h"
1349 #include "gvaluecollector.h"
1350@@ -1809,7 +1810,7 @@ g_signal_newv (const gchar *signal_name,
1351 node->single_va_closure_is_valid = FALSE;
1352 node->flags = signal_flags & G_SIGNAL_FLAGS_MASK;
1353 node->n_params = n_params;
1354- node->param_types = g_memdup (param_types, sizeof (GType) * n_params);
1355+ node->param_types = g_memdup2 (param_types, sizeof (GType) * n_params);
1356 node->return_type = return_type;
1357 node->class_closure_bsa = NULL;
1358 if (accumulator)
1359diff --git a/gobject/gtype.c b/gobject/gtype.c
1360index b5ef2d11e..8d152dccc 100644
1361--- a/gobject/gtype.c
1362+++ b/gobject/gtype.c
1363@@ -33,6 +33,7 @@
1364
1365 #include "glib-private.h"
1366 #include "gconstructor.h"
1367+#include "gstrfuncsprivate.h"
1368
1369 #ifdef G_OS_WIN32
1370 #include <windows.h>
1371@@ -1470,7 +1471,7 @@ type_add_interface_Wm (TypeNode *node,
1372 iholder->next = iface_node_get_holders_L (iface);
1373 iface_node_set_holders_W (iface, iholder);
1374 iholder->instance_type = NODE_TYPE (node);
1375- iholder->info = info ? g_memdup (info, sizeof (*info)) : NULL;
1376+ iholder->info = info ? g_memdup2 (info, sizeof (*info)) : NULL;
1377 iholder->plugin = plugin;
1378
1379 /* create an iface entry for this type */
1380@@ -1731,7 +1732,7 @@ type_iface_retrieve_holder_info_Wm (TypeNode *iface,
1381 INVALID_RECURSION ("g_type_plugin_*", iholder->plugin, NODE_NAME (iface));
1382
1383 check_interface_info_I (iface, instance_type, &tmp_info);
1384- iholder->info = g_memdup (&tmp_info, sizeof (tmp_info));
1385+ iholder->info = g_memdup2 (&tmp_info, sizeof (tmp_info));
1386 }
1387
1388 return iholder; /* we don't modify write lock upon returning NULL */
1389@@ -2016,10 +2017,10 @@ type_iface_vtable_base_init_Wm (TypeNode *iface,
1390 IFaceEntry *pentry = type_lookup_iface_entry_L (pnode, iface);
1391
1392 if (pentry)
1393- vtable = g_memdup (pentry->vtable, iface->data->iface.vtable_size);
1394+ vtable = g_memdup2 (pentry->vtable, iface->data->iface.vtable_size);
1395 }
1396 if (!vtable)
1397- vtable = g_memdup (iface->data->iface.dflt_vtable, iface->data->iface.vtable_size);
1398+ vtable = g_memdup2 (iface->data->iface.dflt_vtable, iface->data->iface.vtable_size);
1399 entry->vtable = vtable;
1400 vtable->g_type = NODE_TYPE (iface);
1401 vtable->g_instance_type = NODE_TYPE (node);
1402diff --git a/gobject/gtypemodule.c b/gobject/gtypemodule.c
1403index 4ecaf8c88..20911fafd 100644
1404--- a/gobject/gtypemodule.c
1405+++ b/gobject/gtypemodule.c
1406@@ -19,6 +19,7 @@
1407
1408 #include <stdlib.h>
1409
1410+#include "gstrfuncsprivate.h"
1411 #include "gtypeplugin.h"
1412 #include "gtypemodule.h"
1413
1414@@ -436,7 +437,7 @@ g_type_module_register_type (GTypeModule *module,
1415 module_type_info->loaded = TRUE;
1416 module_type_info->info = *type_info;
1417 if (type_info->value_table)
1418- module_type_info->info.value_table = g_memdup (type_info->value_table,
1419+ module_type_info->info.value_table = g_memdup2 (type_info->value_table,
1420 sizeof (GTypeValueTable));
1421
1422 return module_type_info->type;
1423diff --git a/gobject/tests/param.c b/gobject/tests/param.c
1424index 93c3f4b94..0a77e51b7 100644
1425--- a/gobject/tests/param.c
1426+++ b/gobject/tests/param.c
1427@@ -2,6 +2,8 @@
1428 #include <glib-object.h>
1429 #include <stdlib.h>
1430
1431+#include "gstrfuncsprivate.h"
1432+
1433 static void
1434 test_param_value (void)
1435 {
1436@@ -874,7 +876,7 @@ main (int argc, char *argv[])
1437 test_path = g_strdup_printf ("/param/implement/subprocess/%d-%d-%d-%d",
1438 data.change_this_flag, data.change_this_type,
1439 data.use_this_flag, data.use_this_type);
1440- test_data = g_memdup (&data, sizeof (TestParamImplementData));
1441+ test_data = g_memdup2 (&data, sizeof (TestParamImplementData));
1442 g_test_add_data_func_full (test_path, test_data, test_param_implement_child, g_free);
1443 g_free (test_path);
1444 }
diff --git a/meta/recipes-core/glib-2.0/glib-2.0_2.64.5.bb b/meta/recipes-core/glib-2.0/glib-2.0_2.64.5.bb
index b9462bc945..ed7b649dc6 100644
--- a/meta/recipes-core/glib-2.0/glib-2.0_2.64.5.bb
+++ b/meta/recipes-core/glib-2.0/glib-2.0_2.64.5.bb
@@ -18,6 +18,7 @@ SRC_URI = "${GNOME_MIRROR}/glib/${SHRT_VER}/glib-${PV}.tar.xz \
18 file://0001-gio-tests-resources.c-comment-out-a-build-host-only-.patch \ 18 file://0001-gio-tests-resources.c-comment-out-a-build-host-only-.patch \
19 file://tzdata-update.patch \ 19 file://tzdata-update.patch \
20 file://CVE-2020-35457.patch \ 20 file://CVE-2020-35457.patch \
21 file://CVE-2021-27219.patch \
21 " 22 "
22 23
23SRC_URI_append_class-native = " file://relocate-modules.patch" 24SRC_URI_append_class-native = " file://relocate-modules.patch"
diff --git a/meta/recipes-core/glibc/glibc-version.inc b/meta/recipes-core/glibc/glibc-version.inc
index 586b2e207e..84d199bb1d 100644
--- a/meta/recipes-core/glibc/glibc-version.inc
+++ b/meta/recipes-core/glibc/glibc-version.inc
@@ -1,6 +1,6 @@
1SRCBRANCH ?= "release/2.32/master" 1SRCBRANCH ?= "release/2.32/master"
2PV = "2.32" 2PV = "2.32"
3SRCREV_glibc ?= "760e1d287825fa91d4d5a0cc921340c740d803e2" 3SRCREV_glibc ?= "44b395932961a29825da4ad025124a6760858d9c"
4SRCREV_localedef ?= "bd644c9e6f3e20c5504da1488448173c69c56c28" 4SRCREV_localedef ?= "bd644c9e6f3e20c5504da1488448173c69c56c28"
5 5
6GLIBC_GIT_URI ?= "git://sourceware.org/git/glibc.git" 6GLIBC_GIT_URI ?= "git://sourceware.org/git/glibc.git"
diff --git a/meta/recipes-core/glibc/glibc_2.32.bb b/meta/recipes-core/glibc/glibc_2.32.bb
index e4fe9b87b5..03aea52508 100644
--- a/meta/recipes-core/glibc/glibc_2.32.bb
+++ b/meta/recipes-core/glibc/glibc_2.32.bb
@@ -2,7 +2,7 @@ require glibc.inc
2require glibc-version.inc 2require glibc-version.inc
3 3
4# whitelist CVE's with fixes in latest release/2.32/master branch 4# whitelist CVE's with fixes in latest release/2.32/master branch
5CVE_CHECK_WHITELIST += "CVE-2019-25013 CVE-2020-10029 CVE-2020-27618" 5CVE_CHECK_WHITELIST += "CVE-2019-25013 CVE-2020-10029 CVE-2020-27618 CVE-2021-27645 CVE-2021-3326"
6 6
7DEPENDS += "gperf-native bison-native make-native" 7DEPENDS += "gperf-native bison-native make-native"
8 8
diff --git a/meta/recipes-core/images/build-appliance-image_15.0.0.bb b/meta/recipes-core/images/build-appliance-image_15.0.0.bb
index ce73592fd3..9e944a2534 100644
--- a/meta/recipes-core/images/build-appliance-image_15.0.0.bb
+++ b/meta/recipes-core/images/build-appliance-image_15.0.0.bb
@@ -22,9 +22,9 @@ APPEND += "rootfstype=ext4 quiet"
22DEPENDS = "zip-native python3-pip-native" 22DEPENDS = "zip-native python3-pip-native"
23IMAGE_FSTYPES = "wic.vmdk" 23IMAGE_FSTYPES = "wic.vmdk"
24 24
25inherit core-image module-base setuptools3 25inherit core-image setuptools3
26 26
27SRCREV ?= "3bd4bf96cce57d3e9286f75c0f12c8b36d706a1c" 27SRCREV ?= "79c4792da2b400431c09d9a2f53efd4443812281"
28SRC_URI = "git://git.yoctoproject.org/poky;branch=gatesgarth \ 28SRC_URI = "git://git.yoctoproject.org/poky;branch=gatesgarth \
29 file://Yocto_Build_Appliance.vmx \ 29 file://Yocto_Build_Appliance.vmx \
30 file://Yocto_Build_Appliance.vmxf \ 30 file://Yocto_Build_Appliance.vmxf \
@@ -61,12 +61,6 @@ fakeroot do_populate_poky_src () {
61 # Place the README_VirtualBox_Toaster file in builders home folder. 61 # Place the README_VirtualBox_Toaster file in builders home folder.
62 cp ${WORKDIR}/README_VirtualBox_Toaster.txt ${IMAGE_ROOTFS}/home/builder/ 62 cp ${WORKDIR}/README_VirtualBox_Toaster.txt ${IMAGE_ROOTFS}/home/builder/
63 63
64 # Create a symlink, needed for out-of-tree kernel modules build
65 if [ ! -e ${IMAGE_ROOTFS}/lib/modules/${KERNEL_VERSION}/build ]; then
66 rm -f ${IMAGE_ROOTFS}/lib/modules/${KERNEL_VERSION}/build
67 lnr ${IMAGE_ROOTFS}${KERNEL_SRC_PATH} ${IMAGE_ROOTFS}/lib/modules/${KERNEL_VERSION}/build
68 fi
69
70 echo "INHERIT += \"rm_work\"" >> ${IMAGE_ROOTFS}/home/builder/poky/build/conf/auto.conf 64 echo "INHERIT += \"rm_work\"" >> ${IMAGE_ROOTFS}/home/builder/poky/build/conf/auto.conf
71 echo "export LC_ALL=en_US.utf8" >> ${IMAGE_ROOTFS}/home/builder/.bashrc 65 echo "export LC_ALL=en_US.utf8" >> ${IMAGE_ROOTFS}/home/builder/.bashrc
72 66
diff --git a/meta/recipes-core/meta/cve-update-db-native.bb b/meta/recipes-core/meta/cve-update-db-native.bb
index cf62e1e32c..b073936298 100644
--- a/meta/recipes-core/meta/cve-update-db-native.bb
+++ b/meta/recipes-core/meta/cve-update-db-native.bb
@@ -138,14 +138,24 @@ def parse_node_and_insert(c, node, cveId):
138 for cpe in node.get('cpe_match', ()): 138 for cpe in node.get('cpe_match', ()):
139 if not cpe['vulnerable']: 139 if not cpe['vulnerable']:
140 return 140 return
141 cpe23 = cpe['cpe23Uri'].split(':') 141 cpe23 = cpe.get('cpe23Uri')
142 if not cpe23:
143 return
144 cpe23 = cpe23.split(':')
145 if len(cpe23) < 6:
146 return
142 vendor = cpe23[3] 147 vendor = cpe23[3]
143 product = cpe23[4] 148 product = cpe23[4]
144 version = cpe23[5] 149 version = cpe23[5]
145 150
151 if cpe23[6] == '*' or cpe23[6] == '-':
152 version_suffix = ""
153 else:
154 version_suffix = "_" + cpe23[6]
155
146 if version != '*' and version != '-': 156 if version != '*' and version != '-':
147 # Version is defined, this is a '=' match 157 # Version is defined, this is a '=' match
148 yield [cveId, vendor, product, version, '=', '', ''] 158 yield [cveId, vendor, product, version + version_suffix, '=', '', '']
149 elif version == '-': 159 elif version == '-':
150 # no version information is available 160 # no version information is available
151 yield [cveId, vendor, product, version, '', '', ''] 161 yield [cveId, vendor, product, version, '', '', '']
diff --git a/meta/recipes-core/systemd/systemd-conf/wired.network b/meta/recipes-core/systemd/systemd-conf/wired.network
index dcf3534596..06d00ea1ba 100644
--- a/meta/recipes-core/systemd/systemd-conf/wired.network
+++ b/meta/recipes-core/systemd/systemd-conf/wired.network
@@ -1,6 +1,7 @@
1[Match] 1[Match]
2Name=en* eth* 2Name=en* eth*
3KernelCommandLine=!nfsroot 3KernelCommandLine=!nfsroot
4KernelCommandLine=!ip
4 5
5[Network] 6[Network]
6DHCP=yes 7DHCP=yes
diff --git a/meta/recipes-core/systemd/systemd-conf_246.9.bb b/meta/recipes-core/systemd/systemd-conf_246.9.bb
index d9ec023bfd..9b797a91f4 100644
--- a/meta/recipes-core/systemd/systemd-conf_246.9.bb
+++ b/meta/recipes-core/systemd/systemd-conf_246.9.bb
@@ -23,9 +23,6 @@ do_install() {
23# Based on change from YP bug 8141, OE commit 5196d7bacaef1076c361adaa2867be31759c1b52 23# Based on change from YP bug 8141, OE commit 5196d7bacaef1076c361adaa2867be31759c1b52
24do_install_append_qemuall() { 24do_install_append_qemuall() {
25 install -D -m0644 ${WORKDIR}/system.conf-qemuall ${D}${systemd_unitdir}/system.conf.d/01-${PN}.conf 25 install -D -m0644 ${WORKDIR}/system.conf-qemuall ${D}${systemd_unitdir}/system.conf.d/01-${PN}.conf
26
27 # Do not install wired.network for qemu bsps
28 rm -rf ${D}${systemd_unitdir}/network
29} 26}
30 27
31PACKAGE_ARCH = "${MACHINE_ARCH}" 28PACKAGE_ARCH = "${MACHINE_ARCH}"
diff --git a/meta/recipes-core/systemd/systemd_246.9.bb b/meta/recipes-core/systemd/systemd_246.9.bb
index daee795cc2..6524b8216a 100644
--- a/meta/recipes-core/systemd/systemd_246.9.bb
+++ b/meta/recipes-core/systemd/systemd_246.9.bb
@@ -135,7 +135,7 @@ PACKAGECONFIG[hibernate] = "-Dhibernate=true,-Dhibernate=false"
135PACKAGECONFIG[hostnamed] = "-Dhostnamed=true,-Dhostnamed=false" 135PACKAGECONFIG[hostnamed] = "-Dhostnamed=true,-Dhostnamed=false"
136PACKAGECONFIG[idn] = "-Didn=true,-Didn=false" 136PACKAGECONFIG[idn] = "-Didn=true,-Didn=false"
137PACKAGECONFIG[ima] = "-Dima=true,-Dima=false" 137PACKAGECONFIG[ima] = "-Dima=true,-Dima=false"
138# importd requires curl/xz/zlib/bzip2/gcrypt 138# importd requires journal-upload/xz/zlib/bzip2/gcrypt
139PACKAGECONFIG[importd] = "-Dimportd=true,-Dimportd=false" 139PACKAGECONFIG[importd] = "-Dimportd=true,-Dimportd=false"
140# Update NAT firewall rules 140# Update NAT firewall rules
141PACKAGECONFIG[iptc] = "-Dlibiptc=true,-Dlibiptc=false,iptables" 141PACKAGECONFIG[iptc] = "-Dlibiptc=true,-Dlibiptc=false,iptables"
diff --git a/meta/recipes-devtools/binutils/binutils-2.35.1.inc b/meta/recipes-devtools/binutils/binutils-2.35.1.inc
index 775af2b8f2..6290d5b191 100644
--- a/meta/recipes-devtools/binutils/binutils-2.35.1.inc
+++ b/meta/recipes-devtools/binutils/binutils-2.35.1.inc
@@ -44,5 +44,6 @@ SRC_URI = "\
44 file://0017-gas-improve-reproducibility-for-stabs-debugging-data.patch \ 44 file://0017-gas-improve-reproducibility-for-stabs-debugging-data.patch \
45 file://0001-aarch64-Return-an-error-on-conditional-branch-to-an-.patch \ 45 file://0001-aarch64-Return-an-error-on-conditional-branch-to-an-.patch \
46 file://CVE-2020-35448.patch \ 46 file://CVE-2020-35448.patch \
47 file://0001-gold-ensure-file_counts_lock-is-initialized-before-u.patch \
47" 48"
48S = "${WORKDIR}/git" 49S = "${WORKDIR}/git"
diff --git a/meta/recipes-devtools/binutils/binutils/0001-gold-ensure-file_counts_lock-is-initialized-before-u.patch b/meta/recipes-devtools/binutils/binutils/0001-gold-ensure-file_counts_lock-is-initialized-before-u.patch
new file mode 100644
index 0000000000..f46415f440
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils/0001-gold-ensure-file_counts_lock-is-initialized-before-u.patch
@@ -0,0 +1,41 @@
1From de24fc96bf24fca470a9ca13176ad9ad9cc4d5a9 Mon Sep 17 00:00:00 2001
2From: Nick Gasson <nick.gasson@arm.com>
3Date: Mon, 2 Nov 2020 12:02:05 +0800
4Subject: [PATCH] gold: ensure file_counts_lock is initialized before using
5
6Since upgrading to binutils 2.35 I've been experiencing random memory
7corruption related crashes with ld.gold --threads. It's caused by
8multiple threads concurrently pushing elements onto the shared
9std::vector in File_read::record_file_read(). This vector is supposed to
10be protected by file_counts_lock, but that is initialized lazily and
11might be NULL when File_read::open() is called, in which case
12Hold_optional_lock silently skips locking it.
13
14Fix by calling the initialize() method before attempting to acquire the
15lock, the same as other places that use file_counts_lock.
16
17 PR 26827
18 * fileread.cc (File_read::open): Ensure file_counts_lock is
19 initialized.
20 * testsuite/Makefile.am (check_PROGRAMS): Add a test that passes
21 -Wl,--threads.
22 * testsuite/Makefile.in: Regenerate.
23
24Upstream-Status: Backport [af61e84fd2d from 2.36.0]
25Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
26---
27 gold/fileread.cc | 1 +
28 1 file changed, 1 insertion(+)
29
30diff --git a/gold/fileread.cc b/gold/fileread.cc
31index f5ca719360d..0b5228e2afd 100644
32--- a/gold/fileread.cc
33+++ b/gold/fileread.cc
34@@ -212,6 +212,7 @@ File_read::open(const Task* task, const std::string& name)
35 gold_debug(DEBUG_FILES, "Attempt to open %s succeeded",
36 this->name_.c_str());
37 this->token_.add_writer(task);
38+ file_counts_initialize_lock.initialize();
39 Hold_optional_lock hl(file_counts_lock);
40 record_file_read(this->name_);
41 }
diff --git a/meta/recipes-devtools/gcc/gcc-sanitizers.inc b/meta/recipes-devtools/gcc/gcc-sanitizers.inc
index 668e14a59f..9e643ee277 100644
--- a/meta/recipes-devtools/gcc/gcc-sanitizers.inc
+++ b/meta/recipes-devtools/gcc/gcc-sanitizers.inc
@@ -35,6 +35,11 @@ do_compile () {
35do_install () { 35do_install () {
36 cd ${B}/${TARGET_SYS}/libsanitizer/ 36 cd ${B}/${TARGET_SYS}/libsanitizer/
37 oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/${TARGET_SYS}/libsanitizer/ install 37 oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/${TARGET_SYS}/libsanitizer/ install
38 if [ -d ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include ]; then
39 install -d ${D}${libdir}/${TARGET_SYS}/${BINV}/include
40 mv ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/* ${D}${libdir}/${TARGET_SYS}/${BINV}/include
41 rmdir --ignore-fail-on-non-empty -p ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include
42 fi
38 if [ -d ${D}${infodir} ]; then 43 if [ -d ${D}${infodir} ]; then
39 rmdir --ignore-fail-on-non-empty -p ${D}${infodir} 44 rmdir --ignore-fail-on-non-empty -p ${D}${infodir}
40 fi 45 fi
@@ -109,4 +114,4 @@ FILES_libtsan-dev += "\
109" 114"
110FILES_libtsan-staticdev += "${libdir}/libtsan.a" 115FILES_libtsan-staticdev += "${libdir}/libtsan.a"
111 116
112FILES_${PN} = "${libdir}/*.spec ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/sanitizer/*.h" 117FILES_${PN} = "${libdir}/*.spec ${libdir}/${TARGET_SYS}/${BINV}/include/sanitizer/*.h"
diff --git a/meta/recipes-devtools/git/git.inc b/meta/recipes-devtools/git/git.inc
index 544e23c844..3e78254eec 100644
--- a/meta/recipes-devtools/git/git.inc
+++ b/meta/recipes-devtools/git/git.inc
@@ -7,7 +7,10 @@ DEPENDS = "openssl curl zlib expat"
7PROVIDES_append_class-native = " git-replacement-native" 7PROVIDES_append_class-native = " git-replacement-native"
8 8
9SRC_URI = "${KERNELORG_MIRROR}/software/scm/git/git-${PV}.tar.gz;name=tarball \ 9SRC_URI = "${KERNELORG_MIRROR}/software/scm/git/git-${PV}.tar.gz;name=tarball \
10 ${KERNELORG_MIRROR}/software/scm/git/git-manpages-${PV}.tar.gz;name=manpages" 10 ${KERNELORG_MIRROR}/software/scm/git/git-manpages-${PV}.tar.gz;name=manpages \
11 file://fixsort.patch \
12 file://CVE-2021-21300.patch \
13"
11 14
12S = "${WORKDIR}/git-${PV}" 15S = "${WORKDIR}/git-${PV}"
13 16
diff --git a/meta/recipes-devtools/git/git/CVE-2021-21300.patch b/meta/recipes-devtools/git/git/CVE-2021-21300.patch
new file mode 100644
index 0000000000..390570fe78
--- /dev/null
+++ b/meta/recipes-devtools/git/git/CVE-2021-21300.patch
@@ -0,0 +1,304 @@
1From ba07d31bd2140190c4d8c197c9b8a503544b4c29 Mon Sep 17 00:00:00 2001
2From: Minjae Kim <flowrgom@gmail.com>
3Date: Sat, 27 Mar 2021 14:05:56 +0900
4Subject: [PATCH] checkout: fix bug that makes checkout follow symlinks in
5 leading path
6
7Before checking out a file, we have to confirm that all of its leading
8components are real existing directories. And to reduce the number of
9lstat() calls in this process, we cache the last leading path known to
10contain only directories. However, when a path collision occurs (e.g.
11when checking out case-sensitive files in case-insensitive file
12systems), a cached path might have its file type changed on disk,
13leaving the cache on an invalid state. Normally, this doesn't bring
14any bad consequences as we usually check out files in index order, and
15therefore, by the time the cached path becomes outdated, we no longer
16need it anyway (because all files in that directory would have already
17been written).
18
19But, there are some users of the checkout machinery that do not always
20follow the index order. In particular: checkout-index writes the paths
21in the same order that they appear on the CLI (or stdin); and the
22delayed checkout feature -- used when a long-running filter process
23replies with "status=delayed" -- postpones the checkout of some entries,
24thus modifying the checkout order.
25
26When we have to check out an out-of-order entry and the lstat() cache is
27invalid (due to a previous path collision), checkout_entry() may end up
28using the invalid data and thrusting that the leading components are
29real directories when, in reality, they are not. In the best case
30scenario, where the directory was replaced by a regular file, the user
31will get an error: "fatal: unable to create file 'foo/bar': Not a
32directory". But if the directory was replaced by a symlink, checkout
33could actually end up following the symlink and writing the file at a
34wrong place, even outside the repository. Since delayed checkout is
35affected by this bug, it could be used by an attacker to write
36arbitrary files during the clone of a maliciously crafted repository.
37
38Some candidate solutions considered were to disable the lstat() cache
39during unordered checkouts or sort the entries before passing them to
40the checkout machinery. But both ideas include some performance penalty
41and they don't future-proof the code against new unordered use cases.
42
43Instead, we now manually reset the lstat cache whenever we successfully
44remove a directory. Note: We are not even checking whether the directory
45was the same as the lstat cache points to because we might face a
46scenario where the paths refer to the same location but differ due to
47case folding, precomposed UTF-8 issues, or the presence of `..`
48components in the path. Two regression tests, with case-collisions and
49utf8-collisions, are also added for both checkout-index and delayed
50checkout.
51
52Note: to make the previously mentioned clone attack unfeasible, it would
53be sufficient to reset the lstat cache only after the remove_subtree()
54call inside checkout_entry(). This is the place where we would remove a
55directory whose path collides with the path of another entry that we are
56currently trying to check out (possibly a symlink). However, in the
57interest of a thorough fix that does not leave Git open to
58similar-but-not-identical attack vectors, we decided to intercept
59all `rmdir()` calls in one fell swoop.
60
61This addresses CVE-2021-21300.
62
63Co-authored-by: Johannes Schindelin <johannes.schindelin@gmx.de>
64Signed-off-by: Matheus Tavares <matheus.bernardino@usp.br>
65
66Upstream-Status: Acepted [https://github.com/git/git/commit/684dd4c2b414bcf648505e74498a608f28de4592]
67CVE: CVE-2021-21300
68Signed-off-by: Minjae Kim <flowergom@gmail.com>
69---
70 cache.h | 1 +
71 compat/mingw.c | 2 ++
72 git-compat-util.h | 5 +++++
73 symlinks.c | 24 ++++++++++++++++++++
74 t/t0021-conversion.sh | 39 ++++++++++++++++++++++++++++++++
75 t/t0021/rot13-filter.pl | 21 ++++++++++++++---
76 t/t2006-checkout-index-basic.sh | 40 +++++++++++++++++++++++++++++++++
77 7 files changed, 129 insertions(+), 3 deletions(-)
78
79diff --git a/cache.h b/cache.h
80index 6544264..64226c3 100644
81--- a/cache.h
82+++ b/cache.h
83@@ -1733,6 +1733,7 @@ int has_symlink_leading_path(const char *name, int len);
84 int threaded_has_symlink_leading_path(struct cache_def *, const char *, int);
85 int check_leading_path(const char *name, int len);
86 int has_dirs_only_path(const char *name, int len, int prefix_len);
87+extern void invalidate_lstat_cache(void);
88 void schedule_dir_for_removal(const char *name, int len);
89 void remove_scheduled_dirs(void);
90
91diff --git a/compat/mingw.c b/compat/mingw.c
92index 8ee0b64..be2b88e 100644
93--- a/compat/mingw.c
94+++ b/compat/mingw.c
95@@ -364,6 +364,8 @@ int mingw_rmdir(const char *pathname)
96 ask_yes_no_if_possible("Deletion of directory '%s' failed. "
97 "Should I try again?", pathname))
98 ret = _wrmdir(wpathname);
99+ if (!ret)
100+ invalidate_lstat_cache();
101 return ret;
102 }
103
104diff --git a/git-compat-util.h b/git-compat-util.h
105index 5637114..d983853 100644
106--- a/git-compat-util.h
107+++ b/git-compat-util.h
108@@ -345,6 +345,11 @@ static inline int noop_core_config(const char *var, const char *value, void *cb)
109 #define platform_core_config noop_core_config
110 #endif
111
112+int lstat_cache_aware_rmdir(const char *path);
113+#if !defined(__MINGW32__) && !defined(_MSC_VER)
114+#define rmdir lstat_cache_aware_rmdir
115+#endif
116+
117 #ifndef has_dos_drive_prefix
118 static inline int git_has_dos_drive_prefix(const char *path)
119 {
120diff --git a/symlinks.c b/symlinks.c
121index 69d458a..7dbb6b2 100644
122--- a/symlinks.c
123+++ b/symlinks.c
124@@ -267,6 +267,13 @@ int has_dirs_only_path(const char *name, int len, int prefix_len)
125 */
126 static int threaded_has_dirs_only_path(struct cache_def *cache, const char *name, int len, int prefix_len)
127 {
128+ /*
129+ * Note: this function is used by the checkout machinery, which also
130+ * takes care to properly reset the cache when it performs an operation
131+ * that would leave the cache outdated. If this function starts caching
132+ * anything else besides FL_DIR, remember to also invalidate the cache
133+ * when creating or deleting paths that might be in the cache.
134+ */
135 return lstat_cache(cache, name, len,
136 FL_DIR|FL_FULLPATH, prefix_len) &
137 FL_DIR;
138@@ -321,3 +328,20 @@ void remove_scheduled_dirs(void)
139 {
140 do_remove_scheduled_dirs(0);
141 }
142+
143+void invalidate_lstat_cache(void)
144+{
145+ reset_lstat_cache(&default_cache);
146+}
147+
148+#undef rmdir
149+int lstat_cache_aware_rmdir(const char *path)
150+{
151+ /* Any change in this function must be made also in `mingw_rmdir()` */
152+ int ret = rmdir(path);
153+
154+ if (!ret)
155+ invalidate_lstat_cache();
156+
157+ return ret;
158+}
159diff --git a/t/t0021-conversion.sh b/t/t0021-conversion.sh
160index 4bfffa9..c42f51e 100755
161--- a/t/t0021-conversion.sh
162+++ b/t/t0021-conversion.sh
163@@ -957,4 +957,43 @@ test_expect_success PERL 'invalid file in delayed checkout' '
164 grep "error: external filter .* signaled that .unfiltered. is now available although it has not been delayed earlier" git-stderr.log
165 '
166
167+for mode in 'case' 'utf-8'
168+do
169+ case "$mode" in
170+ case) dir='A' symlink='a' mode_prereq='CASE_INSENSITIVE_FS' ;;
171+ utf-8)
172+ dir=$(printf "\141\314\210") symlink=$(printf "\303\244")
173+ mode_prereq='UTF8_NFD_TO_NFC' ;;
174+ esac
175+
176+ test_expect_success PERL,SYMLINKS,$mode_prereq \
177+ "delayed checkout with $mode-collision don't write to the wrong place" '
178+ test_config_global filter.delay.process \
179+ "\"$TEST_ROOT/rot13-filter.pl\" --always-delay delayed.log clean smudge delay" &&
180+ test_config_global filter.delay.required true &&
181+ git init $mode-collision &&
182+ (
183+ cd $mode-collision &&
184+ mkdir target-dir &&
185+ empty_oid=$(printf "" | git hash-object -w --stdin) &&
186+ symlink_oid=$(printf "%s" "$PWD/target-dir" | git hash-object -w --stdin) &&
187+ attr_oid=$(echo "$dir/z filter=delay" | git hash-object -w --stdin) &&
188+ cat >objs <<-EOF &&
189+ 100644 blob $empty_oid $dir/x
190+ 100644 blob $empty_oid $dir/y
191+ 100644 blob $empty_oid $dir/z
192+ 120000 blob $symlink_oid $symlink
193+ 100644 blob $attr_oid .gitattributes
194+ EOF
195+ git update-index --index-info <objs &&
196+ git commit -m "test commit"
197+ ) &&
198+ git clone $mode-collision $mode-collision-cloned &&
199+ # Make sure z was really delayed
200+ grep "IN: smudge $dir/z .* \\[DELAYED\\]" $mode-collision-cloned/delayed.log &&
201+ # Should not create $dir/z at $symlink/z
202+ test_path_is_missing $mode-collision/target-dir/z
203+ '
204+done
205+
206 test_done
207diff --git a/t/t0021/rot13-filter.pl b/t/t0021/rot13-filter.pl
208index cd32a82..7bb9376 100644
209--- a/t/t0021/rot13-filter.pl
210+++ b/t/t0021/rot13-filter.pl
211@@ -2,9 +2,15 @@
212 # Example implementation for the Git filter protocol version 2
213 # See Documentation/gitattributes.txt, section "Filter Protocol"
214 #
215-# The first argument defines a debug log file that the script write to.
216-# All remaining arguments define a list of supported protocol
217-# capabilities ("clean", "smudge", etc).
218+# Usage: rot13-filter.pl [--always-delay] <log path> <capabilities>
219+#
220+# Log path defines a debug log file that the script writes to. The
221+# subsequent arguments define a list of supported protocol capabilities
222+# ("clean", "smudge", etc).
223+#
224+# When --always-delay is given all pathnames with the "can-delay" flag
225+# that don't appear on the list bellow are delayed with a count of 1
226+# (see more below).
227 #
228 # This implementation supports special test cases:
229 # (1) If data with the pathname "clean-write-fail.r" is processed with
230@@ -53,6 +59,13 @@ sub gitperllib {
231 use Git::Packet;
232
233 my $MAX_PACKET_CONTENT_SIZE = 65516;
234+
235+my $always_delay = 0;
236+if ( $ARGV[0] eq '--always-delay' ) {
237+ $always_delay = 1;
238+ shift @ARGV;
239+}
240+
241 my $log_file = shift @ARGV;
242 my @capabilities = @ARGV;
243
244@@ -134,6 +147,8 @@ sub rot13 {
245 if ( $buffer eq "can-delay=1" ) {
246 if ( exists $DELAY{$pathname} and $DELAY{$pathname}{"requested"} == 0 ) {
247 $DELAY{$pathname}{"requested"} = 1;
248+ } elsif ( !exists $DELAY{$pathname} and $always_delay ) {
249+ $DELAY{$pathname} = { "requested" => 1, "count" => 1 };
250 }
251 } elsif ($buffer =~ /^(ref|treeish|blob)=/) {
252 print $debug " $buffer";
253diff --git a/t/t2006-checkout-index-basic.sh b/t/t2006-checkout-index-basic.sh
254index 57cbdfe..f223a02 100755
255--- a/t/t2006-checkout-index-basic.sh
256+++ b/t/t2006-checkout-index-basic.sh
257@@ -21,4 +21,44 @@ test_expect_success 'checkout-index -h in broken repository' '
258 test_i18ngrep "[Uu]sage" broken/usage
259 '
260
261+for mode in 'case' 'utf-8'
262+do
263+ case "$mode" in
264+ case) dir='A' symlink='a' mode_prereq='CASE_INSENSITIVE_FS' ;;
265+ utf-8)
266+ dir=$(printf "\141\314\210") symlink=$(printf "\303\244")
267+ mode_prereq='UTF8_NFD_TO_NFC' ;;
268+ esac
269+
270+ test_expect_success SYMLINKS,$mode_prereq \
271+ "checkout-index with $mode-collision don't write to the wrong place" '
272+ git init $mode-collision &&
273+ (
274+ cd $mode-collision &&
275+ mkdir target-dir &&
276+ empty_obj_hex=$(git hash-object -w --stdin </dev/null) &&
277+ symlink_hex=$(printf "%s" "$PWD/target-dir" | git hash-object -w --stdin) &&
278+ cat >objs <<-EOF &&
279+ 100644 blob ${empty_obj_hex} ${dir}/x
280+ 100644 blob ${empty_obj_hex} ${dir}/y
281+ 100644 blob ${empty_obj_hex} ${dir}/z
282+ 120000 blob ${symlink_hex} ${symlink}
283+ EOF
284+ git update-index --index-info <objs &&
285+ # Note: the order is important here to exercise the
286+ # case where the file at ${dir} has its type changed by
287+ # the time Git tries to check out ${dir}/z.
288+ #
289+ # Also, we use core.precomposeUnicode=false because we
290+ # want Git to treat the UTF-8 paths transparently on
291+ # Mac OS, matching what is in the index.
292+ #
293+ git -c core.precomposeUnicode=false checkout-index -f \
294+ ${dir}/x ${dir}/y ${symlink} ${dir}/z &&
295+ # Should not create ${dir}/z at ${symlink}/z
296+ test_path_is_missing target-dir/z
297+ )
298+ '
299+done
300+
301 test_done
302--
3032.17.1
304
diff --git a/meta/recipes-devtools/git/git/fixsort.patch b/meta/recipes-devtools/git/git/fixsort.patch
new file mode 100644
index 0000000000..07a487e8ca
--- /dev/null
+++ b/meta/recipes-devtools/git/git/fixsort.patch
@@ -0,0 +1,31 @@
1[PATCH] generate-configlist.sh: Fix determinism issue
2
3Currently git binaries are not entirely reproducible, at least partly
4due to config-list.h differing in order depending on the system's
5locale settings. Under different locales, the entries:
6
7"sendemail.identity",
8"sendemail.<identity>.*",
9
10would differ in order for example and this leads to differences in
11the debug symbols for the binaries.
12
13This can be fixed by specifying the C locale for the sort in the
14shell script generating the header.
15
16Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
17Upstream-Status: Submitted [https://public-inbox.org/git/f029a942dd3d50d85e60bd37d8e454524987842f.camel@linuxfoundation.org/T/#u]
18
19Index: git-2.30.0/generate-configlist.sh
20===================================================================
21--- git-2.30.0.orig/generate-configlist.sh
22+++ git-2.30.0/generate-configlist.sh
23@@ -9,7 +9,7 @@ static const char *config_name_list[] =
24 EOF
25 grep -h '^[a-zA-Z].*\..*::$' Documentation/*config.txt Documentation/config/*.txt |
26 sed '/deprecated/d; s/::$//; s/, */\n/g' |
27- sort |
28+ LC_ALL=C sort |
29 sed 's/^.*$/ "&",/'
30 cat <<EOF
31 NULL,
diff --git a/meta/recipes-devtools/go/go-1.15.inc b/meta/recipes-devtools/go/go-1.15.inc
index abe74e5eb7..7c8190f68c 100644
--- a/meta/recipes-devtools/go/go-1.15.inc
+++ b/meta/recipes-devtools/go/go-1.15.inc
@@ -1,7 +1,7 @@
1require go-common.inc 1require go-common.inc
2 2
3GO_BASEVERSION = "1.15" 3GO_BASEVERSION = "1.15"
4PV = "1.15.6" 4PV = "1.15.8"
5FILESEXTRAPATHS_prepend := "${FILE_DIRNAME}/go-${GO_BASEVERSION}:" 5FILESEXTRAPATHS_prepend := "${FILE_DIRNAME}/go-${GO_BASEVERSION}:"
6 6
7LIC_FILES_CHKSUM = "file://LICENSE;md5=5d4950ecb7b26d2c5e4e7b4e0dd74707" 7LIC_FILES_CHKSUM = "file://LICENSE;md5=5d4950ecb7b26d2c5e4e7b4e0dd74707"
@@ -16,4 +16,4 @@ SRC_URI += "\
16 file://0007-cmd-go-make-GOROOT-precious-by-default.patch \ 16 file://0007-cmd-go-make-GOROOT-precious-by-default.patch \
17 file://0008-use-GOBUILDMODE-to-set-buildmode.patch \ 17 file://0008-use-GOBUILDMODE-to-set-buildmode.patch \
18" 18"
19SRC_URI[main.sha256sum] = "890bba73c5e2b19ffb1180e385ea225059eb008eb91b694875dd86ea48675817" 19SRC_URI[main.sha256sum] = "540c0ab7781084d124991321ed1458e479982de94454a98afab6acadf38497c2"
diff --git a/meta/recipes-devtools/go/go-binary-native_1.15.6.bb b/meta/recipes-devtools/go/go-binary-native_1.15.8.bb
index 622557ad2b..df697e2781 100644
--- a/meta/recipes-devtools/go/go-binary-native_1.15.6.bb
+++ b/meta/recipes-devtools/go/go-binary-native_1.15.8.bb
@@ -8,8 +8,8 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=5d4950ecb7b26d2c5e4e7b4e0dd74707"
8PROVIDES = "go-native" 8PROVIDES = "go-native"
9 9
10SRC_URI = "https://dl.google.com/go/go${PV}.${BUILD_GOOS}-${BUILD_GOARCH}.tar.gz;name=go_${BUILD_GOTUPLE}" 10SRC_URI = "https://dl.google.com/go/go${PV}.${BUILD_GOOS}-${BUILD_GOARCH}.tar.gz;name=go_${BUILD_GOTUPLE}"
11SRC_URI[go_linux_amd64.sha256sum] = "3918e6cc85e7eaaa6f859f1bdbaac772e7a825b0eb423c63d3ae68b21f84b844" 11SRC_URI[go_linux_amd64.sha256sum] = "d3379c32a90fdf9382166f8f48034c459a8cc433730bc9476d39d9082c94583b"
12SRC_URI[go_linux_arm64.sha256sum] = "f87515b9744154ffe31182da9341d0a61eb0795551173d242c8cad209239e492" 12SRC_URI[go_linux_arm64.sha256sum] = "0e31ea4bf53496b0f0809730520dee98c0ae5c530f3701a19df0ba0a327bf3d2"
13 13
14UPSTREAM_CHECK_URI = "https://golang.org/dl/" 14UPSTREAM_CHECK_URI = "https://golang.org/dl/"
15UPSTREAM_CHECK_REGEX = "go(?P<pver>\d+(\.\d+)+)\.linux" 15UPSTREAM_CHECK_REGEX = "go(?P<pver>\d+(\.\d+)+)\.linux"
diff --git a/meta/recipes-devtools/libtool/libtool-2.4.6.inc b/meta/recipes-devtools/libtool/libtool-2.4.6.inc
index 8e17b56d46..19a03d4733 100644
--- a/meta/recipes-devtools/libtool/libtool-2.4.6.inc
+++ b/meta/recipes-devtools/libtool/libtool-2.4.6.inc
@@ -21,6 +21,7 @@ SRC_URI = "${GNU_MIRROR}/libtool/libtool-${PV}.tar.gz \
21 file://unwind-opt-parsing.patch \ 21 file://unwind-opt-parsing.patch \
22 file://0001-libtool-Fix-support-for-NIOS2-processor.patch \ 22 file://0001-libtool-Fix-support-for-NIOS2-processor.patch \
23 file://0001-libtool-Check-for-static-libs-for-internal-compiler-.patch \ 23 file://0001-libtool-Check-for-static-libs-for-internal-compiler-.patch \
24 file://0001-Makefile.am-make-sure-autoheader-run-before-autoconf.patch \
24 " 25 "
25 26
26SRC_URI[md5sum] = "addf44b646ddb4e3919805aa88fa7c5e" 27SRC_URI[md5sum] = "addf44b646ddb4e3919805aa88fa7c5e"
diff --git a/meta/recipes-devtools/libtool/libtool/0001-Makefile.am-make-sure-autoheader-run-before-autoconf.patch b/meta/recipes-devtools/libtool/libtool/0001-Makefile.am-make-sure-autoheader-run-before-autoconf.patch
new file mode 100644
index 0000000000..2e9908725e
--- /dev/null
+++ b/meta/recipes-devtools/libtool/libtool/0001-Makefile.am-make-sure-autoheader-run-before-autoconf.patch
@@ -0,0 +1,35 @@
1From dfbbbd359e43e0a55fbea06f2647279ad8761cb9 Mon Sep 17 00:00:00 2001
2From: Mingli Yu <mingli.yu@windriver.com>
3Date: Wed, 24 Mar 2021 03:04:13 +0000
4Subject: [PATCH] Makefile.am: make sure autoheader run before autoconf
5
6autoheader will update ../libtool-2.4.6/libltdl/config-h.in which
7autoconf needs, so there comes a race sometimes as below:
8 | configure.ac:45: error: required file 'config-h.in' not found
9 | touch '../libtool-2.4.6/libltdl/config-h.in'
10
11So make sure autoheader run before autoconf to avoid this race.
12
13Upstream-Status: Submitted [libtool-patches@gnu.org maillist]
14
15Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
16---
17 Makefile.am | 2 +-
18 1 file changed, 1 insertion(+), 1 deletion(-)
19
20diff --git a/Makefile.am b/Makefile.am
21index 4142c90..fe1a9fc 100644
22--- a/Makefile.am
23+++ b/Makefile.am
24@@ -365,7 +365,7 @@ lt_configure_deps = $(lt_aclocal_m4) $(lt_aclocal_m4_deps)
25 $(lt_aclocal_m4): $(lt_aclocal_m4_deps)
26 $(AM_V_GEN)cd '$(srcdir)/$(ltdl_dir)' && $(ACLOCAL) -I ../m4
27
28-$(lt_configure): $(lt_configure_deps)
29+$(lt_configure): $(lt_configure_deps) $(lt_config_h_in)
30 $(AM_V_GEN)cd '$(srcdir)/$(ltdl_dir)' && $(AUTOCONF)
31
32 $(lt_config_h_in): $(lt_configure_deps)
33--
342.29.2
35
diff --git a/meta/recipes-devtools/mtd/mtd-utils_git.bb b/meta/recipes-devtools/mtd/mtd-utils_git.bb
index 8d6bbfca3f..ff42219513 100644
--- a/meta/recipes-devtools/mtd/mtd-utils_git.bb
+++ b/meta/recipes-devtools/mtd/mtd-utils_git.bb
@@ -42,11 +42,9 @@ ALTERNATIVE_PRIORITY = "100"
42ALTERNATIVE_${PN} = "flashcp flash_eraseall flash_lock flash_unlock nanddump nandwrite" 42ALTERNATIVE_${PN} = "flashcp flash_eraseall flash_lock flash_unlock nanddump nandwrite"
43ALTERNATIVE_${PN}-ubifs = "ubiattach ubidetach ubimkvol ubirename ubirmvol ubirsvol ubiupdatevol" 43ALTERNATIVE_${PN}-ubifs = "ubiattach ubidetach ubimkvol ubirename ubirmvol ubirsvol ubiupdatevol"
44 44
45ALTERNATIVE_LINK_NAME[flash_eraseall] = "${sbindir}/flash_eraseall"
46ALTERNATIVE_LINK_NAME[nandwrite] = "${sbindir}/nandwrite" 45ALTERNATIVE_LINK_NAME[nandwrite] = "${sbindir}/nandwrite"
47ALTERNATIVE_LINK_NAME[nanddump] = "${sbindir}/nanddump" 46ALTERNATIVE_LINK_NAME[nanddump] = "${sbindir}/nanddump"
48ALTERNATIVE_LINK_NAME[ubiattach] = "${sbindir}/ubiattach" 47ALTERNATIVE_LINK_NAME[ubiattach] = "${sbindir}/ubiattach"
49ALTERNATIVE_LINK_NAME[ubiattach] = "${sbindir}/ubiattach"
50ALTERNATIVE_LINK_NAME[ubidetach] = "${sbindir}/ubidetach" 48ALTERNATIVE_LINK_NAME[ubidetach] = "${sbindir}/ubidetach"
51ALTERNATIVE_LINK_NAME[ubimkvol] = "${sbindir}/ubimkvol" 49ALTERNATIVE_LINK_NAME[ubimkvol] = "${sbindir}/ubimkvol"
52ALTERNATIVE_LINK_NAME[ubirename] = "${sbindir}/ubirename" 50ALTERNATIVE_LINK_NAME[ubirename] = "${sbindir}/ubirename"
diff --git a/meta/recipes-devtools/pseudo/pseudo_git.bb b/meta/recipes-devtools/pseudo/pseudo_git.bb
index 17bd02c27c..4eab133128 100644
--- a/meta/recipes-devtools/pseudo/pseudo_git.bb
+++ b/meta/recipes-devtools/pseudo/pseudo_git.bb
@@ -6,7 +6,7 @@ SRC_URI = "git://git.yoctoproject.org/pseudo;branch=oe-core \
6 file://fallback-group \ 6 file://fallback-group \
7 " 7 "
8 8
9SRCREV = "60e25a36558f1f07dcce1a044fe976b475bec42b" 9SRCREV = "ee24ebec9e5a11dd5208c9be2870f35eab3b9e20"
10S = "${WORKDIR}/git" 10S = "${WORKDIR}/git"
11PV = "1.9.0+git${SRCPV}" 11PV = "1.9.0+git${SRCPV}"
12 12
diff --git a/meta/recipes-devtools/python/python3-jinja2_2.11.2.bb b/meta/recipes-devtools/python/python3-jinja2_2.11.2.bb
index 89538d2f27..9d0666a5c1 100644
--- a/meta/recipes-devtools/python/python3-jinja2_2.11.2.bb
+++ b/meta/recipes-devtools/python/python3-jinja2_2.11.2.bb
@@ -7,6 +7,8 @@ SRC_URI[sha256sum] = "89aab215427ef59c34ad58735269eb58b1a5808103067f7bb9d5836c65
7 7
8PYPI_PACKAGE = "Jinja2" 8PYPI_PACKAGE = "Jinja2"
9 9
10CVE_PRODUCT = "jinja2 jinja"
11
10CLEANBROKEN = "1" 12CLEANBROKEN = "1"
11 13
12inherit pypi setuptools3 14inherit pypi setuptools3
diff --git a/meta/recipes-devtools/python/python3/CVE-2021-23336.patch b/meta/recipes-devtools/python/python3/CVE-2021-23336.patch
new file mode 100644
index 0000000000..27893f69fb
--- /dev/null
+++ b/meta/recipes-devtools/python/python3/CVE-2021-23336.patch
@@ -0,0 +1,548 @@
1From e3110c3cfbb7daa690d54d0eff6c264c870a71bf Mon Sep 17 00:00:00 2001
2From: Senthil Kumaran <senthil@uthcode.com>
3Date: Mon, 15 Feb 2021 10:15:02 -0800
4Subject: [PATCH] [3.8] bpo-42967: only use '&' as a query string separator
5 (GH-24297) (#24529)
6MIME-Version: 1.0
7Content-Type: text/plain; charset=UTF-8
8Content-Transfer-Encoding: 8bit
9
10* bpo-42967: only use '&' as a query string separator (#24297)
11
12bpo-42967: [security] Address a web cache-poisoning issue reported in
13urllib.parse.parse_qsl().
14
15urllib.parse will only us "&" as query string separator by default
16instead of both ";" and "&" as allowed in earlier versions. An optional
17argument seperator with default value "&" is added to specify the
18separator.
19
20Co-authored-by: Éric Araujo <merwok@netwok.org>
21Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
22Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
23Co-authored-by: Éric Araujo <merwok@netwok.org>
24(cherry picked from commit fcbe0cb04d35189401c0c880ebfb4311e952d776)
25
26* [3.8] bpo-42967: only use '&' as a query string separator (GH-24297)
27
28bpo-42967: [security] Address a web cache-poisoning issue reported in urllib.parse.parse_qsl().
29
30urllib.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.
31
32Co-authored-by: Éric Araujo <merwok@netwok.org>
33Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
34Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
35Co-authored-by: Éric Araujo <merwok@netwok.org>.
36(cherry picked from commit fcbe0cb04d35189401c0c880ebfb4311e952d776)
37
38Co-authored-by: Adam Goldschmidt <adamgold7@gmail.com>
39
40* Update correct version information.
41
42* fix docs and make logic clearer
43
44Co-authored-by: Adam Goldschmidt <adamgold7@gmail.com>
45Co-authored-by: Fidget-Spinner <28750310+Fidget-Spinner@users.noreply.github.com>
46
47Upstream-Status: Backport [https://github.com/python/cpython/commit/e3110c3cfbb7daa690d54d0eff6c264c870a71bf]
48CVE: CVE-2020-23336
49Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com>
50
51---
52 Doc/library/cgi.rst | 11 ++-
53 Doc/library/urllib.parse.rst | 22 +++++-
54 Doc/whatsnew/3.6.rst | 13 ++++
55 Doc/whatsnew/3.7.rst | 13 ++++
56 Doc/whatsnew/3.8.rst | 13 ++++
57 Lib/cgi.py | 23 ++++---
58 Lib/test/test_cgi.py | 29 ++++++--
59 Lib/test/test_urlparse.py | 68 +++++++++++++------
60 Lib/urllib/parse.py | 19 ++++--
61 .../2021-02-14-15-59-16.bpo-42967.YApqDS.rst | 1 +
62 10 files changed, 166 insertions(+), 46 deletions(-)
63 create mode 100644 Misc/NEWS.d/next/Security/2021-02-14-15-59-16.bpo-42967.YApqDS.rst
64
65diff --git a/Doc/library/cgi.rst b/Doc/library/cgi.rst
66index 4048592e7361f..880074bed6026 100644
67--- a/Doc/library/cgi.rst
68+++ b/Doc/library/cgi.rst
69@@ -277,14 +277,16 @@ These are useful if you want more control, or if you want to employ some of the
70 algorithms implemented in this module in other circumstances.
71
72
73-.. function:: parse(fp=None, environ=os.environ, keep_blank_values=False, strict_parsing=False)
74+.. function:: parse(fp=None, environ=os.environ, keep_blank_values=False, strict_parsing=False, separator="&")
75
76 Parse a query in the environment or from a file (the file defaults to
77- ``sys.stdin``). The *keep_blank_values* and *strict_parsing* parameters are
78+ ``sys.stdin``). The *keep_blank_values*, *strict_parsing* and *separator* parameters are
79 passed to :func:`urllib.parse.parse_qs` unchanged.
80
81+ .. versionchanged:: 3.8.8
82+ Added the *separator* parameter.
83
84-.. function:: parse_multipart(fp, pdict, encoding="utf-8", errors="replace")
85+.. function:: parse_multipart(fp, pdict, encoding="utf-8", errors="replace", separator="&")
86
87 Parse input of type :mimetype:`multipart/form-data` (for file uploads).
88 Arguments are *fp* for the input file, *pdict* for a dictionary containing
89@@ -303,6 +305,9 @@ algorithms implemented in this module in other circumstances.
90 Added the *encoding* and *errors* parameters. For non-file fields, the
91 value is now a list of strings, not bytes.
92
93+ .. versionchanged:: 3.8.8
94+ Added the *separator* parameter.
95+
96
97 .. function:: parse_header(string)
98
99diff --git a/Doc/library/urllib.parse.rst b/Doc/library/urllib.parse.rst
100index 25e5cc1a6ce0b..fcad7076e6c77 100644
101--- a/Doc/library/urllib.parse.rst
102+++ b/Doc/library/urllib.parse.rst
103@@ -165,7 +165,7 @@ or on combining URL components into a URL string.
104 now raise :exc:`ValueError`.
105
106
107-.. function:: parse_qs(qs, keep_blank_values=False, strict_parsing=False, encoding='utf-8', errors='replace', max_num_fields=None)
108+.. function:: parse_qs(qs, keep_blank_values=False, strict_parsing=False, encoding='utf-8', errors='replace', max_num_fields=None, separator='&')
109
110 Parse a query string given as a string argument (data of type
111 :mimetype:`application/x-www-form-urlencoded`). Data are returned as a
112@@ -190,6 +190,9 @@ or on combining URL components into a URL string.
113 read. If set, then throws a :exc:`ValueError` if there are more than
114 *max_num_fields* fields read.
115
116+ The optional argument *separator* is the symbol to use for separating the
117+ query arguments. It defaults to ``&``.
118+
119 Use the :func:`urllib.parse.urlencode` function (with the ``doseq``
120 parameter set to ``True``) to convert such dictionaries into query
121 strings.
122@@ -201,8 +204,14 @@ or on combining URL components into a URL string.
123 .. versionchanged:: 3.8
124 Added *max_num_fields* parameter.
125
126+ .. versionchanged:: 3.8.8
127+ Added *separator* parameter with the default value of ``&``. Python
128+ versions earlier than Python 3.8.8 allowed using both ``;`` and ``&`` as
129+ query parameter separator. This has been changed to allow only a single
130+ separator key, with ``&`` as the default separator.
131+
132
133-.. function:: parse_qsl(qs, keep_blank_values=False, strict_parsing=False, encoding='utf-8', errors='replace', max_num_fields=None)
134+.. function:: parse_qsl(qs, keep_blank_values=False, strict_parsing=False, encoding='utf-8', errors='replace', max_num_fields=None, separator='&')
135
136 Parse a query string given as a string argument (data of type
137 :mimetype:`application/x-www-form-urlencoded`). Data are returned as a list of
138@@ -226,6 +235,9 @@ or on combining URL components into a URL string.
139 read. If set, then throws a :exc:`ValueError` if there are more than
140 *max_num_fields* fields read.
141
142+ The optional argument *separator* is the symbol to use for separating the
143+ query arguments. It defaults to ``&``.
144+
145 Use the :func:`urllib.parse.urlencode` function to convert such lists of pairs into
146 query strings.
147
148@@ -235,6 +247,12 @@ or on combining URL components into a URL string.
149 .. versionchanged:: 3.8
150 Added *max_num_fields* parameter.
151
152+ .. versionchanged:: 3.8.8
153+ Added *separator* parameter with the default value of ``&``. Python
154+ versions earlier than Python 3.8.8 allowed using both ``;`` and ``&`` as
155+ query parameter separator. This has been changed to allow only a single
156+ separator key, with ``&`` as the default separator.
157+
158
159 .. function:: urlunparse(parts)
160
161diff --git a/Doc/whatsnew/3.6.rst b/Doc/whatsnew/3.6.rst
162index 85a6657fdfbda..03a877a3d9178 100644
163--- a/Doc/whatsnew/3.6.rst
164+++ b/Doc/whatsnew/3.6.rst
165@@ -2443,3 +2443,16 @@ because of the behavior of the socket option ``SO_REUSEADDR`` in UDP. For more
166 details, see the documentation for ``loop.create_datagram_endpoint()``.
167 (Contributed by Kyle Stanley, Antoine Pitrou, and Yury Selivanov in
168 :issue:`37228`.)
169+
170+Notable changes in Python 3.6.13
171+================================
172+
173+Earlier Python versions allowed using both ``;`` and ``&`` as
174+query parameter separators in :func:`urllib.parse.parse_qs` and
175+:func:`urllib.parse.parse_qsl`. Due to security concerns, and to conform with
176+newer W3C recommendations, this has been changed to allow only a single
177+separator key, with ``&`` as the default. This change also affects
178+:func:`cgi.parse` and :func:`cgi.parse_multipart` as they use the affected
179+functions internally. For more details, please see their respective
180+documentation.
181+(Contributed by Adam Goldschmidt, Senthil Kumaran and Ken Jin in :issue:`42967`.)
182diff --git a/Doc/whatsnew/3.7.rst b/Doc/whatsnew/3.7.rst
183index 4933cba3990b1..824dc13e0c6fd 100644
184--- a/Doc/whatsnew/3.7.rst
185+++ b/Doc/whatsnew/3.7.rst
186@@ -2556,3 +2556,16 @@ because of the behavior of the socket option ``SO_REUSEADDR`` in UDP. For more
187 details, see the documentation for ``loop.create_datagram_endpoint()``.
188 (Contributed by Kyle Stanley, Antoine Pitrou, and Yury Selivanov in
189 :issue:`37228`.)
190+
191+Notable changes in Python 3.7.10
192+================================
193+
194+Earlier Python versions allowed using both ``;`` and ``&`` as
195+query parameter separators in :func:`urllib.parse.parse_qs` and
196+:func:`urllib.parse.parse_qsl`. Due to security concerns, and to conform with
197+newer W3C recommendations, this has been changed to allow only a single
198+separator key, with ``&`` as the default. This change also affects
199+:func:`cgi.parse` and :func:`cgi.parse_multipart` as they use the affected
200+functions internally. For more details, please see their respective
201+documentation.
202+(Contributed by Adam Goldschmidt, Senthil Kumaran and Ken Jin in :issue:`42967`.)
203diff --git a/Doc/whatsnew/3.8.rst b/Doc/whatsnew/3.8.rst
204index 1a192800b2f02..632ccc1f2c40a 100644
205--- a/Doc/whatsnew/3.8.rst
206+++ b/Doc/whatsnew/3.8.rst
207@@ -2251,3 +2251,16 @@ The constant values of future flags in the :mod:`__future__` module
208 are updated in order to prevent collision with compiler flags. Previously
209 ``PyCF_ALLOW_TOP_LEVEL_AWAIT`` was clashing with ``CO_FUTURE_DIVISION``.
210 (Contributed by Batuhan Taskaya in :issue:`39562`)
211+
212+Notable changes in Python 3.8.8
213+===============================
214+
215+Earlier Python versions allowed using both ``;`` and ``&`` as
216+query parameter separators in :func:`urllib.parse.parse_qs` and
217+:func:`urllib.parse.parse_qsl`. Due to security concerns, and to conform with
218+newer W3C recommendations, this has been changed to allow only a single
219+separator key, with ``&`` as the default. This change also affects
220+:func:`cgi.parse` and :func:`cgi.parse_multipart` as they use the affected
221+functions internally. For more details, please see their respective
222+documentation.
223+(Contributed by Adam Goldschmidt, Senthil Kumaran and Ken Jin in :issue:`42967`.)
224diff --git a/Lib/cgi.py b/Lib/cgi.py
225index 77ab703cc0360..1e880e51848af 100755
226--- a/Lib/cgi.py
227+++ b/Lib/cgi.py
228@@ -115,7 +115,8 @@ def closelog():
229 # 0 ==> unlimited input
230 maxlen = 0
231
232-def parse(fp=None, environ=os.environ, keep_blank_values=0, strict_parsing=0):
233+def parse(fp=None, environ=os.environ, keep_blank_values=0,
234+ strict_parsing=0, separator='&'):
235 """Parse a query in the environment or from a file (default stdin)
236
237 Arguments, all optional:
238@@ -134,6 +135,9 @@ def parse(fp=None, environ=os.environ, keep_blank_values=0, strict_parsing=0):
239 strict_parsing: flag indicating what to do with parsing errors.
240 If false (the default), errors are silently ignored.
241 If true, errors raise a ValueError exception.
242+
243+ separator: str. The symbol to use for separating the query arguments.
244+ Defaults to &.
245 """
246 if fp is None:
247 fp = sys.stdin
248@@ -154,7 +158,7 @@ def parse(fp=None, environ=os.environ, keep_blank_values=0, strict_parsing=0):
249 if environ['REQUEST_METHOD'] == 'POST':
250 ctype, pdict = parse_header(environ['CONTENT_TYPE'])
251 if ctype == 'multipart/form-data':
252- return parse_multipart(fp, pdict)
253+ return parse_multipart(fp, pdict, separator=separator)
254 elif ctype == 'application/x-www-form-urlencoded':
255 clength = int(environ['CONTENT_LENGTH'])
256 if maxlen and clength > maxlen:
257@@ -178,10 +182,10 @@ def parse(fp=None, environ=os.environ, keep_blank_values=0, strict_parsing=0):
258 qs = ""
259 environ['QUERY_STRING'] = qs # XXX Shouldn't, really
260 return urllib.parse.parse_qs(qs, keep_blank_values, strict_parsing,
261- encoding=encoding)
262+ encoding=encoding, separator=separator)
263
264
265-def parse_multipart(fp, pdict, encoding="utf-8", errors="replace"):
266+def parse_multipart(fp, pdict, encoding="utf-8", errors="replace", separator='&'):
267 """Parse multipart input.
268
269 Arguments:
270@@ -205,7 +209,7 @@ def parse_multipart(fp, pdict, encoding="utf-8", errors="replace"):
271 except KeyError:
272 pass
273 fs = FieldStorage(fp, headers=headers, encoding=encoding, errors=errors,
274- environ={'REQUEST_METHOD': 'POST'})
275+ environ={'REQUEST_METHOD': 'POST'}, separator=separator)
276 return {k: fs.getlist(k) for k in fs}
277
278 def _parseparam(s):
279@@ -315,7 +319,7 @@ class FieldStorage:
280 def __init__(self, fp=None, headers=None, outerboundary=b'',
281 environ=os.environ, keep_blank_values=0, strict_parsing=0,
282 limit=None, encoding='utf-8', errors='replace',
283- max_num_fields=None):
284+ max_num_fields=None, separator='&'):
285 """Constructor. Read multipart/* until last part.
286
287 Arguments, all optional:
288@@ -363,6 +367,7 @@ def __init__(self, fp=None, headers=None, outerboundary=b'',
289 self.keep_blank_values = keep_blank_values
290 self.strict_parsing = strict_parsing
291 self.max_num_fields = max_num_fields
292+ self.separator = separator
293 if 'REQUEST_METHOD' in environ:
294 method = environ['REQUEST_METHOD'].upper()
295 self.qs_on_post = None
296@@ -589,7 +594,7 @@ def read_urlencoded(self):
297 query = urllib.parse.parse_qsl(
298 qs, self.keep_blank_values, self.strict_parsing,
299 encoding=self.encoding, errors=self.errors,
300- max_num_fields=self.max_num_fields)
301+ max_num_fields=self.max_num_fields, separator=self.separator)
302 self.list = [MiniFieldStorage(key, value) for key, value in query]
303 self.skip_lines()
304
305@@ -605,7 +610,7 @@ def read_multi(self, environ, keep_blank_values, strict_parsing):
306 query = urllib.parse.parse_qsl(
307 self.qs_on_post, self.keep_blank_values, self.strict_parsing,
308 encoding=self.encoding, errors=self.errors,
309- max_num_fields=self.max_num_fields)
310+ max_num_fields=self.max_num_fields, separator=self.separator)
311 self.list.extend(MiniFieldStorage(key, value) for key, value in query)
312
313 klass = self.FieldStorageClass or self.__class__
314@@ -649,7 +654,7 @@ def read_multi(self, environ, keep_blank_values, strict_parsing):
315 else self.limit - self.bytes_read
316 part = klass(self.fp, headers, ib, environ, keep_blank_values,
317 strict_parsing, limit,
318- self.encoding, self.errors, max_num_fields)
319+ self.encoding, self.errors, max_num_fields, self.separator)
320
321 if max_num_fields is not None:
322 max_num_fields -= 1
323diff --git a/Lib/test/test_cgi.py b/Lib/test/test_cgi.py
324index 101942de947fb..4e1506a6468b9 100644
325--- a/Lib/test/test_cgi.py
326+++ b/Lib/test/test_cgi.py
327@@ -53,12 +53,9 @@ def do_test(buf, method):
328 ("", ValueError("bad query field: ''")),
329 ("&", ValueError("bad query field: ''")),
330 ("&&", ValueError("bad query field: ''")),
331- (";", ValueError("bad query field: ''")),
332- (";&;", ValueError("bad query field: ''")),
333 # Should the next few really be valid?
334 ("=", {}),
335 ("=&=", {}),
336- ("=;=", {}),
337 # This rest seem to make sense
338 ("=a", {'': ['a']}),
339 ("&=a", ValueError("bad query field: ''")),
340@@ -73,8 +70,6 @@ def do_test(buf, method):
341 ("a=a+b&b=b+c", {'a': ['a b'], 'b': ['b c']}),
342 ("a=a+b&a=b+a", {'a': ['a b', 'b a']}),
343 ("x=1&y=2.0&z=2-3.%2b0", {'x': ['1'], 'y': ['2.0'], 'z': ['2-3.+0']}),
344- ("x=1;y=2.0&z=2-3.%2b0", {'x': ['1'], 'y': ['2.0'], 'z': ['2-3.+0']}),
345- ("x=1;y=2.0;z=2-3.%2b0", {'x': ['1'], 'y': ['2.0'], 'z': ['2-3.+0']}),
346 ("Hbc5161168c542333633315dee1182227:key_store_seqid=400006&cuyer=r&view=bustomer&order_id=0bb2e248638833d48cb7fed300000f1b&expire=964546263&lobale=en-US&kid=130003.300038&ss=env",
347 {'Hbc5161168c542333633315dee1182227:key_store_seqid': ['400006'],
348 'cuyer': ['r'],
349@@ -201,6 +196,30 @@ def test_strict(self):
350 else:
351 self.assertEqual(fs.getvalue(key), expect_val[0])
352
353+ def test_separator(self):
354+ parse_semicolon = [
355+ ("x=1;y=2.0", {'x': ['1'], 'y': ['2.0']}),
356+ ("x=1;y=2.0;z=2-3.%2b0", {'x': ['1'], 'y': ['2.0'], 'z': ['2-3.+0']}),
357+ (";", ValueError("bad query field: ''")),
358+ (";;", ValueError("bad query field: ''")),
359+ ("=;a", ValueError("bad query field: 'a'")),
360+ (";b=a", ValueError("bad query field: ''")),
361+ ("b;=a", ValueError("bad query field: 'b'")),
362+ ("a=a+b;b=b+c", {'a': ['a b'], 'b': ['b c']}),
363+ ("a=a+b;a=b+a", {'a': ['a b', 'b a']}),
364+ ]
365+ for orig, expect in parse_semicolon:
366+ env = {'QUERY_STRING': orig}
367+ fs = cgi.FieldStorage(separator=';', environ=env)
368+ if isinstance(expect, dict):
369+ for key in expect.keys():
370+ expect_val = expect[key]
371+ self.assertIn(key, fs)
372+ if len(expect_val) > 1:
373+ self.assertEqual(fs.getvalue(key), expect_val)
374+ else:
375+ self.assertEqual(fs.getvalue(key), expect_val[0])
376+
377 def test_log(self):
378 cgi.log("Testing")
379
380diff --git a/Lib/test/test_urlparse.py b/Lib/test/test_urlparse.py
381index 4ae6ed33858ce..90c8d6922629e 100644
382--- a/Lib/test/test_urlparse.py
383+++ b/Lib/test/test_urlparse.py
384@@ -32,16 +32,10 @@
385 (b"&a=b", [(b'a', b'b')]),
386 (b"a=a+b&b=b+c", [(b'a', b'a b'), (b'b', b'b c')]),
387 (b"a=1&a=2", [(b'a', b'1'), (b'a', b'2')]),
388- (";", []),
389- (";;", []),
390- (";a=b", [('a', 'b')]),
391- ("a=a+b;b=b+c", [('a', 'a b'), ('b', 'b c')]),
392- ("a=1;a=2", [('a', '1'), ('a', '2')]),
393- (b";", []),
394- (b";;", []),
395- (b";a=b", [(b'a', b'b')]),
396- (b"a=a+b;b=b+c", [(b'a', b'a b'), (b'b', b'b c')]),
397- (b"a=1;a=2", [(b'a', b'1'), (b'a', b'2')]),
398+ (";a=b", [(';a', 'b')]),
399+ ("a=a+b;b=b+c", [('a', 'a b;b=b c')]),
400+ (b";a=b", [(b';a', b'b')]),
401+ (b"a=a+b;b=b+c", [(b'a', b'a b;b=b c')]),
402 ]
403
404 # Each parse_qs testcase is a two-tuple that contains
405@@ -68,16 +62,10 @@
406 (b"&a=b", {b'a': [b'b']}),
407 (b"a=a+b&b=b+c", {b'a': [b'a b'], b'b': [b'b c']}),
408 (b"a=1&a=2", {b'a': [b'1', b'2']}),
409- (";", {}),
410- (";;", {}),
411- (";a=b", {'a': ['b']}),
412- ("a=a+b;b=b+c", {'a': ['a b'], 'b': ['b c']}),
413- ("a=1;a=2", {'a': ['1', '2']}),
414- (b";", {}),
415- (b";;", {}),
416- (b";a=b", {b'a': [b'b']}),
417- (b"a=a+b;b=b+c", {b'a': [b'a b'], b'b': [b'b c']}),
418- (b"a=1;a=2", {b'a': [b'1', b'2']}),
419+ (";a=b", {';a': ['b']}),
420+ ("a=a+b;b=b+c", {'a': ['a b;b=b c']}),
421+ (b";a=b", {b';a': [b'b']}),
422+ (b"a=a+b;b=b+c", {b'a':[ b'a b;b=b c']}),
423 ]
424
425 class UrlParseTestCase(unittest.TestCase):
426@@ -884,10 +872,46 @@ def test_parse_qsl_encoding(self):
427 def test_parse_qsl_max_num_fields(self):
428 with self.assertRaises(ValueError):
429 urllib.parse.parse_qs('&'.join(['a=a']*11), max_num_fields=10)
430- with self.assertRaises(ValueError):
431- urllib.parse.parse_qs(';'.join(['a=a']*11), max_num_fields=10)
432 urllib.parse.parse_qs('&'.join(['a=a']*10), max_num_fields=10)
433
434+ def test_parse_qs_separator(self):
435+ parse_qs_semicolon_cases = [
436+ (";", {}),
437+ (";;", {}),
438+ (";a=b", {'a': ['b']}),
439+ ("a=a+b;b=b+c", {'a': ['a b'], 'b': ['b c']}),
440+ ("a=1;a=2", {'a': ['1', '2']}),
441+ (b";", {}),
442+ (b";;", {}),
443+ (b";a=b", {b'a': [b'b']}),
444+ (b"a=a+b;b=b+c", {b'a': [b'a b'], b'b': [b'b c']}),
445+ (b"a=1;a=2", {b'a': [b'1', b'2']}),
446+ ]
447+ for orig, expect in parse_qs_semicolon_cases:
448+ with self.subTest(f"Original: {orig!r}, Expected: {expect!r}"):
449+ result = urllib.parse.parse_qs(orig, separator=';')
450+ self.assertEqual(result, expect, "Error parsing %r" % orig)
451+
452+
453+ def test_parse_qsl_separator(self):
454+ parse_qsl_semicolon_cases = [
455+ (";", []),
456+ (";;", []),
457+ (";a=b", [('a', 'b')]),
458+ ("a=a+b;b=b+c", [('a', 'a b'), ('b', 'b c')]),
459+ ("a=1;a=2", [('a', '1'), ('a', '2')]),
460+ (b";", []),
461+ (b";;", []),
462+ (b";a=b", [(b'a', b'b')]),
463+ (b"a=a+b;b=b+c", [(b'a', b'a b'), (b'b', b'b c')]),
464+ (b"a=1;a=2", [(b'a', b'1'), (b'a', b'2')]),
465+ ]
466+ for orig, expect in parse_qsl_semicolon_cases:
467+ with self.subTest(f"Original: {orig!r}, Expected: {expect!r}"):
468+ result = urllib.parse.parse_qsl(orig, separator=';')
469+ self.assertEqual(result, expect, "Error parsing %r" % orig)
470+
471+
472 def test_urlencode_sequences(self):
473 # Other tests incidentally urlencode things; test non-covered cases:
474 # Sequence and object values.
475diff --git a/Lib/urllib/parse.py b/Lib/urllib/parse.py
476index 95be7181133b4..0c1c94f5fc986 100644
477--- a/Lib/urllib/parse.py
478+++ b/Lib/urllib/parse.py
479@@ -650,7 +650,7 @@ def unquote(string, encoding='utf-8', errors='replace'):
480
481
482 def parse_qs(qs, keep_blank_values=False, strict_parsing=False,
483- encoding='utf-8', errors='replace', max_num_fields=None):
484+ encoding='utf-8', errors='replace', max_num_fields=None, separator='&'):
485 """Parse a query given as a string argument.
486
487 Arguments:
488@@ -674,12 +674,15 @@ def parse_qs(qs, keep_blank_values=False, strict_parsing=False,
489 max_num_fields: int. If set, then throws a ValueError if there
490 are more than n fields read by parse_qsl().
491
492+ separator: str. The symbol to use for separating the query arguments.
493+ Defaults to &.
494+
495 Returns a dictionary.
496 """
497 parsed_result = {}
498 pairs = parse_qsl(qs, keep_blank_values, strict_parsing,
499 encoding=encoding, errors=errors,
500- max_num_fields=max_num_fields)
501+ max_num_fields=max_num_fields, separator=separator)
502 for name, value in pairs:
503 if name in parsed_result:
504 parsed_result[name].append(value)
505@@ -689,7 +692,7 @@ def parse_qs(qs, keep_blank_values=False, strict_parsing=False,
506
507
508 def parse_qsl(qs, keep_blank_values=False, strict_parsing=False,
509- encoding='utf-8', errors='replace', max_num_fields=None):
510+ encoding='utf-8', errors='replace', max_num_fields=None, separator='&'):
511 """Parse a query given as a string argument.
512
513 Arguments:
514@@ -712,19 +715,25 @@ def parse_qsl(qs, keep_blank_values=False, strict_parsing=False,
515 max_num_fields: int. If set, then throws a ValueError
516 if there are more than n fields read by parse_qsl().
517
518+ separator: str. The symbol to use for separating the query arguments.
519+ Defaults to &.
520+
521 Returns a list, as G-d intended.
522 """
523 qs, _coerce_result = _coerce_args(qs)
524
525+ if not separator or (not isinstance(separator, (str, bytes))):
526+ raise ValueError("Separator must be of type string or bytes.")
527+
528 # If max_num_fields is defined then check that the number of fields
529 # is less than max_num_fields. This prevents a memory exhaustion DOS
530 # attack via post bodies with many fields.
531 if max_num_fields is not None:
532- num_fields = 1 + qs.count('&') + qs.count(';')
533+ num_fields = 1 + qs.count(separator)
534 if max_num_fields < num_fields:
535 raise ValueError('Max number of fields exceeded')
536
537- pairs = [s2 for s1 in qs.split('&') for s2 in s1.split(';')]
538+ pairs = [s1 for s1 in qs.split(separator)]
539 r = []
540 for name_value in pairs:
541 if not name_value and not strict_parsing:
542diff --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
543new file mode 100644
544index 0000000000000..f08489b41494e
545--- /dev/null
546+++ b/Misc/NEWS.d/next/Security/2021-02-14-15-59-16.bpo-42967.YApqDS.rst
547@@ -0,0 +1 @@
548+Fix web cache poisoning vulnerability by defaulting the query args separator to ``&``, and allowing the user to choose a custom separator.
diff --git a/meta/recipes-devtools/python/python3_3.8.5.bb b/meta/recipes-devtools/python/python3_3.8.5.bb
index fb066084bf..418d35acfe 100644
--- a/meta/recipes-devtools/python/python3_3.8.5.bb
+++ b/meta/recipes-devtools/python/python3_3.8.5.bb
@@ -34,6 +34,7 @@ SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.xz \
34 file://0020-configure.ac-setup.py-do-not-add-a-curses-include-pa.patch \ 34 file://0020-configure.ac-setup.py-do-not-add-a-curses-include-pa.patch \
35 file://CVE-2020-27619.patch \ 35 file://CVE-2020-27619.patch \
36 file://CVE-2021-3177.patch \ 36 file://CVE-2021-3177.patch \
37 file://CVE-2021-23336.patch \
37 " 38 "
38 39
39SRC_URI_append_class-native = " \ 40SRC_URI_append_class-native = " \
@@ -169,6 +170,10 @@ do_install_append() {
169} 170}
170 171
171do_install_append_class-nativesdk () { 172do_install_append_class-nativesdk () {
173 # Make sure we use /usr/bin/env python
174 for PYTHSCRIPT in `grep -rIl ${bindir}/python ${D}${bindir}`; do
175 sed -i -e '1s|^#!.*|#!/usr/bin/env python3|' $PYTHSCRIPT
176 done
172 create_wrapper ${D}${bindir}/python${PYTHON_MAJMIN} TERMINFO_DIRS='${sysconfdir}/terminfo:/etc/terminfo:/usr/share/terminfo:/usr/share/misc/terminfo:/lib/terminfo' PYTHONNOUSERSITE='1' 177 create_wrapper ${D}${bindir}/python${PYTHON_MAJMIN} TERMINFO_DIRS='${sysconfdir}/terminfo:/etc/terminfo:/usr/share/terminfo:/usr/share/misc/terminfo:/lib/terminfo' PYTHONNOUSERSITE='1'
173} 178}
174 179
diff --git a/meta/recipes-devtools/qemu/qemu.inc b/meta/recipes-devtools/qemu/qemu.inc
index 97f110cde5..482ca3d6e5 100644
--- a/meta/recipes-devtools/qemu/qemu.inc
+++ b/meta/recipes-devtools/qemu/qemu.inc
@@ -39,6 +39,7 @@ SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \
39 file://CVE-2020-28916.patch \ 39 file://CVE-2020-28916.patch \
40 file://CVE-2020-35517.patch \ 40 file://CVE-2020-35517.patch \
41 file://CVE-2020-29443.patch \ 41 file://CVE-2020-29443.patch \
42 file://CVE-2021-20203.patch \
42 " 43 "
43UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar" 44UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar"
44 45
diff --git a/meta/recipes-devtools/qemu/qemu/CVE-2021-20203.patch b/meta/recipes-devtools/qemu/qemu/CVE-2021-20203.patch
new file mode 100644
index 0000000000..31440af0bd
--- /dev/null
+++ b/meta/recipes-devtools/qemu/qemu/CVE-2021-20203.patch
@@ -0,0 +1,74 @@
1From: Prasad J Pandit <pjp@fedoraproject.org>
2
3While activating device in vmxnet3_acticate_device(), it does not
4validate guest supplied configuration values against predefined
5minimum - maximum limits. This may lead to integer overflow or
6OOB access issues. Add checks to avoid it.
7
8Fixes: CVE-2021-20203
9Buglink: https://bugs.launchpad.net/qemu/+bug/1913873
10Reported-by: Gaoning Pan <pgn@zju.edu.cn>
11Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
12
13Upstream-Status: Acepted [https://lists.gnu.org/archive/html/qemu-devel/2021-01/msg07935.html]
14CVE: CVE-2021-20203
15Signed-off-by: Minjae Kim <flowergom@gmail.com>
16---
17 hw/net/vmxnet3.c | 13 +++++++++++++
18 1 file changed, 13 insertions(+)
19
20diff --git a/hw/net/vmxnet3.c b/hw/net/vmxnet3.c
21index eff299f629..4a910ca971 100644
22--- a/hw/net/vmxnet3.c
23+++ b/hw/net/vmxnet3.c
24@@ -1420,6 +1420,7 @@ static void vmxnet3_activate_device(VMXNET3State *s)
25 vmxnet3_setup_rx_filtering(s);
26 /* Cache fields from shared memory */
27 s->mtu = VMXNET3_READ_DRV_SHARED32(d, s->drv_shmem, devRead.misc.mtu);
28+ assert(VMXNET3_MIN_MTU <= s->mtu && s->mtu < VMXNET3_MAX_MTU);
29 VMW_CFPRN("MTU is %u", s->mtu);
30
31 s->max_rx_frags =
32@@ -1473,6 +1474,9 @@ static void vmxnet3_activate_device(VMXNET3State *s)
33 /* Read rings memory locations for TX queues */
34 pa = VMXNET3_READ_TX_QUEUE_DESCR64(d, qdescr_pa, conf.txRingBasePA);
35 size = VMXNET3_READ_TX_QUEUE_DESCR32(d, qdescr_pa, conf.txRingSize);
36+ if (size > VMXNET3_TX_RING_MAX_SIZE) {
37+ size = VMXNET3_TX_RING_MAX_SIZE;
38+ }
39
40 vmxnet3_ring_init(d, &s->txq_descr[i].tx_ring, pa, size,
41 sizeof(struct Vmxnet3_TxDesc), false);
42@@ -1483,6 +1487,9 @@ static void vmxnet3_activate_device(VMXNET3State *s)
43 /* TXC ring */
44 pa = VMXNET3_READ_TX_QUEUE_DESCR64(d, qdescr_pa, conf.compRingBasePA);
45 size = VMXNET3_READ_TX_QUEUE_DESCR32(d, qdescr_pa, conf.compRingSize);
46+ if (size > VMXNET3_TC_RING_MAX_SIZE) {
47+ size = VMXNET3_TC_RING_MAX_SIZE;
48+ }
49 vmxnet3_ring_init(d, &s->txq_descr[i].comp_ring, pa, size,
50 sizeof(struct Vmxnet3_TxCompDesc), true);
51 VMXNET3_RING_DUMP(VMW_CFPRN, "TXC", i, &s->txq_descr[i].comp_ring);
52@@ -1524,6 +1531,9 @@ static void vmxnet3_activate_device(VMXNET3State *s)
53 /* RX rings */
54 pa = VMXNET3_READ_RX_QUEUE_DESCR64(d, qd_pa, conf.rxRingBasePA[j]);
55 size = VMXNET3_READ_RX_QUEUE_DESCR32(d, qd_pa, conf.rxRingSize[j]);
56+ if (size > VMXNET3_RX_RING_MAX_SIZE) {
57+ size = VMXNET3_RX_RING_MAX_SIZE;
58+ }
59 vmxnet3_ring_init(d, &s->rxq_descr[i].rx_ring[j], pa, size,
60 sizeof(struct Vmxnet3_RxDesc), false);
61 VMW_CFPRN("RX queue %d:%d: Base: %" PRIx64 ", Size: %d",
62@@ -1533,6 +1543,9 @@ static void vmxnet3_activate_device(VMXNET3State *s)
63 /* RXC ring */
64 pa = VMXNET3_READ_RX_QUEUE_DESCR64(d, qd_pa, conf.compRingBasePA);
65 size = VMXNET3_READ_RX_QUEUE_DESCR32(d, qd_pa, conf.compRingSize);
66+ if (size > VMXNET3_RC_RING_MAX_SIZE) {
67+ size = VMXNET3_RC_RING_MAX_SIZE;
68+ }
69 vmxnet3_ring_init(d, &s->rxq_descr[i].comp_ring, pa, size,
70 sizeof(struct Vmxnet3_RxCompDesc), true);
71 VMW_CFPRN("RXC queue %d: Base: %" PRIx64 ", Size: %d", i, pa, size);
72--
732.29.2
74
diff --git a/meta/recipes-devtools/rsync/files/0001-rsync-ssl-Verify-the-hostname-in-the-certificate-whe.patch b/meta/recipes-devtools/rsync/files/0001-rsync-ssl-Verify-the-hostname-in-the-certificate-whe.patch
new file mode 100644
index 0000000000..2d51ddf965
--- /dev/null
+++ b/meta/recipes-devtools/rsync/files/0001-rsync-ssl-Verify-the-hostname-in-the-certificate-whe.patch
@@ -0,0 +1,31 @@
1From fbe85634d88e82fbb439ae2a5d1aca8b8c309bea Mon Sep 17 00:00:00 2001
2From: Matt McCutchen <matt@mattmccutchen.net>
3Date: Wed, 26 Aug 2020 12:16:08 -0400
4Subject: [PATCH] rsync-ssl: Verify the hostname in the certificate when using
5 openssl.
6
7CVE: CVE-2020-14387
8
9Upstream-Status: Backport [https://git.samba.org/?p=rsync.git;a=commit;h=c3f7414]
10
11Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
12---
13 rsync-ssl | 2 +-
14 1 file changed, 1 insertion(+), 1 deletion(-)
15
16diff --git a/rsync-ssl b/rsync-ssl
17index 8101975..46701af 100755
18--- a/rsync-ssl
19+++ b/rsync-ssl
20@@ -129,7 +129,7 @@ function rsync_ssl_helper {
21 fi
22
23 if [[ $RSYNC_SSL_TYPE == openssl ]]; then
24- exec $RSYNC_SSL_OPENSSL s_client $caopt $certopt -quiet -verify_quiet -servername $hostname -connect $hostname:$port
25+ exec $RSYNC_SSL_OPENSSL s_client $caopt $certopt -quiet -verify_quiet -servername $hostname -verify_hostname $hostname -connect $hostname:$port
26 elif [[ $RSYNC_SSL_TYPE == gnutls ]]; then
27 exec $RSYNC_SSL_GNUTLS --logfile=/dev/null $gnutls_cert_opt $gnutls_opts $hostname:$port
28 else
29--
302.17.1
31
diff --git a/meta/recipes-devtools/rsync/files/determism.patch b/meta/recipes-devtools/rsync/files/determism.patch
new file mode 100644
index 0000000000..53a4ca7505
--- /dev/null
+++ b/meta/recipes-devtools/rsync/files/determism.patch
@@ -0,0 +1,28 @@
1The Makefile calls awk on a "*.c" glob. The results of this glob are sorted
2but the order depends on the locale settings, particularly whether
3"util.c" and "util2.c" sort before or after each other. In en_US.UTF-8
4they sort one way, in C, they sort the other. The sorting order changes
5the output binaries. The behaviour also changes dependning on whether
6SHELL (/bin/sh) is dash or bash.
7
8Specify a C locale setting to be deterministic.
9
10Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
11Upstream-Status: Pending
12
13Index: rsync-3.2.3/Makefile.in
14===================================================================
15--- rsync-3.2.3.orig/Makefile.in
16+++ rsync-3.2.3/Makefile.in
17@@ -26,6 +26,11 @@ MKDIR_P=@MKDIR_P@
18 VPATH=$(srcdir)
19 SHELL=/bin/sh
20
21+# We use globbing in commands, need to be deterministic
22+unexport LC_ALL
23+LC_COLLATE=C
24+export LC_COLLATE
25+
26 .SUFFIXES:
27 .SUFFIXES: .c .o
28
diff --git a/meta/recipes-devtools/rsync/rsync_3.2.3.bb b/meta/recipes-devtools/rsync/rsync_3.2.3.bb
index 375efa0dea..df4fbbd0d2 100644
--- a/meta/recipes-devtools/rsync/rsync_3.2.3.bb
+++ b/meta/recipes-devtools/rsync/rsync_3.2.3.bb
@@ -12,6 +12,8 @@ DEPENDS = "popt"
12SRC_URI = "https://download.samba.org/pub/${BPN}/src/${BP}.tar.gz \ 12SRC_URI = "https://download.samba.org/pub/${BPN}/src/${BP}.tar.gz \
13 file://rsyncd.conf \ 13 file://rsyncd.conf \
14 file://makefile-no-rebuild.patch \ 14 file://makefile-no-rebuild.patch \
15 file://determism.patch \
16 file://0001-rsync-ssl-Verify-the-hostname-in-the-certificate-whe.patch \
15 " 17 "
16 18
17SRC_URI[sha256sum] = "becc3c504ceea499f4167a260040ccf4d9f2ef9499ad5683c179a697146ce50e" 19SRC_URI[sha256sum] = "becc3c504ceea499f4167a260040ccf4d9f2ef9499ad5683c179a697146ce50e"
@@ -38,7 +40,7 @@ PACKAGECONFIG[zstd] = "--enable-zstd,--disable-zstd,zstd"
38CACHED_CONFIGUREVARS += "rsync_cv_can_hardlink_special=yes rsync_cv_can_hardlink_symlink=yes" 40CACHED_CONFIGUREVARS += "rsync_cv_can_hardlink_special=yes rsync_cv_can_hardlink_symlink=yes"
39 41
40EXTRA_OEMAKE = 'STRIP=""' 42EXTRA_OEMAKE = 'STRIP=""'
41EXTRA_OECONF = "--disable-simd --disable-md2man --disable-asm" 43EXTRA_OECONF = "--disable-simd --disable-md2man --disable-asm --with-nobody-group=nogroup"
42 44
43# rsync 3.0 uses configure.sh instead of configure, and 45# rsync 3.0 uses configure.sh instead of configure, and
44# makefile checks the existence of configure.sh 46# makefile checks the existence of configure.sh
diff --git a/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts b/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts
index f84a7e18c8..95dccb9cae 100755
--- a/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts
+++ b/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts
@@ -72,12 +72,12 @@ exec_postinst_scriptlets() {
72 else 72 else
73 echo "ERROR: postinst $i failed." 73 echo "ERROR: postinst $i failed."
74 [ "$POSTINST_LOGGING" = "1" ] && eval echo "ERROR: postinst $i failed." $append_log 74 [ "$POSTINST_LOGGING" = "1" ] && eval echo "ERROR: postinst $i failed." $append_log
75 remove_pi_dir=0 75 remove_rcsd_link=0
76 fi 76 fi
77 done 77 done
78} 78}
79 79
80remove_pi_dir=1 80remove_rcsd_link=1
81if $pm_installed; then 81if $pm_installed; then
82 case $pm in 82 case $pm in
83 "ipk") 83 "ipk")
@@ -92,9 +92,7 @@ else
92 exec_postinst_scriptlets 92 exec_postinst_scriptlets
93fi 93fi
94 94
95# since all postinstalls executed successfully, remove the postinstalls directory 95# since all postinstalls executed successfully, remove the rcS.d link
96# and the rcS.d link 96if [ $remove_rcsd_link = 1 ]; then
97if [ $remove_pi_dir = 1 ]; then
98 rm -rf $pi_dir
99 remove_rcsd_link 97 remove_rcsd_link
100fi 98fi
diff --git a/meta/recipes-devtools/valgrind/valgrind/0001-gdbserver_tests-Disable-nlcontrolc.vgtest-for-x86-64.patch b/meta/recipes-devtools/valgrind/valgrind/0001-gdbserver_tests-Disable-nlcontrolc.vgtest-for-x86-64.patch
new file mode 100644
index 0000000000..0bd8273cd8
--- /dev/null
+++ b/meta/recipes-devtools/valgrind/valgrind/0001-gdbserver_tests-Disable-nlcontrolc.vgtest-for-x86-64.patch
@@ -0,0 +1,36 @@
1From d8c19e0bb9ca2fd48f223e1fdeffcafeb0aa1745 Mon Sep 17 00:00:00 2001
2From: Yi Fan Yu <yifan.yu@windriver.com>
3Date: Wed, 17 Feb 2021 14:53:44 -0500
4Subject: [PATCH] gdbserver_tests: Disable nlcontrolc.vgtest for x86-64
5
6Test hangs after glibc 2.33 uprev
7
8Using gdb to modify the timeout argument no longer
9affects how long `select` wait.
10
11https://bugs.kde.org/show_bug.cgi?id=432870
12Upstream-Status: Pending
13Waiting for upstream to take action.
14
15Signed-off-by: Yi Fan Yu <yifan.yu@windriver.com>
16---
17 gdbserver_tests/nlcontrolc.vgtest | 3 ++-
18 1 file changed, 2 insertions(+), 1 deletion(-)
19
20diff --git a/gdbserver_tests/nlcontrolc.vgtest b/gdbserver_tests/nlcontrolc.vgtest
21index bb5308403..96d2b52bb 100644
22--- a/gdbserver_tests/nlcontrolc.vgtest
23+++ b/gdbserver_tests/nlcontrolc.vgtest
24@@ -13,7 +13,8 @@ args: 1000000000 1000000000 1000000000 BSBSBSBS 1
25 vgopts: --tool=none --vgdb=yes --vgdb-error=0 --vgdb-prefix=./vgdb-prefix-nlcontrolc
26 stderr_filter: filter_stderr
27 # Bug 338633 nlcontrol hangs on arm64 currently.
28-prereq: test -e gdb -a -f vgdb.invoker && ! ../tests/arch_test arm64 && ! ../tests/os_test solaris
29+# Bug 432870 nlcontrolc hangs on x86-64 starting with glibc 2.33
30+prereq: test -e gdb -a -f vgdb.invoker && ! ../tests/arch_test arm64 && ! ../tests/os_test solaris && ! ../tests/arch_test amd64
31 progB: gdb
32 argsB: --quiet -l 60 --nx ./sleepers
33 stdinB: nlcontrolc.stdinB.gdb
34--
352.29.2
36
diff --git a/meta/recipes-devtools/valgrind/valgrind/0005-Modify-vg_test-wrapper-to-support-PTEST-formats.patch b/meta/recipes-devtools/valgrind/valgrind/0005-Modify-vg_test-wrapper-to-support-PTEST-formats.patch
index 7985308e41..0c399ef52c 100644
--- a/meta/recipes-devtools/valgrind/valgrind/0005-Modify-vg_test-wrapper-to-support-PTEST-formats.patch
+++ b/meta/recipes-devtools/valgrind/valgrind/0005-Modify-vg_test-wrapper-to-support-PTEST-formats.patch
@@ -19,6 +19,11 @@ Upstream-Status: Pending
19Signed-off-by: Dave Lerner <dave.lerner@windriver.com> 19Signed-off-by: Dave Lerner <dave.lerner@windriver.com>
20Signed-off-by: Tudor Florea <tudor.florea@enea.com> 20Signed-off-by: Tudor Florea <tudor.florea@enea.com>
21Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> 21Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
22
23Increase time limit to 90 s.
24(double of the expected time of drd/tests/std_list on qemuarm64)
25
26Signed-off-by: Yi Fan Yu <yifan.yu@windriver.com>
22--- 27---
23 tests/vg_regtest.in | 75 +++++++++++++++++++++++++++++++++++++++-------------- 28 tests/vg_regtest.in | 75 +++++++++++++++++++++++++++++++++++++++--------------
24 1 file changed, 55 insertions(+), 20 deletions(-) 29 1 file changed, 55 insertions(+), 20 deletions(-)
@@ -66,7 +71,7 @@ index a441f42..cb05b52 100755
66 # Since most of the program time is spent in system() calls, need this to 71 # Since most of the program time is spent in system() calls, need this to
67 # propagate a Ctrl-C enabling us to quit. 72 # propagate a Ctrl-C enabling us to quit.
68-sub mysystem($) 73-sub mysystem($)
69+# Enforce 30 seconds limit for the test. 74+# Enforce 90 seconds limit for the test.
70+# This resume execution of the remaining tests if valgrind hangs. 75+# This resume execution of the remaining tests if valgrind hangs.
71+sub mysystem($) 76+sub mysystem($)
72 { 77 {
@@ -76,7 +81,7 @@ index a441f42..cb05b52 100755
76+ my $exit_code=0; 81+ my $exit_code=0;
77+ eval { 82+ eval {
78+ local $SIG{'ALRM'} = sub { die "timed out\n" }; 83+ local $SIG{'ALRM'} = sub { die "timed out\n" };
79+ alarm(30); 84+ alarm(90);
80+ $exit_code = system($_[0]); 85+ $exit_code = system($_[0]);
81+ alarm (0); 86+ alarm (0);
82+ ($exit_code == 2) and die "SIGINT\n"; # 2 is SIGINT 87+ ($exit_code == 2) and die "SIGINT\n"; # 2 is SIGINT
diff --git a/meta/recipes-devtools/valgrind/valgrind_3.16.1.bb b/meta/recipes-devtools/valgrind/valgrind_3.16.1.bb
index 25fa58249c..fc070dec78 100644
--- a/meta/recipes-devtools/valgrind/valgrind_3.16.1.bb
+++ b/meta/recipes-devtools/valgrind/valgrind_3.16.1.bb
@@ -44,6 +44,7 @@ SRC_URI = "https://sourceware.org/pub/valgrind/valgrind-${PV}.tar.bz2 \
44 file://0001-drd-Port-to-Fedora-33.patch \ 44 file://0001-drd-Port-to-Fedora-33.patch \
45 file://0001-drd-musl-fix.patch \ 45 file://0001-drd-musl-fix.patch \
46 file://0001-helgrind-Intercept-libc-functions.patch \ 46 file://0001-helgrind-Intercept-libc-functions.patch \
47 file://0001-gdbserver_tests-Disable-nlcontrolc.vgtest-for-x86-64.patch \
47 " 48 "
48SRC_URI[md5sum] = "d1b153f1ab17cf1f311705e7a83ef589" 49SRC_URI[md5sum] = "d1b153f1ab17cf1f311705e7a83ef589"
49SRC_URI[sha256sum] = "c91f3a2f7b02db0f3bc99479861656154d241d2fdb265614ba918cc6720a33ca" 50SRC_URI[sha256sum] = "c91f3a2f7b02db0f3bc99479861656154d241d2fdb265614ba918cc6720a33ca"
diff --git a/meta/recipes-extended/asciidoc/asciidoc_9.0.2.bb b/meta/recipes-extended/asciidoc/asciidoc_9.0.2.bb
index 711bfbfb9b..5fd3832ef9 100644
--- a/meta/recipes-extended/asciidoc/asciidoc_9.0.2.bb
+++ b/meta/recipes-extended/asciidoc/asciidoc_9.0.2.bb
@@ -8,7 +8,7 @@ LICENSE = "GPLv2"
8LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=4e5d1baf6f20559e3bec172226a47e4e \ 8LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=4e5d1baf6f20559e3bec172226a47e4e \
9 file://LICENSE;md5=b234ee4d69f5fce4486a80fdaf4a4263 " 9 file://LICENSE;md5=b234ee4d69f5fce4486a80fdaf4a4263 "
10 10
11SRC_URI = "git://github.com/asciidoc/asciidoc-py3;protocol=https \ 11SRC_URI = "git://github.com/asciidoc/asciidoc-py3;protocol=https;branch=main \
12 file://auto-catalogs.patch" 12 file://auto-catalogs.patch"
13SRCREV = "9a407dc9a497364c91421fd961954eddb565baf1" 13SRCREV = "9a407dc9a497364c91421fd961954eddb565baf1"
14 14
diff --git a/meta/recipes-extended/cups/cups.inc b/meta/recipes-extended/cups/cups.inc
index e7a704134c..244c87001f 100644
--- a/meta/recipes-extended/cups/cups.inc
+++ b/meta/recipes-extended/cups/cups.inc
@@ -15,6 +15,7 @@ SRC_URI = "https://github.com/apple/cups/releases/download/v${PV}/${BP}-source.t
15 file://0004-cups-fix-multilib-install-file-conflicts.patch \ 15 file://0004-cups-fix-multilib-install-file-conflicts.patch \
16 file://volatiles.99_cups \ 16 file://volatiles.99_cups \
17 file://cups-volatiles.conf \ 17 file://cups-volatiles.conf \
18 file://CVE-2020-10001.patch \
18 " 19 "
19 20
20UPSTREAM_CHECK_URI = "https://github.com/apple/cups/releases" 21UPSTREAM_CHECK_URI = "https://github.com/apple/cups/releases"
@@ -54,6 +55,8 @@ EXTRA_OECONF = " \
54 --enable-debug \ 55 --enable-debug \
55 --disable-relro \ 56 --disable-relro \
56 --enable-libusb \ 57 --enable-libusb \
58 --with-system-groups=lpadmin \
59 --with-cups-group=lp \
57 --with-domainsocket=/run/cups/cups.sock \ 60 --with-domainsocket=/run/cups/cups.sock \
58 DSOFLAGS='${LDFLAGS}' \ 61 DSOFLAGS='${LDFLAGS}' \
59 " 62 "
diff --git a/meta/recipes-extended/cups/cups/CVE-2020-10001.patch b/meta/recipes-extended/cups/cups/CVE-2020-10001.patch
new file mode 100644
index 0000000000..09a0a5765d
--- /dev/null
+++ b/meta/recipes-extended/cups/cups/CVE-2020-10001.patch
@@ -0,0 +1,74 @@
1From efbea1742bd30f842fbbfb87a473e5c84f4162f9 Mon Sep 17 00:00:00 2001
2From: Michael R Sweet <msweet@msweet.org>
3Date: Mon, 1 Feb 2021 15:02:32 -0500
4Subject: [PATCH] Fix a buffer (read) overflow in ippReadIO (CVE-2020-10001)
5
6Upstream-Status: Backport
7CVE: CVE-2020-10001
8
9Reference to upstream patch:
10[https://github.com/OpenPrinting/cups/commit/efbea1742bd30f842fbbfb87a473e5c84f4162f9]
11
12[SG: Addapted for version 2.3.3]
13Signed-off-by: Stefan Ghinea <stefan.ghinea@windriver.com>
14---
15 CHANGES.md | 2 ++
16 cups/ipp.c | 8 +++++---
17 2 files changed, 7 insertions(+), 3 deletions(-)
18
19diff --git a/CHANGES.md b/CHANGES.md
20index df72892..5ca12da 100644
21--- a/CHANGES.md
22+++ b/CHANGES.md
23@@ -4,6 +4,8 @@ CHANGES - 2.3.3 - 2020-04-24
24 Changes in CUPS v2.3.3
25 ----------------------
26
27+- Security: Fixed a buffer (read) overflow in the `ippReadIO` function
28+ (CVE-2020-10001)
29 - CVE-2020-3898: The `ppdOpen` function did not handle invalid UI
30 constraint. `ppdcSource::get_resolution` function did not handle
31 invalid resolution strings.
32diff --git a/cups/ipp.c b/cups/ipp.c
33index 3d52934..adbb26f 100644
34--- a/cups/ipp.c
35+++ b/cups/ipp.c
36@@ -2866,7 +2866,8 @@ ippReadIO(void *src, /* I - Data source */
37 unsigned char *buffer, /* Data buffer */
38 string[IPP_MAX_TEXT],
39 /* Small string buffer */
40- *bufptr; /* Pointer into buffer */
41+ *bufptr, /* Pointer into buffer */
42+ *bufend; /* End of buffer */
43 ipp_attribute_t *attr; /* Current attribute */
44 ipp_tag_t tag; /* Current tag */
45 ipp_tag_t value_tag; /* Current value tag */
46@@ -3441,6 +3442,7 @@ ippReadIO(void *src, /* I - Data source */
47 }
48
49 bufptr = buffer;
50+ bufend = buffer + n;
51
52 /*
53 * text-with-language and name-with-language are composite
54@@ -3454,7 +3456,7 @@ ippReadIO(void *src, /* I - Data source */
55
56 n = (bufptr[0] << 8) | bufptr[1];
57
58- if ((bufptr + 2 + n) >= (buffer + IPP_BUF_SIZE) || n >= (int)sizeof(string))
59+ if ((bufptr + 2 + n + 2) > bufend || n >= (int)sizeof(string))
60 {
61 _cupsSetError(IPP_STATUS_ERROR_INTERNAL,
62 _("IPP language length overflows value."), 1);
63@@ -3481,7 +3483,7 @@ ippReadIO(void *src, /* I - Data source */
64 bufptr += 2 + n;
65 n = (bufptr[0] << 8) | bufptr[1];
66
67- if ((bufptr + 2 + n) >= (buffer + IPP_BUF_SIZE))
68+ if ((bufptr + 2 + n) > bufend)
69 {
70 _cupsSetError(IPP_STATUS_ERROR_INTERNAL,
71 _("IPP string length overflows value."), 1);
72--
732.17.1
74
diff --git a/meta/recipes-extended/groff/files/0001-Include-config.h.patch b/meta/recipes-extended/groff/files/0001-Include-config.h.patch
index 348a61d9df..46065bc513 100644
--- a/meta/recipes-extended/groff/files/0001-Include-config.h.patch
+++ b/meta/recipes-extended/groff/files/0001-Include-config.h.patch
@@ -17,6 +17,9 @@ In file included from TOPDIR/build/tmp/work/aarch64-yoe-linux-musl/groff/1.22.4-
17 ^ 17 ^
18./lib/math.h:40:1: error: unknown type name '_GL_INLINE_HEADER_BEGIN' 18./lib/math.h:40:1: error: unknown type name '_GL_INLINE_HEADER_BEGIN'
19 19
20We delete eqn.cpp and qen.hpp in do_configure
21to ensure they're regenerated and deterministic.
22
20Upstream-Status: Pending 23Upstream-Status: Pending
21Signed-off-by: Khem Raj <raj.khem@gmail.com> 24Signed-off-by: Khem Raj <raj.khem@gmail.com>
22--- 25---
@@ -140,1029 +143,6 @@ index f95c05e..d875045 100644
140 #include <string.h> 143 #include <string.h>
141 #include <stdlib.h> 144 #include <stdlib.h>
142 145
143diff --git a/src/preproc/eqn/eqn.cpp b/src/preproc/eqn/eqn.cpp
144index 4ede465..fdd9484 100644
145--- a/src/preproc/eqn/eqn.cpp
146+++ b/src/preproc/eqn/eqn.cpp
147@@ -1,8 +1,9 @@
148-/* A Bison parser, made by GNU Bison 3.2. */
149+/* A Bison parser, made by GNU Bison 3.4.1. */
150
151 /* Bison implementation for Yacc-like parsers in C
152
153- Copyright (C) 1984, 1989-1990, 2000-2015, 2018 Free Software Foundation, Inc.
154+ Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 Free Software Foundation,
155+ Inc.
156
157 This program is free software: you can redistribute it and/or modify
158 it under the terms of the GNU General Public License as published by
159@@ -47,7 +48,7 @@
160 #define YYBISON 1
161
162 /* Bison version. */
163-#define YYBISON_VERSION "3.2"
164+#define YYBISON_VERSION "3.4.1"
165
166 /* Skeleton name. */
167 #define YYSKELETON_NAME "yacc.c"
168@@ -65,7 +66,11 @@
169
170
171 /* First part of user prologue. */
172-#line 18 "../src/preproc/eqn/eqn.ypp" /* yacc.c:338 */
173+#line 18 "src/preproc/eqn/eqn.ypp"
174+
175+#if HAVE_CONFIG_H
176+# include <config.h>
177+#endif
178
179 #include <stdio.h>
180 #include <string.h>
181@@ -77,7 +82,8 @@ extern int non_empty_flag;
182 int yylex();
183 void yyerror(const char *);
184
185-#line 81 "src/preproc/eqn/eqn.cpp" /* yacc.c:338 */
186+#line 86 "src/preproc/eqn/eqn.cpp"
187+
188 # ifndef YY_NULLPTR
189 # if defined __cplusplus
190 # if 201103L <= __cplusplus
191@@ -98,8 +104,8 @@ void yyerror(const char *);
192 # define YYERROR_VERBOSE 0
193 #endif
194
195-/* In a future release of Bison, this section will be replaced
196- by #include "y.tab.h". */
197+/* Use api.header.include to #include this header
198+ instead of duplicating it here. */
199 #ifndef YY_YY_SRC_PREPROC_EQN_EQN_HPP_INCLUDED
200 # define YY_YY_SRC_PREPROC_EQN_EQN_HPP_INCLUDED
201 /* Debug traces. */
202@@ -237,10 +243,9 @@ extern int yydebug;
203
204 /* Value type. */
205 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
206-
207 union YYSTYPE
208 {
209-#line 30 "../src/preproc/eqn/eqn.ypp" /* yacc.c:353 */
210+#line 34 "src/preproc/eqn/eqn.ypp"
211
212 char *str;
213 box *b;
214@@ -249,9 +254,9 @@ union YYSTYPE
215 int n;
216 column *col;
217
218-#line 253 "src/preproc/eqn/eqn.cpp" /* yacc.c:353 */
219-};
220+#line 258 "src/preproc/eqn/eqn.cpp"
221
222+};
223 typedef union YYSTYPE YYSTYPE;
224 # define YYSTYPE_IS_TRIVIAL 1
225 # define YYSTYPE_IS_DECLARED 1
226@@ -366,6 +371,8 @@ typedef short yytype_int16;
227 #endif
228
229
230+#define YY_ASSERT(E) ((void) (0 && (E)))
231+
232 #if ! defined yyoverflow || YYERROR_VERBOSE
233
234 /* The parser invokes alloca or malloc; define the necessary symbols. */
235@@ -508,16 +515,16 @@ union yyalloc
236 /* YYNSTATES -- Number of states. */
237 #define YYNSTATES 142
238
239-/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
240- by yylex, with out-of-bounds checking. */
241 #define YYUNDEFTOK 2
242 #define YYMAXUTOK 315
243
244+/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
245+ as returned by yylex, with out-of-bounds checking. */
246 #define YYTRANSLATE(YYX) \
247 ((unsigned) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
248
249 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
250- as returned by yylex, without out-of-bounds checking. */
251+ as returned by yylex. */
252 static const yytype_uint8 yytranslate[] =
253 {
254 0, 2, 2, 2, 2, 2, 2, 2, 2, 63,
255@@ -558,14 +565,14 @@ static const yytype_uint8 yytranslate[] =
256 /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
257 static const yytype_uint16 yyrline[] =
258 {
259- 0, 121, 121, 123, 128, 130, 141, 143, 145, 150,
260- 152, 154, 156, 158, 163, 165, 167, 169, 174, 176,
261- 181, 183, 185, 190, 192, 194, 196, 198, 200, 202,
262- 204, 206, 208, 210, 212, 214, 216, 218, 220, 222,
263- 224, 226, 228, 230, 232, 234, 236, 238, 240, 242,
264- 244, 246, 248, 250, 252, 254, 259, 269, 271, 276,
265- 278, 283, 285, 290, 292, 297, 299, 304, 306, 308,
266- 310, 314, 316, 321, 323, 325
267+ 0, 125, 125, 127, 132, 134, 145, 147, 149, 154,
268+ 156, 158, 160, 162, 167, 169, 171, 173, 178, 180,
269+ 185, 187, 189, 194, 196, 198, 200, 202, 204, 206,
270+ 208, 210, 212, 214, 216, 218, 220, 222, 224, 226,
271+ 228, 230, 232, 234, 236, 238, 240, 242, 244, 246,
272+ 248, 250, 252, 254, 256, 258, 263, 273, 275, 280,
273+ 282, 287, 289, 294, 296, 301, 303, 308, 310, 312,
274+ 314, 318, 320, 325, 327, 329
275 };
276 #endif
277
278@@ -818,22 +825,22 @@ static const yytype_uint8 yyr2[] =
279
280 #define YYRECOVERING() (!!yyerrstatus)
281
282-#define YYBACKUP(Token, Value) \
283-do \
284- if (yychar == YYEMPTY) \
285- { \
286- yychar = (Token); \
287- yylval = (Value); \
288- YYPOPSTACK (yylen); \
289- yystate = *yyssp; \
290- goto yybackup; \
291- } \
292- else \
293- { \
294- yyerror (YY_("syntax error: cannot back up")); \
295- YYERROR; \
296- } \
297-while (0)
298+#define YYBACKUP(Token, Value) \
299+ do \
300+ if (yychar == YYEMPTY) \
301+ { \
302+ yychar = (Token); \
303+ yylval = (Value); \
304+ YYPOPSTACK (yylen); \
305+ yystate = *yyssp; \
306+ goto yybackup; \
307+ } \
308+ else \
309+ { \
310+ yyerror (YY_("syntax error: cannot back up")); \
311+ YYERROR; \
312+ } \
313+ while (0)
314
315 /* Error token number */
316 #define YYTERROR 1
317@@ -948,7 +955,7 @@ yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule)
318 YYFPRINTF (stderr, " $%d = ", yyi + 1);
319 yy_symbol_print (stderr,
320 yystos[yyssp[yyi + 1 - yynrhs]],
321- &(yyvsp[(yyi + 1) - (yynrhs)])
322+ &yyvsp[(yyi + 1) - (yynrhs)]
323 );
324 YYFPRINTF (stderr, "\n");
325 }
326@@ -1052,7 +1059,10 @@ yytnamerr (char *yyres, const char *yystr)
327 case '\\':
328 if (*++yyp != '\\')
329 goto do_not_strip_quotes;
330- /* Fall through. */
331+ else
332+ goto append;
333+
334+ append:
335 default:
336 if (yyres)
337 yyres[yyn] = *yyp;
338@@ -1148,10 +1158,10 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
339 yyarg[yycount++] = yytname[yyx];
340 {
341 YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
342- if (! (yysize <= yysize1
343- && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
344+ if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
345+ yysize = yysize1;
346+ else
347 return 2;
348- yysize = yysize1;
349 }
350 }
351 }
352@@ -1175,9 +1185,10 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
353
354 {
355 YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
356- if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
357+ if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
358+ yysize = yysize1;
359+ else
360 return 2;
361- yysize = yysize1;
362 }
363
364 if (*yymsg_alloc < yysize)
365@@ -1303,23 +1314,33 @@ yyparse (void)
366 yychar = YYEMPTY; /* Cause a token to be read. */
367 goto yysetstate;
368
369+
370 /*------------------------------------------------------------.
371-| yynewstate -- Push a new state, which is found in yystate. |
372+| yynewstate -- push a new state, which is found in yystate. |
373 `------------------------------------------------------------*/
374- yynewstate:
375+yynewstate:
376 /* In all cases, when you get here, the value and location stacks
377 have just been pushed. So pushing a state here evens the stacks. */
378 yyssp++;
379
380- yysetstate:
381+
382+/*--------------------------------------------------------------------.
383+| yynewstate -- set current state (the top of the stack) to yystate. |
384+`--------------------------------------------------------------------*/
385+yysetstate:
386+ YYDPRINTF ((stderr, "Entering state %d\n", yystate));
387+ YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
388 *yyssp = (yytype_int16) yystate;
389
390 if (yyss + yystacksize - 1 <= yyssp)
391+#if !defined yyoverflow && !defined YYSTACK_RELOCATE
392+ goto yyexhaustedlab;
393+#else
394 {
395 /* Get the current used size of the three stacks, in elements. */
396 YYSIZE_T yysize = (YYSIZE_T) (yyssp - yyss + 1);
397
398-#ifdef yyoverflow
399+# if defined yyoverflow
400 {
401 /* Give user a chance to reallocate the stack. Use copies of
402 these so that the &'s don't force the real ones into
403@@ -1338,10 +1359,7 @@ yyparse (void)
404 yyss = yyss1;
405 yyvs = yyvs1;
406 }
407-#else /* no yyoverflow */
408-# ifndef YYSTACK_RELOCATE
409- goto yyexhaustedlab;
410-# else
411+# else /* defined YYSTACK_RELOCATE */
412 /* Extend the stack our own way. */
413 if (YYMAXDEPTH <= yystacksize)
414 goto yyexhaustedlab;
415@@ -1357,12 +1375,11 @@ yyparse (void)
416 goto yyexhaustedlab;
417 YYSTACK_RELOCATE (yyss_alloc, yyss);
418 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
419-# undef YYSTACK_RELOCATE
420+# undef YYSTACK_RELOCATE
421 if (yyss1 != yyssa)
422 YYSTACK_FREE (yyss1);
423 }
424 # endif
425-#endif /* no yyoverflow */
426
427 yyssp = yyss + yysize - 1;
428 yyvsp = yyvs + yysize - 1;
429@@ -1373,19 +1390,18 @@ yyparse (void)
430 if (yyss + yystacksize - 1 <= yyssp)
431 YYABORT;
432 }
433-
434- YYDPRINTF ((stderr, "Entering state %d\n", yystate));
435+#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
436
437 if (yystate == YYFINAL)
438 YYACCEPT;
439
440 goto yybackup;
441
442+
443 /*-----------.
444 | yybackup. |
445 `-----------*/
446 yybackup:
447-
448 /* Do appropriate processing given the current state. Read a
449 lookahead token if we need one and don't already have one. */
450
451@@ -1443,7 +1459,6 @@ yybackup:
452 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
453 *++yyvsp = yylval;
454 YY_IGNORE_MAYBE_UNINITIALIZED_END
455-
456 goto yynewstate;
457
458
459@@ -1458,7 +1473,7 @@ yydefault:
460
461
462 /*-----------------------------.
463-| yyreduce -- Do a reduction. |
464+| yyreduce -- do a reduction. |
465 `-----------------------------*/
466 yyreduce:
467 /* yyn is the number of a rule to reduce with. */
468@@ -1478,20 +1493,20 @@ yyreduce:
469 YY_REDUCE_PRINT (yyn);
470 switch (yyn)
471 {
472- case 3:
473-#line 124 "../src/preproc/eqn/eqn.ypp" /* yacc.c:1645 */
474+ case 3:
475+#line 128 "src/preproc/eqn/eqn.ypp"
476 { (yyvsp[0].b)->top_level(); non_empty_flag = 1; }
477-#line 1485 "src/preproc/eqn/eqn.cpp" /* yacc.c:1645 */
478+#line 1500 "src/preproc/eqn/eqn.cpp"
479 break;
480
481 case 4:
482-#line 129 "../src/preproc/eqn/eqn.ypp" /* yacc.c:1645 */
483+#line 133 "src/preproc/eqn/eqn.ypp"
484 { (yyval.b) = (yyvsp[0].b); }
485-#line 1491 "src/preproc/eqn/eqn.cpp" /* yacc.c:1645 */
486+#line 1506 "src/preproc/eqn/eqn.cpp"
487 break;
488
489 case 5:
490-#line 131 "../src/preproc/eqn/eqn.ypp" /* yacc.c:1645 */
491+#line 135 "src/preproc/eqn/eqn.ypp"
492 {
493 list_box *lb = (yyvsp[-1].b)->to_list_box();
494 if (!lb)
495@@ -1499,436 +1514,437 @@ yyreduce:
496 lb->append((yyvsp[0].b));
497 (yyval.b) = lb;
498 }
499-#line 1503 "src/preproc/eqn/eqn.cpp" /* yacc.c:1645 */
500+#line 1518 "src/preproc/eqn/eqn.cpp"
501 break;
502
503 case 6:
504-#line 142 "../src/preproc/eqn/eqn.ypp" /* yacc.c:1645 */
505+#line 146 "src/preproc/eqn/eqn.ypp"
506 { (yyval.b) = (yyvsp[0].b); }
507-#line 1509 "src/preproc/eqn/eqn.cpp" /* yacc.c:1645 */
508+#line 1524 "src/preproc/eqn/eqn.cpp"
509 break;
510
511 case 7:
512-#line 144 "../src/preproc/eqn/eqn.ypp" /* yacc.c:1645 */
513+#line 148 "src/preproc/eqn/eqn.ypp"
514 { (yyval.b) = make_mark_box((yyvsp[0].b)); }
515-#line 1515 "src/preproc/eqn/eqn.cpp" /* yacc.c:1645 */
516+#line 1530 "src/preproc/eqn/eqn.cpp"
517 break;
518
519 case 8:
520-#line 146 "../src/preproc/eqn/eqn.ypp" /* yacc.c:1645 */
521+#line 150 "src/preproc/eqn/eqn.ypp"
522 { (yyval.b) = make_lineup_box((yyvsp[0].b)); }
523-#line 1521 "src/preproc/eqn/eqn.cpp" /* yacc.c:1645 */
524+#line 1536 "src/preproc/eqn/eqn.cpp"
525 break;
526
527 case 9:
528-#line 151 "../src/preproc/eqn/eqn.ypp" /* yacc.c:1645 */
529+#line 155 "src/preproc/eqn/eqn.ypp"
530 { (yyval.b) = (yyvsp[0].b); }
531-#line 1527 "src/preproc/eqn/eqn.cpp" /* yacc.c:1645 */
532+#line 1542 "src/preproc/eqn/eqn.cpp"
533 break;
534
535 case 10:
536-#line 153 "../src/preproc/eqn/eqn.ypp" /* yacc.c:1645 */
537+#line 157 "src/preproc/eqn/eqn.ypp"
538 { (yyval.b) = make_limit_box((yyvsp[-2].b), 0, (yyvsp[0].b)); }
539-#line 1533 "src/preproc/eqn/eqn.cpp" /* yacc.c:1645 */
540+#line 1548 "src/preproc/eqn/eqn.cpp"
541 break;
542
543 case 11:
544-#line 155 "../src/preproc/eqn/eqn.ypp" /* yacc.c:1645 */
545+#line 159 "src/preproc/eqn/eqn.ypp"
546 { (yyval.b) = make_limit_box((yyvsp[-2].b), (yyvsp[0].b), 0); }
547-#line 1539 "src/preproc/eqn/eqn.cpp" /* yacc.c:1645 */
548+#line 1554 "src/preproc/eqn/eqn.cpp"
549 break;
550
551 case 12:
552-#line 157 "../src/preproc/eqn/eqn.ypp" /* yacc.c:1645 */
553+#line 161 "src/preproc/eqn/eqn.ypp"
554 { (yyval.b) = make_limit_box((yyvsp[-4].b), (yyvsp[-2].b), (yyvsp[0].b)); }
555-#line 1545 "src/preproc/eqn/eqn.cpp" /* yacc.c:1645 */
556+#line 1560 "src/preproc/eqn/eqn.cpp"
557 break;
558
559 case 13:
560-#line 159 "../src/preproc/eqn/eqn.ypp" /* yacc.c:1645 */
561+#line 163 "src/preproc/eqn/eqn.ypp"
562 { (yyval.b) = make_limit_box((yyvsp[-4].b), make_limit_box((yyvsp[-2].b), (yyvsp[0].b), 0), 0); }
563-#line 1551 "src/preproc/eqn/eqn.cpp" /* yacc.c:1645 */
564+#line 1566 "src/preproc/eqn/eqn.cpp"
565 break;
566
567 case 14:
568-#line 164 "../src/preproc/eqn/eqn.ypp" /* yacc.c:1645 */
569+#line 168 "src/preproc/eqn/eqn.ypp"
570 { (yyval.b) = (yyvsp[0].b); }
571-#line 1557 "src/preproc/eqn/eqn.cpp" /* yacc.c:1645 */
572+#line 1572 "src/preproc/eqn/eqn.cpp"
573 break;
574
575 case 15:
576-#line 166 "../src/preproc/eqn/eqn.ypp" /* yacc.c:1645 */
577+#line 170 "src/preproc/eqn/eqn.ypp"
578 { (yyval.b) = make_sqrt_box((yyvsp[0].b)); }
579-#line 1563 "src/preproc/eqn/eqn.cpp" /* yacc.c:1645 */
580+#line 1578 "src/preproc/eqn/eqn.cpp"
581 break;
582
583 case 16:
584-#line 168 "../src/preproc/eqn/eqn.ypp" /* yacc.c:1645 */
585+#line 172 "src/preproc/eqn/eqn.ypp"
586 { (yyval.b) = make_over_box((yyvsp[-2].b), (yyvsp[0].b)); }
587-#line 1569 "src/preproc/eqn/eqn.cpp" /* yacc.c:1645 */
588+#line 1584 "src/preproc/eqn/eqn.cpp"
589 break;
590
591 case 17:
592-#line 170 "../src/preproc/eqn/eqn.ypp" /* yacc.c:1645 */
593+#line 174 "src/preproc/eqn/eqn.ypp"
594 { (yyval.b) = make_small_over_box((yyvsp[-2].b), (yyvsp[0].b)); }
595-#line 1575 "src/preproc/eqn/eqn.cpp" /* yacc.c:1645 */
596+#line 1590 "src/preproc/eqn/eqn.cpp"
597 break;
598
599 case 18:
600-#line 175 "../src/preproc/eqn/eqn.ypp" /* yacc.c:1645 */
601+#line 179 "src/preproc/eqn/eqn.ypp"
602 { (yyval.b) = (yyvsp[0].b); }
603-#line 1581 "src/preproc/eqn/eqn.cpp" /* yacc.c:1645 */
604+#line 1596 "src/preproc/eqn/eqn.cpp"
605 break;
606
607 case 19:
608-#line 177 "../src/preproc/eqn/eqn.ypp" /* yacc.c:1645 */
609+#line 181 "src/preproc/eqn/eqn.ypp"
610 { (yyval.b) = make_script_box((yyvsp[-2].b), 0, (yyvsp[0].b)); }
611-#line 1587 "src/preproc/eqn/eqn.cpp" /* yacc.c:1645 */
612+#line 1602 "src/preproc/eqn/eqn.cpp"
613 break;
614
615 case 20:
616-#line 182 "../src/preproc/eqn/eqn.ypp" /* yacc.c:1645 */
617+#line 186 "src/preproc/eqn/eqn.ypp"
618 { (yyval.b) = (yyvsp[0].b); }
619-#line 1593 "src/preproc/eqn/eqn.cpp" /* yacc.c:1645 */
620+#line 1608 "src/preproc/eqn/eqn.cpp"
621 break;
622
623 case 21:
624-#line 184 "../src/preproc/eqn/eqn.ypp" /* yacc.c:1645 */
625+#line 188 "src/preproc/eqn/eqn.ypp"
626 { (yyval.b) = make_script_box((yyvsp[-2].b), (yyvsp[0].b), 0); }
627-#line 1599 "src/preproc/eqn/eqn.cpp" /* yacc.c:1645 */
628+#line 1614 "src/preproc/eqn/eqn.cpp"
629 break;
630
631 case 22:
632-#line 186 "../src/preproc/eqn/eqn.ypp" /* yacc.c:1645 */
633+#line 190 "src/preproc/eqn/eqn.ypp"
634 { (yyval.b) = make_script_box((yyvsp[-4].b), (yyvsp[-2].b), (yyvsp[0].b)); }
635-#line 1605 "src/preproc/eqn/eqn.cpp" /* yacc.c:1645 */
636+#line 1620 "src/preproc/eqn/eqn.cpp"
637 break;
638
639 case 23:
640-#line 191 "../src/preproc/eqn/eqn.ypp" /* yacc.c:1645 */
641+#line 195 "src/preproc/eqn/eqn.ypp"
642 { (yyval.b) = split_text((yyvsp[0].str)); }
643-#line 1611 "src/preproc/eqn/eqn.cpp" /* yacc.c:1645 */
644+#line 1626 "src/preproc/eqn/eqn.cpp"
645 break;
646
647 case 24:
648-#line 193 "../src/preproc/eqn/eqn.ypp" /* yacc.c:1645 */
649+#line 197 "src/preproc/eqn/eqn.ypp"
650 { (yyval.b) = new quoted_text_box((yyvsp[0].str)); }
651-#line 1617 "src/preproc/eqn/eqn.cpp" /* yacc.c:1645 */
652+#line 1632 "src/preproc/eqn/eqn.cpp"
653 break;
654
655 case 25:
656-#line 195 "../src/preproc/eqn/eqn.ypp" /* yacc.c:1645 */
657+#line 199 "src/preproc/eqn/eqn.ypp"
658 { (yyval.b) = split_text((yyvsp[0].str)); }
659-#line 1623 "src/preproc/eqn/eqn.cpp" /* yacc.c:1645 */
660+#line 1638 "src/preproc/eqn/eqn.cpp"
661 break;
662
663 case 26:
664-#line 197 "../src/preproc/eqn/eqn.ypp" /* yacc.c:1645 */
665+#line 201 "src/preproc/eqn/eqn.ypp"
666 { (yyval.b) = new quoted_text_box((yyvsp[0].str)); }
667-#line 1629 "src/preproc/eqn/eqn.cpp" /* yacc.c:1645 */
668+#line 1644 "src/preproc/eqn/eqn.cpp"
669 break;
670
671 case 27:
672-#line 199 "../src/preproc/eqn/eqn.ypp" /* yacc.c:1645 */
673+#line 203 "src/preproc/eqn/eqn.ypp"
674 { (yyval.b) = new half_space_box; }
675-#line 1635 "src/preproc/eqn/eqn.cpp" /* yacc.c:1645 */
676+#line 1650 "src/preproc/eqn/eqn.cpp"
677 break;
678
679 case 28:
680-#line 201 "../src/preproc/eqn/eqn.ypp" /* yacc.c:1645 */
681+#line 205 "src/preproc/eqn/eqn.ypp"
682 { (yyval.b) = new space_box; }
683-#line 1641 "src/preproc/eqn/eqn.cpp" /* yacc.c:1645 */
684+#line 1656 "src/preproc/eqn/eqn.cpp"
685 break;
686
687 case 29:
688-#line 203 "../src/preproc/eqn/eqn.ypp" /* yacc.c:1645 */
689+#line 207 "src/preproc/eqn/eqn.ypp"
690 { (yyval.b) = new tab_box; }
691-#line 1647 "src/preproc/eqn/eqn.cpp" /* yacc.c:1645 */
692+#line 1662 "src/preproc/eqn/eqn.cpp"
693 break;
694
695 case 30:
696-#line 205 "../src/preproc/eqn/eqn.ypp" /* yacc.c:1645 */
697+#line 209 "src/preproc/eqn/eqn.ypp"
698 { (yyval.b) = (yyvsp[-1].b); }
699-#line 1653 "src/preproc/eqn/eqn.cpp" /* yacc.c:1645 */
700+#line 1668 "src/preproc/eqn/eqn.cpp"
701 break;
702
703 case 31:
704-#line 207 "../src/preproc/eqn/eqn.ypp" /* yacc.c:1645 */
705+#line 211 "src/preproc/eqn/eqn.ypp"
706 { (yyvsp[0].pb)->set_alignment(CENTER_ALIGN); (yyval.b) = (yyvsp[0].pb); }
707-#line 1659 "src/preproc/eqn/eqn.cpp" /* yacc.c:1645 */
708+#line 1674 "src/preproc/eqn/eqn.cpp"
709 break;
710
711 case 32:
712-#line 209 "../src/preproc/eqn/eqn.ypp" /* yacc.c:1645 */
713+#line 213 "src/preproc/eqn/eqn.ypp"
714 { (yyvsp[0].pb)->set_alignment(LEFT_ALIGN); (yyval.b) = (yyvsp[0].pb); }
715-#line 1665 "src/preproc/eqn/eqn.cpp" /* yacc.c:1645 */
716+#line 1680 "src/preproc/eqn/eqn.cpp"
717 break;
718
719 case 33:
720-#line 211 "../src/preproc/eqn/eqn.ypp" /* yacc.c:1645 */
721+#line 215 "src/preproc/eqn/eqn.ypp"
722 { (yyvsp[0].pb)->set_alignment(RIGHT_ALIGN); (yyval.b) = (yyvsp[0].pb); }
723-#line 1671 "src/preproc/eqn/eqn.cpp" /* yacc.c:1645 */
724+#line 1686 "src/preproc/eqn/eqn.cpp"
725 break;
726
727 case 34:
728-#line 213 "../src/preproc/eqn/eqn.ypp" /* yacc.c:1645 */
729+#line 217 "src/preproc/eqn/eqn.ypp"
730 { (yyvsp[0].pb)->set_alignment(CENTER_ALIGN); (yyval.b) = (yyvsp[0].pb); }
731-#line 1677 "src/preproc/eqn/eqn.cpp" /* yacc.c:1645 */
732+#line 1692 "src/preproc/eqn/eqn.cpp"
733 break;
734
735 case 35:
736-#line 215 "../src/preproc/eqn/eqn.ypp" /* yacc.c:1645 */
737+#line 219 "src/preproc/eqn/eqn.ypp"
738 { (yyval.b) = (yyvsp[-1].mb); }
739-#line 1683 "src/preproc/eqn/eqn.cpp" /* yacc.c:1645 */
740+#line 1698 "src/preproc/eqn/eqn.cpp"
741 break;
742
743 case 36:
744-#line 217 "../src/preproc/eqn/eqn.ypp" /* yacc.c:1645 */
745+#line 221 "src/preproc/eqn/eqn.ypp"
746 { (yyval.b) = make_delim_box((yyvsp[-3].str), (yyvsp[-2].b), (yyvsp[0].str)); }
747-#line 1689 "src/preproc/eqn/eqn.cpp" /* yacc.c:1645 */
748+#line 1704 "src/preproc/eqn/eqn.cpp"
749 break;
750
751 case 37:
752-#line 219 "../src/preproc/eqn/eqn.ypp" /* yacc.c:1645 */
753+#line 223 "src/preproc/eqn/eqn.ypp"
754 { (yyval.b) = make_delim_box((yyvsp[-1].str), (yyvsp[0].b), 0); }
755-#line 1695 "src/preproc/eqn/eqn.cpp" /* yacc.c:1645 */
756+#line 1710 "src/preproc/eqn/eqn.cpp"
757 break;
758
759 case 38:
760-#line 221 "../src/preproc/eqn/eqn.ypp" /* yacc.c:1645 */
761+#line 225 "src/preproc/eqn/eqn.ypp"
762 { (yyval.b) = make_overline_box((yyvsp[-1].b)); }
763-#line 1701 "src/preproc/eqn/eqn.cpp" /* yacc.c:1645 */
764+#line 1716 "src/preproc/eqn/eqn.cpp"
765 break;
766
767 case 39:
768-#line 223 "../src/preproc/eqn/eqn.ypp" /* yacc.c:1645 */
769+#line 227 "src/preproc/eqn/eqn.ypp"
770 { (yyval.b) = make_underline_box((yyvsp[-1].b)); }
771-#line 1707 "src/preproc/eqn/eqn.cpp" /* yacc.c:1645 */
772+#line 1722 "src/preproc/eqn/eqn.cpp"
773 break;
774
775 case 40:
776-#line 225 "../src/preproc/eqn/eqn.ypp" /* yacc.c:1645 */
777+#line 229 "src/preproc/eqn/eqn.ypp"
778 { (yyval.b) = make_prime_box((yyvsp[-1].b)); }
779-#line 1713 "src/preproc/eqn/eqn.cpp" /* yacc.c:1645 */
780+#line 1728 "src/preproc/eqn/eqn.cpp"
781 break;
782
783 case 41:
784-#line 227 "../src/preproc/eqn/eqn.ypp" /* yacc.c:1645 */
785+#line 231 "src/preproc/eqn/eqn.ypp"
786 { (yyval.b) = make_accent_box((yyvsp[-2].b), (yyvsp[0].b)); }
787-#line 1719 "src/preproc/eqn/eqn.cpp" /* yacc.c:1645 */
788+#line 1734 "src/preproc/eqn/eqn.cpp"
789 break;
790
791 case 42:
792-#line 229 "../src/preproc/eqn/eqn.ypp" /* yacc.c:1645 */
793+#line 233 "src/preproc/eqn/eqn.ypp"
794 { (yyval.b) = make_uaccent_box((yyvsp[-2].b), (yyvsp[0].b)); }
795-#line 1725 "src/preproc/eqn/eqn.cpp" /* yacc.c:1645 */
796+#line 1740 "src/preproc/eqn/eqn.cpp"
797 break;
798
799 case 43:
800-#line 231 "../src/preproc/eqn/eqn.ypp" /* yacc.c:1645 */
801+#line 235 "src/preproc/eqn/eqn.ypp"
802 { (yyval.b) = new font_box(strsave(get_grfont()), (yyvsp[0].b)); }
803-#line 1731 "src/preproc/eqn/eqn.cpp" /* yacc.c:1645 */
804+#line 1746 "src/preproc/eqn/eqn.cpp"
805 break;
806
807 case 44:
808-#line 233 "../src/preproc/eqn/eqn.ypp" /* yacc.c:1645 */
809+#line 237 "src/preproc/eqn/eqn.ypp"
810 { (yyval.b) = new font_box(strsave(get_gbfont()), (yyvsp[0].b)); }
811-#line 1737 "src/preproc/eqn/eqn.cpp" /* yacc.c:1645 */
812+#line 1752 "src/preproc/eqn/eqn.cpp"
813 break;
814
815 case 45:
816-#line 235 "../src/preproc/eqn/eqn.ypp" /* yacc.c:1645 */
817+#line 239 "src/preproc/eqn/eqn.ypp"
818 { (yyval.b) = new font_box(strsave(get_gfont()), (yyvsp[0].b)); }
819-#line 1743 "src/preproc/eqn/eqn.cpp" /* yacc.c:1645 */
820+#line 1758 "src/preproc/eqn/eqn.cpp"
821 break;
822
823 case 46:
824-#line 237 "../src/preproc/eqn/eqn.ypp" /* yacc.c:1645 */
825+#line 241 "src/preproc/eqn/eqn.ypp"
826 { (yyval.b) = new fat_box((yyvsp[0].b)); }
827-#line 1749 "src/preproc/eqn/eqn.cpp" /* yacc.c:1645 */
828+#line 1764 "src/preproc/eqn/eqn.cpp"
829 break;
830
831 case 47:
832-#line 239 "../src/preproc/eqn/eqn.ypp" /* yacc.c:1645 */
833+#line 243 "src/preproc/eqn/eqn.ypp"
834 { (yyval.b) = new font_box((yyvsp[-1].str), (yyvsp[0].b)); }
835-#line 1755 "src/preproc/eqn/eqn.cpp" /* yacc.c:1645 */
836+#line 1770 "src/preproc/eqn/eqn.cpp"
837 break;
838
839 case 48:
840-#line 241 "../src/preproc/eqn/eqn.ypp" /* yacc.c:1645 */
841+#line 245 "src/preproc/eqn/eqn.ypp"
842 { (yyval.b) = new size_box((yyvsp[-1].str), (yyvsp[0].b)); }
843-#line 1761 "src/preproc/eqn/eqn.cpp" /* yacc.c:1645 */
844+#line 1776 "src/preproc/eqn/eqn.cpp"
845 break;
846
847 case 49:
848-#line 243 "../src/preproc/eqn/eqn.ypp" /* yacc.c:1645 */
849+#line 247 "src/preproc/eqn/eqn.ypp"
850 { (yyval.b) = new hmotion_box((yyvsp[-1].n), (yyvsp[0].b)); }
851-#line 1767 "src/preproc/eqn/eqn.cpp" /* yacc.c:1645 */
852+#line 1782 "src/preproc/eqn/eqn.cpp"
853 break;
854
855 case 50:
856-#line 245 "../src/preproc/eqn/eqn.ypp" /* yacc.c:1645 */
857+#line 249 "src/preproc/eqn/eqn.ypp"
858 { (yyval.b) = new hmotion_box(-(yyvsp[-1].n), (yyvsp[0].b)); }
859-#line 1773 "src/preproc/eqn/eqn.cpp" /* yacc.c:1645 */
860+#line 1788 "src/preproc/eqn/eqn.cpp"
861 break;
862
863 case 51:
864-#line 247 "../src/preproc/eqn/eqn.ypp" /* yacc.c:1645 */
865+#line 251 "src/preproc/eqn/eqn.ypp"
866 { (yyval.b) = new vmotion_box((yyvsp[-1].n), (yyvsp[0].b)); }
867-#line 1779 "src/preproc/eqn/eqn.cpp" /* yacc.c:1645 */
868+#line 1794 "src/preproc/eqn/eqn.cpp"
869 break;
870
871 case 52:
872-#line 249 "../src/preproc/eqn/eqn.ypp" /* yacc.c:1645 */
873+#line 253 "src/preproc/eqn/eqn.ypp"
874 { (yyval.b) = new vmotion_box(-(yyvsp[-1].n), (yyvsp[0].b)); }
875-#line 1785 "src/preproc/eqn/eqn.cpp" /* yacc.c:1645 */
876+#line 1800 "src/preproc/eqn/eqn.cpp"
877 break;
878
879 case 53:
880-#line 251 "../src/preproc/eqn/eqn.ypp" /* yacc.c:1645 */
881+#line 255 "src/preproc/eqn/eqn.ypp"
882 { (yyvsp[0].b)->set_spacing_type((yyvsp[-1].str)); (yyval.b) = (yyvsp[0].b); }
883-#line 1791 "src/preproc/eqn/eqn.cpp" /* yacc.c:1645 */
884+#line 1806 "src/preproc/eqn/eqn.cpp"
885 break;
886
887 case 54:
888-#line 253 "../src/preproc/eqn/eqn.ypp" /* yacc.c:1645 */
889+#line 257 "src/preproc/eqn/eqn.ypp"
890 { (yyval.b) = new vcenter_box((yyvsp[0].b)); }
891-#line 1797 "src/preproc/eqn/eqn.cpp" /* yacc.c:1645 */
892+#line 1812 "src/preproc/eqn/eqn.cpp"
893 break;
894
895 case 55:
896-#line 255 "../src/preproc/eqn/eqn.ypp" /* yacc.c:1645 */
897+#line 259 "src/preproc/eqn/eqn.ypp"
898 { (yyval.b) = make_special_box((yyvsp[-1].str), (yyvsp[0].b)); }
899-#line 1803 "src/preproc/eqn/eqn.cpp" /* yacc.c:1645 */
900+#line 1818 "src/preproc/eqn/eqn.cpp"
901 break;
902
903 case 56:
904-#line 260 "../src/preproc/eqn/eqn.ypp" /* yacc.c:1645 */
905+#line 264 "src/preproc/eqn/eqn.ypp"
906 {
907 int n;
908 if (sscanf((yyvsp[0].str), "%d", &n) == 1)
909 (yyval.n) = n;
910 a_delete (yyvsp[0].str);
911 }
912-#line 1814 "src/preproc/eqn/eqn.cpp" /* yacc.c:1645 */
913+#line 1829 "src/preproc/eqn/eqn.cpp"
914 break;
915
916 case 57:
917-#line 270 "../src/preproc/eqn/eqn.ypp" /* yacc.c:1645 */
918+#line 274 "src/preproc/eqn/eqn.ypp"
919 { (yyval.pb) = new pile_box((yyvsp[0].b)); }
920-#line 1820 "src/preproc/eqn/eqn.cpp" /* yacc.c:1645 */
921+#line 1835 "src/preproc/eqn/eqn.cpp"
922 break;
923
924 case 58:
925-#line 272 "../src/preproc/eqn/eqn.ypp" /* yacc.c:1645 */
926+#line 276 "src/preproc/eqn/eqn.ypp"
927 { (yyvsp[-2].pb)->append((yyvsp[0].b)); (yyval.pb) = (yyvsp[-2].pb); }
928-#line 1826 "src/preproc/eqn/eqn.cpp" /* yacc.c:1645 */
929+#line 1841 "src/preproc/eqn/eqn.cpp"
930 break;
931
932 case 59:
933-#line 277 "../src/preproc/eqn/eqn.ypp" /* yacc.c:1645 */
934+#line 281 "src/preproc/eqn/eqn.ypp"
935 { (yyval.pb) = (yyvsp[-1].pb); }
936-#line 1832 "src/preproc/eqn/eqn.cpp" /* yacc.c:1645 */
937+#line 1847 "src/preproc/eqn/eqn.cpp"
938 break;
939
940 case 60:
941-#line 279 "../src/preproc/eqn/eqn.ypp" /* yacc.c:1645 */
942+#line 283 "src/preproc/eqn/eqn.ypp"
943 { (yyvsp[-1].pb)->set_space((yyvsp[-3].n)); (yyval.pb) = (yyvsp[-1].pb); }
944-#line 1838 "src/preproc/eqn/eqn.cpp" /* yacc.c:1645 */
945+#line 1853 "src/preproc/eqn/eqn.cpp"
946 break;
947
948 case 61:
949-#line 284 "../src/preproc/eqn/eqn.ypp" /* yacc.c:1645 */
950+#line 288 "src/preproc/eqn/eqn.ypp"
951 { (yyval.mb) = new matrix_box((yyvsp[0].col)); }
952-#line 1844 "src/preproc/eqn/eqn.cpp" /* yacc.c:1645 */
953+#line 1859 "src/preproc/eqn/eqn.cpp"
954 break;
955
956 case 62:
957-#line 286 "../src/preproc/eqn/eqn.ypp" /* yacc.c:1645 */
958+#line 290 "src/preproc/eqn/eqn.ypp"
959 { (yyvsp[-1].mb)->append((yyvsp[0].col)); (yyval.mb) = (yyvsp[-1].mb); }
960-#line 1850 "src/preproc/eqn/eqn.cpp" /* yacc.c:1645 */
961+#line 1865 "src/preproc/eqn/eqn.cpp"
962 break;
963
964 case 63:
965-#line 291 "../src/preproc/eqn/eqn.ypp" /* yacc.c:1645 */
966+#line 295 "src/preproc/eqn/eqn.ypp"
967 { (yyval.col) = new column((yyvsp[0].b)); }
968-#line 1856 "src/preproc/eqn/eqn.cpp" /* yacc.c:1645 */
969+#line 1871 "src/preproc/eqn/eqn.cpp"
970 break;
971
972 case 64:
973-#line 293 "../src/preproc/eqn/eqn.ypp" /* yacc.c:1645 */
974+#line 297 "src/preproc/eqn/eqn.ypp"
975 { (yyvsp[-2].col)->append((yyvsp[0].b)); (yyval.col) = (yyvsp[-2].col); }
976-#line 1862 "src/preproc/eqn/eqn.cpp" /* yacc.c:1645 */
977+#line 1877 "src/preproc/eqn/eqn.cpp"
978 break;
979
980 case 65:
981-#line 298 "../src/preproc/eqn/eqn.ypp" /* yacc.c:1645 */
982+#line 302 "src/preproc/eqn/eqn.ypp"
983 { (yyval.col) = (yyvsp[-1].col); }
984-#line 1868 "src/preproc/eqn/eqn.cpp" /* yacc.c:1645 */
985+#line 1883 "src/preproc/eqn/eqn.cpp"
986 break;
987
988 case 66:
989-#line 300 "../src/preproc/eqn/eqn.ypp" /* yacc.c:1645 */
990+#line 304 "src/preproc/eqn/eqn.ypp"
991 { (yyvsp[-1].col)->set_space((yyvsp[-3].n)); (yyval.col) = (yyvsp[-1].col); }
992-#line 1874 "src/preproc/eqn/eqn.cpp" /* yacc.c:1645 */
993+#line 1889 "src/preproc/eqn/eqn.cpp"
994 break;
995
996 case 67:
997-#line 305 "../src/preproc/eqn/eqn.ypp" /* yacc.c:1645 */
998+#line 309 "src/preproc/eqn/eqn.ypp"
999 { (yyvsp[0].col)->set_alignment(CENTER_ALIGN); (yyval.col) = (yyvsp[0].col); }
1000-#line 1880 "src/preproc/eqn/eqn.cpp" /* yacc.c:1645 */
1001+#line 1895 "src/preproc/eqn/eqn.cpp"
1002 break;
1003
1004 case 68:
1005-#line 307 "../src/preproc/eqn/eqn.ypp" /* yacc.c:1645 */
1006+#line 311 "src/preproc/eqn/eqn.ypp"
1007 { (yyvsp[0].col)->set_alignment(LEFT_ALIGN); (yyval.col) = (yyvsp[0].col); }
1008-#line 1886 "src/preproc/eqn/eqn.cpp" /* yacc.c:1645 */
1009+#line 1901 "src/preproc/eqn/eqn.cpp"
1010 break;
1011
1012 case 69:
1013-#line 309 "../src/preproc/eqn/eqn.ypp" /* yacc.c:1645 */
1014+#line 313 "src/preproc/eqn/eqn.ypp"
1015 { (yyvsp[0].col)->set_alignment(RIGHT_ALIGN); (yyval.col) = (yyvsp[0].col); }
1016-#line 1892 "src/preproc/eqn/eqn.cpp" /* yacc.c:1645 */
1017+#line 1907 "src/preproc/eqn/eqn.cpp"
1018 break;
1019
1020 case 70:
1021-#line 311 "../src/preproc/eqn/eqn.ypp" /* yacc.c:1645 */
1022+#line 315 "src/preproc/eqn/eqn.ypp"
1023 { (yyvsp[0].col)->set_alignment(CENTER_ALIGN); (yyval.col) = (yyvsp[0].col); }
1024-#line 1898 "src/preproc/eqn/eqn.cpp" /* yacc.c:1645 */
1025+#line 1913 "src/preproc/eqn/eqn.cpp"
1026 break;
1027
1028 case 71:
1029-#line 315 "../src/preproc/eqn/eqn.ypp" /* yacc.c:1645 */
1030+#line 319 "src/preproc/eqn/eqn.ypp"
1031 { (yyval.str) = (yyvsp[0].str); }
1032-#line 1904 "src/preproc/eqn/eqn.cpp" /* yacc.c:1645 */
1033+#line 1919 "src/preproc/eqn/eqn.cpp"
1034 break;
1035
1036 case 72:
1037-#line 317 "../src/preproc/eqn/eqn.ypp" /* yacc.c:1645 */
1038+#line 321 "src/preproc/eqn/eqn.ypp"
1039 { (yyval.str) = (yyvsp[0].str); }
1040-#line 1910 "src/preproc/eqn/eqn.cpp" /* yacc.c:1645 */
1041+#line 1925 "src/preproc/eqn/eqn.cpp"
1042 break;
1043
1044 case 73:
1045-#line 322 "../src/preproc/eqn/eqn.ypp" /* yacc.c:1645 */
1046+#line 326 "src/preproc/eqn/eqn.ypp"
1047 { (yyval.str) = (yyvsp[0].str); }
1048-#line 1916 "src/preproc/eqn/eqn.cpp" /* yacc.c:1645 */
1049+#line 1931 "src/preproc/eqn/eqn.cpp"
1050 break;
1051
1052 case 74:
1053-#line 324 "../src/preproc/eqn/eqn.ypp" /* yacc.c:1645 */
1054+#line 328 "src/preproc/eqn/eqn.ypp"
1055 { (yyval.str) = strsave("{"); }
1056-#line 1922 "src/preproc/eqn/eqn.cpp" /* yacc.c:1645 */
1057+#line 1937 "src/preproc/eqn/eqn.cpp"
1058 break;
1059
1060 case 75:
1061-#line 326 "../src/preproc/eqn/eqn.ypp" /* yacc.c:1645 */
1062+#line 330 "src/preproc/eqn/eqn.ypp"
1063 { (yyval.str) = strsave("}"); }
1064-#line 1928 "src/preproc/eqn/eqn.cpp" /* yacc.c:1645 */
1065+#line 1943 "src/preproc/eqn/eqn.cpp"
1066 break;
1067
1068
1069-#line 1932 "src/preproc/eqn/eqn.cpp" /* yacc.c:1645 */
1070+#line 1947 "src/preproc/eqn/eqn.cpp"
1071+
1072 default: break;
1073 }
1074 /* User semantic actions sometimes alter yychar, and that requires
1075@@ -2042,12 +2058,10 @@ yyerrlab:
1076 | yyerrorlab -- error raised explicitly by YYERROR. |
1077 `---------------------------------------------------*/
1078 yyerrorlab:
1079-
1080- /* Pacify compilers like GCC when the user code never invokes
1081- YYERROR and the label yyerrorlab therefore never appears in user
1082- code. */
1083- if (/*CONSTCOND*/ 0)
1084- goto yyerrorlab;
1085+ /* Pacify compilers when the user code never invokes YYERROR and the
1086+ label yyerrorlab therefore never appears in user code. */
1087+ if (0)
1088+ YYERROR;
1089
1090 /* Do not reclaim the symbols of the rule whose action triggered
1091 this YYERROR. */
1092@@ -2109,6 +2123,7 @@ yyacceptlab:
1093 yyresult = 0;
1094 goto yyreturn;
1095
1096+
1097 /*-----------------------------------.
1098 | yyabortlab -- YYABORT comes here. |
1099 `-----------------------------------*/
1100@@ -2116,6 +2131,7 @@ yyabortlab:
1101 yyresult = 1;
1102 goto yyreturn;
1103
1104+
1105 #if !defined yyoverflow || YYERROR_VERBOSE
1106 /*-------------------------------------------------.
1107 | yyexhaustedlab -- memory exhaustion comes here. |
1108@@ -2126,6 +2142,10 @@ yyexhaustedlab:
1109 /* Fall through. */
1110 #endif
1111
1112+
1113+/*-----------------------------------------------------.
1114+| yyreturn -- parsing is finished, return the result. |
1115+`-----------------------------------------------------*/
1116 yyreturn:
1117 if (yychar != YYEMPTY)
1118 {
1119@@ -2155,5 +2175,5 @@ yyreturn:
1120 #endif
1121 return yyresult;
1122 }
1123-#line 329 "../src/preproc/eqn/eqn.ypp" /* yacc.c:1903 */
1124+#line 333 "src/preproc/eqn/eqn.ypp"
1125
1126diff --git a/src/preproc/eqn/eqn.hpp b/src/preproc/eqn/eqn.hpp
1127index 32a32a5..9a092c1 100644
1128--- a/src/preproc/eqn/eqn.hpp
1129+++ b/src/preproc/eqn/eqn.hpp
1130@@ -1,8 +1,9 @@
1131-/* A Bison parser, made by GNU Bison 3.2. */
1132+/* A Bison parser, made by GNU Bison 3.4.1. */
1133
1134 /* Bison interface for Yacc-like parsers in C
1135
1136- Copyright (C) 1984, 1989-1990, 2000-2015, 2018 Free Software Foundation, Inc.
1137+ Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 Free Software Foundation,
1138+ Inc.
1139
1140 This program is free software: you can redistribute it and/or modify
1141 it under the terms of the GNU General Public License as published by
1142@@ -170,10 +171,9 @@ extern int yydebug;
1143
1144 /* Value type. */
1145 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
1146-
1147 union YYSTYPE
1148 {
1149-#line 30 "../src/preproc/eqn/eqn.ypp" /* yacc.c:1906 */
1150+#line 34 "src/preproc/eqn/eqn.ypp"
1151
1152 char *str;
1153 box *b;
1154@@ -182,9 +182,9 @@ union YYSTYPE
1155 int n;
1156 column *col;
1157
1158-#line 186 "src/preproc/eqn/eqn.hpp" /* yacc.c:1906 */
1159-};
1160+#line 186 "src/preproc/eqn/eqn.hpp"
1161
1162+};
1163 typedef union YYSTYPE YYSTYPE;
1164 # define YYSTYPE_IS_TRIVIAL 1
1165 # define YYSTYPE_IS_DECLARED 1
1166diff --git a/src/preproc/eqn/eqn.ypp b/src/preproc/eqn/eqn.ypp 146diff --git a/src/preproc/eqn/eqn.ypp b/src/preproc/eqn/eqn.ypp
1167index fb318c3..b7b647e 100644 147index fb318c3..b7b647e 100644
1168--- a/src/preproc/eqn/eqn.ypp 148--- a/src/preproc/eqn/eqn.ypp
diff --git a/meta/recipes-extended/groff/groff_1.22.4.bb b/meta/recipes-extended/groff/groff_1.22.4.bb
index 0867452ce7..7bb393e09c 100644
--- a/meta/recipes-extended/groff/groff_1.22.4.bb
+++ b/meta/recipes-extended/groff/groff_1.22.4.bb
@@ -18,6 +18,10 @@ SRC_URI = "${GNU_MIRROR}/groff/groff-${PV}.tar.gz \
18SRC_URI[md5sum] = "08fb04335e2f5e73f23ea4c3adbf0c5f" 18SRC_URI[md5sum] = "08fb04335e2f5e73f23ea4c3adbf0c5f"
19SRC_URI[sha256sum] = "e78e7b4cb7dec310849004fa88847c44701e8d133b5d4c13057d876c1bad0293" 19SRC_URI[sha256sum] = "e78e7b4cb7dec310849004fa88847c44701e8d133b5d4c13057d876c1bad0293"
20 20
21# Remove at the next upgrade
22PR = "r1"
23HASHEQUIV_HASH_VERSION .= ".1"
24
21DEPENDS = "bison-native" 25DEPENDS = "bison-native"
22RDEPENDS_${PN} += "perl sed" 26RDEPENDS_${PN} += "perl sed"
23 27
@@ -30,6 +34,13 @@ PARALLEL_MAKE = ""
30 34
31CACHED_CONFIGUREVARS += "ac_cv_path_PERL='/usr/bin/env perl' ac_cv_path_BASH_PROG='no' PAGE=A4" 35CACHED_CONFIGUREVARS += "ac_cv_path_PERL='/usr/bin/env perl' ac_cv_path_BASH_PROG='no' PAGE=A4"
32 36
37# Delete these generated files since we depend on bison-native
38# and regenerate them. Do it deterministically (always).
39do_configure_prepend() {
40 rm -f ${S}/src/preproc/eqn/eqn.cpp
41 rm -f ${S}/src/preproc/eqn/eqn.hpp
42}
43
33do_install_append() { 44do_install_append() {
34 # Some distros have both /bin/perl and /usr/bin/perl, but we set perl location 45 # Some distros have both /bin/perl and /usr/bin/perl, but we set perl location
35 # for target as /usr/bin/perl, so fix it to /usr/bin/perl. 46 # for target as /usr/bin/perl, so fix it to /usr/bin/perl.
diff --git a/meta/recipes-extended/parted/parted_3.3.bb b/meta/recipes-extended/parted/parted_3.3.bb
index ce40c04ad4..915ab05b65 100644
--- a/meta/recipes-extended/parted/parted_3.3.bb
+++ b/meta/recipes-extended/parted/parted_3.3.bb
@@ -42,6 +42,7 @@ do_install_ptest() {
42 sed -i "s|^abs_srcdir =.*|abs_srcdir = \.|g" $t/tests/Makefile 42 sed -i "s|^abs_srcdir =.*|abs_srcdir = \.|g" $t/tests/Makefile
43 sed -i "s|^abs_top_srcdir =.*|abs_top_srcdir = \.\.|g" $t/tests/Makefile 43 sed -i "s|^abs_top_srcdir =.*|abs_top_srcdir = \.\.|g" $t/tests/Makefile
44 sed -i "s|^Makefile:.*|Makefile:|g" $t/tests/Makefile 44 sed -i "s|^Makefile:.*|Makefile:|g" $t/tests/Makefile
45 sed -i "/^BUILDINFO.*$/d" $t/tests/Makefile
45 for i in print-align print-max print-flags dup-clobber duplicate fs-resize; \ 46 for i in print-align print-max print-flags dup-clobber duplicate fs-resize; \
46 do cp ${B}/tests/.libs/$i $t/tests/; \ 47 do cp ${B}/tests/.libs/$i $t/tests/; \
47 done 48 done
diff --git a/meta/recipes-extended/screen/screen/CVE-2021-26937.patch b/meta/recipes-extended/screen/screen/CVE-2021-26937.patch
new file mode 100644
index 0000000000..983b35c1b0
--- /dev/null
+++ b/meta/recipes-extended/screen/screen/CVE-2021-26937.patch
@@ -0,0 +1,68 @@
1Description: [CVE-2021-26937] Fix out of bounds array access
2Author: Michael Schröder <mls@suse.de>
3Bug-Debian: https://bugs.debian.org/982435
4Bug: https://savannah.gnu.org/bugs/?60030
5Bug: https://lists.gnu.org/archive/html/screen-devel/2021-02/msg00000.html
6Bug-OSS-Security: https://www.openwall.com/lists/oss-security/2021/02/09/3
7Origin: https://lists.gnu.org/archive/html/screen-devel/2021-02/msg00010.html
8
9CVE: CVE-2021-26937
10Upstream-Status: Pending
11Signed-off-by: Scott Murray <scott.murray@konsulko.com>
12
13--- a/encoding.c
14+++ b/encoding.c
15@@ -43,7 +43,7 @@
16 # ifdef UTF8
17 static int recode_char __P((int, int, int));
18 static int recode_char_to_encoding __P((int, int));
19-static void comb_tofront __P((int, int));
20+static void comb_tofront __P((int));
21 # ifdef DW_CHARS
22 static int recode_char_dw __P((int, int *, int, int));
23 static int recode_char_dw_to_encoding __P((int, int *, int));
24@@ -1263,6 +1263,8 @@
25 {0x30000, 0x3FFFD},
26 };
27
28+ if (c >= 0xdf00 && c <= 0xdfff)
29+ return 1; /* dw combining sequence */
30 return ((bisearch(c, wide, sizeof(wide) / sizeof(struct interval) - 1)) ||
31 (cjkwidth &&
32 bisearch(c, ambiguous,
33@@ -1330,11 +1332,12 @@
34 }
35
36 static void
37-comb_tofront(root, i)
38-int root, i;
39+comb_tofront(i)
40+int i;
41 {
42 for (;;)
43 {
44+ int root = i >= 0x700 ? 0x801 : 0x800;
45 debug1("bring to front: %x\n", i);
46 combchars[combchars[i]->prev]->next = combchars[i]->next;
47 combchars[combchars[i]->next]->prev = combchars[i]->prev;
48@@ -1396,9 +1399,9 @@
49 {
50 /* full, recycle old entry */
51 if (c1 >= 0xd800 && c1 < 0xe000)
52- comb_tofront(root, c1 - 0xd800);
53+ comb_tofront(c1 - 0xd800);
54 i = combchars[root]->prev;
55- if (c1 == i + 0xd800)
56+ if (i == 0x800 || i == 0x801 || c1 == i + 0xd800)
57 {
58 /* completely full, can't recycle */
59 debug("utf8_handle_comp: completely full!\n");
60@@ -1422,7 +1425,7 @@
61 mc->font = (i >> 8) + 0xd8;
62 mc->fontx = 0;
63 debug3("combinig char %x %x -> %x\n", c1, c, i + 0xd800);
64- comb_tofront(root, i);
65+ comb_tofront(i);
66 }
67
68 #else /* !UTF8 */
diff --git a/meta/recipes-extended/screen/screen_4.8.0.bb b/meta/recipes-extended/screen/screen_4.8.0.bb
index 4772eb6c7a..fe640c262b 100644
--- a/meta/recipes-extended/screen/screen_4.8.0.bb
+++ b/meta/recipes-extended/screen/screen_4.8.0.bb
@@ -21,6 +21,7 @@ SRC_URI = "${GNU_MIRROR}/screen/screen-${PV}.tar.gz \
21 file://0002-comm.h-now-depends-on-term.h.patch \ 21 file://0002-comm.h-now-depends-on-term.h.patch \
22 file://0001-fix-for-multijob-build.patch \ 22 file://0001-fix-for-multijob-build.patch \
23 file://0001-Remove-more-compatibility-stuff.patch \ 23 file://0001-Remove-more-compatibility-stuff.patch \
24 file://CVE-2021-26937.patch \
24 " 25 "
25 26
26SRC_URI[md5sum] = "d276213d3acd10339cd37848b8c4ab1e" 27SRC_URI[md5sum] = "d276213d3acd10339cd37848b8c4ab1e"
diff --git a/meta/recipes-extended/shadow/shadow_4.8.1.bb b/meta/recipes-extended/shadow/shadow_4.8.1.bb
index c975395ff8..ff4aad926f 100644
--- a/meta/recipes-extended/shadow/shadow_4.8.1.bb
+++ b/meta/recipes-extended/shadow/shadow_4.8.1.bb
@@ -6,5 +6,6 @@ BUILD_LDFLAGS_append_class-target = " ${@bb.utils.contains('DISTRO_FEATURES', 'p
6 6
7BBCLASSEXTEND = "native nativesdk" 7BBCLASSEXTEND = "native nativesdk"
8 8
9 9# Severity is low and marked as closed and won't fix.
10 10# https://bugzilla.redhat.com/show_bug.cgi?id=884658
11CVE_CHECK_WHITELIST += "CVE-2013-4235"
diff --git a/meta/recipes-extended/sudo/sudo.inc b/meta/recipes-extended/sudo/sudo.inc
index 86a18be7e2..8b50f5eee5 100644
--- a/meta/recipes-extended/sudo/sudo.inc
+++ b/meta/recipes-extended/sudo/sudo.inc
@@ -49,3 +49,5 @@ do_compile_prepend () {
49do_install_prepend (){ 49do_install_prepend (){
50 mkdir -p ${D}/${localstatedir}/lib 50 mkdir -p ${D}/${localstatedir}/lib
51} 51}
52
53CVE_VERSION_SUFFIX = "patch"
diff --git a/meta/recipes-extended/tar/tar/CVE-2021-20193.patch b/meta/recipes-extended/tar/tar/CVE-2021-20193.patch
new file mode 100644
index 0000000000..89e8e20844
--- /dev/null
+++ b/meta/recipes-extended/tar/tar/CVE-2021-20193.patch
@@ -0,0 +1,133 @@
1From d9d4435692150fa8ff68e1b1a473d187cc3fd777 Mon Sep 17 00:00:00 2001
2From: Sergey Poznyakoff <gray@gnu.org>
3Date: Sun, 17 Jan 2021 20:41:11 +0200
4Subject: Fix memory leak in read_header
5
6Bug reported in https://savannah.gnu.org/bugs/?59897
7
8* src/list.c (read_header): Don't return directly from the loop.
9Instead set the status and break. Return the status. Free
10next_long_name and next_long_link before returning.
11
12CVE: CVE-2021-20193
13Upstream-Status: Backport
14[https://git.savannah.gnu.org/cgit/tar.git/patch/?id=d9d4435692150fa8ff68e1b1a473d187cc3fd777]
15Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
16
17---
18 src/list.c | 40 ++++++++++++++++++++++++++++------------
19 1 file changed, 28 insertions(+), 12 deletions(-)
20
21diff --git a/src/list.c b/src/list.c
22index e40a5c8..d7ef441 100644
23--- a/src/list.c
24+++ b/src/list.c
25@@ -408,26 +408,27 @@ read_header (union block **return_block, struct tar_stat_info *info,
26 enum read_header_mode mode)
27 {
28 union block *header;
29- union block *header_copy;
30 char *bp;
31 union block *data_block;
32 size_t size, written;
33- union block *next_long_name = 0;
34- union block *next_long_link = 0;
35+ union block *next_long_name = NULL;
36+ union block *next_long_link = NULL;
37 size_t next_long_name_blocks = 0;
38 size_t next_long_link_blocks = 0;
39-
40+ enum read_header status = HEADER_SUCCESS;
41+
42 while (1)
43 {
44- enum read_header status;
45-
46 header = find_next_block ();
47 *return_block = header;
48 if (!header)
49- return HEADER_END_OF_FILE;
50+ {
51+ status = HEADER_END_OF_FILE;
52+ break;
53+ }
54
55 if ((status = tar_checksum (header, false)) != HEADER_SUCCESS)
56- return status;
57+ break;
58
59 /* Good block. Decode file size and return. */
60
61@@ -437,7 +438,10 @@ read_header (union block **return_block, struct tar_stat_info *info,
62 {
63 info->stat.st_size = OFF_FROM_HEADER (header->header.size);
64 if (info->stat.st_size < 0)
65- return HEADER_FAILURE;
66+ {
67+ status = HEADER_FAILURE;
68+ break;
69+ }
70 }
71
72 if (header->header.typeflag == GNUTYPE_LONGNAME
73@@ -447,10 +451,14 @@ read_header (union block **return_block, struct tar_stat_info *info,
74 || header->header.typeflag == SOLARIS_XHDTYPE)
75 {
76 if (mode == read_header_x_raw)
77- return HEADER_SUCCESS_EXTENDED;
78+ {
79+ status = HEADER_SUCCESS_EXTENDED;
80+ break;
81+ }
82 else if (header->header.typeflag == GNUTYPE_LONGNAME
83 || header->header.typeflag == GNUTYPE_LONGLINK)
84 {
85+ union block *header_copy;
86 size_t name_size = info->stat.st_size;
87 size_t n = name_size % BLOCKSIZE;
88 size = name_size + BLOCKSIZE;
89@@ -517,7 +525,10 @@ read_header (union block **return_block, struct tar_stat_info *info,
90 xheader_decode_global (&xhdr);
91 xheader_destroy (&xhdr);
92 if (mode == read_header_x_global)
93- return HEADER_SUCCESS_EXTENDED;
94+ {
95+ status = HEADER_SUCCESS_EXTENDED;
96+ break;
97+ }
98 }
99
100 /* Loop! */
101@@ -536,6 +547,7 @@ read_header (union block **return_block, struct tar_stat_info *info,
102 name = next_long_name->buffer + BLOCKSIZE;
103 recent_long_name = next_long_name;
104 recent_long_name_blocks = next_long_name_blocks;
105+ next_long_name = NULL;
106 }
107 else
108 {
109@@ -567,6 +579,7 @@ read_header (union block **return_block, struct tar_stat_info *info,
110 name = next_long_link->buffer + BLOCKSIZE;
111 recent_long_link = next_long_link;
112 recent_long_link_blocks = next_long_link_blocks;
113+ next_long_link = NULL;
114 }
115 else
116 {
117@@ -578,9 +591,12 @@ read_header (union block **return_block, struct tar_stat_info *info,
118 }
119 assign_string (&info->link_name, name);
120
121- return HEADER_SUCCESS;
122+ break;
123 }
124 }
125+ free (next_long_name);
126+ free (next_long_link);
127+ return status;
128 }
129
130 #define ISOCTAL(c) ((c)>='0'&&(c)<='7')
131--
132cgit v1.2.1
133
diff --git a/meta/recipes-extended/tar/tar_1.32.bb b/meta/recipes-extended/tar/tar_1.32.bb
index ebe6cb0dbd..3ae6d674a5 100644
--- a/meta/recipes-extended/tar/tar_1.32.bb
+++ b/meta/recipes-extended/tar/tar_1.32.bb
@@ -8,6 +8,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
8 8
9SRC_URI = "${GNU_MIRROR}/tar/tar-${PV}.tar.bz2 \ 9SRC_URI = "${GNU_MIRROR}/tar/tar-${PV}.tar.bz2 \
10 file://musl_dirent.patch \ 10 file://musl_dirent.patch \
11 file://CVE-2021-20193.patch \
11" 12"
12 13
13SRC_URI[md5sum] = "17917356fff5cb4bd3cd5a6c3e727b05" 14SRC_URI[md5sum] = "17917356fff5cb4bd3cd5a6c3e727b05"
diff --git a/meta/recipes-gnome/epiphany/epiphany_3.36.4.bb b/meta/recipes-gnome/epiphany/epiphany_3.36.4.bb
index 4c3b18331a..0c22a67bde 100644
--- a/meta/recipes-gnome/epiphany/epiphany_3.36.4.bb
+++ b/meta/recipes-gnome/epiphany/epiphany_3.36.4.bb
@@ -13,6 +13,8 @@ REQUIRED_DISTRO_FEATURES = "x11 opengl"
13 13
14SRC_URI = "${GNOME_MIRROR}/${GNOMEBN}/${@gnome_verdir("${PV}")}/${GNOMEBN}-${PV}.tar.${GNOME_COMPRESS_TYPE};name=archive \ 14SRC_URI = "${GNOME_MIRROR}/${GNOMEBN}/${@gnome_verdir("${PV}")}/${GNOMEBN}-${PV}.tar.${GNOME_COMPRESS_TYPE};name=archive \
15 file://0002-help-meson.build-disable-the-use-of-yelp.patch \ 15 file://0002-help-meson.build-disable-the-use-of-yelp.patch \
16 file://migrator.patch \
17 file://distributor.patch \
16 " 18 "
17SRC_URI[archive.sha256sum] = "588a75b1588f5a509c33cf0be6a38a0f4fc1748eeb499a51d991ddef485242bf" 19SRC_URI[archive.sha256sum] = "588a75b1588f5a509c33cf0be6a38a0f4fc1748eeb499a51d991ddef485242bf"
18 20
diff --git a/meta/recipes-gnome/epiphany/files/distributor.patch b/meta/recipes-gnome/epiphany/files/distributor.patch
new file mode 100644
index 0000000000..b09c9b38d2
--- /dev/null
+++ b/meta/recipes-gnome/epiphany/files/distributor.patch
@@ -0,0 +1,17 @@
1Don't encode the distro from /etc/os-release into the binaries.
2
3Upstream-Status: Pending
4RP 2021/2/26
5
6Index: epiphany-3.38.2/meson.build
7===================================================================
8--- epiphany-3.38.2.orig/meson.build
9+++ epiphany-3.38.2/meson.build
10@@ -15,6 +15,7 @@ if r.returncode() == 0
11 else
12 distributor_name = 'GNOME Web'
13 endif
14+distributor_name = 'OpenEmbedded'
15
16 prefix = get_option('prefix')
17 datadir = join_paths(prefix, get_option('datadir'))
diff --git a/meta/recipes-gnome/epiphany/files/migrator.patch b/meta/recipes-gnome/epiphany/files/migrator.patch
new file mode 100644
index 0000000000..a9a650a64a
--- /dev/null
+++ b/meta/recipes-gnome/epiphany/files/migrator.patch
@@ -0,0 +1,24 @@
1We don't want to encide BUILD_ROOT into target packages. This is used
2for build time tests but in our case those would be on target anyway
3do use the target paths.
4
5Upstream-Status: Pending
6RP 2021/2/25
7
8Index: epiphany-3.38.2/lib/ephy-profile-utils.c
9===================================================================
10--- epiphany-3.38.2.orig/lib/ephy-profile-utils.c
11+++ epiphany-3.38.2/lib/ephy-profile-utils.c
12@@ -130,10 +130,10 @@ ephy_profile_utils_do_migration (const c
13 argv[i++] = NULL;
14
15 #if DEVELOPER_MODE
16- argv[0] = BUILD_ROOT "/src/" EPHY_PROFILE_MIGRATOR;
17+ argv[0] = PKGLIBEXECDIR "/" EPHY_PROFILE_MIGRATOR;
18 #else
19 if (debug)
20- argv[0] = BUILD_ROOT "/src/" EPHY_PROFILE_MIGRATOR;
21+ argv[0] = PKGLIBEXECDIR "/" EPHY_PROFILE_MIGRATOR;
22 #endif
23
24 g_spawn_sync (NULL, (char **)argv, envp, G_SPAWN_SEARCH_PATH,
diff --git a/meta/recipes-gnome/gcr/gcr_3.36.0.bb b/meta/recipes-gnome/gcr/gcr_3.36.0.bb
index ff455a68ec..567ca8b774 100644
--- a/meta/recipes-gnome/gcr/gcr_3.36.0.bb
+++ b/meta/recipes-gnome/gcr/gcr_3.36.0.bb
@@ -11,6 +11,8 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=55ca817ccb7d5b5b66355690e9abc605"
11DEPENDS = "gtk+3 p11-kit glib-2.0 libgcrypt gnupg-native \ 11DEPENDS = "gtk+3 p11-kit glib-2.0 libgcrypt gnupg-native \
12 ${@bb.utils.contains('GI_DATA_ENABLED', 'True', 'libxslt-native', '', d)}" 12 ${@bb.utils.contains('GI_DATA_ENABLED', 'True', 'libxslt-native', '', d)}"
13 13
14CACHED_CONFIGUREVARS += "ac_cv_path_GPG='gpg2'"
15
14GNOMEBASEBUILDCLASS = "meson" 16GNOMEBASEBUILDCLASS = "meson"
15GTKDOC_MESON_OPTION = "gtk_doc" 17GTKDOC_MESON_OPTION = "gtk_doc"
16inherit gnomebase gtk-icon-cache gtk-doc features_check upstream-version-is-even vala gobject-introspection gettext mime mime-xdg 18inherit gnomebase gtk-icon-cache gtk-doc features_check upstream-version-is-even vala gobject-introspection gettext mime mime-xdg
@@ -32,3 +34,11 @@ FILES_${PN} += " \
32ARM_INSTRUCTION_SET_armv4 = "arm" 34ARM_INSTRUCTION_SET_armv4 = "arm"
33ARM_INSTRUCTION_SET_armv5 = "arm" 35ARM_INSTRUCTION_SET_armv5 = "arm"
34ARM_INSTRUCTION_SET_armv6 = "arm" 36ARM_INSTRUCTION_SET_armv6 = "arm"
37
38EXTRA_OEMESON += "--cross-file ${WORKDIR}/meson-${PN}.cross"
39do_write_config_append() {
40 cat >${WORKDIR}/meson-${PN}.cross <<EOF
41[binaries]
42gpg2 = '${bindir}/gpg2'
43EOF
44}
diff --git a/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/CVE-2021-20240.patch b/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/CVE-2021-20240.patch
new file mode 100644
index 0000000000..fe594b24bb
--- /dev/null
+++ b/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/CVE-2021-20240.patch
@@ -0,0 +1,40 @@
1From 086e8adf4cc352cd11572f96066b001b545f354e Mon Sep 17 00:00:00 2001
2From: Emmanuele Bassi <ebassi@gnome.org>
3Date: Wed, 1 Apr 2020 18:11:55 +0100
4Subject: [PATCH] Check the memset length argument
5
6Avoid overflows by using the checked multiplication macro for gsize.
7
8Fixes: #132
9
10Upstream-Status: Backported [https://gitlab.gnome.org/GNOME/gdk-pixbuf/-/commit/086e8adf4cc352cd11572f96066b001b545f354e]
11CVE: CVE-2021-20240
12
13Signed-off-by: Changqing Li <changqing.li@windriver.com>
14---
15 gdk-pixbuf/io-gif-animation.c | 6 +++++-
16 1 file changed, 5 insertions(+), 1 deletion(-)
17
18diff --git a/gdk-pixbuf/io-gif-animation.c b/gdk-pixbuf/io-gif-animation.c
19index c9db3c66e..49674fd2e 100644
20--- a/gdk-pixbuf/io-gif-animation.c
21+++ b/gdk-pixbuf/io-gif-animation.c
22@@ -412,11 +412,15 @@ gdk_pixbuf_gif_anim_iter_get_pixbuf (GdkPixbufAnimationIter *anim_iter)
23
24 /* If no rendered frame, render the first frame */
25 if (anim->last_frame == NULL) {
26+ gsize len = 0;
27 if (anim->last_frame_data == NULL)
28 anim->last_frame_data = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8, anim->width, anim->height);
29 if (anim->last_frame_data == NULL)
30 return NULL;
31- memset (gdk_pixbuf_get_pixels (anim->last_frame_data), 0, gdk_pixbuf_get_rowstride (anim->last_frame_data) * anim->height);
32+ if (g_size_checked_mul (&len, gdk_pixbuf_get_rowstride (anim->last_frame_data), anim->height))
33+ memset (gdk_pixbuf_get_pixels (anim->last_frame_data), 0, len);
34+ else
35+ return NULL;
36 composite_frame (anim, g_list_nth_data (anim->frames, 0));
37 }
38
39--
40GitLab
diff --git a/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.40.0.bb b/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.40.0.bb
index 16708fd581..32af2de1e8 100644
--- a/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.40.0.bb
+++ b/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.40.0.bb
@@ -25,6 +25,7 @@ SRC_URI = "${GNOME_MIRROR}/${BPN}/${MAJ_VER}/${BPN}-${PV}.tar.xz \
25 file://0006-Build-thumbnailer-and-tests-also-in-cross-builds.patch \ 25 file://0006-Build-thumbnailer-and-tests-also-in-cross-builds.patch \
26 file://missing-test-data.patch \ 26 file://missing-test-data.patch \
27 file://CVE-2020-29385.patch \ 27 file://CVE-2020-29385.patch \
28 file://CVE-2021-20240.patch \
28 " 29 "
29 30
30SRC_URI_append_class-target = " \ 31SRC_URI_append_class-target = " \
diff --git a/meta/recipes-gnome/libsecret/libsecret/determinism.patch b/meta/recipes-gnome/libsecret/libsecret/determinism.patch
new file mode 100644
index 0000000000..ad96e8f59b
--- /dev/null
+++ b/meta/recipes-gnome/libsecret/libsecret/determinism.patch
@@ -0,0 +1,37 @@
1secret-enum-types.c/h.template: Fix reproducibility issue
2
3When full filenames are used in generated sources it makes the resulting
4debug packages non-reproducible. Best practise is to use basename in
5comments instead.
6
7Signed-off-by: Richard Purdie richard.purdie@linuxfoundation.org
8Upstream-Status: Submitted [https://gitlab.gnome.org/GNOME/libsecret/-/merge_requests/68]
9
10Index: libsecret-0.20.4/libsecret/secret-enum-types.c.template
11===================================================================
12--- libsecret-0.20.4.orig/libsecret/secret-enum-types.c.template
13+++ libsecret-0.20.4/libsecret/secret-enum-types.c.template
14@@ -23,8 +23,8 @@
15 /*** END file-header ***/
16
17 /*** BEGIN file-production ***/
18-#include "@filename@"
19-/* enumerations from "@filename@" */
20+#include "@basename@"
21+/* enumerations from "@basename@" */
22 /*** END file-production ***/
23
24 /*** BEGIN value-header ***/
25Index: libsecret-0.20.4/libsecret/secret-enum-types.h.template
26===================================================================
27--- libsecret-0.20.4.orig/libsecret/secret-enum-types.h.template
28+++ libsecret-0.20.4/libsecret/secret-enum-types.h.template
29@@ -27,7 +27,7 @@ G_BEGIN_DECLS
30
31 /*** BEGIN file-production ***/
32
33-/* enumerations from "@filename@" */
34+/* enumerations from "@basename@" */
35 /*** END file-production ***/
36
37 /*** BEGIN value-header ***/
diff --git a/meta/recipes-gnome/libsecret/libsecret_0.20.3.bb b/meta/recipes-gnome/libsecret/libsecret_0.20.3.bb
index 533015a1e4..b72206535f 100644
--- a/meta/recipes-gnome/libsecret/libsecret_0.20.3.bb
+++ b/meta/recipes-gnome/libsecret/libsecret_0.20.3.bb
@@ -13,7 +13,8 @@ inherit gnomebase gtk-doc vala gobject-introspection manpages
13 13
14DEPENDS += "glib-2.0 libgcrypt gettext-native" 14DEPENDS += "glib-2.0 libgcrypt gettext-native"
15 15
16SRC_URI += "file://0001-meson-add-option-introspection.patch" 16SRC_URI += "file://0001-meson-add-option-introspection.patch \
17 file://determinism.patch"
17 18
18SRC_URI[archive.md5sum] = "47c3fdfeb111a87b509ad271e4a6f496" 19SRC_URI[archive.md5sum] = "47c3fdfeb111a87b509ad271e4a6f496"
19SRC_URI[archive.sha256sum] = "4fcb3c56f8ac4ab9c75b66901fb0104ec7f22aa9a012315a14c0d6dffa5290e4" 20SRC_URI[archive.sha256sum] = "4fcb3c56f8ac4ab9c75b66901fb0104ec7f22aa9a012315a14c0d6dffa5290e4"
diff --git a/meta/recipes-graphics/cairo/cairo/CVE-2020-35492.patch b/meta/recipes-graphics/cairo/cairo/CVE-2020-35492.patch
new file mode 100644
index 0000000000..f8e69beb0b
--- /dev/null
+++ b/meta/recipes-graphics/cairo/cairo/CVE-2020-35492.patch
@@ -0,0 +1,121 @@
1From 03a820b173ed1fdef6ff14b4468f5dbc02ff59be Mon Sep 17 00:00:00 2001
2From: Heiko Lewin <heiko.lewin@worldiety.de>
3Date: Tue, 15 Dec 2020 16:48:19 +0100
4Subject: [PATCH] Fix mask usage in image-compositor
5
6CVE: CVE-2020-35492
7
8Upstream-Status: Backport [https://gitlab.freedesktop.org/cairo/cairo/-/commit/03a820b173ed1fdef6ff14b4468f5dbc02ff59be?merge_request_iid=85]
9
10original patch from upstream has a binary file, it will cause
11do_patch failed with "git binary diffs are not supported".
12
13so add do_patch_append in recipe to add this binary source. when removing
14this patch, please also remove do_patch_append for this patch
15
16Signed-off-by: Changqing Li <changqing.li@windriver.com>
17---
18 src/cairo-image-compositor.c | 8 ++--
19 test/Makefile.sources | 1 +
20 test/bug-image-compositor.c | 39 ++++++++++++++++++++
21 3 files changed, 44 insertions(+), 4 deletions(-)
22 create mode 100644 test/bug-image-compositor.c
23
24diff --git a/src/cairo-image-compositor.c b/src/cairo-image-compositor.c
25index 79ad69f68..4f8aaed99 100644
26--- a/src/cairo-image-compositor.c
27+++ b/src/cairo-image-compositor.c
28@@ -2610,14 +2610,14 @@ _inplace_src_spans (void *abstract_renderer, int y, int h,
29 unsigned num_spans)
30 {
31 cairo_image_span_renderer_t *r = abstract_renderer;
32- uint8_t *m;
33+ uint8_t *m, *base = (uint8_t*)pixman_image_get_data(r->mask);
34 int x0;
35
36 if (num_spans == 0)
37 return CAIRO_STATUS_SUCCESS;
38
39 x0 = spans[0].x;
40- m = r->_buf;
41+ m = base;
42 do {
43 int len = spans[1].x - spans[0].x;
44 if (len >= r->u.composite.run_length && spans[0].coverage == 0xff) {
45@@ -2655,7 +2655,7 @@ _inplace_src_spans (void *abstract_renderer, int y, int h,
46 spans[0].x, y,
47 spans[1].x - spans[0].x, h);
48
49- m = r->_buf;
50+ m = base;
51 x0 = spans[1].x;
52 } else if (spans[0].coverage == 0x0) {
53 if (spans[0].x != x0) {
54@@ -2684,7 +2684,7 @@ _inplace_src_spans (void *abstract_renderer, int y, int h,
55 #endif
56 }
57
58- m = r->_buf;
59+ m = base;
60 x0 = spans[1].x;
61 } else {
62 *m++ = spans[0].coverage;
63diff --git a/test/Makefile.sources b/test/Makefile.sources
64index 7eb73647f..86494348d 100644
65--- a/test/Makefile.sources
66+++ b/test/Makefile.sources
67@@ -34,6 +34,7 @@ test_sources = \
68 bug-source-cu.c \
69 bug-extents.c \
70 bug-seams.c \
71+ bug-image-compositor.c \
72 caps.c \
73 checkerboard.c \
74 caps-joins.c \
75diff --git a/test/bug-image-compositor.c b/test/bug-image-compositor.c
76new file mode 100644
77index 000000000..fc4fd370b
78--- /dev/null
79+++ b/test/bug-image-compositor.c
80@@ -0,0 +1,39 @@
81+#include "cairo-test.h"
82+
83+static cairo_test_status_t
84+draw (cairo_t *cr, int width, int height)
85+{
86+ cairo_set_source_rgb (cr, 0., 0., 0.);
87+ cairo_paint (cr);
88+
89+ cairo_set_source_rgb (cr, 1., 1., 1.);
90+ cairo_set_line_width (cr, 1.);
91+
92+ cairo_pattern_t *p = cairo_pattern_create_linear (0, 0, width, height);
93+ cairo_pattern_add_color_stop_rgb (p, 0, 0.99, 1, 1);
94+ cairo_pattern_add_color_stop_rgb (p, 1, 1, 1, 1);
95+ cairo_set_source (cr, p);
96+
97+ cairo_move_to (cr, 0.5, -1);
98+ for (int i = 0; i < width; i+=3) {
99+ cairo_rel_line_to (cr, 2, 2);
100+ cairo_rel_line_to (cr, 1, -2);
101+ }
102+
103+ cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
104+ cairo_stroke (cr);
105+
106+ cairo_pattern_destroy(p);
107+
108+ return CAIRO_TEST_SUCCESS;
109+}
110+
111+
112+CAIRO_TEST (bug_image_compositor,
113+ "Crash in image-compositor",
114+ "stroke, stress", /* keywords */
115+ NULL, /* requirements */
116+ 10000, 1,
117+ NULL, draw)
118+
119+
120--
121GitLab
diff --git a/meta/recipes-graphics/cairo/cairo/bug-image-compositor.ref.png b/meta/recipes-graphics/cairo/cairo/bug-image-compositor.ref.png
new file mode 100644
index 0000000000..939f659d2c
--- /dev/null
+++ b/meta/recipes-graphics/cairo/cairo/bug-image-compositor.ref.png
Binary files differ
diff --git a/meta/recipes-graphics/cairo/cairo_1.16.0.bb b/meta/recipes-graphics/cairo/cairo_1.16.0.bb
index 68f993d7ca..d48da1a4c7 100644
--- a/meta/recipes-graphics/cairo/cairo_1.16.0.bb
+++ b/meta/recipes-graphics/cairo/cairo_1.16.0.bb
@@ -27,6 +27,8 @@ SRC_URI = "http://cairographics.org/releases/cairo-${PV}.tar.xz \
27 file://CVE-2018-19876.patch \ 27 file://CVE-2018-19876.patch \
28 file://CVE-2019-6461.patch \ 28 file://CVE-2019-6461.patch \
29 file://CVE-2019-6462.patch \ 29 file://CVE-2019-6462.patch \
30 file://CVE-2020-35492.patch \
31 file://bug-image-compositor.ref.png \
30 " 32 "
31 33
32SRC_URI[md5sum] = "f19e0353828269c22bd72e271243a552" 34SRC_URI[md5sum] = "f19e0353828269c22bd72e271243a552"
@@ -64,6 +66,15 @@ export ac_cv_lib_bfd_bfd_openr="no"
64# Ensure we don't depend on LZO 66# Ensure we don't depend on LZO
65export ac_cv_lib_lzo2_lzo2a_decompress="no" 67export ac_cv_lib_lzo2_lzo2a_decompress="no"
66 68
69#for CVE-2020-35492.patch
70do_patch_append() {
71 bb.build.exec_func('do_cp_binary_source', d)
72}
73
74do_cp_binary_source () {
75 cp ${WORKDIR}/bug-image-compositor.ref.png ${S}/test/reference/
76}
77
67do_install_append () { 78do_install_append () {
68 rm -rf ${D}${bindir}/cairo-sphinx 79 rm -rf ${D}${bindir}/cairo-sphinx
69 rm -rf ${D}${libdir}/cairo/cairo-fdr* 80 rm -rf ${D}${libdir}/cairo/cairo-fdr*
diff --git a/meta/recipes-graphics/igt-gpu-tools/igt-gpu-tools/reproducibility.patch b/meta/recipes-graphics/igt-gpu-tools/igt-gpu-tools/reproducibility.patch
new file mode 100644
index 0000000000..39e36d8737
--- /dev/null
+++ b/meta/recipes-graphics/igt-gpu-tools/igt-gpu-tools/reproducibility.patch
@@ -0,0 +1,38 @@
1meson: Allow source location to be configurable
2
3Hardcoding a build source path into a binary when cross compiling isn't
4appropriate and breaks build reproducibility. Allow the srcdir to be
5specified by an optional configuration option to meson.
6
7Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
8Upstream-Status: Submitted [https://lists.freedesktop.org/archives/igt-dev/2021-February/029443.html]
9
10Index: git/lib/meson.build
11===================================================================
12--- git.orig/lib/meson.build
13+++ git/lib/meson.build
14@@ -122,7 +122,11 @@ if chamelium.found()
15 lib_sources += 'igt_chamelium_stream.c'
16 endif
17
18-srcdir = join_paths(meson.source_root(), 'tests')
19+if get_option('srcdir') != ''
20+ srcdir = join_paths(get_option('srcdir'), 'tests')
21+else
22+ srcdir = join_paths(meson.source_root(), 'tests')
23+endif
24
25 lib_version = vcs_tag(input : 'version.h.in', output : 'version.h',
26 fallback : 'NO-GIT',
27Index: git/meson_options.txt
28===================================================================
29--- git.orig/meson_options.txt
30+++ git/meson_options.txt
31@@ -50,3 +50,7 @@ option('use_rpath',
32 type : 'boolean',
33 value : false,
34 description : 'Set runpath on installed executables for libigt.so')
35+
36+option('srcdir',
37+ type : 'string',
38+ description : 'Path to source code to be compiled into binaries (optional)')
diff --git a/meta/recipes-graphics/igt-gpu-tools/igt-gpu-tools_git.bb b/meta/recipes-graphics/igt-gpu-tools/igt-gpu-tools_git.bb
index 89480d79d2..f25cbc0603 100644
--- a/meta/recipes-graphics/igt-gpu-tools/igt-gpu-tools_git.bb
+++ b/meta/recipes-graphics/igt-gpu-tools/igt-gpu-tools_git.bb
@@ -10,7 +10,8 @@ inherit meson
10SRCREV = "d16ad07e7f2a028e14d61f570931c87fa5ce404c" 10SRCREV = "d16ad07e7f2a028e14d61f570931c87fa5ce404c"
11PV = "1.25+git${SRCPV}" 11PV = "1.25+git${SRCPV}"
12 12
13SRC_URI = "git://gitlab.freedesktop.org/drm/igt-gpu-tools.git;protocol=https" 13SRC_URI = "git://gitlab.freedesktop.org/drm/igt-gpu-tools.git;protocol=https \
14 file://reproducibility.patch"
14 15
15S = "${WORKDIR}/git" 16S = "${WORKDIR}/git"
16 17
@@ -22,7 +23,7 @@ PACKAGE_BEFORE_PN = "${PN}-benchmarks ${PN}-tests"
22 23
23PACKAGECONFIG[chamelium] = "-Dchamelium=enabled,-Dchamelium=disabled,gsl xmlrpc-c" 24PACKAGECONFIG[chamelium] = "-Dchamelium=enabled,-Dchamelium=disabled,gsl xmlrpc-c"
24 25
25EXTRA_OEMESON = "-Ddocs=disabled -Drunner=enabled" 26EXTRA_OEMESON = "-Ddocs=disabled -Drunner=enabled -Dsrcdir=/usr/src/debug/${PN}/${PV}-${PR}/git/"
26COMPATIBLE_HOST = "(x86_64.*|i.86.*|arm.*|aarch64).*-linux" 27COMPATIBLE_HOST = "(x86_64.*|i.86.*|arm.*|aarch64).*-linux"
27COMPATIBLE_HOST_libc-musl_class-target = "null" 28COMPATIBLE_HOST_libc-musl_class-target = "null"
28SECURITY_LDFLAGS = "${SECURITY_X_LDFLAGS}" 29SECURITY_LDFLAGS = "${SECURITY_X_LDFLAGS}"
diff --git a/meta/recipes-graphics/libsdl2/libsdl2/CVE-2020-14409-14410.patch b/meta/recipes-graphics/libsdl2/libsdl2/CVE-2020-14409-14410.patch
new file mode 100644
index 0000000000..d8fa24bc65
--- /dev/null
+++ b/meta/recipes-graphics/libsdl2/libsdl2/CVE-2020-14409-14410.patch
@@ -0,0 +1,79 @@
1From a7ff6e96155f550a5597621ebeddd03c98aa9294 Mon Sep 17 00:00:00 2001
2From: Sam Lantinga <slouken@libsdl.org>
3Date: Wed, 17 Jun 2020 08:44:45 -0700
4Subject: [PATCH] Fixed overflow in surface pitch calculation
5
6
7Upstream-Status: Backport
8[https://github.com/libsdl-org/SDL/commit/a7ff6e96155f550a5597621ebeddd03c98aa9294]
9CVE: CVE-2020-14409 CVE-2020-14410
10Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com>
11
12---
13 src/video/SDL_surface.c | 23 +++++++++++++++--------
14 1 file changed, 15 insertions(+), 8 deletions(-)
15
16diff --git a/src/video/SDL_surface.c b/src/video/SDL_surface.c
17index 085d9ff1e..bff826f7c 100644
18--- a/src/video/SDL_surface.c
19+++ b/src/video/SDL_surface.c
20@@ -28,24 +28,23 @@
21 #include "SDL_yuv_c.h"
22
23
24-/* Check to make sure we can safely check multiplication of surface w and pitch and it won't overflow size_t */
25-SDL_COMPILE_TIME_ASSERT(surface_size_assumptions,
26- sizeof(int) == sizeof(Sint32) && sizeof(size_t) >= sizeof(Sint32));
27+/* Check to make sure we can safely check multiplication of surface w and pitch and it won't overflow Sint64 */
28+SDL_COMPILE_TIME_ASSERT(surface_size_assumptions, sizeof(int) == sizeof(Sint32));
29
30 /* Public routines */
31
32 /*
33 * Calculate the pad-aligned scanline width of a surface
34 */
35-static int
36+static Sint64
37 SDL_CalculatePitch(Uint32 format, int width)
38 {
39- int pitch;
40+ Sint64 pitch;
41
42 if (SDL_ISPIXELFORMAT_FOURCC(format) || SDL_BITSPERPIXEL(format) >= 8) {
43- pitch = (width * SDL_BYTESPERPIXEL(format));
44+ pitch = ((Sint64)width * SDL_BYTESPERPIXEL(format));
45 } else {
46- pitch = ((width * SDL_BITSPERPIXEL(format)) + 7) / 8;
47+ pitch = (((Sint64)width * SDL_BITSPERPIXEL(format)) + 7) / 8;
48 }
49 pitch = (pitch + 3) & ~3; /* 4-byte aligning for speed */
50 return pitch;
51@@ -59,11 +58,19 @@ SDL_Surface *
52 SDL_CreateRGBSurfaceWithFormat(Uint32 flags, int width, int height, int depth,
53 Uint32 format)
54 {
55+ Sint64 pitch;
56 SDL_Surface *surface;
57
58 /* The flags are no longer used, make the compiler happy */
59 (void)flags;
60
61+ pitch = SDL_CalculatePitch(format, width);
62+ if (pitch < 0 || pitch > SDL_MAX_SINT32) {
63+ /* Overflow... */
64+ SDL_OutOfMemory();
65+ return NULL;
66+ }
67+
68 /* Allocate the surface */
69 surface = (SDL_Surface *) SDL_calloc(1, sizeof(*surface));
70 if (surface == NULL) {
71@@ -78,7 +85,7 @@ SDL_CreateRGBSurfaceWithFormat(Uint32 flags, int width, int height, int depth,
72 }
73 surface->w = width;
74 surface->h = height;
75- surface->pitch = SDL_CalculatePitch(format, width);
76+ surface->pitch = (int)pitch;
77 SDL_SetClipRect(surface, NULL);
78
79 if (SDL_ISPIXELFORMAT_INDEXED(surface->format->format)) {
diff --git a/meta/recipes-graphics/libsdl2/libsdl2_2.0.12.bb b/meta/recipes-graphics/libsdl2/libsdl2_2.0.12.bb
index 1513746492..639a465567 100644
--- a/meta/recipes-graphics/libsdl2/libsdl2_2.0.12.bb
+++ b/meta/recipes-graphics/libsdl2/libsdl2_2.0.12.bb
@@ -20,6 +20,7 @@ SRC_URI = "http://www.libsdl.org/release/SDL2-${PV}.tar.gz \
20 file://more-gen-depends.patch \ 20 file://more-gen-depends.patch \
21 file://directfb-spurious-curly-brace-missing-e.patch \ 21 file://directfb-spurious-curly-brace-missing-e.patch \
22 file://directfb-renderfillrect-fix.patch \ 22 file://directfb-renderfillrect-fix.patch \
23 file://CVE-2020-14409-14410.patch \
23" 24"
24 25
25S = "${WORKDIR}/SDL2-${PV}" 26S = "${WORKDIR}/SDL2-${PV}"
diff --git a/meta/recipes-graphics/wayland/libinput/run-ptest b/meta/recipes-graphics/wayland/libinput/run-ptest
index 5a84c568b9..d11e6eb25b 100644
--- a/meta/recipes-graphics/wayland/libinput/run-ptest
+++ b/meta/recipes-graphics/wayland/libinput/run-ptest
@@ -1,6 +1,6 @@
1#!/bin/sh 1#!/bin/sh
2 2
3/usr/libexec/libinput/libinput-test-suite 3/usr/libexec/libinput/libinput-test-suite -j1
4if [ $? -eq 0 ]; then 4if [ $? -eq 0 ]; then
5 echo 'PASS: libinput-test-suite' 5 echo 'PASS: libinput-test-suite'
6else 6else
diff --git a/meta/recipes-graphics/xorg-font/xorg-minimal-fonts.bb b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts.bb
index 1ea08a6c99..bf8385fe6d 100644
--- a/meta/recipes-graphics/xorg-font/xorg-minimal-fonts.bb
+++ b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts.bb
@@ -10,8 +10,12 @@ LIC_FILES_CHKSUM = "file://../misc/fonts.dir;md5=82a143d94d6a974aafe97132d2d519a
10 10
11SRC_URI = "file://misc" 11SRC_URI = "file://misc"
12 12
13SOURCE_DATE_EPOCH = "1613559011"
14
13PE = "1" 15PE = "1"
14PR = "r2" 16PR = "r3"
17HASHEQUIV_HASH_VERSION .= ".1"
18
15 19
16inherit allarch features_check 20inherit allarch features_check
17 21
@@ -27,6 +31,8 @@ RDEPENDS_${PN} += "font-alias"
27do_install() { 31do_install() {
28 install -d ${D}/${datadir}/fonts/X11/misc 32 install -d ${D}/${datadir}/fonts/X11/misc
29 install -m 0644 ${S}/* ${D}/${datadir}/fonts/X11/misc/ 33 install -m 0644 ${S}/* ${D}/${datadir}/fonts/X11/misc/
34 # Pick a date/time as otherwise it would be the git checkout/modify time
35 touch -d @1613559011 ${D}/${datadir}/fonts/X11/misc/*
30 install -d ${D}/${libdir}/X11 36 install -d ${D}/${libdir}/X11
31 ln -sf ${datadir}/fonts/X11/ ${D}/${libdir}/X11/fonts -s 37 ln -sf ${datadir}/fonts/X11/ ${D}/${libdir}/X11/fonts -s
32} 38}
diff --git a/meta/recipes-graphics/xorg-proto/xcb-proto_1.14.bb b/meta/recipes-graphics/xorg-proto/xcb-proto_1.14.1.bb
index 6de30098d6..52e474a2e9 100644
--- a/meta/recipes-graphics/xorg-proto/xcb-proto_1.14.bb
+++ b/meta/recipes-graphics/xorg-proto/xcb-proto_1.14.1.bb
@@ -11,8 +11,8 @@ LICENSE = "MIT"
11LIC_FILES_CHKSUM = "file://COPYING;md5=d763b081cb10c223435b01e00dc0aba7 \ 11LIC_FILES_CHKSUM = "file://COPYING;md5=d763b081cb10c223435b01e00dc0aba7 \
12 file://src/dri2.xml;beginline=2;endline=28;md5=f8763b13ff432e8597e0d610cf598e65" 12 file://src/dri2.xml;beginline=2;endline=28;md5=f8763b13ff432e8597e0d610cf598e65"
13 13
14SRC_URI = "http://xcb.freedesktop.org/dist/${BP}.tar.xz" 14SRC_URI = "https://xorg.freedesktop.org/archive/individual/proto/${BP}.tar.xz"
15SRC_URI[sha256sum] = "186a3ceb26f9b4a015f5a44dcc814c93033a5fc39684f36f1ecc79834416a605" 15SRC_URI[sha256sum] = "f04add9a972ac334ea11d9d7eb4fc7f8883835da3e4859c9afa971efdf57fcc3"
16 16
17inherit autotools pkgconfig python3native 17inherit autotools pkgconfig python3native
18 18
diff --git a/meta/recipes-kernel/kmod/kmod.inc b/meta/recipes-kernel/kmod/kmod.inc
index 646dff9a97..10a319ac9f 100644
--- a/meta/recipes-kernel/kmod/kmod.inc
+++ b/meta/recipes-kernel/kmod/kmod.inc
@@ -26,7 +26,6 @@ SRC_URI = "git://git.kernel.org/pub/scm/utils/kernel/kmod/kmod.git \
26 26
27S = "${WORKDIR}/git" 27S = "${WORKDIR}/git"
28 28
29EXTRA_AUTORECONF += "--install --symlink"
30EXTRA_OECONF +=" --enable-tools --with-zlib" 29EXTRA_OECONF +=" --enable-tools --with-zlib"
31 30
32PACKAGECONFIG[debug] = "--enable-debug,--disable-debug" 31PACKAGECONFIG[debug] = "--enable-debug,--disable-debug"
diff --git a/meta/recipes-kernel/linux-firmware/linux-firmware_20201218.bb b/meta/recipes-kernel/linux-firmware/linux-firmware_20210208.bb
index 700a79b118..1a9374d0b4 100644
--- a/meta/recipes-kernel/linux-firmware/linux-firmware_20201218.bb
+++ b/meta/recipes-kernel/linux-firmware/linux-firmware_20210208.bb
@@ -128,7 +128,7 @@ LIC_FILES_CHKSUM = "file://LICENCE.Abilis;md5=b5ee3f410780e56711ad48eadc22b8bc \
128 file://LICENCE.xc4000;md5=0ff51d2dc49fce04814c9155081092f0 \ 128 file://LICENCE.xc4000;md5=0ff51d2dc49fce04814c9155081092f0 \
129 file://LICENCE.xc5000;md5=1e170c13175323c32c7f4d0998d53f66 \ 129 file://LICENCE.xc5000;md5=1e170c13175323c32c7f4d0998d53f66 \
130 file://LICENCE.xc5000c;md5=12b02efa3049db65d524aeb418dd87ca \ 130 file://LICENCE.xc5000c;md5=12b02efa3049db65d524aeb418dd87ca \
131 file://WHENCE;md5=03f0fad70b8b557b56084e3090198021 \ 131 file://WHENCE;md5=ef0565762eac313c409567b59dff00b2 \
132 " 132 "
133 133
134# These are not common licenses, set NO_GENERIC_LICENSE for them 134# These are not common licenses, set NO_GENERIC_LICENSE for them
@@ -201,7 +201,7 @@ PE = "1"
201 201
202SRC_URI = "${KERNELORG_MIRROR}/linux/kernel/firmware/${BPN}-${PV}.tar.xz" 202SRC_URI = "${KERNELORG_MIRROR}/linux/kernel/firmware/${BPN}-${PV}.tar.xz"
203 203
204SRC_URI[sha256sum] = "a1cc1ff72c739f312b095df589e9fd639fc81c3f8f7966377ea35222dc94c04b" 204SRC_URI[sha256sum] = "1bcb1a3944c361507754a7d26ccff40ffc28d1fb93bce711d67da26b33e785b7"
205 205
206inherit allarch 206inherit allarch
207 207
@@ -225,6 +225,7 @@ PACKAGES =+ "${PN}-ralink-license ${PN}-ralink \
225 ${PN}-sd8887 ${PN}-sd8897 ${PN}-sd8997 ${PN}-usb8997 \ 225 ${PN}-sd8887 ${PN}-sd8897 ${PN}-sd8997 ${PN}-usb8997 \
226 ${PN}-ti-connectivity-license ${PN}-wlcommon ${PN}-wl12xx ${PN}-wl18xx \ 226 ${PN}-ti-connectivity-license ${PN}-wlcommon ${PN}-wl12xx ${PN}-wl18xx \
227 ${PN}-vt6656-license ${PN}-vt6656 \ 227 ${PN}-vt6656-license ${PN}-vt6656 \
228 ${PN}-rs9113 ${PN}-rs9116 \
228 ${PN}-rtl-license ${PN}-rtl8188 ${PN}-rtl8192cu ${PN}-rtl8192ce ${PN}-rtl8192su ${PN}-rtl8723 ${PN}-rtl8821 \ 229 ${PN}-rtl-license ${PN}-rtl8188 ${PN}-rtl8192cu ${PN}-rtl8192ce ${PN}-rtl8192su ${PN}-rtl8723 ${PN}-rtl8821 \
229 ${PN}-rtl8168 \ 230 ${PN}-rtl8168 \
230 ${PN}-cypress-license \ 231 ${PN}-cypress-license \
@@ -492,6 +493,13 @@ FILES_${PN}-netronome = " \
492 ${nonarch_base_libdir}/firmware/netronome/nic_AMDA0096*.nffw \ 493 ${nonarch_base_libdir}/firmware/netronome/nic_AMDA0096*.nffw \
493 ${nonarch_base_libdir}/firmware/netronome/nic_AMDA0097*.nffw \ 494 ${nonarch_base_libdir}/firmware/netronome/nic_AMDA0097*.nffw \
494 ${nonarch_base_libdir}/firmware/netronome/nic_AMDA0099*.nffw \ 495 ${nonarch_base_libdir}/firmware/netronome/nic_AMDA0099*.nffw \
496 ${nonarch_base_libdir}/firmware/netronome/nic_AMDA0058-0011_2x40.nffw \
497 ${nonarch_base_libdir}/firmware/netronome/nic_AMDA0058-0012_2x40.nffw \
498 ${nonarch_base_libdir}/firmware/netronome/nic_AMDA0078-0011_1x100.nffw \
499 ${nonarch_base_libdir}/firmware/netronome/bpf \
500 ${nonarch_base_libdir}/firmware/netronome/flower \
501 ${nonarch_base_libdir}/firmware/netronome/nic \
502 ${nonarch_base_libdir}/firmware/netronome/nic-sriov \
495" 503"
496 504
497RDEPENDS_${PN}-netronome += "${PN}-netronome-license" 505RDEPENDS_${PN}-netronome += "${PN}-netronome-license"
@@ -518,6 +526,16 @@ RDEPENDS_${PN}-nvidia-gpu += "${PN}-nvidia-license"
518RDEPENDS_${PN}-nvidia-tegra += "${PN}-nvidia-license" 526RDEPENDS_${PN}-nvidia-tegra += "${PN}-nvidia-license"
519RDEPENDS_${PN}-nvidia-tegra-k1 += "${PN}-nvidia-license" 527RDEPENDS_${PN}-nvidia-tegra-k1 += "${PN}-nvidia-license"
520 528
529# For RSI RS911x WiFi
530LICENSE_${PN}-rs9113 = "WHENCE"
531LICENSE_${PN}-rs9116 = "WHENCE"
532
533FILES_${PN}-rs9113 = " ${nonarch_base_libdir}/firmware/rsi/rs9113*.rps "
534FILES_${PN}-rs9116 = " ${nonarch_base_libdir}/firmware/rsi/rs9116*.rps "
535
536RDEPENDS_${PN}-rs9113 += "${PN}-whence-license"
537RDEPENDS_${PN}-rs9116 += "${PN}-whence-license"
538
521# For rtl 539# For rtl
522LICENSE_${PN}-rtl8188 = "Firmware-rtlwifi_firmware" 540LICENSE_${PN}-rtl8188 = "Firmware-rtlwifi_firmware"
523LICENSE_${PN}-rtl8192cu = "Firmware-rtlwifi_firmware" 541LICENSE_${PN}-rtl8192cu = "Firmware-rtlwifi_firmware"
@@ -618,7 +636,9 @@ FILES_${PN}-bcm4329 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac4329-sdio.bi
618FILES_${PN}-bcm4330 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac4330-sdio.*" 636FILES_${PN}-bcm4330 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac4330-sdio.*"
619FILES_${PN}-bcm4334 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac4334-sdio.bin" 637FILES_${PN}-bcm4334 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac4334-sdio.bin"
620FILES_${PN}-bcm4335 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac4335-sdio.bin" 638FILES_${PN}-bcm4335 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac4335-sdio.bin"
621FILES_${PN}-bcm4339 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac4339-sdio.bin" 639FILES_${PN}-bcm4339 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac4339-sdio.bin \
640 ${nonarch_base_libdir}/firmware/cypress/cyfmac4339-sdio.bin \
641"
622FILES_${PN}-bcm43241b0 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac43241b0-sdio.bin" 642FILES_${PN}-bcm43241b0 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac43241b0-sdio.bin"
623FILES_${PN}-bcm43241b4 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac43241b4-sdio.bin" 643FILES_${PN}-bcm43241b4 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac43241b4-sdio.bin"
624FILES_${PN}-bcm43241b5 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac43241b5-sdio.bin" 644FILES_${PN}-bcm43241b5 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac43241b5-sdio.bin"
@@ -627,12 +647,18 @@ FILES_${PN}-bcm43143 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac43143.bin \
627 ${nonarch_base_libdir}/firmware/brcm/brcmfmac43143-sdio.bin \ 647 ${nonarch_base_libdir}/firmware/brcm/brcmfmac43143-sdio.bin \
628" 648"
629FILES_${PN}-bcm43430a0 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac43430a0-sdio.*" 649FILES_${PN}-bcm43430a0 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac43430a0-sdio.*"
630FILES_${PN}-bcm43455 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac43455-sdio.*" 650FILES_${PN}-bcm43455 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac43455-sdio.* \
651 ${nonarch_base_libdir}/firmware/cypress/cyfmac43455-sdio.* \
652"
631FILES_${PN}-bcm4350c2 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac4350c2-pcie.bin" 653FILES_${PN}-bcm4350c2 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac4350c2-pcie.bin"
632FILES_${PN}-bcm4350 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac4350-pcie.bin" 654FILES_${PN}-bcm4350 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac4350-pcie.bin"
633FILES_${PN}-bcm4356 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac4356-sdio.bin" 655FILES_${PN}-bcm4356 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac4356-sdio.bin \
656 ${nonarch_base_libdir}/firmware/cypress/cyfmac4356-sdio.bin \
657"
634FILES_${PN}-bcm43569 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac43569.bin" 658FILES_${PN}-bcm43569 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac43569.bin"
635FILES_${PN}-bcm43570 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac43570-pcie.bin" 659FILES_${PN}-bcm43570 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac43570-pcie.bin \
660 ${nonarch_base_libdir}/firmware/cypress/cyfmac43570-pcie.bin \
661"
636FILES_${PN}-bcm4358 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac4358-pcie.bin" 662FILES_${PN}-bcm4358 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac4358-pcie.bin"
637FILES_${PN}-bcm43602 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac43602-pcie.bin \ 663FILES_${PN}-bcm43602 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac43602-pcie.bin \
638 ${nonarch_base_libdir}/firmware/brcm/brcmfmac43602-pcie.ap.bin \ 664 ${nonarch_base_libdir}/firmware/brcm/brcmfmac43602-pcie.ap.bin \
@@ -703,13 +729,21 @@ LICENSE_${PN}-cypress-license = "Firmware-cypress"
703FILES_${PN}-cypress-license = "${nonarch_base_libdir}/firmware/LICENCE.cypress" 729FILES_${PN}-cypress-license = "${nonarch_base_libdir}/firmware/LICENCE.cypress"
704 730
705FILES_${PN}-bcm-0bb4-0306 = "${nonarch_base_libdir}/firmware/brcm/BCM-0bb4-0306.hcd" 731FILES_${PN}-bcm-0bb4-0306 = "${nonarch_base_libdir}/firmware/brcm/BCM-0bb4-0306.hcd"
706FILES_${PN}-bcm43340 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac43340-sdio.*" 732FILES_${PN}-bcm43340 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac43340-sdio.* \
707FILES_${PN}-bcm43362 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac43362-sdio.*" 733 ${nonarch_base_libdir}/firmware/cypress/cyfmac43340-sdio.*"
708FILES_${PN}-bcm43430 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.*" 734FILES_${PN}-bcm43362 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac43362-sdio.* \
709FILES_${PN}-bcm4354 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac4354-sdio.bin" 735 ${nonarch_base_libdir}/firmware/cypress/cyfmac43362-sdio.*"
710FILES_${PN}-bcm4356-pcie = "${nonarch_base_libdir}/firmware/brcm/brcmfmac4356-pcie.*" 736FILES_${PN}-bcm43430 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.* \
737 ${nonarch_base_libdir}/firmware/cypress/cyfmac43430-sdio.*"
738FILES_${PN}-bcm4354 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac4354-sdio.bin \
739 ${nonarch_base_libdir}/firmware/cypress/cyfmac4354-sdio.bin \
740"
741FILES_${PN}-bcm4356-pcie = "${nonarch_base_libdir}/firmware/brcm/brcmfmac4356-pcie.* \
742 ${nonarch_base_libdir}/firmware/cypress/cyfmac4356-pcie.* \
743"
711FILES_${PN}-bcm4373 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac4373-sdio.bin \ 744FILES_${PN}-bcm4373 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac4373-sdio.bin \
712 ${nonarch_base_libdir}/firmware/brcm/brcmfmac4373.bin \ 745 ${nonarch_base_libdir}/firmware/brcm/brcmfmac4373.bin \
746 ${nonarch_base_libdir}/firmware/cypress/cyfmac4373-sdio.bin \
713" 747"
714 748
715LICENSE_${PN}-bcm-0bb4-0306 = "Firmware-cypress" 749LICENSE_${PN}-bcm-0bb4-0306 = "Firmware-cypress"
diff --git a/meta/recipes-kernel/linux/linux-yocto-rt_5.4.bb b/meta/recipes-kernel/linux/linux-yocto-rt_5.4.bb
index f280e0efbd..da1d5b72da 100644
--- a/meta/recipes-kernel/linux/linux-yocto-rt_5.4.bb
+++ b/meta/recipes-kernel/linux/linux-yocto-rt_5.4.bb
@@ -11,13 +11,13 @@ python () {
11 raise bb.parse.SkipRecipe("Set PREFERRED_PROVIDER_virtual/kernel to linux-yocto-rt to enable it") 11 raise bb.parse.SkipRecipe("Set PREFERRED_PROVIDER_virtual/kernel to linux-yocto-rt to enable it")
12} 12}
13 13
14SRCREV_machine ?= "84a6ec1f97d6b6afebe3514e772536342a4189fc" 14SRCREV_machine ?= "324e77d816cf6434507ab29140beb24044009efa"
15SRCREV_meta ?= "e120076c07e69166ebeac0eee011c085bbde2139" 15SRCREV_meta ?= "d7fd0213b75ce9b6206f63dbdd435ab326598642"
16 16
17SRC_URI = "git://git.yoctoproject.org/linux-yocto.git;branch=${KBRANCH};name=machine \ 17SRC_URI = "git://git.yoctoproject.org/linux-yocto.git;branch=${KBRANCH};name=machine \
18 git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-5.4;destsuffix=${KMETA}" 18 git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-5.4;destsuffix=${KMETA}"
19 19
20LINUX_VERSION ?= "5.4.94" 20LINUX_VERSION ?= "5.4.112"
21 21
22LIC_FILES_CHKSUM = "file://COPYING;md5=bbea815ee2795b2f4230826c0c6b8814" 22LIC_FILES_CHKSUM = "file://COPYING;md5=bbea815ee2795b2f4230826c0c6b8814"
23 23
diff --git a/meta/recipes-kernel/linux/linux-yocto-tiny_5.4.bb b/meta/recipes-kernel/linux/linux-yocto-tiny_5.4.bb
index bd21c619c9..1edc632de7 100644
--- a/meta/recipes-kernel/linux/linux-yocto-tiny_5.4.bb
+++ b/meta/recipes-kernel/linux/linux-yocto-tiny_5.4.bb
@@ -6,7 +6,7 @@ KCONFIG_MODE = "--allnoconfig"
6 6
7require recipes-kernel/linux/linux-yocto.inc 7require recipes-kernel/linux/linux-yocto.inc
8 8
9LINUX_VERSION ?= "5.4.94" 9LINUX_VERSION ?= "5.4.112"
10LIC_FILES_CHKSUM = "file://COPYING;md5=bbea815ee2795b2f4230826c0c6b8814" 10LIC_FILES_CHKSUM = "file://COPYING;md5=bbea815ee2795b2f4230826c0c6b8814"
11 11
12DEPENDS += "${@bb.utils.contains('ARCH', 'x86', 'elfutils-native', '', d)}" 12DEPENDS += "${@bb.utils.contains('ARCH', 'x86', 'elfutils-native', '', d)}"
@@ -15,9 +15,9 @@ DEPENDS += "openssl-native util-linux-native"
15KMETA = "kernel-meta" 15KMETA = "kernel-meta"
16KCONF_BSP_AUDIT_LEVEL = "2" 16KCONF_BSP_AUDIT_LEVEL = "2"
17 17
18SRCREV_machine_qemuarm ?= "768311f24c5d817e7cb9ee0803790ee284e9ff30" 18SRCREV_machine_qemuarm ?= "8463db325b93f0669446f68c19334cfe11ffb9c2"
19SRCREV_machine ?= "31db2b47ac7d8508080fbb7344399b501216de66" 19SRCREV_machine ?= "5f54b437b6502d3febee553100b2cb2a9e0c5f8a"
20SRCREV_meta ?= "e120076c07e69166ebeac0eee011c085bbde2139" 20SRCREV_meta ?= "d7fd0213b75ce9b6206f63dbdd435ab326598642"
21 21
22PV = "${LINUX_VERSION}+git${SRCPV}" 22PV = "${LINUX_VERSION}+git${SRCPV}"
23 23
diff --git a/meta/recipes-kernel/linux/linux-yocto_5.4.bb b/meta/recipes-kernel/linux/linux-yocto_5.4.bb
index 9c616f7a07..53cfabb3a7 100644
--- a/meta/recipes-kernel/linux/linux-yocto_5.4.bb
+++ b/meta/recipes-kernel/linux/linux-yocto_5.4.bb
@@ -12,16 +12,16 @@ KBRANCH_qemux86 ?= "v5.4/standard/base"
12KBRANCH_qemux86-64 ?= "v5.4/standard/base" 12KBRANCH_qemux86-64 ?= "v5.4/standard/base"
13KBRANCH_qemumips64 ?= "v5.4/standard/mti-malta64" 13KBRANCH_qemumips64 ?= "v5.4/standard/mti-malta64"
14 14
15SRCREV_machine_qemuarm ?= "17b04c3b496d6a89d5de8ef97ce8c2675ac19814" 15SRCREV_machine_qemuarm ?= "133328e5d558f6060a5633d71506a6b716bb4fc6"
16SRCREV_machine_qemuarm64 ?= "31db2b47ac7d8508080fbb7344399b501216de66" 16SRCREV_machine_qemuarm64 ?= "5f54b437b6502d3febee553100b2cb2a9e0c5f8a"
17SRCREV_machine_qemumips ?= "4b4534a5bb1e765574349baf31dddceb521e6bec" 17SRCREV_machine_qemumips ?= "eef7365804592f95bceefa143cdb3cc19e8c6b66"
18SRCREV_machine_qemuppc ?= "31db2b47ac7d8508080fbb7344399b501216de66" 18SRCREV_machine_qemuppc ?= "5f54b437b6502d3febee553100b2cb2a9e0c5f8a"
19SRCREV_machine_qemuriscv64 ?= "31db2b47ac7d8508080fbb7344399b501216de66" 19SRCREV_machine_qemuriscv64 ?= "5f54b437b6502d3febee553100b2cb2a9e0c5f8a"
20SRCREV_machine_qemux86 ?= "31db2b47ac7d8508080fbb7344399b501216de66" 20SRCREV_machine_qemux86 ?= "5f54b437b6502d3febee553100b2cb2a9e0c5f8a"
21SRCREV_machine_qemux86-64 ?= "31db2b47ac7d8508080fbb7344399b501216de66" 21SRCREV_machine_qemux86-64 ?= "5f54b437b6502d3febee553100b2cb2a9e0c5f8a"
22SRCREV_machine_qemumips64 ?= "a3b16f0dc7b90e68e5a7d38e0ab70cbe290ec9a6" 22SRCREV_machine_qemumips64 ?= "996fe040c8d8d01a9af6be42dae3844d127471bf"
23SRCREV_machine ?= "31db2b47ac7d8508080fbb7344399b501216de66" 23SRCREV_machine ?= "5f54b437b6502d3febee553100b2cb2a9e0c5f8a"
24SRCREV_meta ?= "e120076c07e69166ebeac0eee011c085bbde2139" 24SRCREV_meta ?= "d7fd0213b75ce9b6206f63dbdd435ab326598642"
25 25
26# remap qemuarm to qemuarma15 for the 5.4 kernel 26# remap qemuarm to qemuarma15 for the 5.4 kernel
27# KMACHINE_qemuarm ?= "qemuarma15" 27# KMACHINE_qemuarm ?= "qemuarma15"
@@ -30,7 +30,7 @@ SRC_URI = "git://git.yoctoproject.org/linux-yocto.git;name=machine;branch=${KBRA
30 git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-5.4;destsuffix=${KMETA}" 30 git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-5.4;destsuffix=${KMETA}"
31 31
32LIC_FILES_CHKSUM = "file://COPYING;md5=bbea815ee2795b2f4230826c0c6b8814" 32LIC_FILES_CHKSUM = "file://COPYING;md5=bbea815ee2795b2f4230826c0c6b8814"
33LINUX_VERSION ?= "5.4.94" 33LINUX_VERSION ?= "5.4.112"
34 34
35DEPENDS += "${@bb.utils.contains('ARCH', 'x86', 'elfutils-native', '', d)}" 35DEPENDS += "${@bb.utils.contains('ARCH', 'x86', 'elfutils-native', '', d)}"
36DEPENDS += "openssl-native util-linux-native" 36DEPENDS += "openssl-native util-linux-native"
diff --git a/meta/recipes-kernel/lttng/babeltrace2_2.0.3.bb b/meta/recipes-kernel/lttng/babeltrace2_2.0.3.bb
index c65882581d..32ba75bf36 100644
--- a/meta/recipes-kernel/lttng/babeltrace2_2.0.3.bb
+++ b/meta/recipes-kernel/lttng/babeltrace2_2.0.3.bb
@@ -17,7 +17,7 @@ UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>2(\.\d+)+)$"
17 17
18S = "${WORKDIR}/git" 18S = "${WORKDIR}/git"
19 19
20inherit autotools pkgconfig ptest 20inherit autotools pkgconfig ptest python3targetconfig
21 21
22EXTRA_OECONF = "--disable-debug-info" 22EXTRA_OECONF = "--disable-debug-info"
23 23
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-python_1.16.3.bb b/meta/recipes-multimedia/gstreamer/gstreamer1.0-python_1.16.3.bb
index 14b34a2808..3eeb69d72c 100644
--- a/meta/recipes-multimedia/gstreamer/gstreamer1.0-python_1.16.3.bb
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-python_1.16.3.bb
@@ -16,6 +16,8 @@ PNREAL = "gst-python"
16 16
17S = "${WORKDIR}/${PNREAL}-${PV}" 17S = "${WORKDIR}/${PNREAL}-${PV}"
18 18
19EXTRA_OEMESON += "-Dlibpython-dir=${libdir}"
20
19# gobject-introspection is mandatory and cannot be configured 21# gobject-introspection is mandatory and cannot be configured
20REQUIRED_DISTRO_FEATURES = "gobject-introspection-data" 22REQUIRED_DISTRO_FEATURES = "gobject-introspection-data"
21UNKNOWN_CONFIGURE_WHITELIST_append = " introspection" 23UNKNOWN_CONFIGURE_WHITELIST_append = " introspection"
diff --git a/meta/recipes-sato/webkit/wpebackend-fdo_1.7.1.bb b/meta/recipes-sato/webkit/wpebackend-fdo_1.7.1.bb
index 519762d125..15f4f4276c 100644
--- a/meta/recipes-sato/webkit/wpebackend-fdo_1.7.1.bb
+++ b/meta/recipes-sato/webkit/wpebackend-fdo_1.7.1.bb
@@ -15,3 +15,6 @@ REQUIRED_DISTRO_FEATURES = "opengl"
15SRC_URI = "https://wpewebkit.org/releases/${BPN}-${PV}.tar.xz" 15SRC_URI = "https://wpewebkit.org/releases/${BPN}-${PV}.tar.xz"
16SRC_URI[sha256sum] = "9b980a73ea4e3762266c48f81ded56d9dcad4acf32bad9bd05d0dffdd454c6f5" 16SRC_URI[sha256sum] = "9b980a73ea4e3762266c48f81ded56d9dcad4acf32bad9bd05d0dffdd454c6f5"
17 17
18FILES_${PN} += "${libdir}/libWPEBackend-fdo-1.0.so"
19FILES_SOLIBSDEV = ""
20INSANE_SKIP_${PN} += "dev-so"
diff --git a/meta/recipes-support/apr/apr-util_1.6.1.bb b/meta/recipes-support/apr/apr-util_1.6.1.bb
index f7d827a1d8..4e183ca374 100644
--- a/meta/recipes-support/apr/apr-util_1.6.1.bb
+++ b/meta/recipes-support/apr/apr-util_1.6.1.bb
@@ -35,6 +35,7 @@ OE_BINCONFIG_EXTRA_MANGLE = " -e 's:location=source:location=installed:'"
35do_configure_append() { 35do_configure_append() {
36 if [ "${CLASSOVERRIDE}" = "class-target" ]; then 36 if [ "${CLASSOVERRIDE}" = "class-target" ]; then
37 cp ${STAGING_DATADIR}/apr/apr_rules.mk ${B}/build/rules.mk 37 cp ${STAGING_DATADIR}/apr/apr_rules.mk ${B}/build/rules.mk
38 sed -i -e 's#^CFLAGS=.*#CFLAGS=${TARGET_CFLAGS}#g' ${B}/build/rules.mk
38 fi 39 fi
39} 40}
40do_configure_prepend_class-native() { 41do_configure_prepend_class-native() {
@@ -49,6 +50,7 @@ do_configure_append_class-native() {
49 50
50do_configure_prepend_class-nativesdk() { 51do_configure_prepend_class-nativesdk() {
51 cp ${STAGING_DATADIR}/apr/apr_rules.mk ${S}/build/rules.mk 52 cp ${STAGING_DATADIR}/apr/apr_rules.mk ${S}/build/rules.mk
53 sed -i -e 's#^CFLAGS=.*#CFLAGS=${TARGET_CFLAGS}#g' ${S}/build/rules.mk
52} 54}
53 55
54do_configure_append_class-nativesdk() { 56do_configure_append_class-nativesdk() {
diff --git a/meta/recipes-support/ca-certificates/ca-certificates_20210119.bb b/meta/recipes-support/ca-certificates/ca-certificates_20210119.bb
index 888a235c1a..7dcc86fdc1 100644
--- a/meta/recipes-support/ca-certificates/ca-certificates_20210119.bb
+++ b/meta/recipes-support/ca-certificates/ca-certificates_20210119.bb
@@ -83,8 +83,8 @@ do_install_append_class-native () {
83 SYSROOT="${D}${base_prefix}" ${D}${sbindir}/update-ca-certificates 83 SYSROOT="${D}${base_prefix}" ${D}${sbindir}/update-ca-certificates
84} 84}
85 85
86RDEPENDS_${PN}_class-target = "openssl-bin" 86RDEPENDS_${PN}_append_class-target = " openssl-bin openssl"
87RDEPENDS_${PN}_class-native = "openssl-native" 87RDEPENDS_${PN}_append_class-native = " openssl-native"
88RDEPENDS_${PN}_class-nativesdk = "nativesdk-openssl-bin" 88RDEPENDS_${PN}_append_class-nativesdk = " nativesdk-openssl-bin nativesdk-openssl"
89 89
90BBCLASSEXTEND = "native nativesdk" 90BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-support/iso-codes/iso-codes_4.5.0.bb b/meta/recipes-support/iso-codes/iso-codes_4.5.0.bb
index 9d02f5c794..0b4582b202 100644
--- a/meta/recipes-support/iso-codes/iso-codes_4.5.0.bb
+++ b/meta/recipes-support/iso-codes/iso-codes_4.5.0.bb
@@ -5,7 +5,7 @@ BUGTRACKER = "https://salsa.debian.org/iso-codes-team/iso-codes/issues"
5LICENSE = "LGPLv2.1" 5LICENSE = "LGPLv2.1"
6LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c" 6LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c"
7 7
8SRC_URI = "git://salsa.debian.org/iso-codes-team/iso-codes.git;protocol=http;branch=main;" 8SRC_URI = "git://salsa.debian.org/iso-codes-team/iso-codes.git;protocol=https;branch=main;"
9SRCREV = "a36019e5014bff251f83d522ddcfebaecf52afd3" 9SRCREV = "a36019e5014bff251f83d522ddcfebaecf52afd3"
10 10
11# inherit gettext cannot be used, because it adds gettext-native to BASEDEPENDS which 11# inherit gettext cannot be used, because it adds gettext-native to BASEDEPENDS which
diff --git a/meta/recipes-support/libevdev/libevdev/determinism.patch b/meta/recipes-support/libevdev/libevdev/determinism.patch
index f6b7fc82d3..71cbd876eb 100644
--- a/meta/recipes-support/libevdev/libevdev/determinism.patch
+++ b/meta/recipes-support/libevdev/libevdev/determinism.patch
@@ -9,7 +9,8 @@ Sort to remove this inconsistency.
9RP 2020/2/7 9RP 2020/2/7
10 10
11Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> 11Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
12Upstream-Status: Pending 12Submitted: https://lists.freedesktop.org/archives/input-tools/2021-February/001560.html
13Upstream-Status: Backport [https://gitlab.freedesktop.org/libevdev/libevdev/-/commit/8d70f449892c6f7659e07bb0f06b8347677bb7d8]
13 14
14--- 15---
15 libevdev/make-event-names.py | 6 +++--- 16 libevdev/make-event-names.py | 6 +++---
diff --git a/scripts/contrib/documentation-audit.sh b/scripts/contrib/documentation-audit.sh
index 1191f57a8e..f436f9bae0 100755
--- a/scripts/contrib/documentation-audit.sh
+++ b/scripts/contrib/documentation-audit.sh
@@ -27,7 +27,7 @@ fi
27 27
28echo "REMINDER: you need to build for MACHINE=qemux86 or you won't get useful results" 28echo "REMINDER: you need to build for MACHINE=qemux86 or you won't get useful results"
29echo "REMINDER: you need to set LICENSE_FLAGS_WHITELIST appropriately in local.conf or " 29echo "REMINDER: you need to set LICENSE_FLAGS_WHITELIST appropriately in local.conf or "
30echo " you'll get false positives. For example, LICENSE_FLAGS_WHITELIST = \"Commercial\"" 30echo " you'll get false positives. For example, LICENSE_FLAGS_WHITELIST = \"commercial\""
31 31
32for pkg in `bitbake -s | awk '{ print \$1 }'`; do 32for pkg in `bitbake -s | awk '{ print \$1 }'`; do
33 if [[ "$pkg" == "Loading" || "$pkg" == "Loaded" || 33 if [[ "$pkg" == "Loading" || "$pkg" == "Loaded" ||
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
index 7b62b7e7b8..f364a45283 100644
--- a/scripts/lib/devtool/standard.py
+++ b/scripts/lib/devtool/standard.py
@@ -953,12 +953,17 @@ def modify(args, config, basepath, workspace):
953 953
954 if bb.data.inherits_class('kernel', rd): 954 if bb.data.inherits_class('kernel', rd):
955 f.write('SRCTREECOVEREDTASKS = "do_validate_branches do_kernel_checkout ' 955 f.write('SRCTREECOVEREDTASKS = "do_validate_branches do_kernel_checkout '
956 'do_fetch do_unpack do_kernel_configme do_kernel_configcheck"\n') 956 'do_fetch do_unpack do_kernel_configcheck"\n')
957 f.write('\ndo_patch[noexec] = "1"\n') 957 f.write('\ndo_patch[noexec] = "1"\n')
958 f.write('\ndo_configure_append() {\n' 958 f.write('\ndo_configure_append() {\n'
959 ' cp ${B}/.config ${S}/.config.baseline\n' 959 ' cp ${B}/.config ${S}/.config.baseline\n'
960 ' ln -sfT ${B}/.config ${S}/.config.new\n' 960 ' ln -sfT ${B}/.config ${S}/.config.new\n'
961 '}\n') 961 '}\n')
962 f.write('\ndo_kernel_configme_prepend() {\n'
963 ' if [ -e ${S}/.config ]; then\n'
964 ' mv ${S}/.config ${S}/.config.old\n'
965 ' fi\n'
966 '}\n')
962 if rd.getVarFlag('do_menuconfig','task'): 967 if rd.getVarFlag('do_menuconfig','task'):
963 f.write('\ndo_configure_append() {\n' 968 f.write('\ndo_configure_append() {\n'
964 ' if [ ! ${DEVTOOL_DISABLE_MENUCONFIG} ]; then\n' 969 ' if [ ! ${DEVTOOL_DISABLE_MENUCONFIG} ]; then\n'
diff --git a/scripts/lib/wic/canned-wks/common.wks.inc b/scripts/lib/wic/canned-wks/common.wks.inc
index 89880b417b..4fd29fa8c1 100644
--- a/scripts/lib/wic/canned-wks/common.wks.inc
+++ b/scripts/lib/wic/canned-wks/common.wks.inc
@@ -1,3 +1,3 @@
1# This file is included into 3 canned wks files from this directory 1# This file is included into 3 canned wks files from this directory
2part /boot --source bootimg-pcbios --ondisk sda --label boot --active --align 1024 2part /boot --source bootimg-pcbios --ondisk sda --label boot --active --align 1024
3part / --source rootfs --use-uuid --fstype=ext4 --label platform --align 1024 3part / --source rootfs --use-uuid --fstype=ext4 --mkfs-extraopts "-T default" --label platform --align 1024
diff --git a/scripts/lib/wic/canned-wks/directdisk-gpt.wks b/scripts/lib/wic/canned-wks/directdisk-gpt.wks
index 8d7d8de6ea..cf16c0c30b 100644
--- a/scripts/lib/wic/canned-wks/directdisk-gpt.wks
+++ b/scripts/lib/wic/canned-wks/directdisk-gpt.wks
@@ -4,7 +4,7 @@
4 4
5 5
6part /boot --source bootimg-pcbios --ondisk sda --label boot --active --align 1024 6part /boot --source bootimg-pcbios --ondisk sda --label boot --active --align 1024
7part / --source rootfs --ondisk sda --fstype=ext4 --label platform --align 1024 --use-uuid 7part / --source rootfs --ondisk sda --fstype=ext4 --mkfs-extraopts "-T default" --label platform --align 1024 --use-uuid
8 8
9bootloader --ptable gpt --timeout=0 --append="rootwait rootfstype=ext4 video=vesafb vga=0x318 console=tty0 console=ttyS0,115200n8" 9bootloader --ptable gpt --timeout=0 --append="rootwait rootfstype=ext4 video=vesafb vga=0x318 console=tty0 console=ttyS0,115200n8"
10 10
diff --git a/scripts/lib/wic/canned-wks/mkefidisk.wks b/scripts/lib/wic/canned-wks/mkefidisk.wks
index 9f534fe184..d1878e23e5 100644
--- a/scripts/lib/wic/canned-wks/mkefidisk.wks
+++ b/scripts/lib/wic/canned-wks/mkefidisk.wks
@@ -4,7 +4,7 @@
4 4
5part /boot --source bootimg-efi --sourceparams="loader=grub-efi" --ondisk sda --label msdos --active --align 1024 5part /boot --source bootimg-efi --sourceparams="loader=grub-efi" --ondisk sda --label msdos --active --align 1024
6 6
7part / --source rootfs --ondisk sda --fstype=ext4 --label platform --align 1024 --use-uuid 7part / --source rootfs --ondisk sda --fstype=ext4 --mkfs-extraopts "-T default" --label platform --align 1024 --use-uuid
8 8
9part swap --ondisk sda --size 44 --label swap1 --fstype=swap 9part swap --ondisk sda --size 44 --label swap1 --fstype=swap
10 10
diff --git a/scripts/lib/wic/misc.py b/scripts/lib/wic/misc.py
index 75b219cd3f..57c042c503 100644
--- a/scripts/lib/wic/misc.py
+++ b/scripts/lib/wic/misc.py
@@ -26,6 +26,7 @@ logger = logging.getLogger('wic')
26 26
27# executable -> recipe pairs for exec_native_cmd 27# executable -> recipe pairs for exec_native_cmd
28NATIVE_RECIPES = {"bmaptool": "bmap-tools", 28NATIVE_RECIPES = {"bmaptool": "bmap-tools",
29 "dumpe2fs": "e2fsprogs",
29 "grub-mkimage": "grub-efi", 30 "grub-mkimage": "grub-efi",
30 "isohybrid": "syslinux", 31 "isohybrid": "syslinux",
31 "mcopy": "mtools", 32 "mcopy": "mtools",
diff --git a/scripts/lib/wic/partition.py b/scripts/lib/wic/partition.py
index e574f40c47..85f9847047 100644
--- a/scripts/lib/wic/partition.py
+++ b/scripts/lib/wic/partition.py
@@ -298,6 +298,8 @@ class Partition():
298 mkfs_cmd = "fsck.%s -pvfD %s" % (self.fstype, rootfs) 298 mkfs_cmd = "fsck.%s -pvfD %s" % (self.fstype, rootfs)
299 exec_native_cmd(mkfs_cmd, native_sysroot, pseudo=pseudo) 299 exec_native_cmd(mkfs_cmd, native_sysroot, pseudo=pseudo)
300 300
301 self.check_for_Y2038_problem(rootfs, native_sysroot)
302
301 def prepare_rootfs_btrfs(self, rootfs, cr_workdir, oe_builddir, rootfs_dir, 303 def prepare_rootfs_btrfs(self, rootfs, cr_workdir, oe_builddir, rootfs_dir,
302 native_sysroot, pseudo): 304 native_sysroot, pseudo):
303 """ 305 """
@@ -388,6 +390,8 @@ class Partition():
388 (self.fstype, extraopts, label_str, self.fsuuid, rootfs) 390 (self.fstype, extraopts, label_str, self.fsuuid, rootfs)
389 exec_native_cmd(mkfs_cmd, native_sysroot) 391 exec_native_cmd(mkfs_cmd, native_sysroot)
390 392
393 self.check_for_Y2038_problem(rootfs, native_sysroot)
394
391 def prepare_empty_partition_btrfs(self, rootfs, oe_builddir, 395 def prepare_empty_partition_btrfs(self, rootfs, oe_builddir,
392 native_sysroot): 396 native_sysroot):
393 """ 397 """
@@ -449,3 +453,37 @@ class Partition():
449 453
450 mkswap_cmd = "mkswap %s -U %s %s" % (label_str, self.fsuuid, path) 454 mkswap_cmd = "mkswap %s -U %s %s" % (label_str, self.fsuuid, path)
451 exec_native_cmd(mkswap_cmd, native_sysroot) 455 exec_native_cmd(mkswap_cmd, native_sysroot)
456
457 def check_for_Y2038_problem(self, rootfs, native_sysroot):
458 """
459 Check if the filesystem is affected by the Y2038 problem
460 (Y2038 problem = 32 bit time_t overflow in January 2038)
461 """
462 def get_err_str(part):
463 err = "The {} filesystem {} has no Y2038 support."
464 if part.mountpoint:
465 args = [part.fstype, "mounted at %s" % part.mountpoint]
466 elif part.label:
467 args = [part.fstype, "labeled '%s'" % part.label]
468 elif part.part_name:
469 args = [part.fstype, "in partition '%s'" % part.part_name]
470 else:
471 args = [part.fstype, "in partition %s" % part.num]
472 return err.format(*args)
473
474 # ext2 and ext3 are always affected by the Y2038 problem
475 if self.fstype in ["ext2", "ext3"]:
476 logger.warn(get_err_str(self))
477 return
478
479 ret, out = exec_native_cmd("dumpe2fs %s" % rootfs, native_sysroot)
480
481 # if ext4 is affected by the Y2038 problem depends on the inode size
482 for line in out.splitlines():
483 if line.startswith("Inode size:"):
484 size = int(line.split(":")[1].strip())
485 if size < 256:
486 logger.warn("%s Inodes (of size %d) are too small." %
487 (get_err_str(self), size))
488 break
489
diff --git a/scripts/runqemu b/scripts/runqemu
index e5e66f3453..b80fec1c99 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -1340,6 +1340,8 @@ class BaseConfig(object):
1340 1340
1341 for ovmf in self.ovmf_bios: 1341 for ovmf in self.ovmf_bios:
1342 format = ovmf.rsplit('.', 1)[-1] 1342 format = ovmf.rsplit('.', 1)[-1]
1343 if format == "bin":
1344 format = "raw"
1343 self.qemu_opt += ' -drive if=pflash,format=%s,file=%s' % (format, ovmf) 1345 self.qemu_opt += ' -drive if=pflash,format=%s,file=%s' % (format, ovmf)
1344 1346
1345 self.qemu_opt += ' ' + self.qemu_opt_script 1347 self.qemu_opt += ' ' + self.qemu_opt_script
diff --git a/scripts/verify-bashisms b/scripts/verify-bashisms
index fb0cc719ea..14d8c298e9 100755
--- a/scripts/verify-bashisms
+++ b/scripts/verify-bashisms
@@ -100,7 +100,7 @@ if __name__=='__main__':
100 args = parser.parse_args() 100 args = parser.parse_args()
101 101
102 if shutil.which("checkbashisms.pl") is None: 102 if shutil.which("checkbashisms.pl") is None:
103 print("Cannot find checkbashisms.pl on $PATH, get it from https://anonscm.debian.org/cgit/collab-maint/devscripts.git/plain/scripts/checkbashisms.pl") 103 print("Cannot find checkbashisms.pl on $PATH, get it from https://salsa.debian.org/debian/devscripts/raw/master/scripts/checkbashisms.pl")
104 sys.exit(1) 104 sys.exit(1)
105 105
106 # The order of defining the worker function, 106 # The order of defining the worker function,
diff --git a/scripts/yocto-check-layer b/scripts/yocto-check-layer
index b7c83c8b54..deba3cb4f8 100755
--- a/scripts/yocto-check-layer
+++ b/scripts/yocto-check-layer
@@ -138,6 +138,9 @@ def main():
138 layer['type'] == LayerType.ERROR_BSP_DISTRO: 138 layer['type'] == LayerType.ERROR_BSP_DISTRO:
139 continue 139 continue
140 140
141 # Reset to a clean backup copy for each run
142 shutil.copyfile(bblayersconf + '.backup', bblayersconf)
143
141 if check_bblayers(bblayersconf, layer['path'], logger): 144 if check_bblayers(bblayersconf, layer['path'], logger):
142 logger.info("%s already in %s. To capture initial signatures, layer under test should not present " 145 logger.info("%s already in %s. To capture initial signatures, layer under test should not present "
143 "in BBLAYERS. Please remove %s from BBLAYERS." % (layer['name'], bblayersconf, layer['name'])) 146 "in BBLAYERS. Please remove %s from BBLAYERS." % (layer['name'], bblayersconf, layer['name']))