mirror of
https://git.yoctoproject.org/poky
synced 2026-02-20 08:29:42 +01:00
Compare commits
69 Commits
yocto-3.1.
...
dunfell-23
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
32da5ee951 | ||
|
|
88bec50206 | ||
|
|
aa5a1adb60 | ||
|
|
df86cc15d0 | ||
|
|
9c828566b2 | ||
|
|
d7ef6fd67c | ||
|
|
6e42635ae0 | ||
|
|
f8a370159b | ||
|
|
7ac47c90cc | ||
|
|
5de95d9c29 | ||
|
|
a022b1abef | ||
|
|
228d031f73 | ||
|
|
a04b507d39 | ||
|
|
0bf993da8b | ||
|
|
5b0daa0061 | ||
|
|
fcb0381657 | ||
|
|
1adc1600f2 | ||
|
|
218ca73cab | ||
|
|
ed4a2d3d41 | ||
|
|
8b1211f81f | ||
|
|
87f16e1f3b | ||
|
|
579797adab | ||
|
|
9faca1f692 | ||
|
|
6c5b006a10 | ||
|
|
5e9e50e544 | ||
|
|
60cd2c29ea | ||
|
|
122c106794 | ||
|
|
65c2f76dca | ||
|
|
a16a21af9a | ||
|
|
84ef58ae39 | ||
|
|
e146653c21 | ||
|
|
b30e81df2b | ||
|
|
0a24a5bb3b | ||
|
|
f506b0c057 | ||
|
|
4cfb4fc8ed | ||
|
|
e211a16fb5 | ||
|
|
82fd9eb08f | ||
|
|
f3a78fecc2 | ||
|
|
8c4bad844f | ||
|
|
2ae4aff0a6 | ||
|
|
55750ffd78 | ||
|
|
70d75e8996 | ||
|
|
b994c2d4f5 | ||
|
|
eb7bb5b589 | ||
|
|
bc3497092e | ||
|
|
642040373e | ||
|
|
a6f3173407 | ||
|
|
00277476e3 | ||
|
|
8f837940fd | ||
|
|
74b8f9ee39 | ||
|
|
7256436957 | ||
|
|
f25b363233 | ||
|
|
2474c30274 | ||
|
|
5ca4b2a548 | ||
|
|
a84a25acc5 | ||
|
|
c8f5ff0ffe | ||
|
|
822d364542 | ||
|
|
b01dd27a8d | ||
|
|
42a4f98ab5 | ||
|
|
756bae9bf9 | ||
|
|
ec29356556 | ||
|
|
f6f1b85384 | ||
|
|
6dcf266eb4 | ||
|
|
5ea3190383 | ||
|
|
5127d99785 | ||
|
|
ff22728dd5 | ||
|
|
af419f2429 | ||
|
|
04003b36bf | ||
|
|
800b69b78b |
@@ -1975,11 +1975,19 @@ class RunQueueExecute:
|
||||
self.setbuildable(revdep)
|
||||
logger.debug(1, "Marking task %s as buildable", revdep)
|
||||
|
||||
for t in self.sq_deferred.copy():
|
||||
found = None
|
||||
for t in sorted(self.sq_deferred.copy()):
|
||||
if self.sq_deferred[t] == task:
|
||||
logger.debug(2, "Deferred task %s now buildable" % t)
|
||||
del self.sq_deferred[t]
|
||||
update_scenequeue_data([t], self.sqdata, self.rqdata, self.rq, self.cooker, self.stampcache, self, summary=False)
|
||||
# Allow the next deferred task to run. Any other deferred tasks should be deferred after that task.
|
||||
# We shouldn't allow all to run at once as it is prone to races.
|
||||
if not found:
|
||||
bb.note("Deferred task %s now buildable" % t)
|
||||
del self.sq_deferred[t]
|
||||
update_scenequeue_data([t], self.sqdata, self.rqdata, self.rq, self.cooker, self.stampcache, self, summary=False)
|
||||
found = t
|
||||
else:
|
||||
bb.note("Deferring %s after %s" % (t, found))
|
||||
self.sq_deferred[t] = found
|
||||
|
||||
def task_complete(self, task):
|
||||
self.stats.taskCompleted()
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
DISTRO : "3.1.26"
|
||||
DISTRO : "3.1.27"
|
||||
DISTRO_NAME_NO_CAP : "dunfell"
|
||||
DISTRO_NAME : "Dunfell"
|
||||
DISTRO_NAME_NO_CAP_MINUS_ONE : "zeus"
|
||||
YOCTO_DOC_VERSION : "3.1.26"
|
||||
YOCTO_DOC_VERSION : "3.1.27"
|
||||
YOCTO_DOC_VERSION_MINUS_ONE : "3.0.4"
|
||||
DISTRO_REL_TAG : "yocto-3.1.26"
|
||||
DOCCONF_VERSION : "3.1.26"
|
||||
DISTRO_REL_TAG : "yocto-3.1.27"
|
||||
DOCCONF_VERSION : "3.1.27"
|
||||
BITBAKE_SERIES : "1.46"
|
||||
POKYVERSION : "23.0.26"
|
||||
POKYVERSION : "23.0.27"
|
||||
YOCTO_POKY : "poky-&DISTRO_NAME_NO_CAP;-&POKYVERSION;"
|
||||
YOCTO_DL_URL : "https://downloads.yoctoproject.org"
|
||||
YOCTO_AB_URL : "https://autobuilder.yoctoproject.org"
|
||||
|
||||
@@ -14,16 +14,17 @@ image you want.
|
||||
Building an image without GNU General Public License Version 3
|
||||
(GPLv3), GNU Lesser General Public License Version 3 (LGPLv3), and
|
||||
the GNU Affero General Public License Version 3 (AGPL-3.0) components
|
||||
is only supported for minimal and base images. Furthermore, if you
|
||||
are going to build an image using non-GPLv3 and similarly licensed
|
||||
components, you must make the following changes in the ``local.conf``
|
||||
file before using the BitBake command to build the minimal or base
|
||||
image:
|
||||
::
|
||||
is only tested for core-image-minimal image. Furthermore, if you would like to
|
||||
build an image and verify that it does not include GPLv3 and similarly licensed
|
||||
components, you must make the following changes in the image recipe
|
||||
file before using the BitBake command to build the image:
|
||||
|
||||
1. Comment out the EXTRA_IMAGE_FEATURES line
|
||||
2. Set INCOMPATIBLE_LICENSE = "GPL-3.0 LGPL-3.0 AGPL-3.0"
|
||||
INCOMPATIBLE_LICENSE = "GPL-3.0* LGPL-3.0*"
|
||||
|
||||
Alternatively, you can adjust ``local.conf`` file, repeating and adjusting the line
|
||||
for all images where the license restriction must apply:
|
||||
|
||||
INCOMPATIBLE_LICENSE_pn-your-image-name = "GPL-3.0* LGPL-3.0*"
|
||||
|
||||
From within the ``poky`` Git repository, you can use the following
|
||||
command to display the list of directories within the :term:`Source Directory`
|
||||
|
||||
@@ -3337,9 +3337,18 @@ system and gives an overview of their function and contents.
|
||||
:term:`INCOMPATIBLE_LICENSE`
|
||||
Specifies a space-separated list of license names (as they would
|
||||
appear in :term:`LICENSE`) that should be excluded
|
||||
from the build. Recipes that provide no alternatives to listed
|
||||
from the build (if set globally), or from an image (if set locally
|
||||
in an image recipe).
|
||||
|
||||
When the variable is set globally, recipes that provide no alternatives to listed
|
||||
incompatible licenses are not built. Packages that are individually
|
||||
licensed with the specified incompatible licenses will be deleted.
|
||||
Most of the time this does not allow a feasible build (because it becomes impossible
|
||||
to satisfy build time dependencies), so the recommended way to
|
||||
implement license restrictions is to set the variable in specific
|
||||
image recipes where the restrictions must apply. That way there
|
||||
are no build time restrictions, but the license check is still
|
||||
performed when the image's filesystem is assembled from packages.
|
||||
|
||||
.. note::
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
DISTRO = "poky"
|
||||
DISTRO_NAME = "Poky (Yocto Project Reference Distro)"
|
||||
DISTRO_VERSION = "3.1.26"
|
||||
DISTRO_VERSION = "3.1.27"
|
||||
DISTRO_CODENAME = "dunfell"
|
||||
SDK_VENDOR = "-pokysdk"
|
||||
SDK_VERSION = "${@d.getVar('DISTRO_VERSION').replace('snapshot-${DATE}', 'snapshot')}"
|
||||
|
||||
@@ -26,7 +26,7 @@ CVE_PRODUCT ??= "${BPN}"
|
||||
CVE_VERSION ??= "${PV}"
|
||||
|
||||
CVE_CHECK_DB_DIR ?= "${DL_DIR}/CVE_CHECK"
|
||||
CVE_CHECK_DB_FILE ?= "${CVE_CHECK_DB_DIR}/nvdcve_1.1.db"
|
||||
CVE_CHECK_DB_FILE ?= "${CVE_CHECK_DB_DIR}/nvdcve_2.db"
|
||||
CVE_CHECK_DB_FILE_LOCK ?= "${CVE_CHECK_DB_FILE}.lock"
|
||||
|
||||
CVE_CHECK_LOG ?= "${T}/cve.log"
|
||||
@@ -154,7 +154,7 @@ python do_cve_check () {
|
||||
}
|
||||
|
||||
addtask cve_check before do_build
|
||||
do_cve_check[depends] = "cve-update-db-native:do_fetch"
|
||||
do_cve_check[depends] = "cve-update-nvd2-native:do_fetch"
|
||||
do_cve_check[nostamp] = "1"
|
||||
|
||||
python cve_check_cleanup () {
|
||||
|
||||
@@ -118,7 +118,7 @@ go_do_install() {
|
||||
tar -C ${B} -cf - --exclude-vcs --exclude '*.test' --exclude 'testdata' pkg | \
|
||||
tar -C ${D}${libdir}/go --no-same-owner -xf -
|
||||
|
||||
if [ -n "`ls ${B}/${GO_BUILD_BINDIR}/`" ]; then
|
||||
if ls ${B}/${GO_BUILD_BINDIR}/* >/dev/null 2>/dev/null ; then
|
||||
install -d ${D}${bindir}
|
||||
install -m 0755 ${B}/${GO_BUILD_BINDIR}/* ${D}${bindir}/
|
||||
fi
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
inherit kernel-uboot kernel-artifact-names uboot-sign
|
||||
|
||||
KERNEL_IMAGETYPE_REPLACEMENT = ""
|
||||
|
||||
python __anonymous () {
|
||||
kerneltypes = d.getVar('KERNEL_IMAGETYPES') or ""
|
||||
if 'fitImage' in kerneltypes.split():
|
||||
@@ -21,6 +23,8 @@ python __anonymous () {
|
||||
else:
|
||||
replacementtype = "zImage"
|
||||
|
||||
d.setVar("KERNEL_IMAGETYPE_REPLACEMENT", replacementtype)
|
||||
|
||||
# Override KERNEL_IMAGETYPE_FOR_MAKE variable, which is internal
|
||||
# to kernel.bbclass . We have to override it, since we pack zImage
|
||||
# (at least for now) into the fitImage .
|
||||
@@ -45,6 +49,8 @@ python __anonymous () {
|
||||
if d.getVar('UBOOT_SIGN_ENABLE') == "1" and d.getVar('UBOOT_DTB_BINARY'):
|
||||
uboot_pn = d.getVar('PREFERRED_PROVIDER_u-boot') or 'u-boot'
|
||||
d.appendVarFlag('do_assemble_fitimage', 'depends', ' %s:do_populate_sysroot' % uboot_pn)
|
||||
if d.getVar('INITRAMFS_IMAGE_BUNDLE') == "1":
|
||||
d.appendVarFlag('do_assemble_fitimage_initramfs', 'depends', ' %s:do_populate_sysroot' % uboot_pn)
|
||||
}
|
||||
|
||||
# Options for the device tree compiler passed to mkimage '-D' feature:
|
||||
@@ -180,6 +186,43 @@ fitimage_emit_section_dtb() {
|
||||
EOF
|
||||
}
|
||||
|
||||
#
|
||||
# Emit the fitImage ITS u-boot script section
|
||||
#
|
||||
# $1 ... .its filename
|
||||
# $2 ... Image counter
|
||||
# $3 ... Path to boot script image
|
||||
fitimage_emit_section_boot_script() {
|
||||
|
||||
bootscr_csum="${FIT_HASH_ALG}"
|
||||
bootscr_sign_algo="${FIT_SIGN_ALG}"
|
||||
bootscr_sign_keyname="${UBOOT_SIGN_IMG_KEYNAME}"
|
||||
|
||||
cat << EOF >> $1
|
||||
bootscr-$2 {
|
||||
description = "U-boot script";
|
||||
data = /incbin/("$3");
|
||||
type = "script";
|
||||
arch = "${UBOOT_ARCH}";
|
||||
compression = "none";
|
||||
hash-1 {
|
||||
algo = "$bootscr_csum";
|
||||
};
|
||||
};
|
||||
EOF
|
||||
|
||||
if [ "${UBOOT_SIGN_ENABLE}" = "1" -a "${FIT_SIGN_INDIVIDUAL}" = "1" -a -n "$bootscr_sign_keyname" ] ; then
|
||||
sed -i '$ d' $1
|
||||
cat << EOF >> $1
|
||||
signature-1 {
|
||||
algo = "$bootscr_csum,$bootscr_sign_algo";
|
||||
key-name-hint = "$bootscr_sign_keyname";
|
||||
};
|
||||
};
|
||||
EOF
|
||||
fi
|
||||
}
|
||||
|
||||
#
|
||||
# Emit the fitImage ITS setup section
|
||||
#
|
||||
@@ -250,8 +293,9 @@ EOF
|
||||
# $2 ... Linux kernel ID
|
||||
# $3 ... DTB image name
|
||||
# $4 ... ramdisk ID
|
||||
# $5 ... config ID
|
||||
# $6 ... default flag
|
||||
# $5 ... u-boot script ID
|
||||
# $6 ... config ID
|
||||
# $7 ... default flag
|
||||
fitimage_emit_section_config() {
|
||||
|
||||
conf_csum="${FIT_HASH_ALG}"
|
||||
@@ -267,6 +311,7 @@ fitimage_emit_section_config() {
|
||||
kernel_line=""
|
||||
fdt_line=""
|
||||
ramdisk_line=""
|
||||
bootscr_line=""
|
||||
setup_line=""
|
||||
default_line=""
|
||||
|
||||
@@ -289,21 +334,28 @@ fitimage_emit_section_config() {
|
||||
fi
|
||||
|
||||
if [ -n "${5}" ]; then
|
||||
conf_desc="${conf_desc}${sep}setup"
|
||||
setup_line="setup = \"setup-${5}\";"
|
||||
conf_desc="${conf_desc}${sep}u-boot script"
|
||||
sep=", "
|
||||
bootscr_line="bootscr = \"bootscr-${5}\";"
|
||||
fi
|
||||
|
||||
if [ "${6}" = "1" ]; then
|
||||
if [ -n "${6}" ]; then
|
||||
conf_desc="${conf_desc}${sep}setup"
|
||||
setup_line="setup = \"setup-${6}\";"
|
||||
fi
|
||||
|
||||
if [ "${7}" = "1" ]; then
|
||||
default_line="default = \"conf-${3}\";"
|
||||
fi
|
||||
|
||||
cat << EOF >> ${1}
|
||||
${default_line}
|
||||
conf-${3} {
|
||||
description = "${6} ${conf_desc}";
|
||||
description = "${7} ${conf_desc}";
|
||||
${kernel_line}
|
||||
${fdt_line}
|
||||
${ramdisk_line}
|
||||
${bootscr_line}
|
||||
${setup_line}
|
||||
hash-1 {
|
||||
algo = "${conf_csum}";
|
||||
@@ -331,6 +383,11 @@ EOF
|
||||
fi
|
||||
|
||||
if [ -n "${5}" ]; then
|
||||
sign_line="${sign_line}${sep}\"bootscr\""
|
||||
sep=", "
|
||||
fi
|
||||
|
||||
if [ -n "${6}" ]; then
|
||||
sign_line="${sign_line}${sep}\"setup\""
|
||||
fi
|
||||
|
||||
@@ -363,6 +420,7 @@ fitimage_assemble() {
|
||||
DTBS=""
|
||||
ramdiskcount=${3}
|
||||
setupcount=""
|
||||
bootscr_id=""
|
||||
rm -f ${1} arch/${ARCH}/boot/${2}
|
||||
|
||||
fitimage_emit_fit_header ${1}
|
||||
@@ -373,7 +431,7 @@ fitimage_assemble() {
|
||||
fitimage_emit_section_maint ${1} imagestart
|
||||
|
||||
uboot_prep_kimage
|
||||
fitimage_emit_section_kernel ${1} "${kernelcount}" linux.bin "${linux_comp}"
|
||||
fitimage_emit_section_kernel $1 $kernelcount linux.bin "$linux_comp"
|
||||
|
||||
#
|
||||
# Step 2: Prepare a DTB image section
|
||||
@@ -407,7 +465,21 @@ fitimage_assemble() {
|
||||
fi
|
||||
|
||||
#
|
||||
# Step 3: Prepare a setup section. (For x86)
|
||||
# Step 3: Prepare a u-boot script section
|
||||
#
|
||||
|
||||
if [ -n "${UBOOT_ENV}" ] && [ -d "${STAGING_DIR_HOST}/boot" ]; then
|
||||
if [ -e "${STAGING_DIR_HOST}/boot/${UBOOT_ENV_BINARY}" ]; then
|
||||
cp ${STAGING_DIR_HOST}/boot/${UBOOT_ENV_BINARY} ${B}
|
||||
bootscr_id="${UBOOT_ENV_BINARY}"
|
||||
fitimage_emit_section_boot_script ${1} "${bootscr_id}" ${UBOOT_ENV_BINARY}
|
||||
else
|
||||
bbwarn "${STAGING_DIR_HOST}/boot/${UBOOT_ENV_BINARY} not found."
|
||||
fi
|
||||
fi
|
||||
|
||||
#
|
||||
# Step 4: Prepare a setup section. (For x86)
|
||||
#
|
||||
if [ -e arch/${ARCH}/boot/setup.bin ]; then
|
||||
setupcount=1
|
||||
@@ -415,9 +487,9 @@ fitimage_assemble() {
|
||||
fi
|
||||
|
||||
#
|
||||
# Step 4: Prepare a ramdisk section.
|
||||
# Step 5: Prepare a ramdisk section.
|
||||
#
|
||||
if [ "x${ramdiskcount}" = "x1" ] ; then
|
||||
if [ "x${ramdiskcount}" = "x1" ] && [ "${INITRAMFS_IMAGE_BUNDLE}" != "1" ]; then
|
||||
# Find and use the first initramfs image archive type we find
|
||||
for img in cpio.lz4 cpio.lzo cpio.lzma cpio.xz cpio.gz ext2.gz cpio; do
|
||||
initramfs_path="${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE_NAME}.${img}"
|
||||
@@ -438,7 +510,7 @@ fitimage_assemble() {
|
||||
fi
|
||||
|
||||
#
|
||||
# Step 5: Prepare a configurations section
|
||||
# Step 6: Prepare a configurations section
|
||||
#
|
||||
fitimage_emit_section_maint ${1} confstart
|
||||
|
||||
@@ -447,9 +519,9 @@ fitimage_assemble() {
|
||||
for DTB in ${DTBS}; do
|
||||
dtb_ext=${DTB##*.}
|
||||
if [ "${dtb_ext}" = "dtbo" ]; then
|
||||
fitimage_emit_section_config ${1} "" "${DTB}" "" "" "`expr ${i} = ${dtbcount}`"
|
||||
fitimage_emit_section_config ${1} "" "${DTB}" "" "${bootscr_id}" "" "`expr ${i} = ${dtbcount}`"
|
||||
else
|
||||
fitimage_emit_section_config ${1} "${kernelcount}" "${DTB}" "${ramdiskcount}" "${setupcount}" "`expr ${i} = ${dtbcount}`"
|
||||
fitimage_emit_section_config ${1} "${kernelcount}" "${DTB}" "${ramdiskcount}" "${bootscr_id}" "${setupcount}" "`expr ${i} = ${dtbcount}`"
|
||||
fi
|
||||
i=`expr ${i} + 1`
|
||||
done
|
||||
@@ -460,7 +532,7 @@ fitimage_assemble() {
|
||||
fitimage_emit_section_maint ${1} fitend
|
||||
|
||||
#
|
||||
# Step 6: Assemble the image
|
||||
# Step 7: Assemble the image
|
||||
#
|
||||
uboot-mkimage \
|
||||
${@'-D "${UBOOT_MKIMAGE_DTCOPTS}"' if len('${UBOOT_MKIMAGE_DTCOPTS}') else ''} \
|
||||
@@ -468,7 +540,7 @@ fitimage_assemble() {
|
||||
arch/${ARCH}/boot/${2}
|
||||
|
||||
#
|
||||
# Step 7: Sign the image and add public key to U-Boot dtb
|
||||
# Step 8: Sign the image and add public key to U-Boot dtb
|
||||
#
|
||||
if [ "x${UBOOT_SIGN_ENABLE}" = "x1" ] ; then
|
||||
add_key_to_u_boot=""
|
||||
@@ -500,7 +572,11 @@ do_assemble_fitimage_initramfs() {
|
||||
if echo ${KERNEL_IMAGETYPES} | grep -wq "fitImage" && \
|
||||
test -n "${INITRAMFS_IMAGE}" ; then
|
||||
cd ${B}
|
||||
fitimage_assemble fit-image-${INITRAMFS_IMAGE}.its fitImage-${INITRAMFS_IMAGE} 1
|
||||
if [ "${INITRAMFS_IMAGE_BUNDLE}" = "1" ]; then
|
||||
fitimage_assemble fit-image-${INITRAMFS_IMAGE}.its fitImage ""
|
||||
else
|
||||
fitimage_assemble fit-image-${INITRAMFS_IMAGE}.its fitImage-${INITRAMFS_IMAGE} 1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -511,22 +587,32 @@ kernel_do_deploy[vardepsexclude] = "DATETIME"
|
||||
kernel_do_deploy_append() {
|
||||
# Update deploy directory
|
||||
if echo ${KERNEL_IMAGETYPES} | grep -wq "fitImage"; then
|
||||
echo "Copying fit-image.its source file..."
|
||||
install -m 0644 ${B}/fit-image.its "$deployDir/fitImage-its-${KERNEL_FIT_NAME}.its"
|
||||
ln -snf fitImage-its-${KERNEL_FIT_NAME}.its "$deployDir/fitImage-its-${KERNEL_FIT_LINK_NAME}"
|
||||
if [ "${INITRAMFS_IMAGE_BUNDLE}" != "1" ]; then
|
||||
echo "Copying fit-image.its source file..."
|
||||
install -m 0644 ${B}/fit-image.its "$deployDir/fitImage-its-${KERNEL_FIT_NAME}.its"
|
||||
if [ -n "${KERNEL_FIT_LINK_NAME}" ] ; then
|
||||
ln -snf fitImage-its-${KERNEL_FIT_NAME}.its "$deployDir/fitImage-its-${KERNEL_FIT_LINK_NAME}"
|
||||
fi
|
||||
|
||||
echo "Copying linux.bin file..."
|
||||
install -m 0644 ${B}/linux.bin $deployDir/fitImage-linux.bin-${KERNEL_FIT_NAME}.bin
|
||||
ln -snf fitImage-linux.bin-${KERNEL_FIT_NAME}.bin "$deployDir/fitImage-linux.bin-${KERNEL_FIT_LINK_NAME}"
|
||||
echo "Copying linux.bin file..."
|
||||
install -m 0644 ${B}/linux.bin $deployDir/fitImage-linux.bin-${KERNEL_FIT_NAME}.bin
|
||||
if [ -n "${KERNEL_FIT_LINK_NAME}" ] ; then
|
||||
ln -snf fitImage-linux.bin-${KERNEL_FIT_NAME}.bin "$deployDir/fitImage-linux.bin-${KERNEL_FIT_LINK_NAME}"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -n "${INITRAMFS_IMAGE}" ]; then
|
||||
echo "Copying fit-image-${INITRAMFS_IMAGE}.its source file..."
|
||||
install -m 0644 ${B}/fit-image-${INITRAMFS_IMAGE}.its "$deployDir/fitImage-its-${INITRAMFS_IMAGE_NAME}-${KERNEL_FIT_NAME}.its"
|
||||
ln -snf fitImage-its-${INITRAMFS_IMAGE_NAME}-${KERNEL_FIT_NAME}.its "$deployDir/fitImage-its-${INITRAMFS_IMAGE_NAME}-${KERNEL_FIT_LINK_NAME}"
|
||||
|
||||
echo "Copying fitImage-${INITRAMFS_IMAGE} file..."
|
||||
install -m 0644 ${B}/arch/${ARCH}/boot/fitImage-${INITRAMFS_IMAGE} "$deployDir/fitImage-${INITRAMFS_IMAGE_NAME}-${KERNEL_FIT_NAME}.bin"
|
||||
ln -snf fitImage-${INITRAMFS_IMAGE_NAME}-${KERNEL_FIT_NAME}.bin "$deployDir/fitImage-${INITRAMFS_IMAGE_NAME}-${KERNEL_FIT_LINK_NAME}"
|
||||
if [ "${INITRAMFS_IMAGE_BUNDLE}" != "1" ]; then
|
||||
echo "Copying fitImage-${INITRAMFS_IMAGE} file..."
|
||||
install -m 0644 ${B}/arch/${ARCH}/boot/fitImage-${INITRAMFS_IMAGE} "$deployDir/fitImage-${INITRAMFS_IMAGE_NAME}-${KERNEL_FIT_NAME}.bin"
|
||||
if [ -n "${KERNEL_FIT_LINK_NAME}" ] ; then
|
||||
ln -snf fitImage-${INITRAMFS_IMAGE_NAME}-${KERNEL_FIT_NAME}.bin "$deployDir/fitImage-${INITRAMFS_IMAGE_NAME}-${KERNEL_FIT_LINK_NAME}"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
if [ "${UBOOT_SIGN_ENABLE}" = "1" -a -n "${UBOOT_DTB_BINARY}" ] ; then
|
||||
# UBOOT_DTB_IMAGE is a realfile, but we can't use
|
||||
@@ -536,3 +622,13 @@ kernel_do_deploy_append() {
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# The function below performs the following in case of initramfs bundles:
|
||||
# - Removes do_assemble_fitimage. FIT generation is done through
|
||||
# do_assemble_fitimage_initramfs. do_assemble_fitimage is not needed
|
||||
# and should not be part of the tasks to be executed.
|
||||
python () {
|
||||
d.appendVarFlag('do_compile', 'vardeps', ' INITRAMFS_IMAGE_BUNDLE')
|
||||
if d.getVar('INITRAMFS_IMAGE_BUNDLE') == "1":
|
||||
bb.build.deltask('do_assemble_fitimage', d)
|
||||
}
|
||||
|
||||
@@ -34,6 +34,8 @@ python uninative_event_fetchloader() {
|
||||
with open(loaderchksum, "r") as f:
|
||||
readchksum = f.read().strip()
|
||||
if readchksum == chksum:
|
||||
if "uninative" not in d.getVar("SSTATEPOSTUNPACKFUNCS"):
|
||||
enable_uninative(d)
|
||||
return
|
||||
|
||||
import subprocess
|
||||
@@ -167,5 +169,7 @@ python uninative_changeinterp () {
|
||||
if not elf.isDynamic():
|
||||
continue
|
||||
|
||||
os.chmod(f, s[stat.ST_MODE] | stat.S_IWUSR)
|
||||
subprocess.check_output(("patchelf-uninative", "--set-interpreter", d.getVar("UNINATIVE_LOADER"), f), stderr=subprocess.STDOUT)
|
||||
os.chmod(f, s[stat.ST_MODE])
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ def update_useradd_static_config(d):
|
||||
def handle_missing_id(id, type, pkg, files, var, value):
|
||||
# For backwards compatibility we accept "1" in addition to "error"
|
||||
error_dynamic = d.getVar('USERADD_ERROR_DYNAMIC')
|
||||
msg = "%s - %s: %sname %s does not have a static ID defined." % (d.getVar('PN'), pkg, type, id)
|
||||
msg = 'Recipe %s, package %s: %sname "%s" does not have a static ID defined.' % (d.getVar('PN'), pkg, type, id)
|
||||
if files:
|
||||
msg += " Add %s to one of these files: %s" % (id, files)
|
||||
else:
|
||||
|
||||
@@ -897,7 +897,7 @@ BB_HASHCONFIG_WHITELIST ?= "${BB_HASHEXCLUDE_COMMON} DATE TIME SSH_AGENT_PID \
|
||||
PARALLEL_MAKE BB_NUMBER_THREADS BB_ORIGENV BB_INVALIDCONF BBINCLUDED \
|
||||
GIT_PROXY_COMMAND ALL_PROXY all_proxy NO_PROXY no_proxy FTP_PROXY ftp_proxy \
|
||||
HTTP_PROXY http_proxy HTTPS_PROXY https_proxy SOCKS5_USER SOCKS5_PASSWD \
|
||||
BB_SETSCENE_ENFORCE BB_CMDLINE BB_SERVER_TIMEOUT"
|
||||
BB_SETSCENE_ENFORCE BB_CMDLINE BB_SERVER_TIMEOUT BB_NICE_LEVEL"
|
||||
BB_SIGNATURE_EXCLUDE_FLAGS ?= "doc deps depends \
|
||||
lockfiles type vardepsexclude vardeps vardepvalue vardepvalueexclude \
|
||||
file-checksums python func task export unexport noexec nostamp dirs cleandirs \
|
||||
|
||||
@@ -26,6 +26,7 @@ PTESTS_FAST = "\
|
||||
liberror-perl-ptest \
|
||||
libmodule-build-perl-ptest \
|
||||
libpcre-ptest \
|
||||
libpng-ptest \
|
||||
libtimedate-perl-ptest \
|
||||
libtest-needs-perl-ptest \
|
||||
liburi-perl-ptest \
|
||||
|
||||
@@ -6,10 +6,10 @@
|
||||
# to the distro running on the build machine.
|
||||
#
|
||||
|
||||
UNINATIVE_MAXGLIBCVERSION = "2.36"
|
||||
UNINATIVE_VERSION = "3.7"
|
||||
UNINATIVE_MAXGLIBCVERSION = "2.37"
|
||||
UNINATIVE_VERSION = "4.0"
|
||||
|
||||
UNINATIVE_URL ?= "http://downloads.yoctoproject.org/releases/uninative/${UNINATIVE_VERSION}/"
|
||||
UNINATIVE_CHECKSUM[aarch64] ?= "6a29bcae4b5b716d2d520e18800b33943b65f8a835eac1ff8793fc5ee65b4be6"
|
||||
UNINATIVE_CHECKSUM[i686] ?= "3f6d52e64996570c716108d49f8108baccf499a283bbefae438c7266b7a93305"
|
||||
UNINATIVE_CHECKSUM[x86_64] ?= "b110bf2e10fe420f5ca2f3ec55f048ee5f0a54c7e34856a3594e51eb2aea0570"
|
||||
UNINATIVE_CHECKSUM[aarch64] ?= "7baa8418a302df52e00916193b0a04f318356d9d2670c9a2bce3e966efefd738"
|
||||
UNINATIVE_CHECKSUM[i686] ?= "83114d36883d43a521e280742b9849bf85d039b2f83d8e21d480659babe75ee8"
|
||||
UNINATIVE_CHECKSUM[x86_64] ?= "fd75b2a1a67a10f6b7d65afb7d0f3e71a63b0038e428f34dfe420bb37716558a"
|
||||
|
||||
@@ -102,6 +102,10 @@ class Rxvt(XTerminal):
|
||||
command = 'rxvt -T "{title}" -e {command}'
|
||||
priority = 1
|
||||
|
||||
class URxvt(XTerminal):
|
||||
command = 'urxvt -T "{title}" -e {command}'
|
||||
priority = 1
|
||||
|
||||
class Screen(Terminal):
|
||||
command = 'screen -D -m -t "{title}" -S devshell {command}'
|
||||
|
||||
|
||||
@@ -185,6 +185,10 @@ SSTATE_DIR = \"${TOPDIR}/download-selftest\"
|
||||
self.assertTrue(find, "No version returned for searched recipe. bitbake output: %s" % result.output)
|
||||
|
||||
def test_prefile(self):
|
||||
# Test when the prefile does not exist
|
||||
result = runCmd('bitbake -r conf/prefile.conf', ignore_status=True)
|
||||
self.assertEqual(1, result.status, "bitbake didn't error and should have when a specified prefile didn't exist: %s" % result.output)
|
||||
# Test when the prefile exists
|
||||
preconf = os.path.join(self.builddir, 'conf/prefile.conf')
|
||||
self.track_for_cleanup(preconf)
|
||||
ftools.write_file(preconf ,"TEST_PREFILE=\"prefile\"")
|
||||
@@ -195,6 +199,10 @@ SSTATE_DIR = \"${TOPDIR}/download-selftest\"
|
||||
self.assertIn('localconf', result.output)
|
||||
|
||||
def test_postfile(self):
|
||||
# Test when the postfile does not exist
|
||||
result = runCmd('bitbake -R conf/postfile.conf', ignore_status=True)
|
||||
self.assertEqual(1, result.status, "bitbake didn't error and should have when a specified postfile didn't exist: %s" % result.output)
|
||||
# Test when the postfile exists
|
||||
postconf = os.path.join(self.builddir, 'conf/postfile.conf')
|
||||
self.track_for_cleanup(postconf)
|
||||
ftools.write_file(postconf , "TEST_POSTFILE=\"postfile\"")
|
||||
|
||||
@@ -8,6 +8,7 @@ import shutil
|
||||
import tempfile
|
||||
import glob
|
||||
import fnmatch
|
||||
import unittest
|
||||
|
||||
import oeqa.utils.ftools as ftools
|
||||
from oeqa.selftest.case import OESelftestTestCase
|
||||
@@ -38,6 +39,13 @@ def setUpModule():
|
||||
canonical_layerpath = os.path.realpath(canonical_layerpath) + '/'
|
||||
edited_layers.append(layerpath)
|
||||
oldmetapath = os.path.realpath(layerpath)
|
||||
|
||||
# when downloading poky from tar.gz some tests will be skipped (BUG 12389)
|
||||
try:
|
||||
runCmd('git rev-parse --is-inside-work-tree', cwd=canonical_layerpath)
|
||||
except:
|
||||
raise unittest.SkipTest("devtool tests require folder to be a git repo")
|
||||
|
||||
result = runCmd('git rev-parse --show-toplevel', cwd=canonical_layerpath)
|
||||
oldreporoot = result.output.rstrip()
|
||||
newmetapath = os.path.join(corecopydir, os.path.relpath(oldmetapath, oldreporoot))
|
||||
|
||||
609
meta/recipes-bsp/grub/files/CVE-2020-27749.patch
Normal file
609
meta/recipes-bsp/grub/files/CVE-2020-27749.patch
Normal file
@@ -0,0 +1,609 @@
|
||||
From 4ea7bae51f97e49c84dc67ea30b466ca8633b9f6 Mon Sep 17 00:00:00 2001
|
||||
From: Chris Coulson <chris.coulson@canonical.com>
|
||||
Date: Thu, 7 Jan 2021 19:21:03 +0000
|
||||
Subject: kern/parser: Fix a stack buffer overflow
|
||||
|
||||
grub_parser_split_cmdline() expands variable names present in the supplied
|
||||
command line in to their corresponding variable contents and uses a 1 kiB
|
||||
stack buffer for temporary storage without sufficient bounds checking. If
|
||||
the function is called with a command line that references a variable with
|
||||
a sufficiently large payload, it is possible to overflow the stack
|
||||
buffer via tab completion, corrupt the stack frame and potentially
|
||||
control execution.
|
||||
|
||||
Fixes: CVE-2020-27749
|
||||
|
||||
Reported-by: Chris Coulson <chris.coulson@canonical.com>
|
||||
Signed-off-by: Chris Coulson <chris.coulson@canonical.com>
|
||||
Signed-off-by: Darren Kenny <darren.kenny@oracle.com>
|
||||
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
|
||||
|
||||
Upstream-Status: Backport [https://git.savannah.gnu.org/cgit/grub.git/commit/?h=grub-2.06&id=c6c426e5ab6ea715153b72584de6bd8c82f698ec && https://git.savannah.gnu.org/cgit/grub.git/commit/?h=grub-2.06&id=b1c9e9e889e4273fb15712051c887e6078511448 && https://git.savannah.gnu.org/cgit/grub.git/commit/?h=grub-2.06&id=3d157bbd06506b170fde5ec23980c4bf9f7660e2 && https://git.savannah.gnu.org/cgit/grub.git/commit/?h=grub-2.06&id=8bc817014ce3d7a498db44eae33c8b90e2430926 && https://git.savannah.gnu.org/cgit/grub.git/commit/?h=grub-2.06&id=030fb6c4fa354cdbd6a8d6903dfed5d36eaf3cb2 && https://git.savannah.gnu.org/cgit/grub.git/commit/?h=grub-2.06&id=4ea7bae51f97e49c84dc67ea30b466ca8633b9f6]
|
||||
CVE: CVE-2020-27749
|
||||
|
||||
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
---
|
||||
grub-core/Makefile.core.def | 1 +
|
||||
grub-core/kern/buffer.c | 117 +++++++++++++++++++++
|
||||
grub-core/kern/parser.c | 204 +++++++++++++++++++++++-------------
|
||||
include/grub/buffer.h | 144 +++++++++++++++++++++++++
|
||||
4 files changed, 395 insertions(+), 71 deletions(-)
|
||||
create mode 100644 grub-core/kern/buffer.c
|
||||
create mode 100644 include/grub/buffer.h
|
||||
|
||||
diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def
|
||||
index 651ea2a..823cd57 100644
|
||||
--- a/grub-core/Makefile.core.def
|
||||
+++ b/grub-core/Makefile.core.def
|
||||
@@ -123,6 +123,7 @@ kernel = {
|
||||
riscv32_efi_startup = kern/riscv/efi/startup.S;
|
||||
riscv64_efi_startup = kern/riscv/efi/startup.S;
|
||||
|
||||
+ common = kern/buffer.c;
|
||||
common = kern/command.c;
|
||||
common = kern/corecmd.c;
|
||||
common = kern/device.c;
|
||||
diff --git a/grub-core/kern/buffer.c b/grub-core/kern/buffer.c
|
||||
new file mode 100644
|
||||
index 0000000..9f5f8b8
|
||||
--- /dev/null
|
||||
+++ b/grub-core/kern/buffer.c
|
||||
@@ -0,0 +1,117 @@
|
||||
+/*
|
||||
+ * GRUB -- GRand Unified Bootloader
|
||||
+ * Copyright (C) 2021 Free Software Foundation, Inc.
|
||||
+ *
|
||||
+ * GRUB is free software: you can redistribute it and/or modify
|
||||
+ * it under the terms of the GNU General Public License as published by
|
||||
+ * the Free Software Foundation, either version 3 of the License, or
|
||||
+ * (at your option) any later version.
|
||||
+ *
|
||||
+ * GRUB is distributed in the hope that it will be useful,
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ * GNU General Public License for more details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU General Public License
|
||||
+ * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
|
||||
+ */
|
||||
+
|
||||
+#include <grub/buffer.h>
|
||||
+#include <grub/err.h>
|
||||
+#include <grub/misc.h>
|
||||
+#include <grub/mm.h>
|
||||
+#include <grub/safemath.h>
|
||||
+#include <grub/types.h>
|
||||
+
|
||||
+grub_buffer_t
|
||||
+grub_buffer_new (grub_size_t sz)
|
||||
+{
|
||||
+ struct grub_buffer *ret;
|
||||
+
|
||||
+ ret = (struct grub_buffer *) grub_malloc (sizeof (*ret));
|
||||
+ if (ret == NULL)
|
||||
+ return NULL;
|
||||
+
|
||||
+ ret->data = (grub_uint8_t *) grub_malloc (sz);
|
||||
+ if (ret->data == NULL)
|
||||
+ {
|
||||
+ grub_free (ret);
|
||||
+ return NULL;
|
||||
+ }
|
||||
+
|
||||
+ ret->sz = sz;
|
||||
+ ret->pos = 0;
|
||||
+ ret->used = 0;
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+void
|
||||
+grub_buffer_free (grub_buffer_t buf)
|
||||
+{
|
||||
+ grub_free (buf->data);
|
||||
+ grub_free (buf);
|
||||
+}
|
||||
+
|
||||
+grub_err_t
|
||||
+grub_buffer_ensure_space (grub_buffer_t buf, grub_size_t req)
|
||||
+{
|
||||
+ grub_uint8_t *d;
|
||||
+ grub_size_t newsz = 1;
|
||||
+
|
||||
+ /* Is the current buffer size adequate? */
|
||||
+ if (buf->sz >= req)
|
||||
+ return GRUB_ERR_NONE;
|
||||
+
|
||||
+ /* Find the smallest power-of-2 size that satisfies the request. */
|
||||
+ while (newsz < req)
|
||||
+ {
|
||||
+ if (newsz == 0)
|
||||
+ return grub_error (GRUB_ERR_OUT_OF_RANGE,
|
||||
+ N_("requested buffer size is too large"));
|
||||
+ newsz <<= 1;
|
||||
+ }
|
||||
+
|
||||
+ d = (grub_uint8_t *) grub_realloc (buf->data, newsz);
|
||||
+ if (d == NULL)
|
||||
+ return grub_errno;
|
||||
+
|
||||
+ buf->data = d;
|
||||
+ buf->sz = newsz;
|
||||
+
|
||||
+ return GRUB_ERR_NONE;
|
||||
+}
|
||||
+
|
||||
+void *
|
||||
+grub_buffer_take_data (grub_buffer_t buf)
|
||||
+{
|
||||
+ void *data = buf->data;
|
||||
+
|
||||
+ buf->data = NULL;
|
||||
+ buf->sz = buf->pos = buf->used = 0;
|
||||
+
|
||||
+ return data;
|
||||
+}
|
||||
+
|
||||
+void
|
||||
+grub_buffer_reset (grub_buffer_t buf)
|
||||
+{
|
||||
+ buf->pos = buf->used = 0;
|
||||
+}
|
||||
+
|
||||
+grub_err_t
|
||||
+grub_buffer_advance_read_pos (grub_buffer_t buf, grub_size_t n)
|
||||
+{
|
||||
+ grub_size_t newpos;
|
||||
+
|
||||
+ if (grub_add (buf->pos, n, &newpos))
|
||||
+ return grub_error (GRUB_ERR_OUT_OF_RANGE, N_("overflow is detected"));
|
||||
+
|
||||
+ if (newpos > buf->used)
|
||||
+ return grub_error (GRUB_ERR_OUT_OF_RANGE,
|
||||
+ N_("new read is position beyond the end of the written data"));
|
||||
+
|
||||
+ buf->pos = newpos;
|
||||
+
|
||||
+ return GRUB_ERR_NONE;
|
||||
+}
|
||||
diff --git a/grub-core/kern/parser.c b/grub-core/kern/parser.c
|
||||
index d1cf061..6ab7aa4 100644
|
||||
--- a/grub-core/kern/parser.c
|
||||
+++ b/grub-core/kern/parser.c
|
||||
@@ -1,7 +1,7 @@
|
||||
/* parser.c - the part of the parser that can return partial tokens */
|
||||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
- * Copyright (C) 2005,2007,2009 Free Software Foundation, Inc.
|
||||
+ * Copyright (C) 2005,2007,2009,2021 Free Software Foundation, Inc.
|
||||
*
|
||||
* GRUB is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -18,6 +18,7 @@
|
||||
*/
|
||||
|
||||
#include <grub/parser.h>
|
||||
+#include <grub/buffer.h>
|
||||
#include <grub/env.h>
|
||||
#include <grub/misc.h>
|
||||
#include <grub/mm.h>
|
||||
@@ -107,8 +108,8 @@ check_varstate (grub_parser_state_t s)
|
||||
}
|
||||
|
||||
|
||||
-static void
|
||||
-add_var (char *varname, char **bp, char **vp,
|
||||
+static grub_err_t
|
||||
+add_var (grub_buffer_t varname, grub_buffer_t buf,
|
||||
grub_parser_state_t state, grub_parser_state_t newstate)
|
||||
{
|
||||
const char *val;
|
||||
@@ -116,17 +117,74 @@ add_var (char *varname, char **bp, char **vp,
|
||||
/* Check if a variable was being read in and the end of the name
|
||||
was reached. */
|
||||
if (!(check_varstate (state) && !check_varstate (newstate)))
|
||||
- return;
|
||||
+ return GRUB_ERR_NONE;
|
||||
+
|
||||
+ if (grub_buffer_append_char (varname, '\0') != GRUB_ERR_NONE)
|
||||
+ return grub_errno;
|
||||
|
||||
- *((*vp)++) = '\0';
|
||||
- val = grub_env_get (varname);
|
||||
- *vp = varname;
|
||||
+ val = grub_env_get ((const char *) grub_buffer_peek_data (varname));
|
||||
+ grub_buffer_reset (varname);
|
||||
if (!val)
|
||||
- return;
|
||||
+ return GRUB_ERR_NONE;
|
||||
|
||||
/* Insert the contents of the variable in the buffer. */
|
||||
- for (; *val; val++)
|
||||
- *((*bp)++) = *val;
|
||||
+ return grub_buffer_append_data (buf, val, grub_strlen (val));
|
||||
+}
|
||||
+
|
||||
+static grub_err_t
|
||||
+terminate_arg (grub_buffer_t buffer, int *argc)
|
||||
+{
|
||||
+ grub_size_t unread = grub_buffer_get_unread_bytes (buffer);
|
||||
+
|
||||
+ if (unread == 0)
|
||||
+ return GRUB_ERR_NONE;
|
||||
+
|
||||
+ if (*(const char *) grub_buffer_peek_data_at (buffer, unread - 1) == '\0')
|
||||
+ return GRUB_ERR_NONE;
|
||||
+
|
||||
+ if (grub_buffer_append_char (buffer, '\0') != GRUB_ERR_NONE)
|
||||
+ return grub_errno;
|
||||
+
|
||||
+ (*argc)++;
|
||||
+
|
||||
+ return GRUB_ERR_NONE;
|
||||
+}
|
||||
+
|
||||
+static grub_err_t
|
||||
+process_char (char c, grub_buffer_t buffer, grub_buffer_t varname,
|
||||
+ grub_parser_state_t state, int *argc,
|
||||
+ grub_parser_state_t *newstate)
|
||||
+{
|
||||
+ char use;
|
||||
+
|
||||
+ *newstate = grub_parser_cmdline_state (state, c, &use);
|
||||
+
|
||||
+ /*
|
||||
+ * If a variable was being processed and this character does
|
||||
+ * not describe the variable anymore, write the variable to
|
||||
+ * the buffer.
|
||||
+ */
|
||||
+ if (add_var (varname, buffer, state, *newstate) != GRUB_ERR_NONE)
|
||||
+ return grub_errno;
|
||||
+
|
||||
+ if (check_varstate (*newstate))
|
||||
+ {
|
||||
+ if (use)
|
||||
+ return grub_buffer_append_char (varname, use);
|
||||
+ }
|
||||
+ else if (*newstate == GRUB_PARSER_STATE_TEXT &&
|
||||
+ state != GRUB_PARSER_STATE_ESC && grub_isspace (use))
|
||||
+ {
|
||||
+ /*
|
||||
+ * Don't add more than one argument if multiple
|
||||
+ * spaces are used.
|
||||
+ */
|
||||
+ return terminate_arg (buffer, argc);
|
||||
+ }
|
||||
+ else if (use)
|
||||
+ return grub_buffer_append_char (buffer, use);
|
||||
+
|
||||
+ return GRUB_ERR_NONE;
|
||||
}
|
||||
|
||||
grub_err_t
|
||||
@@ -135,24 +193,36 @@ grub_parser_split_cmdline (const char *cmdline,
|
||||
int *argc, char ***argv)
|
||||
{
|
||||
grub_parser_state_t state = GRUB_PARSER_STATE_TEXT;
|
||||
- /* XXX: Fixed size buffer, perhaps this buffer should be dynamically
|
||||
- allocated. */
|
||||
- char buffer[1024];
|
||||
- char *bp = buffer;
|
||||
+ grub_buffer_t buffer, varname;
|
||||
char *rd = (char *) cmdline;
|
||||
- char varname[200];
|
||||
- char *vp = varname;
|
||||
- char *args;
|
||||
+ char *rp = rd;
|
||||
int i;
|
||||
|
||||
*argc = 0;
|
||||
*argv = NULL;
|
||||
+
|
||||
+ buffer = grub_buffer_new (1024);
|
||||
+ if (buffer == NULL)
|
||||
+ return grub_errno;
|
||||
+
|
||||
+ varname = grub_buffer_new (200);
|
||||
+ if (varname == NULL)
|
||||
+ goto fail;
|
||||
+
|
||||
do
|
||||
{
|
||||
- if (!rd || !*rd)
|
||||
+ if (rp == NULL || *rp == '\0')
|
||||
{
|
||||
+ if (rd != cmdline)
|
||||
+ {
|
||||
+ grub_free (rd);
|
||||
+ rd = rp = NULL;
|
||||
+ }
|
||||
if (getline)
|
||||
- getline (&rd, 1, getline_data);
|
||||
+ {
|
||||
+ getline (&rd, 1, getline_data);
|
||||
+ rp = rd;
|
||||
+ }
|
||||
else
|
||||
break;
|
||||
}
|
||||
@@ -160,39 +230,14 @@ grub_parser_split_cmdline (const char *cmdline,
|
||||
if (!rd)
|
||||
break;
|
||||
|
||||
- for (; *rd; rd++)
|
||||
+ for (; *rp != '\0'; rp++)
|
||||
{
|
||||
grub_parser_state_t newstate;
|
||||
- char use;
|
||||
|
||||
- newstate = grub_parser_cmdline_state (state, *rd, &use);
|
||||
+ if (process_char (*rp, buffer, varname, state, argc,
|
||||
+ &newstate) != GRUB_ERR_NONE)
|
||||
+ goto fail;
|
||||
|
||||
- /* If a variable was being processed and this character does
|
||||
- not describe the variable anymore, write the variable to
|
||||
- the buffer. */
|
||||
- add_var (varname, &bp, &vp, state, newstate);
|
||||
-
|
||||
- if (check_varstate (newstate))
|
||||
- {
|
||||
- if (use)
|
||||
- *(vp++) = use;
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- if (newstate == GRUB_PARSER_STATE_TEXT
|
||||
- && state != GRUB_PARSER_STATE_ESC && grub_isspace (use))
|
||||
- {
|
||||
- /* Don't add more than one argument if multiple
|
||||
- spaces are used. */
|
||||
- if (bp != buffer && *(bp - 1))
|
||||
- {
|
||||
- *(bp++) = '\0';
|
||||
- (*argc)++;
|
||||
- }
|
||||
- }
|
||||
- else if (use)
|
||||
- *(bp++) = use;
|
||||
- }
|
||||
state = newstate;
|
||||
}
|
||||
}
|
||||
@@ -200,43 +245,60 @@ grub_parser_split_cmdline (const char *cmdline,
|
||||
|
||||
/* A special case for when the last character was part of a
|
||||
variable. */
|
||||
- add_var (varname, &bp, &vp, state, GRUB_PARSER_STATE_TEXT);
|
||||
+ if (add_var (varname, buffer, state, GRUB_PARSER_STATE_TEXT) != GRUB_ERR_NONE)
|
||||
+ goto fail;
|
||||
|
||||
- if (bp != buffer && *(bp - 1))
|
||||
- {
|
||||
- *(bp++) = '\0';
|
||||
- (*argc)++;
|
||||
- }
|
||||
+ /* Ensure that the last argument is terminated. */
|
||||
+ if (terminate_arg (buffer, argc) != GRUB_ERR_NONE)
|
||||
+ goto fail;
|
||||
|
||||
/* If there are no args, then we're done. */
|
||||
if (!*argc)
|
||||
- return 0;
|
||||
-
|
||||
- /* Reserve memory for the return values. */
|
||||
- args = grub_malloc (bp - buffer);
|
||||
- if (!args)
|
||||
- return grub_errno;
|
||||
- grub_memcpy (args, buffer, bp - buffer);
|
||||
+ {
|
||||
+ grub_errno = GRUB_ERR_NONE;
|
||||
+ goto out;
|
||||
+ }
|
||||
|
||||
*argv = grub_calloc (*argc + 1, sizeof (char *));
|
||||
if (!*argv)
|
||||
- {
|
||||
- grub_free (args);
|
||||
- return grub_errno;
|
||||
- }
|
||||
+ goto fail;
|
||||
|
||||
/* The arguments are separated with 0's, setup argv so it points to
|
||||
the right values. */
|
||||
- bp = args;
|
||||
for (i = 0; i < *argc; i++)
|
||||
{
|
||||
- (*argv)[i] = bp;
|
||||
- while (*bp)
|
||||
- bp++;
|
||||
- bp++;
|
||||
+ char *arg;
|
||||
+
|
||||
+ if (i > 0)
|
||||
+ {
|
||||
+ if (grub_buffer_advance_read_pos (buffer, 1) != GRUB_ERR_NONE)
|
||||
+ goto fail;
|
||||
+ }
|
||||
+
|
||||
+ arg = (char *) grub_buffer_peek_data (buffer);
|
||||
+ if (arg == NULL ||
|
||||
+ grub_buffer_advance_read_pos (buffer, grub_strlen (arg)) != GRUB_ERR_NONE)
|
||||
+ goto fail;
|
||||
+
|
||||
+ (*argv)[i] = arg;
|
||||
}
|
||||
|
||||
- return 0;
|
||||
+ /* Keep memory for the return values. */
|
||||
+ grub_buffer_take_data (buffer);
|
||||
+
|
||||
+ grub_errno = GRUB_ERR_NONE;
|
||||
+
|
||||
+ out:
|
||||
+ if (rd != cmdline)
|
||||
+ grub_free (rd);
|
||||
+ grub_buffer_free (buffer);
|
||||
+ grub_buffer_free (varname);
|
||||
+
|
||||
+ return grub_errno;
|
||||
+
|
||||
+ fail:
|
||||
+ grub_free (*argv);
|
||||
+ goto out;
|
||||
}
|
||||
|
||||
/* Helper for grub_parser_execute. */
|
||||
diff --git a/include/grub/buffer.h b/include/grub/buffer.h
|
||||
new file mode 100644
|
||||
index 0000000..f4b10cf
|
||||
--- /dev/null
|
||||
+++ b/include/grub/buffer.h
|
||||
@@ -0,0 +1,144 @@
|
||||
+/*
|
||||
+ * GRUB -- GRand Unified Bootloader
|
||||
+ * Copyright (C) 2021 Free Software Foundation, Inc.
|
||||
+ *
|
||||
+ * GRUB is free software: you can redistribute it and/or modify
|
||||
+ * it under the terms of the GNU General Public License as published by
|
||||
+ * the Free Software Foundation, either version 3 of the License, or
|
||||
+ * (at your option) any later version.
|
||||
+ *
|
||||
+ * GRUB is distributed in the hope that it will be useful,
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ * GNU General Public License for more details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU General Public License
|
||||
+ * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
|
||||
+ */
|
||||
+
|
||||
+#ifndef GRUB_BUFFER_H
|
||||
+#define GRUB_BUFFER_H 1
|
||||
+
|
||||
+#include <grub/err.h>
|
||||
+#include <grub/misc.h>
|
||||
+#include <grub/mm.h>
|
||||
+#include <grub/safemath.h>
|
||||
+#include <grub/types.h>
|
||||
+
|
||||
+struct grub_buffer
|
||||
+{
|
||||
+ grub_uint8_t *data;
|
||||
+ grub_size_t sz;
|
||||
+ grub_size_t pos;
|
||||
+ grub_size_t used;
|
||||
+};
|
||||
+
|
||||
+/*
|
||||
+ * grub_buffer_t represents a simple variable sized byte buffer with
|
||||
+ * read and write cursors. It currently only implements
|
||||
+ * functionality required by the only user in GRUB (append byte[s],
|
||||
+ * peeking data at a specified position and updating the read cursor.
|
||||
+ * Some things that this doesn't do yet are:
|
||||
+ * - Reading a portion of the buffer by copying data from the current
|
||||
+ * read position in to a caller supplied destination buffer and then
|
||||
+ * automatically updating the read cursor.
|
||||
+ * - Dropping the read part at the start of the buffer when an append
|
||||
+ * requires more space.
|
||||
+ */
|
||||
+typedef struct grub_buffer *grub_buffer_t;
|
||||
+
|
||||
+/* Allocate a new buffer with the specified initial size. */
|
||||
+extern grub_buffer_t grub_buffer_new (grub_size_t sz);
|
||||
+
|
||||
+/* Free the buffer and its resources. */
|
||||
+extern void grub_buffer_free (grub_buffer_t buf);
|
||||
+
|
||||
+/* Return the number of unread bytes in this buffer. */
|
||||
+static inline grub_size_t
|
||||
+grub_buffer_get_unread_bytes (grub_buffer_t buf)
|
||||
+{
|
||||
+ return buf->used - buf->pos;
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
+ * Ensure that the buffer size is at least the requested
|
||||
+ * number of bytes.
|
||||
+ */
|
||||
+extern grub_err_t grub_buffer_ensure_space (grub_buffer_t buf, grub_size_t req);
|
||||
+
|
||||
+/*
|
||||
+ * Append the specified number of bytes from the supplied
|
||||
+ * data to the buffer.
|
||||
+ */
|
||||
+static inline grub_err_t
|
||||
+grub_buffer_append_data (grub_buffer_t buf, const void *data, grub_size_t len)
|
||||
+{
|
||||
+ grub_size_t req;
|
||||
+
|
||||
+ if (grub_add (buf->used, len, &req))
|
||||
+ return grub_error (GRUB_ERR_OUT_OF_RANGE, N_("overflow is detected"));
|
||||
+
|
||||
+ if (grub_buffer_ensure_space (buf, req) != GRUB_ERR_NONE)
|
||||
+ return grub_errno;
|
||||
+
|
||||
+ grub_memcpy (&buf->data[buf->used], data, len);
|
||||
+ buf->used = req;
|
||||
+
|
||||
+ return GRUB_ERR_NONE;
|
||||
+}
|
||||
+
|
||||
+/* Append the supplied character to the buffer. */
|
||||
+static inline grub_err_t
|
||||
+grub_buffer_append_char (grub_buffer_t buf, char c)
|
||||
+{
|
||||
+ return grub_buffer_append_data (buf, &c, 1);
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
+ * Forget and return the underlying data buffer. The caller
|
||||
+ * becomes the owner of this buffer, and must free it when it
|
||||
+ * is no longer required.
|
||||
+ */
|
||||
+extern void *grub_buffer_take_data (grub_buffer_t buf);
|
||||
+
|
||||
+/* Reset this buffer. Note that this does not deallocate any resources. */
|
||||
+void grub_buffer_reset (grub_buffer_t buf);
|
||||
+
|
||||
+/*
|
||||
+ * Return a pointer to the underlying data buffer at the specified
|
||||
+ * offset from the current read position. Note that this pointer may
|
||||
+ * become invalid if the buffer is mutated further.
|
||||
+ */
|
||||
+static inline void *
|
||||
+grub_buffer_peek_data_at (grub_buffer_t buf, grub_size_t off)
|
||||
+{
|
||||
+ if (grub_add (buf->pos, off, &off))
|
||||
+ {
|
||||
+ grub_error (GRUB_ERR_OUT_OF_RANGE, N_("overflow is detected."));
|
||||
+ return NULL;
|
||||
+ }
|
||||
+
|
||||
+ if (off >= buf->used)
|
||||
+ {
|
||||
+ grub_error (GRUB_ERR_OUT_OF_RANGE, N_("peek out of range"));
|
||||
+ return NULL;
|
||||
+ }
|
||||
+
|
||||
+ return &buf->data[off];
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
+ * Return a pointer to the underlying data buffer at the current
|
||||
+ * read position. Note that this pointer may become invalid if the
|
||||
+ * buffer is mutated further.
|
||||
+ */
|
||||
+static inline void *
|
||||
+grub_buffer_peek_data (grub_buffer_t buf)
|
||||
+{
|
||||
+ return grub_buffer_peek_data_at (buf, 0);
|
||||
+}
|
||||
+
|
||||
+/* Advance the read position by the specified number of bytes. */
|
||||
+extern grub_err_t grub_buffer_advance_read_pos (grub_buffer_t buf, grub_size_t n);
|
||||
+
|
||||
+#endif /* GRUB_BUFFER_H */
|
||||
--
|
||||
2.25.1
|
||||
|
||||
58
meta/recipes-bsp/grub/files/CVE-2021-20225.patch
Normal file
58
meta/recipes-bsp/grub/files/CVE-2021-20225.patch
Normal file
@@ -0,0 +1,58 @@
|
||||
From 2a330dba93ff11bc00eda76e9419bc52b0c7ead6 Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Axtens <dja@axtens.net>
|
||||
Date: Fri, 22 Jan 2021 16:07:29 +1100
|
||||
Subject: lib/arg: Block repeated short options that require an argument
|
||||
|
||||
Fuzzing found the following crash:
|
||||
|
||||
search -hhhhhhhhhhhhhf
|
||||
|
||||
We didn't allocate enough option space for 13 hints because the
|
||||
allocation code counts the number of discrete arguments (i.e. argc).
|
||||
However, the shortopt parsing code will happily keep processing
|
||||
a combination of short options without checking if those short
|
||||
options require an argument. This means you can easily end writing
|
||||
past the allocated option space.
|
||||
|
||||
This fixes a OOB write which can cause heap corruption.
|
||||
|
||||
Fixes: CVE-2021-20225
|
||||
|
||||
Reported-by: Daniel Axtens <dja@axtens.net>
|
||||
Signed-off-by: Daniel Axtens <dja@axtens.net>
|
||||
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
|
||||
|
||||
Upstream-Status: Backport [https://git.savannah.gnu.org/cgit/grub.git/commit/?h=grub-2.06&id=2a330dba93ff11bc00eda76e9419bc52b0c7ead6]
|
||||
CVE: CVE-2021-20225
|
||||
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
---
|
||||
grub-core/lib/arg.c | 13 +++++++++++++
|
||||
1 file changed, 13 insertions(+)
|
||||
|
||||
diff --git a/grub-core/lib/arg.c b/grub-core/lib/arg.c
|
||||
index 3288609..537c5e9 100644
|
||||
--- a/grub-core/lib/arg.c
|
||||
+++ b/grub-core/lib/arg.c
|
||||
@@ -299,6 +299,19 @@ grub_arg_parse (grub_extcmd_t cmd, int argc, char **argv,
|
||||
it can have an argument value. */
|
||||
if (*curshort)
|
||||
{
|
||||
+ /*
|
||||
+ * Only permit further short opts if this one doesn't
|
||||
+ * require a value.
|
||||
+ */
|
||||
+ if (opt->type != ARG_TYPE_NONE &&
|
||||
+ !(opt->flags & GRUB_ARG_OPTION_OPTIONAL))
|
||||
+ {
|
||||
+ grub_error (GRUB_ERR_BAD_ARGUMENT,
|
||||
+ N_("missing mandatory option for `%s'"),
|
||||
+ opt->longarg);
|
||||
+ goto fail;
|
||||
+ }
|
||||
+
|
||||
if (parse_option (cmd, opt, 0, usr) || grub_errno)
|
||||
goto fail;
|
||||
}
|
||||
--
|
||||
2.25.1
|
||||
|
||||
50
meta/recipes-bsp/grub/files/CVE-2021-20233.patch
Normal file
50
meta/recipes-bsp/grub/files/CVE-2021-20233.patch
Normal file
@@ -0,0 +1,50 @@
|
||||
From 2f533a89a8dfcacbf2c9dbc77d910f111f24bf33 Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Axtens <dja@axtens.net>
|
||||
Date: Fri, 22 Jan 2021 17:10:48 +1100
|
||||
Subject: commands/menuentry: Fix quoting in setparams_prefix()
|
||||
|
||||
Commit 9acdcbf32542 (use single quotes in menuentry setparams command)
|
||||
says that expressing a quoted single quote will require 3 characters. It
|
||||
actually requires (and always did require!) 4 characters:
|
||||
|
||||
str: a'b => a'\''b
|
||||
len: 3 => 6 (2 for the letters + 4 for the quote)
|
||||
|
||||
This leads to not allocating enough memory and thus out of bounds writes
|
||||
that have been observed to cause heap corruption.
|
||||
|
||||
Allocate 4 bytes for each single quote.
|
||||
|
||||
Commit 22e7dbb2bb81 (Fix quoting in legacy parser.) does the same
|
||||
quoting, but it adds 3 as extra overhead on top of the single byte that
|
||||
the quote already needs. So it's correct.
|
||||
|
||||
Fixes: 9acdcbf32542 (use single quotes in menuentry setparams command)
|
||||
Fixes: CVE-2021-20233
|
||||
|
||||
Reported-by: Daniel Axtens <dja@axtens.net>
|
||||
Signed-off-by: Daniel Axtens <dja@axtens.net>
|
||||
|
||||
Upstream-Status: Backport [https://git.savannah.gnu.org/cgit/grub.git/commit/?h=grub-2.06&id=2f533a89a8dfcacbf2c9dbc77d910f111f24bf33]
|
||||
CVE: CVE-2021-20233
|
||||
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
---
|
||||
grub-core/commands/menuentry.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/grub-core/commands/menuentry.c b/grub-core/commands/menuentry.c
|
||||
index 9164df7..720e6d8 100644
|
||||
--- a/grub-core/commands/menuentry.c
|
||||
+++ b/grub-core/commands/menuentry.c
|
||||
@@ -230,7 +230,7 @@ setparams_prefix (int argc, char **args)
|
||||
len += 3; /* 3 = 1 space + 2 quotes */
|
||||
p = args[i];
|
||||
while (*p)
|
||||
- len += (*p++ == '\'' ? 3 : 1);
|
||||
+ len += (*p++ == '\'' ? 4 : 1);
|
||||
}
|
||||
|
||||
result = grub_malloc (len + 2);
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@@ -11,7 +11,7 @@ missing sorting of the list used to generate it. Add such a sort.
|
||||
Also ensure the generated unidata.c file is deterministic by sorting the
|
||||
keys of the dict.
|
||||
|
||||
Upstream-Status: Pending
|
||||
Upstream-Status: Submitted [https://lists.gnu.org/archive/html/grub-devel/2023-06/index.html]
|
||||
Richard Purdie <richard.purdie@linuxfoundation.org>
|
||||
|
||||
Index: grub-2.04/grub-core/genmoddep.awk
|
||||
|
||||
@@ -106,6 +106,9 @@ SRC_URI = "${GNU_MIRROR}/grub/grub-${PV}.tar.gz \
|
||||
file://font-Fix-size-overflow-in-grub_font_get_glyph_intern.patch \
|
||||
file://CVE-2022-2601.patch \
|
||||
file://CVE-2022-3775.patch \
|
||||
file://CVE-2020-27749.patch \
|
||||
file://CVE-2021-20225.patch \
|
||||
file://CVE-2021-20233.patch \
|
||||
"
|
||||
SRC_URI[md5sum] = "5ce674ca6b2612d8939b9e6abed32934"
|
||||
SRC_URI[sha256sum] = "f10c85ae3e204dbaec39ae22fa3c5e99f0665417e91c2cb49b7e5031658ba6ea"
|
||||
|
||||
@@ -19,9 +19,12 @@ PACKAGECONFIG[manpages] = "--enable-doc, --disable-doc, libxslt-native xmlto-nat
|
||||
|
||||
RDEPENDS_${PN} = "grep bash"
|
||||
|
||||
EXTRA_OECONF = "--libdir=${nonarch_libdir}"
|
||||
|
||||
do_configure_prepend () {
|
||||
( cd ${S}; autoreconf -f -i -s )
|
||||
}
|
||||
|
||||
FILES_${PN} += "${libdir}/${BPN}/*"
|
||||
FILES_${PN} += "${nonarch_libdir}/${BPN}/*"
|
||||
FILES_${PN}-dbg += "${datadir}/doc/pm-utils/README.debugging"
|
||||
FILES_${PN}-dev += "${nonarch_libdir}/pkgconfig/pm-utils.pc"
|
||||
|
||||
@@ -5,8 +5,8 @@ SECTION = "network"
|
||||
LICENSE = "PD"
|
||||
LIC_FILES_CHKSUM = "file://COPYING;md5=87964579b2a8ece4bc6744d2dc9a8b04"
|
||||
|
||||
SRCREV = "22a5de3ef637990ce03141f786fbdb327e9c5a3f"
|
||||
PV = "20221107"
|
||||
SRCREV = "aae7c68671d225e6d35224613d5b98192b9b2ffe"
|
||||
PV = "20230416"
|
||||
PE = "1"
|
||||
|
||||
SRC_URI = "git://gitlab.gnome.org/GNOME/mobile-broadband-provider-info.git;protocol=https;branch=main"
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
From 679ae2f72ef8cf37609cb0eff5de3b98aa85e395 Mon Sep 17 00:00:00 2001
|
||||
From: Steve Sakoman <steve@sakoman.com>
|
||||
Date: Thu, 20 Jul 2023 04:14:42 -1000
|
||||
Subject: [PATCH] Configure: add 2 missing key sorts in generation of unified_info
|
||||
|
||||
Otherwise generation of this section in configdata.pm is not reproducible
|
||||
|
||||
Signed-off-by: Steve Sakoman <steve@sakoman.com>
|
||||
Upstream-Status: Backport [adapted from 3.x commit https://github.com/openssl/openssl/commit/764cf5b26306a8712e8b3d41599c44dc5ed07a25]
|
||||
---
|
||||
Configure | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/Configure b/Configure
|
||||
index 2a01746..8fc5a2c 100755
|
||||
--- a/Configure
|
||||
+++ b/Configure
|
||||
@@ -2326,7 +2326,7 @@ EOF
|
||||
"dso" => [ @{$unified_info{engines}} ],
|
||||
"bin" => [ @{$unified_info{programs}} ],
|
||||
"script" => [ @{$unified_info{scripts}} ] );
|
||||
- foreach my $type (keys %loopinfo) {
|
||||
+ foreach my $type (sort keys %loopinfo) {
|
||||
foreach my $product (@{$loopinfo{$type}}) {
|
||||
my %dirs = ();
|
||||
my $pd = dirname($product);
|
||||
@@ -2347,7 +2347,7 @@ EOF
|
||||
push @{$unified_info{dirinfo}->{$d}->{deps}}, $_
|
||||
if $d ne $pd;
|
||||
}
|
||||
- foreach (keys %dirs) {
|
||||
+ foreach (sort keys %dirs) {
|
||||
push @{$unified_info{dirinfo}->{$_}->{products}->{$type}},
|
||||
$product;
|
||||
}
|
||||
--
|
||||
2.34.1
|
||||
|
||||
122
meta/recipes-connectivity/openssl/openssl/CVE-2023-2650.patch
Normal file
122
meta/recipes-connectivity/openssl/openssl/CVE-2023-2650.patch
Normal file
@@ -0,0 +1,122 @@
|
||||
From 9e209944b35cf82368071f160a744b6178f9b098 Mon Sep 17 00:00:00 2001
|
||||
From: Richard Levitte <levitte@openssl.org>
|
||||
Date: Fri, 12 May 2023 10:00:13 +0200
|
||||
Subject: [PATCH] Restrict the size of OBJECT IDENTIFIERs that OBJ_obj2txt will
|
||||
translate
|
||||
|
||||
OBJ_obj2txt() would translate any size OBJECT IDENTIFIER to canonical
|
||||
numeric text form. For gigantic sub-identifiers, this would take a very
|
||||
long time, the time complexity being O(n^2) where n is the size of that
|
||||
sub-identifier.
|
||||
|
||||
To mitigate this, a restriction on the size that OBJ_obj2txt() will
|
||||
translate to canonical numeric text form is added, based on RFC 2578
|
||||
(STD 58), which says this:
|
||||
|
||||
> 3.5. OBJECT IDENTIFIER values
|
||||
>
|
||||
> An OBJECT IDENTIFIER value is an ordered list of non-negative numbers.
|
||||
> For the SMIv2, each number in the list is referred to as a sub-identifier,
|
||||
> there are at most 128 sub-identifiers in a value, and each sub-identifier
|
||||
> has a maximum value of 2^32-1 (4294967295 decimal).
|
||||
|
||||
Fixes otc/security#96
|
||||
Fixes CVE-2023-2650
|
||||
|
||||
Reviewed-by: Matt Caswell <matt@openssl.org>
|
||||
Reviewed-by: Tomas Mraz <tomas@openssl.org>
|
||||
|
||||
Upstream-Status: Backport [https://github.com/openssl/openssl/commit/9e209944b35cf82368071f160a744b6178f9b098]
|
||||
CVE: CVE-2023-2650
|
||||
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
---
|
||||
CHANGES | 28 +++++++++++++++++++++++++++-
|
||||
NEWS | 2 ++
|
||||
crypto/objects/obj_dat.c | 19 +++++++++++++++++++
|
||||
3 files changed, 48 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/CHANGES b/CHANGES
|
||||
index 1eaaf4e..f2cf38f 100644
|
||||
--- a/CHANGES
|
||||
+++ b/CHANGES
|
||||
@@ -7,7 +7,33 @@
|
||||
https://github.com/openssl/openssl/commits/ and pick the appropriate
|
||||
release branch.
|
||||
|
||||
- Changes between 1.1.1s and 1.1.1t [7 Feb 2023]
|
||||
+ Changes between 1.1.1t and 1.1.1u [xx XXX xxxx]
|
||||
+
|
||||
+ *) Mitigate for the time it takes for `OBJ_obj2txt` to translate gigantic
|
||||
+ OBJECT IDENTIFIER sub-identifiers to canonical numeric text form.
|
||||
+
|
||||
+ OBJ_obj2txt() would translate any size OBJECT IDENTIFIER to canonical
|
||||
+ numeric text form. For gigantic sub-identifiers, this would take a very
|
||||
+ long time, the time complexity being O(n^2) where n is the size of that
|
||||
+ sub-identifier. (CVE-2023-2650)
|
||||
+
|
||||
+ To mitigitate this, `OBJ_obj2txt()` will only translate an OBJECT
|
||||
+ IDENTIFIER to canonical numeric text form if the size of that OBJECT
|
||||
+ IDENTIFIER is 586 bytes or less, and fail otherwise.
|
||||
+
|
||||
+ The basis for this restriction is RFC 2578 (STD 58), section 3.5. OBJECT
|
||||
+ IDENTIFIER values, which stipulates that OBJECT IDENTIFIERS may have at
|
||||
+ most 128 sub-identifiers, and that the maximum value that each sub-
|
||||
+ identifier may have is 2^32-1 (4294967295 decimal).
|
||||
+
|
||||
+ For each byte of every sub-identifier, only the 7 lower bits are part of
|
||||
+ the value, so the maximum amount of bytes that an OBJECT IDENTIFIER with
|
||||
+ these restrictions may occupy is 32 * 128 / 7, which is approximately 586
|
||||
+ bytes.
|
||||
+
|
||||
+ Ref: https://datatracker.ietf.org/doc/html/rfc2578#section-3.5
|
||||
+
|
||||
+Changes between 1.1.1s and 1.1.1t [7 Feb 2023]
|
||||
|
||||
*) Corrected documentation of X509_VERIFY_PARAM_add0_policy() to mention
|
||||
that it does not enable policy checking. Thanks to
|
||||
diff --git a/NEWS b/NEWS
|
||||
index a86220a..41922c4 100644
|
||||
--- a/NEWS
|
||||
+++ b/NEWS
|
||||
@@ -7,6 +7,8 @@
|
||||
|
||||
Major changes between OpenSSL 1.1.1s and OpenSSL 1.1.1t [7 Feb 2023]
|
||||
|
||||
+ o Mitigate for very slow `OBJ_obj2txt()` performance with gigantic
|
||||
+ OBJECT IDENTIFIER sub-identities. (CVE-2023-2650)
|
||||
o Fixed documentation of X509_VERIFY_PARAM_add0_policy() (CVE-2023-0466)
|
||||
o Fixed X.400 address type confusion in X.509 GeneralName (CVE-2023-0286)
|
||||
o Fixed Use-after-free following BIO_new_NDEF (CVE-2023-0215)
|
||||
diff --git a/crypto/objects/obj_dat.c b/crypto/objects/obj_dat.c
|
||||
index 7e8de72..d699915 100644
|
||||
--- a/crypto/objects/obj_dat.c
|
||||
+++ b/crypto/objects/obj_dat.c
|
||||
@@ -428,6 +428,25 @@ int OBJ_obj2txt(char *buf, int buf_len, const ASN1_OBJECT *a, int no_name)
|
||||
first = 1;
|
||||
bl = NULL;
|
||||
|
||||
+ /*
|
||||
+ * RFC 2578 (STD 58) says this about OBJECT IDENTIFIERs:
|
||||
+ *
|
||||
+ * > 3.5. OBJECT IDENTIFIER values
|
||||
+ * >
|
||||
+ * > An OBJECT IDENTIFIER value is an ordered list of non-negative
|
||||
+ * > numbers. For the SMIv2, each number in the list is referred to as a
|
||||
+ * > sub-identifier, there are at most 128 sub-identifiers in a value,
|
||||
+ * > and each sub-identifier has a maximum value of 2^32-1 (4294967295
|
||||
+ * > decimal).
|
||||
+ *
|
||||
+ * So a legitimate OID according to this RFC is at most (32 * 128 / 7),
|
||||
+ * i.e. 586 bytes long.
|
||||
+ *
|
||||
+ * Ref: https://datatracker.ietf.org/doc/html/rfc2578#section-3.5
|
||||
+ */
|
||||
+ if (len > 586)
|
||||
+ goto err;
|
||||
+
|
||||
while (len > 0) {
|
||||
l = 0;
|
||||
use_bn = 0;
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@@ -18,9 +18,11 @@ SRC_URI = "http://www.openssl.org/source/openssl-${PV}.tar.gz \
|
||||
file://afalg.patch \
|
||||
file://reproducible.patch \
|
||||
file://reproducibility.patch \
|
||||
file://0001-Configure-add-2-missing-key-sorts.patch \
|
||||
file://CVE-2023-0464.patch \
|
||||
file://CVE-2023-0465.patch \
|
||||
file://CVE-2023-0466.patch \
|
||||
file://CVE-2023-2650.patch \
|
||||
"
|
||||
|
||||
SRC_URI_append_class-nativesdk = " \
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
SRCBRANCH ?= "release/2.31/master"
|
||||
PV = "2.31+git${SRCPV}"
|
||||
SRCREV_glibc ?= "d4b75594574ab8a9c2c41209cd8c62aac76b5a04"
|
||||
SRCREV_glibc ?= "2d4f26e5cfda682f9ce61444b81533b83f6381af"
|
||||
SRCREV_localedef ?= "cd9f958c4c94a638fa7b2b4e21627364f1a1a655"
|
||||
|
||||
GLIBC_GIT_URI ?= "git://sourceware.org/git/glibc.git"
|
||||
|
||||
@@ -24,7 +24,7 @@ IMAGE_FSTYPES = "wic.vmdk"
|
||||
|
||||
inherit core-image setuptools3
|
||||
|
||||
SRCREV ?= "d91c3c124231b6094cd797de5d11110f80153ebb"
|
||||
SRCREV ?= "88bec50206d02fef3cdc3eaabb638963144eb63b"
|
||||
SRC_URI = "git://git.yoctoproject.org/poky;branch=dunfell \
|
||||
file://Yocto_Build_Appliance.vmx \
|
||||
file://Yocto_Build_Appliance.vmxf \
|
||||
|
||||
342
meta/recipes-core/meta/cve-update-nvd2-native.bb
Normal file
342
meta/recipes-core/meta/cve-update-nvd2-native.bb
Normal file
@@ -0,0 +1,342 @@
|
||||
SUMMARY = "Updates the NVD CVE database"
|
||||
LICENSE = "MIT"
|
||||
|
||||
# Important note:
|
||||
# This product uses the NVD API but is not endorsed or certified by the NVD.
|
||||
|
||||
INHIBIT_DEFAULT_DEPS = "1"
|
||||
|
||||
inherit native
|
||||
|
||||
deltask do_unpack
|
||||
deltask do_patch
|
||||
deltask do_configure
|
||||
deltask do_compile
|
||||
deltask do_install
|
||||
deltask do_populate_sysroot
|
||||
|
||||
NVDCVE_URL ?= "https://services.nvd.nist.gov/rest/json/cves/2.0"
|
||||
|
||||
# If you have a NVD API key (https://nvd.nist.gov/developers/request-an-api-key)
|
||||
# then setting this to get higher rate limits.
|
||||
NVDCVE_API_KEY ?= ""
|
||||
|
||||
# CVE database update interval, in seconds. By default: once a day (24*60*60).
|
||||
# Use 0 to force the update
|
||||
# Use a negative value to skip the update
|
||||
CVE_DB_UPDATE_INTERVAL ?= "86400"
|
||||
|
||||
# Timeout for blocking socket operations, such as the connection attempt.
|
||||
CVE_SOCKET_TIMEOUT ?= "60"
|
||||
|
||||
CVE_DB_TEMP_FILE ?= "${CVE_CHECK_DB_DIR}/temp_nvdcve_2.db"
|
||||
|
||||
CVE_CHECK_DB_FILE ?= "${CVE_CHECK_DB_DIR}/nvdcve_2.db"
|
||||
|
||||
python () {
|
||||
if not bb.data.inherits_class("cve-check", d):
|
||||
raise bb.parse.SkipRecipe("Skip recipe when cve-check class is not loaded.")
|
||||
}
|
||||
|
||||
python do_fetch() {
|
||||
"""
|
||||
Update NVD database with API 2.0
|
||||
"""
|
||||
import bb.utils
|
||||
import bb.progress
|
||||
import shutil
|
||||
|
||||
bb.utils.export_proxies(d)
|
||||
|
||||
db_file = d.getVar("CVE_CHECK_DB_FILE")
|
||||
db_dir = os.path.dirname(db_file)
|
||||
db_tmp_file = d.getVar("CVE_DB_TEMP_FILE")
|
||||
|
||||
cleanup_db_download(db_file, db_tmp_file)
|
||||
# By default let's update the whole database (since time 0)
|
||||
database_time = 0
|
||||
|
||||
# The NVD database changes once a day, so no need to update more frequently
|
||||
# Allow the user to force-update
|
||||
try:
|
||||
import time
|
||||
update_interval = int(d.getVar("CVE_DB_UPDATE_INTERVAL"))
|
||||
if update_interval < 0:
|
||||
bb.note("CVE database update skipped")
|
||||
return
|
||||
if time.time() - os.path.getmtime(db_file) < update_interval:
|
||||
bb.note("CVE database recently updated, skipping")
|
||||
return
|
||||
database_time = os.path.getmtime(db_file)
|
||||
|
||||
except OSError:
|
||||
pass
|
||||
|
||||
bb.utils.mkdirhier(db_dir)
|
||||
if os.path.exists(db_file):
|
||||
shutil.copy2(db_file, db_tmp_file)
|
||||
|
||||
if update_db_file(db_tmp_file, d, database_time) == True:
|
||||
# Update downloaded correctly, can swap files
|
||||
shutil.move(db_tmp_file, db_file)
|
||||
else:
|
||||
# Update failed, do not modify the database
|
||||
bb.warn("CVE database update failed")
|
||||
os.remove(db_tmp_file)
|
||||
}
|
||||
|
||||
do_fetch[lockfiles] += "${CVE_CHECK_DB_FILE_LOCK}"
|
||||
do_fetch[file-checksums] = ""
|
||||
do_fetch[vardeps] = ""
|
||||
|
||||
def cleanup_db_download(db_file, db_tmp_file):
|
||||
"""
|
||||
Cleanup the download space from possible failed downloads
|
||||
"""
|
||||
|
||||
# Clean up the updates done on the main file
|
||||
# Remove it only if a journal file exists - it means a complete re-download
|
||||
if os.path.exists("{0}-journal".format(db_file)):
|
||||
# If a journal is present the last update might have been interrupted. In that case,
|
||||
# just wipe any leftovers and force the DB to be recreated.
|
||||
os.remove("{0}-journal".format(db_file))
|
||||
|
||||
if os.path.exists(db_file):
|
||||
os.remove(db_file)
|
||||
|
||||
# Clean-up the temporary file downloads, we can remove both journal
|
||||
# and the temporary database
|
||||
if os.path.exists("{0}-journal".format(db_tmp_file)):
|
||||
# If a journal is present the last update might have been interrupted. In that case,
|
||||
# just wipe any leftovers and force the DB to be recreated.
|
||||
os.remove("{0}-journal".format(db_tmp_file))
|
||||
|
||||
if os.path.exists(db_tmp_file):
|
||||
os.remove(db_tmp_file)
|
||||
|
||||
def nvd_request_next(url, api_key, args):
|
||||
"""
|
||||
Request next part of the NVD dabase
|
||||
"""
|
||||
|
||||
import urllib.request
|
||||
import urllib.parse
|
||||
import gzip
|
||||
import http
|
||||
import time
|
||||
|
||||
request = urllib.request.Request(url + "?" + urllib.parse.urlencode(args))
|
||||
if api_key:
|
||||
request.add_header("apiKey", api_key)
|
||||
bb.note("Requesting %s" % request.full_url)
|
||||
|
||||
for attempt in range(5):
|
||||
try:
|
||||
r = urllib.request.urlopen(request)
|
||||
|
||||
if (r.headers['content-encoding'] == 'gzip'):
|
||||
buf = r.read()
|
||||
raw_data = gzip.decompress(buf)
|
||||
else:
|
||||
raw_data = r.read().decode("utf-8")
|
||||
|
||||
r.close()
|
||||
|
||||
except Exception as e:
|
||||
bb.note("CVE database: received error (%s), retrying" % (e))
|
||||
time.sleep(6)
|
||||
pass
|
||||
else:
|
||||
return raw_data
|
||||
else:
|
||||
# We failed at all attempts
|
||||
return None
|
||||
|
||||
def update_db_file(db_tmp_file, d, database_time):
|
||||
"""
|
||||
Update the given database file
|
||||
"""
|
||||
import bb.utils, bb.progress
|
||||
import datetime
|
||||
import sqlite3
|
||||
import json
|
||||
|
||||
# Connect to database
|
||||
conn = sqlite3.connect(db_tmp_file)
|
||||
initialize_db(conn)
|
||||
|
||||
req_args = {'startIndex' : 0}
|
||||
|
||||
# The maximum range for time is 120 days
|
||||
# Force a complete update if our range is longer
|
||||
if (database_time != 0):
|
||||
database_date = datetime.datetime.fromtimestamp(database_time, tz=datetime.timezone.utc)
|
||||
today_date = datetime.datetime.now(tz=datetime.timezone.utc)
|
||||
delta = today_date - database_date
|
||||
if delta.days < 120:
|
||||
bb.note("CVE database: performing partial update")
|
||||
req_args['lastModStartDate'] = database_date.isoformat()
|
||||
req_args['lastModEndDate'] = today_date.isoformat()
|
||||
else:
|
||||
bb.note("CVE database: file too old, forcing a full update")
|
||||
|
||||
with bb.progress.ProgressHandler(d) as ph, open(os.path.join(d.getVar("TMPDIR"), 'cve_check'), 'a') as cve_f:
|
||||
|
||||
bb.note("Updating entries")
|
||||
index = 0
|
||||
url = d.getVar("NVDCVE_URL")
|
||||
api_key = d.getVar("NVDCVE_API_KEY") or None
|
||||
|
||||
while True:
|
||||
req_args['startIndex'] = index
|
||||
raw_data = nvd_request_next(url, api_key, req_args)
|
||||
if raw_data is None:
|
||||
# We haven't managed to download data
|
||||
return False
|
||||
|
||||
data = json.loads(raw_data)
|
||||
|
||||
index = data["startIndex"]
|
||||
total = data["totalResults"]
|
||||
per_page = data["resultsPerPage"]
|
||||
bb.note("Got %d entries" % per_page)
|
||||
for cve in data["vulnerabilities"]:
|
||||
update_db(conn, cve)
|
||||
|
||||
index += per_page
|
||||
ph.update((float(index) / (total+1)) * 100)
|
||||
if index >= total:
|
||||
break
|
||||
|
||||
# Recommended by NVD
|
||||
time.sleep(6)
|
||||
|
||||
# Update success, set the date to cve_check file.
|
||||
cve_f.write('CVE database update : %s\n\n' % datetime.date.today())
|
||||
|
||||
conn.commit()
|
||||
conn.close()
|
||||
return True
|
||||
|
||||
def initialize_db(conn):
|
||||
with conn:
|
||||
c = conn.cursor()
|
||||
|
||||
c.execute("CREATE TABLE IF NOT EXISTS META (YEAR INTEGER UNIQUE, DATE TEXT)")
|
||||
|
||||
c.execute("CREATE TABLE IF NOT EXISTS NVD (ID TEXT UNIQUE, SUMMARY TEXT, \
|
||||
SCOREV2 TEXT, SCOREV3 TEXT, MODIFIED INTEGER, VECTOR TEXT)")
|
||||
|
||||
c.execute("CREATE TABLE IF NOT EXISTS PRODUCTS (ID TEXT, \
|
||||
VENDOR TEXT, PRODUCT TEXT, VERSION_START TEXT, OPERATOR_START TEXT, \
|
||||
VERSION_END TEXT, OPERATOR_END TEXT)")
|
||||
c.execute("CREATE INDEX IF NOT EXISTS PRODUCT_ID_IDX on PRODUCTS(ID);")
|
||||
|
||||
c.close()
|
||||
|
||||
def parse_node_and_insert(conn, node, cveId):
|
||||
|
||||
def cpe_generator():
|
||||
for cpe in node.get('cpeMatch', ()):
|
||||
if not cpe['vulnerable']:
|
||||
return
|
||||
cpe23 = cpe.get('criteria')
|
||||
if not cpe23:
|
||||
return
|
||||
cpe23 = cpe23.split(':')
|
||||
if len(cpe23) < 6:
|
||||
return
|
||||
vendor = cpe23[3]
|
||||
product = cpe23[4]
|
||||
version = cpe23[5]
|
||||
|
||||
if cpe23[6] == '*' or cpe23[6] == '-':
|
||||
version_suffix = ""
|
||||
else:
|
||||
version_suffix = "_" + cpe23[6]
|
||||
|
||||
if version != '*' and version != '-':
|
||||
# Version is defined, this is a '=' match
|
||||
yield [cveId, vendor, product, version + version_suffix, '=', '', '']
|
||||
elif version == '-':
|
||||
# no version information is available
|
||||
yield [cveId, vendor, product, version, '', '', '']
|
||||
else:
|
||||
# Parse start version, end version and operators
|
||||
op_start = ''
|
||||
op_end = ''
|
||||
v_start = ''
|
||||
v_end = ''
|
||||
|
||||
if 'versionStartIncluding' in cpe:
|
||||
op_start = '>='
|
||||
v_start = cpe['versionStartIncluding']
|
||||
|
||||
if 'versionStartExcluding' in cpe:
|
||||
op_start = '>'
|
||||
v_start = cpe['versionStartExcluding']
|
||||
|
||||
if 'versionEndIncluding' in cpe:
|
||||
op_end = '<='
|
||||
v_end = cpe['versionEndIncluding']
|
||||
|
||||
if 'versionEndExcluding' in cpe:
|
||||
op_end = '<'
|
||||
v_end = cpe['versionEndExcluding']
|
||||
|
||||
if op_start or op_end or v_start or v_end:
|
||||
yield [cveId, vendor, product, v_start, op_start, v_end, op_end]
|
||||
else:
|
||||
# This is no version information, expressed differently.
|
||||
# Save processing by representing as -.
|
||||
yield [cveId, vendor, product, '-', '', '', '']
|
||||
|
||||
conn.executemany("insert into PRODUCTS values (?, ?, ?, ?, ?, ?, ?)", cpe_generator()).close()
|
||||
|
||||
def update_db(conn, elt):
|
||||
"""
|
||||
Update a single entry in the on-disk database
|
||||
"""
|
||||
|
||||
accessVector = None
|
||||
cveId = elt['cve']['id']
|
||||
if elt['cve']['vulnStatus'] == "Rejected":
|
||||
return
|
||||
cveDesc = ""
|
||||
for desc in elt['cve']['descriptions']:
|
||||
if desc['lang'] == 'en':
|
||||
cveDesc = desc['value']
|
||||
date = elt['cve']['lastModified']
|
||||
try:
|
||||
accessVector = elt['cve']['metrics']['cvssMetricV2'][0]['cvssData']['accessVector']
|
||||
cvssv2 = elt['cve']['metrics']['cvssMetricV2'][0]['cvssData']['baseScore']
|
||||
except KeyError:
|
||||
cvssv2 = 0.0
|
||||
cvssv3 = None
|
||||
try:
|
||||
accessVector = accessVector or elt['cve']['metrics']['cvssMetricV30'][0]['cvssData']['attackVector']
|
||||
cvssv3 = elt['cve']['metrics']['cvssMetricV30'][0]['cvssData']['baseScore']
|
||||
except KeyError:
|
||||
pass
|
||||
try:
|
||||
accessVector = accessVector or elt['cve']['metrics']['cvssMetricV31'][0]['cvssData']['attackVector']
|
||||
cvssv3 = cvssv3 or elt['cve']['metrics']['cvssMetricV31'][0]['cvssData']['baseScore']
|
||||
except KeyError:
|
||||
pass
|
||||
accessVector = accessVector or "UNKNOWN"
|
||||
cvssv3 = cvssv3 or 0.0
|
||||
|
||||
conn.execute("insert or replace into NVD values (?, ?, ?, ?, ?, ?)",
|
||||
[cveId, cveDesc, cvssv2, cvssv3, date, accessVector]).close()
|
||||
|
||||
try:
|
||||
for config in elt['cve']['configurations']:
|
||||
# This is suboptimal as it doesn't handle AND/OR and negate, but is better than nothing
|
||||
for node in config["nodes"]:
|
||||
parse_node_and_insert(conn, node, cveId)
|
||||
except KeyError:
|
||||
bb.note("CVE %s has no configurations" % cveId)
|
||||
|
||||
do_fetch[nostamp] = "1"
|
||||
|
||||
EXCLUDE_FROM_WORLD = "1"
|
||||
@@ -182,12 +182,14 @@ class SystemdUnit():
|
||||
|
||||
raise SystemdUnitNotFoundError(self.root, unit)
|
||||
|
||||
def _process_deps(self, config, service, location, prop, dirstem):
|
||||
def _process_deps(self, config, service, location, prop, dirstem, instance):
|
||||
systemdir = self.root / SYSCONFDIR / "systemd" / "system"
|
||||
|
||||
target = ROOT / location.relative_to(self.root)
|
||||
try:
|
||||
for dependent in config.get('Install', prop):
|
||||
# expand any %i to instance (ignoring escape sequence %%)
|
||||
dependent = re.sub("([^%](%%)*)%i", "\\1{}".format(instance), dependent)
|
||||
wants = systemdir / "{}.{}".format(dependent, dirstem) / service
|
||||
add_link(wants, target)
|
||||
|
||||
@@ -227,8 +229,8 @@ class SystemdUnit():
|
||||
else:
|
||||
service = self.unit
|
||||
|
||||
self._process_deps(config, service, path, 'WantedBy', 'wants')
|
||||
self._process_deps(config, service, path, 'RequiredBy', 'requires')
|
||||
self._process_deps(config, service, path, 'WantedBy', 'wants', instance)
|
||||
self._process_deps(config, service, path, 'RequiredBy', 'requires', instance)
|
||||
|
||||
try:
|
||||
for also in config.get('Install', 'Also'):
|
||||
|
||||
@@ -12,10 +12,7 @@ set( CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY )
|
||||
|
||||
set(CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX "$ENV{OE_CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX}")
|
||||
|
||||
# Set CMAKE_SYSTEM_PROCESSOR from the sysroot name (assuming processor-distro-os).
|
||||
if ($ENV{SDKTARGETSYSROOT} MATCHES "/sysroots/([a-zA-Z0-9_-]+)-.+-.+")
|
||||
set(CMAKE_SYSTEM_PROCESSOR ${CMAKE_MATCH_1})
|
||||
endif()
|
||||
set( CMAKE_SYSTEM_PROCESSOR $ENV{OECORE_TARGET_ARCH} )
|
||||
|
||||
# Include the toolchain configuration subscripts
|
||||
file( GLOB toolchain_config_files "${CMAKE_TOOLCHAIN_FILE}.d/*.cmake" )
|
||||
|
||||
@@ -75,7 +75,7 @@ S = "${TMPDIR}/work-shared/gcc-${PV}-${PR}/gcc-${PV}"
|
||||
SRC_URI[sha256sum] = "27769f64ef1d4cd5e2be8682c0c93f9887983e6cfd1a927ce5a0a2915a95cf8f"
|
||||
# For dev release snapshotting
|
||||
#S = "${TMPDIR}/work-shared/gcc-${PV}-${PR}/official-gcc-${RELEASE}"
|
||||
#B = "${WORKDIR}/gcc-${PV}/build.${HOST_SYS}.${TARGET_SYS}"
|
||||
B = "${WORKDIR}/gcc-${PV}/build.${HOST_SYS}.${TARGET_SYS}"
|
||||
|
||||
# Language Overrides
|
||||
FORTRAN = ""
|
||||
|
||||
@@ -63,6 +63,11 @@ SRC_URI += "\
|
||||
file://CVE-2023-24538-3.patch \
|
||||
file://CVE-2023-24539.patch \
|
||||
file://CVE-2023-24540.patch \
|
||||
file://CVE-2023-29405-1.patch \
|
||||
file://CVE-2023-29405-2.patch \
|
||||
file://CVE-2023-29402.patch \
|
||||
file://CVE-2023-29404.patch \
|
||||
file://CVE-2023-29400.patch \
|
||||
"
|
||||
|
||||
SRC_URI_append_libc-musl = " file://0009-ld-replace-glibc-dynamic-linker-with-musl.patch"
|
||||
|
||||
94
meta/recipes-devtools/go/go-1.14/CVE-2023-29400.patch
Normal file
94
meta/recipes-devtools/go/go-1.14/CVE-2023-29400.patch
Normal file
@@ -0,0 +1,94 @@
|
||||
From 0d347544cbca0f42b160424f6bc2458ebcc7b3fc Mon Sep 17 00:00:00 2001
|
||||
From: Roland Shoemaker <bracewell@google.com>
|
||||
Date: Thu, 13 Apr 2023 14:01:50 -0700
|
||||
Subject: [PATCH] html/template: emit filterFailsafe for empty unquoted attr
|
||||
value
|
||||
|
||||
An unquoted action used as an attribute value can result in unsafe
|
||||
behavior if it is empty, as HTML normalization will result in unexpected
|
||||
attributes, and may allow attribute injection. If executing a template
|
||||
results in a empty unquoted attribute value, emit filterFailsafe
|
||||
instead.
|
||||
|
||||
Thanks to Juho Nurminen of Mattermost for reporting this issue.
|
||||
|
||||
Fixes #59722
|
||||
Fixes CVE-2023-29400
|
||||
|
||||
Change-Id: Ia38d1b536ae2b4af5323a6c6d861e3c057c2570a
|
||||
Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1826631
|
||||
Reviewed-by: Julie Qiu <julieqiu@google.com>
|
||||
Run-TryBot: Roland Shoemaker <bracewell@google.com>
|
||||
Reviewed-by: Damien Neil <dneil@google.com>
|
||||
Reviewed-on: https://go-review.googlesource.com/c/go/+/491617
|
||||
Run-TryBot: Carlos Amedee <carlos@golang.org>
|
||||
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
|
||||
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
|
||||
TryBot-Result: Gopher Robot <gobot@golang.org>
|
||||
|
||||
Upstream-Status: Backport from [https://github.com/golang/go/commit/0d347544cbca0f42b160424f6bc2458ebcc7b3fc]
|
||||
CVE: CVE-2023-29400
|
||||
Signed-off-by: Ashish Sharma <asharma@mvista.com>
|
||||
---
|
||||
src/html/template/escape.go | 5 ++---
|
||||
src/html/template/escape_test.go | 15 +++++++++++++++
|
||||
src/html/template/html.go | 3 +++
|
||||
3 files changed, 20 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/html/template/escape.go b/src/html/template/escape.go
|
||||
index 4ba1d6b31897e..a62ef159f0dcd 100644
|
||||
--- a/src/html/template/escape.go
|
||||
+++ b/src/html/template/escape.go
|
||||
@@ -382,9 +382,8 @@ func normalizeEscFn(e string) string {
|
||||
// for all x.
|
||||
var redundantFuncs = map[string]map[string]bool{
|
||||
"_html_template_commentescaper": {
|
||||
- "_html_template_attrescaper": true,
|
||||
- "_html_template_nospaceescaper": true,
|
||||
- "_html_template_htmlescaper": true,
|
||||
+ "_html_template_attrescaper": true,
|
||||
+ "_html_template_htmlescaper": true,
|
||||
},
|
||||
"_html_template_cssescaper": {
|
||||
"_html_template_attrescaper": true,
|
||||
diff --git a/src/html/template/escape_test.go b/src/html/template/escape_test.go
|
||||
index 3dd212bac9406..f8b2b448f2dfa 100644
|
||||
--- a/src/html/template/escape_test.go
|
||||
+++ b/src/html/template/escape_test.go
|
||||
@@ -678,6 +678,21 @@ func TestEscape(t *testing.T) {
|
||||
`<img srcset={{",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"}}>`,
|
||||
`<img srcset=,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,>`,
|
||||
},
|
||||
+ {
|
||||
+ "unquoted empty attribute value (plaintext)",
|
||||
+ "<p name={{.U}}>",
|
||||
+ "<p name=ZgotmplZ>",
|
||||
+ },
|
||||
+ {
|
||||
+ "unquoted empty attribute value (url)",
|
||||
+ "<p href={{.U}}>",
|
||||
+ "<p href=ZgotmplZ>",
|
||||
+ },
|
||||
+ {
|
||||
+ "quoted empty attribute value",
|
||||
+ "<p name=\"{{.U}}\">",
|
||||
+ "<p name=\"\">",
|
||||
+ },
|
||||
}
|
||||
|
||||
for _, test := range tests {
|
||||
diff --git a/src/html/template/html.go b/src/html/template/html.go
|
||||
index bcca0b51a0ef9..a181699a5bda8 100644
|
||||
--- a/src/html/template/html.go
|
||||
+++ b/src/html/template/html.go
|
||||
@@ -14,6 +14,9 @@ import (
|
||||
// htmlNospaceEscaper escapes for inclusion in unquoted attribute values.
|
||||
func htmlNospaceEscaper(args ...interface{}) string {
|
||||
s, t := stringify(args...)
|
||||
+ if s == "" {
|
||||
+ return filterFailsafe
|
||||
+ }
|
||||
if t == contentTypeHTML {
|
||||
return htmlReplacer(stripTags(s), htmlNospaceNormReplacementTable, false)
|
||||
}
|
||||
|
||||
201
meta/recipes-devtools/go/go-1.14/CVE-2023-29402.patch
Normal file
201
meta/recipes-devtools/go/go-1.14/CVE-2023-29402.patch
Normal file
@@ -0,0 +1,201 @@
|
||||
rom c160b49b6d328c86bd76ca2fff9009a71347333f Mon Sep 17 00:00:00 2001
|
||||
From: "Bryan C. Mills" <bcmills@google.com>
|
||||
Date: Fri, 12 May 2023 14:15:16 -0400
|
||||
Subject: [PATCH] [release-branch.go1.19] cmd/go: disallow package directories
|
||||
containing newlines
|
||||
|
||||
Directory or file paths containing newlines may cause tools (such as
|
||||
cmd/cgo) that emit "//line" or "#line" -directives to write part of
|
||||
the path into non-comment lines in generated source code. If those
|
||||
lines contain valid Go code, it may be injected into the resulting
|
||||
binary.
|
||||
|
||||
(Note that Go import paths and file paths within module zip files
|
||||
already could not contain newlines.)
|
||||
|
||||
Thanks to Juho Nurminen of Mattermost for reporting this issue.
|
||||
|
||||
Updates #60167.
|
||||
Fixes #60515.
|
||||
Fixes CVE-2023-29402.
|
||||
|
||||
Change-Id: If55d0400c02beb7a5da5eceac60f1abeac99f064
|
||||
Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1882606
|
||||
Reviewed-by: Roland Shoemaker <bracewell@google.com>
|
||||
Run-TryBot: Roland Shoemaker <bracewell@google.com>
|
||||
Reviewed-by: Russ Cox <rsc@google.com>
|
||||
Reviewed-by: Damien Neil <dneil@google.com>
|
||||
(cherry picked from commit 41f9046495564fc728d6f98384ab7276450ac7e2)
|
||||
Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1902229
|
||||
Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1904343
|
||||
Reviewed-by: Michael Knyszek <mknyszek@google.com>
|
||||
Reviewed-by: Bryan Mills <bcmills@google.com>
|
||||
Reviewed-on: https://go-review.googlesource.com/c/go/+/501218
|
||||
Run-TryBot: David Chase <drchase@google.com>
|
||||
Auto-Submit: Michael Knyszek <mknyszek@google.com>
|
||||
TryBot-Result: Gopher Robot <gobot@golang.org>
|
||||
|
||||
Upstream-Status: Backport [https://github.com/golang/go/commit/c160b49b6d328c86bd76ca2fff9009a71347333f]
|
||||
CVE: CVE-2023-29402
|
||||
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
---
|
||||
src/cmd/go/internal/load/pkg.go | 4 +
|
||||
src/cmd/go/internal/work/exec.go | 6 ++
|
||||
src/cmd/go/script_test.go | 1 +
|
||||
.../go/testdata/script/build_cwd_newline.txt | 100 ++++++++++++++++++
|
||||
4 files changed, 111 insertions(+)
|
||||
create mode 100644 src/cmd/go/testdata/script/build_cwd_newline.txt
|
||||
|
||||
diff --git a/src/cmd/go/internal/load/pkg.go b/src/cmd/go/internal/load/pkg.go
|
||||
index 369a79b..d2b63b0 100644
|
||||
--- a/src/cmd/go/internal/load/pkg.go
|
||||
+++ b/src/cmd/go/internal/load/pkg.go
|
||||
@@ -1697,6 +1697,10 @@ func (p *Package) load(stk *ImportStack, bp *build.Package, err error) {
|
||||
setError(ImportErrorf(p.ImportPath, "invalid import path %q", p.ImportPath))
|
||||
return
|
||||
}
|
||||
+ if strings.ContainsAny(p.Dir, "\r\n") {
|
||||
+ setError(fmt.Errorf("invalid package directory %q", p.Dir))
|
||||
+ return
|
||||
+ }
|
||||
|
||||
// Build list of imported packages and full dependency list.
|
||||
imports := make([]*Package, 0, len(p.Imports))
|
||||
diff --git a/src/cmd/go/internal/work/exec.go b/src/cmd/go/internal/work/exec.go
|
||||
index 9a9650b..050b785 100644
|
||||
--- a/src/cmd/go/internal/work/exec.go
|
||||
+++ b/src/cmd/go/internal/work/exec.go
|
||||
@@ -458,6 +458,12 @@ func (b *Builder) build(a *Action) (err error) {
|
||||
b.Print(a.Package.ImportPath + "\n")
|
||||
}
|
||||
|
||||
+ if p.Error != nil {
|
||||
+ // Don't try to build anything for packages with errors. There may be a
|
||||
+ // problem with the inputs that makes the package unsafe to build.
|
||||
+ return p.Error
|
||||
+ }
|
||||
+
|
||||
if a.Package.BinaryOnly {
|
||||
p.Stale = true
|
||||
p.StaleReason = "binary-only packages are no longer supported"
|
||||
diff --git a/src/cmd/go/script_test.go b/src/cmd/go/script_test.go
|
||||
index ec498bb..a1398ad 100644
|
||||
--- a/src/cmd/go/script_test.go
|
||||
+++ b/src/cmd/go/script_test.go
|
||||
@@ -123,6 +123,7 @@ func (ts *testScript) setup() {
|
||||
"devnull=" + os.DevNull,
|
||||
"goversion=" + goVersion(ts),
|
||||
":=" + string(os.PathListSeparator),
|
||||
+ "newline=\n",
|
||||
}
|
||||
|
||||
if runtime.GOOS == "plan9" {
|
||||
diff --git a/src/cmd/go/testdata/script/build_cwd_newline.txt b/src/cmd/go/testdata/script/build_cwd_newline.txt
|
||||
new file mode 100644
|
||||
index 0000000..61c6966
|
||||
--- /dev/null
|
||||
+++ b/src/cmd/go/testdata/script/build_cwd_newline.txt
|
||||
@@ -0,0 +1,100 @@
|
||||
+[windows] skip 'filesystem normalizes / to \'
|
||||
+[plan9] skip 'filesystem disallows \n in paths'
|
||||
+
|
||||
+# If the directory path containing a package to be built includes a newline,
|
||||
+# the go command should refuse to even try to build the package.
|
||||
+
|
||||
+env DIR=$WORK${/}${newline}'package main'${newline}'func main() { panic("uh-oh")'${newline}'/*'
|
||||
+
|
||||
+mkdir $DIR
|
||||
+cd $DIR
|
||||
+exec pwd
|
||||
+cp $WORK/go.mod ./go.mod
|
||||
+cp $WORK/main.go ./main.go
|
||||
+cp $WORK/main_test.go ./main_test.go
|
||||
+
|
||||
+! go build -o $devnull .
|
||||
+stderr 'package example: invalid package directory .*uh-oh'
|
||||
+
|
||||
+! go build -o $devnull main.go
|
||||
+stderr 'package command-line-arguments: invalid package directory .*uh-oh'
|
||||
+
|
||||
+! go run .
|
||||
+stderr 'package example: invalid package directory .*uh-oh'
|
||||
+
|
||||
+! go run main.go
|
||||
+stderr 'package command-line-arguments: invalid package directory .*uh-oh'
|
||||
+
|
||||
+! go test .
|
||||
+stderr 'package example: invalid package directory .*uh-oh'
|
||||
+
|
||||
+! go test -v main.go main_test.go
|
||||
+stderr 'package command-line-arguments: invalid package directory .*uh-oh'
|
||||
+
|
||||
+
|
||||
+# Since we do preserve $PWD (or set it appropriately) for commands, and we do
|
||||
+# not resolve symlinks unnecessarily, referring to the contents of the unsafe
|
||||
+# directory via a safe symlink should be ok, and should not inject the data from
|
||||
+# the symlink target path.
|
||||
+
|
||||
+[!symlink] stop 'remainder of test checks symlink behavior'
|
||||
+[short] stop 'links and runs binaries'
|
||||
+
|
||||
+symlink $WORK${/}link -> $DIR
|
||||
+
|
||||
+go run $WORK${/}link${/}main.go
|
||||
+! stdout panic
|
||||
+! stderr panic
|
||||
+stderr '^ok$'
|
||||
+
|
||||
+go test -v $WORK${/}link${/}main.go $WORK${/}link${/}main_test.go
|
||||
+! stdout panic
|
||||
+! stderr panic
|
||||
+stdout '^ok$' # 'go test' combines the test's stdout into stderr
|
||||
+
|
||||
+cd $WORK/link
|
||||
+
|
||||
+! go run $DIR${/}main.go
|
||||
+stderr 'package command-line-arguments: invalid package directory .*uh-oh'
|
||||
+
|
||||
+go run .
|
||||
+! stdout panic
|
||||
+! stderr panic
|
||||
+stderr '^ok$'
|
||||
+
|
||||
+go run main.go
|
||||
+! stdout panic
|
||||
+! stderr panic
|
||||
+stderr '^ok$'
|
||||
+
|
||||
+go test -v
|
||||
+! stdout panic
|
||||
+! stderr panic
|
||||
+stdout '^ok$' # 'go test' combines the test's stdout into stderr
|
||||
+
|
||||
+go test -v .
|
||||
+! stdout panic
|
||||
+! stderr panic
|
||||
+stdout '^ok$' # 'go test' combines the test's stdout into stderr
|
||||
+
|
||||
+
|
||||
+-- $WORK/go.mod --
|
||||
+module example
|
||||
+go 1.19
|
||||
+-- $WORK/main.go --
|
||||
+package main
|
||||
+
|
||||
+import "C"
|
||||
+
|
||||
+func main() {
|
||||
+ /* nothing here */
|
||||
+ println("ok")
|
||||
+}
|
||||
+-- $WORK/main_test.go --
|
||||
+package main
|
||||
+
|
||||
+import "testing"
|
||||
+
|
||||
+func TestMain(*testing.M) {
|
||||
+ main()
|
||||
+}
|
||||
--
|
||||
2.25.1
|
||||
|
||||
84
meta/recipes-devtools/go/go-1.14/CVE-2023-29404.patch
Normal file
84
meta/recipes-devtools/go/go-1.14/CVE-2023-29404.patch
Normal file
@@ -0,0 +1,84 @@
|
||||
From bf3c8ce03e175e870763901a3850bca01381a828 Mon Sep 17 00:00:00 2001
|
||||
From: Roland Shoemaker <bracewell@google.com>
|
||||
Date: Fri, 5 May 2023 13:10:34 -0700
|
||||
Subject: [PATCH] [release-branch.go1.19] cmd/go: enforce flags with
|
||||
non-optional arguments
|
||||
|
||||
Enforce that linker flags which expect arguments get them, otherwise it
|
||||
may be possible to smuggle unexpected flags through as the linker can
|
||||
consume what looks like a flag as an argument to a preceding flag (i.e.
|
||||
"-Wl,-O -Wl,-R,-bad-flag" is interpreted as "-O=-R -bad-flag"). Also be
|
||||
somewhat more restrictive in the general format of some flags.
|
||||
|
||||
Thanks to Juho Nurminen of Mattermost for reporting this issue.
|
||||
|
||||
Updates #60305
|
||||
Fixes #60511
|
||||
Fixes CVE-2023-29404
|
||||
|
||||
Change-Id: Icdffef2c0f644da50261cace6f43742783931cff
|
||||
Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1876275
|
||||
Reviewed-by: Ian Lance Taylor <iant@google.com>
|
||||
Reviewed-by: Damien Neil <dneil@google.com>
|
||||
(cherry picked from commit 896779503cf754cbdac24b61d4cc953b50fe2dde)
|
||||
Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1902225
|
||||
Run-TryBot: Roland Shoemaker <bracewell@google.com>
|
||||
Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1904342
|
||||
Reviewed-by: Michael Knyszek <mknyszek@google.com>
|
||||
Reviewed-on: https://go-review.googlesource.com/c/go/+/501217
|
||||
Auto-Submit: Michael Knyszek <mknyszek@google.com>
|
||||
Run-TryBot: David Chase <drchase@google.com>
|
||||
TryBot-Bypass: Michael Knyszek <mknyszek@google.com>
|
||||
|
||||
Upstream-Status: Backport [https://github.com/golang/go/commit/bf3c8ce03e175e870763901a3850bca01381a828]
|
||||
CVE: CVE-2023-29404
|
||||
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
---
|
||||
src/cmd/go/internal/work/security.go | 6 +++---
|
||||
src/cmd/go/internal/work/security_test.go | 5 +++++
|
||||
2 files changed, 8 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/cmd/go/internal/work/security.go b/src/cmd/go/internal/work/security.go
|
||||
index a823b20..8acb6dc 100644
|
||||
--- a/src/cmd/go/internal/work/security.go
|
||||
+++ b/src/cmd/go/internal/work/security.go
|
||||
@@ -177,17 +177,17 @@ var validLinkerFlags = []*lazyregexp.Regexp{
|
||||
re(`-Wl,-Bdynamic`),
|
||||
re(`-Wl,-berok`),
|
||||
re(`-Wl,-Bstatic`),
|
||||
- re(`-WL,-O([^@,\-][^,]*)?`),
|
||||
+ re(`-Wl,-O[0-9]+`),
|
||||
re(`-Wl,-d[ny]`),
|
||||
re(`-Wl,--disable-new-dtags`),
|
||||
- re(`-Wl,-e[=,][a-zA-Z0-9]*`),
|
||||
+ re(`-Wl,-e[=,][a-zA-Z0-9]+`),
|
||||
re(`-Wl,--enable-new-dtags`),
|
||||
re(`-Wl,--end-group`),
|
||||
re(`-Wl,--(no-)?export-dynamic`),
|
||||
re(`-Wl,-framework,[^,@\-][^,]+`),
|
||||
re(`-Wl,-headerpad_max_install_names`),
|
||||
re(`-Wl,--no-undefined`),
|
||||
- re(`-Wl,-R([^@\-][^,@]*$)`),
|
||||
+ re(`-Wl,-R,?([^@\-,][^,@]*$)`),
|
||||
re(`-Wl,--just-symbols[=,]([^,@\-][^,@]+)`),
|
||||
re(`-Wl,-rpath(-link)?[=,]([^,@\-][^,]+)`),
|
||||
re(`-Wl,-s`),
|
||||
diff --git a/src/cmd/go/internal/work/security_test.go b/src/cmd/go/internal/work/security_test.go
|
||||
index bd707ff..7b0b7d3 100644
|
||||
--- a/src/cmd/go/internal/work/security_test.go
|
||||
+++ b/src/cmd/go/internal/work/security_test.go
|
||||
@@ -220,6 +220,11 @@ var badLinkerFlags = [][]string{
|
||||
{"-Wl,-R,@foo"},
|
||||
{"-Wl,--just-symbols,@foo"},
|
||||
{"../x.o"},
|
||||
+ {"-Wl,-R,"},
|
||||
+ {"-Wl,-O"},
|
||||
+ {"-Wl,-e="},
|
||||
+ {"-Wl,-e,"},
|
||||
+ {"-Wl,-R,-flag"},
|
||||
}
|
||||
|
||||
func TestCheckLinkerFlags(t *testing.T) {
|
||||
--
|
||||
2.25.1
|
||||
|
||||
112
meta/recipes-devtools/go/go-1.14/CVE-2023-29405-1.patch
Normal file
112
meta/recipes-devtools/go/go-1.14/CVE-2023-29405-1.patch
Normal file
@@ -0,0 +1,112 @@
|
||||
From fa60c381ed06c12f9c27a7b50ca44c5f84f7f0f4 Mon Sep 17 00:00:00 2001
|
||||
From: Ian Lance Taylor <iant@golang.org>
|
||||
Date: Thu, 4 May 2023 14:06:39 -0700
|
||||
Subject: [PATCH] [release-branch.go1.20] cmd/go,cmd/cgo: in _cgo_flags use one
|
||||
line per flag
|
||||
|
||||
The flags that we recorded in _cgo_flags did not use any quoting,
|
||||
so a flag containing embedded spaces was mishandled.
|
||||
Change the _cgo_flags format to put each flag on a separate line.
|
||||
That is a simple format that does not require any quoting.
|
||||
|
||||
As far as I can tell only cmd/go uses _cgo_flags, and it is only
|
||||
used for gccgo. If this patch doesn't cause any trouble, then
|
||||
in the next release we can change to only using _cgo_flags for gccgo.
|
||||
|
||||
Thanks to Juho Nurminen of Mattermost for reporting this issue.
|
||||
|
||||
Updates #60306
|
||||
Fixes #60514
|
||||
Fixes CVE-2023-29405
|
||||
|
||||
Change-Id: I36b6e188a44c80d7b9573efa577c386770bd2ba3
|
||||
Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1875094
|
||||
Reviewed-by: Damien Neil <dneil@google.com>
|
||||
Reviewed-by: Roland Shoemaker <bracewell@google.com>
|
||||
(cherry picked from commit bcdfcadd5612212089d958bc352a6f6c90742dcc)
|
||||
Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1902228
|
||||
Run-TryBot: Roland Shoemaker <bracewell@google.com>
|
||||
TryBot-Result: Security TryBots <security-trybots@go-security-trybots.iam.gserviceaccount.com>
|
||||
Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1904345
|
||||
Reviewed-by: Michael Knyszek <mknyszek@google.com>
|
||||
Reviewed-on: https://go-review.googlesource.com/c/go/+/501220
|
||||
TryBot-Result: Gopher Robot <gobot@golang.org>
|
||||
Run-TryBot: David Chase <drchase@google.com>
|
||||
Auto-Submit: Michael Knyszek <mknyszek@google.com>
|
||||
---
|
||||
Upstream-Status: Backport [https://github.com/golang/go/commit/fa60c381ed06c12f9c27a7b50ca44c5f84f7f0f4]
|
||||
CVE: CVE-2023-29405
|
||||
Signed-off-by: Ashish Sharma <asharma@mvista.com>
|
||||
|
||||
src/cmd/cgo/out.go | 4 +++-
|
||||
src/cmd/go/internal/work/gccgo.go | 14 ++++++-------
|
||||
.../go/testdata/script/gccgo_link_ldflags.txt | 20 +++++++++++++++++++
|
||||
3 files changed, 29 insertions(+), 9 deletions(-)
|
||||
create mode 100644 src/cmd/go/testdata/script/gccgo_link_ldflags.txt
|
||||
|
||||
diff --git a/src/cmd/cgo/out.go b/src/cmd/cgo/out.go
|
||||
index d26f9e76a374a..d0c6fe3d4c2c2 100644
|
||||
--- a/src/cmd/cgo/out.go
|
||||
+++ b/src/cmd/cgo/out.go
|
||||
@@ -47,7 +47,9 @@ func (p *Package) writeDefs() {
|
||||
|
||||
fflg := creat(*objDir + "_cgo_flags")
|
||||
for k, v := range p.CgoFlags {
|
||||
- fmt.Fprintf(fflg, "_CGO_%s=%s\n", k, strings.Join(v, " "))
|
||||
+ for _, arg := range v {
|
||||
+ fmt.Fprintf(fflg, "_CGO_%s=%s\n", arg)
|
||||
+ }
|
||||
if k == "LDFLAGS" && !*gccgo {
|
||||
for _, arg := range v {
|
||||
fmt.Fprintf(fgo2, "//go:cgo_ldflag %q\n", arg)
|
||||
diff --git a/src/cmd/go/internal/work/gccgo.go b/src/cmd/go/internal/work/gccgo.go
|
||||
index 08a4c2d8166c7..a048b7f4eecef 100644
|
||||
--- a/src/cmd/go/internal/work/gccgo.go
|
||||
+++ b/src/cmd/go/internal/work/gccgo.go
|
||||
@@ -280,14 +280,12 @@ func (tools gccgoToolchain) link(b *Builder, root *Action, out, importcfg string
|
||||
const ldflagsPrefix = "_CGO_LDFLAGS="
|
||||
for _, line := range strings.Split(string(flags), "\n") {
|
||||
if strings.HasPrefix(line, ldflagsPrefix) {
|
||||
- newFlags := strings.Fields(line[len(ldflagsPrefix):])
|
||||
- for _, flag := range newFlags {
|
||||
- // Every _cgo_flags file has -g and -O2 in _CGO_LDFLAGS
|
||||
- // but they don't mean anything to the linker so filter
|
||||
- // them out.
|
||||
- if flag != "-g" && !strings.HasPrefix(flag, "-O") {
|
||||
- cgoldflags = append(cgoldflags, flag)
|
||||
- }
|
||||
+ flag := line[len(ldflagsPrefix):]
|
||||
+ // Every _cgo_flags file has -g and -O2 in _CGO_LDFLAGS
|
||||
+ // but they don't mean anything to the linker so filter
|
||||
+ // them out.
|
||||
+ if flag != "-g" && !strings.HasPrefix(flag, "-O") {
|
||||
+ cgoldflags = append(cgoldflags, flag)
|
||||
}
|
||||
}
|
||||
}
|
||||
diff --git a/src/cmd/go/testdata/script/gccgo_link_ldflags.txt b/src/cmd/go/testdata/script/gccgo_link_ldflags.txt
|
||||
new file mode 100644
|
||||
index 0000000000000..4e91ae56505b6
|
||||
--- /dev/null
|
||||
+++ b/src/cmd/go/testdata/script/gccgo_link_ldflags.txt
|
||||
@@ -0,0 +1,20 @@
|
||||
+# Test that #cgo LDFLAGS are properly quoted.
|
||||
+# The #cgo LDFLAGS below should pass a string with spaces to -L,
|
||||
+# as though searching a directory with a space in its name.
|
||||
+# It should not pass --nosuchoption to the external linker.
|
||||
+
|
||||
+[!cgo] skip
|
||||
+
|
||||
+go build
|
||||
+
|
||||
+[!exec:gccgo] skip
|
||||
+
|
||||
+go build -compiler gccgo
|
||||
+
|
||||
+-- go.mod --
|
||||
+module m
|
||||
+-- cgo.go --
|
||||
+package main
|
||||
+// #cgo LDFLAGS: -L "./ -Wl,--nosuchoption"
|
||||
+import "C"
|
||||
+func main() {}
|
||||
38
meta/recipes-devtools/go/go-1.14/CVE-2023-29405-2.patch
Normal file
38
meta/recipes-devtools/go/go-1.14/CVE-2023-29405-2.patch
Normal file
@@ -0,0 +1,38 @@
|
||||
From 1008486a9ff979dbd21c7466eeb6abf378f9c637 Mon Sep 17 00:00:00 2001
|
||||
From: Ian Lance Taylor <iant@golang.org>
|
||||
Date: Tue, 6 Jun 2023 12:51:17 -0700
|
||||
Subject: [PATCH] [release-branch.go1.20] cmd/cgo: correct _cgo_flags output
|
||||
|
||||
For #60306
|
||||
For #60514
|
||||
|
||||
Change-Id: I3f5d14aee7d7195030e8872e42b1d97aa11d3582
|
||||
Reviewed-on: https://go-review.googlesource.com/c/go/+/501298
|
||||
Run-TryBot: Ian Lance Taylor <iant@golang.org>
|
||||
TryBot-Result: Gopher Robot <gobot@golang.org>
|
||||
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
|
||||
Reviewed-by: David Chase <drchase@google.com>
|
||||
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
|
||||
---
|
||||
|
||||
Upstream-Status: Backport [https://github.com/golang/go/commit/1008486a9ff979dbd21c7466eeb6abf378f9c637]
|
||||
CVE: CVE-2023-29405
|
||||
Signed-off-by: Ashish Sharma <asharma@mvista.com>
|
||||
|
||||
|
||||
src/cmd/cgo/out.go | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/cmd/cgo/out.go b/src/cmd/cgo/out.go
|
||||
index d0c6fe3d4c2c2..a48f52105628a 100644
|
||||
--- a/src/cmd/cgo/out.go
|
||||
+++ b/src/cmd/cgo/out.go
|
||||
@@ -48,7 +48,7 @@ func (p *Package) writeDefs() {
|
||||
fflg := creat(*objDir + "_cgo_flags")
|
||||
for k, v := range p.CgoFlags {
|
||||
for _, arg := range v {
|
||||
- fmt.Fprintf(fflg, "_CGO_%s=%s\n", arg)
|
||||
+ fmt.Fprintf(fflg, "_CGO_%s=%s\n", k, arg)
|
||||
}
|
||||
if k == "LDFLAGS" && !*gccgo {
|
||||
for _, arg := range v {
|
||||
@@ -29,3 +29,6 @@ do_install() {
|
||||
}
|
||||
|
||||
BBCLASSEXTEND = "native nativesdk"
|
||||
|
||||
# This is a different Ninja
|
||||
CVE_CHECK_WHITELIST += "CVE-2021-4336"
|
||||
|
||||
@@ -1,100 +0,0 @@
|
||||
From 064ec20bf7a181ba5fa961aaa12973812aa6ca5d Mon Sep 17 00:00:00 2001
|
||||
From: "Miss Islington (bot)"
|
||||
<31488909+miss-islington@users.noreply.github.com>
|
||||
Date: Mon, 7 Nov 2022 18:57:10 -0800
|
||||
Subject: [PATCH] [3.11] gh-98433: Fix quadratic time idna decoding. (GH-99092)
|
||||
(GH-99222)
|
||||
|
||||
There was an unnecessary quadratic loop in idna decoding. This restores
|
||||
the behavior to linear.
|
||||
|
||||
(cherry picked from commit d315722564927c7202dd6e111dc79eaf14240b0d)
|
||||
|
||||
(cherry picked from commit a6f6c3a3d6f2b580f2d87885c9b8a9350ad7bf15)
|
||||
|
||||
Co-authored-by: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
|
||||
Co-authored-by: Gregory P. Smith <greg@krypto.org>
|
||||
|
||||
CVE: CVE-2022-45061
|
||||
Upstream-Status: Backport [https://github.com/python/cpython/pull/99231/commits/064ec20bf7a181ba5fa961aaa12973812aa6ca5d]
|
||||
Signed-off-by: Omkar Patil <Omkar.Patil@kpit.com>
|
||||
|
||||
---
|
||||
Lib/encodings/idna.py | 32 +++++++++----------
|
||||
Lib/test/test_codecs.py | 6 ++++
|
||||
...2-11-04-09-29-36.gh-issue-98433.l76c5G.rst | 6 ++++
|
||||
3 files changed, 27 insertions(+), 17 deletions(-)
|
||||
create mode 100644 Misc/NEWS.d/next/Security/2022-11-04-09-29-36.gh-issue-98433.l76c5G.rst
|
||||
|
||||
diff --git a/Lib/encodings/idna.py b/Lib/encodings/idna.py
|
||||
index ea4058512fe3..bf98f513366b 100644
|
||||
--- a/Lib/encodings/idna.py
|
||||
+++ b/Lib/encodings/idna.py
|
||||
@@ -39,23 +39,21 @@ def nameprep(label):
|
||||
|
||||
# Check bidi
|
||||
RandAL = [stringprep.in_table_d1(x) for x in label]
|
||||
- for c in RandAL:
|
||||
- if c:
|
||||
- # There is a RandAL char in the string. Must perform further
|
||||
- # tests:
|
||||
- # 1) The characters in section 5.8 MUST be prohibited.
|
||||
- # This is table C.8, which was already checked
|
||||
- # 2) If a string contains any RandALCat character, the string
|
||||
- # MUST NOT contain any LCat character.
|
||||
- if any(stringprep.in_table_d2(x) for x in label):
|
||||
- raise UnicodeError("Violation of BIDI requirement 2")
|
||||
-
|
||||
- # 3) If a string contains any RandALCat character, a
|
||||
- # RandALCat character MUST be the first character of the
|
||||
- # string, and a RandALCat character MUST be the last
|
||||
- # character of the string.
|
||||
- if not RandAL[0] or not RandAL[-1]:
|
||||
- raise UnicodeError("Violation of BIDI requirement 3")
|
||||
+ if any(RandAL):
|
||||
+ # There is a RandAL char in the string. Must perform further
|
||||
+ # tests:
|
||||
+ # 1) The characters in section 5.8 MUST be prohibited.
|
||||
+ # This is table C.8, which was already checked
|
||||
+ # 2) If a string contains any RandALCat character, the string
|
||||
+ # MUST NOT contain any LCat character.
|
||||
+ if any(stringprep.in_table_d2(x) for x in label):
|
||||
+ raise UnicodeError("Violation of BIDI requirement 2")
|
||||
+ # 3) If a string contains any RandALCat character, a
|
||||
+ # RandALCat character MUST be the first character of the
|
||||
+ # string, and a RandALCat character MUST be the last
|
||||
+ # character of the string.
|
||||
+ if not RandAL[0] or not RandAL[-1]:
|
||||
+ raise UnicodeError("Violation of BIDI requirement 3")
|
||||
|
||||
return label
|
||||
|
||||
diff --git a/Lib/test/test_codecs.py b/Lib/test/test_codecs.py
|
||||
index d1faf0126c1e..37ade7d80d02 100644
|
||||
--- a/Lib/test/test_codecs.py
|
||||
+++ b/Lib/test/test_codecs.py
|
||||
@@ -1532,6 +1532,12 @@ def test_builtin_encode(self):
|
||||
self.assertEqual("pyth\xf6n.org".encode("idna"), b"xn--pythn-mua.org")
|
||||
self.assertEqual("pyth\xf6n.org.".encode("idna"), b"xn--pythn-mua.org.")
|
||||
|
||||
+ def test_builtin_decode_length_limit(self):
|
||||
+ with self.assertRaisesRegex(UnicodeError, "too long"):
|
||||
+ (b"xn--016c"+b"a"*1100).decode("idna")
|
||||
+ with self.assertRaisesRegex(UnicodeError, "too long"):
|
||||
+ (b"xn--016c"+b"a"*70).decode("idna")
|
||||
+
|
||||
def test_stream(self):
|
||||
r = codecs.getreader("idna")(io.BytesIO(b"abc"))
|
||||
r.read(3)
|
||||
diff --git a/Misc/NEWS.d/next/Security/2022-11-04-09-29-36.gh-issue-98433.l76c5G.rst b/Misc/NEWS.d/next/Security/2022-11-04-09-29-36.gh-issue-98433.l76c5G.rst
|
||||
new file mode 100644
|
||||
index 000000000000..5185fac2e29d
|
||||
--- /dev/null
|
||||
+++ b/Misc/NEWS.d/next/Security/2022-11-04-09-29-36.gh-issue-98433.l76c5G.rst
|
||||
@@ -0,0 +1,6 @@
|
||||
+The IDNA codec decoder used on DNS hostnames by :mod:`socket` or :mod:`asyncio`
|
||||
+related name resolution functions no longer involves a quadratic algorithm.
|
||||
+This prevents a potential CPU denial of service if an out-of-spec excessive
|
||||
+length hostname involving bidirectional characters were decoded. Some protocols
|
||||
+such as :mod:`urllib` http ``3xx`` redirects potentially allow for an attacker
|
||||
+to supply such a name.
|
||||
@@ -1,105 +0,0 @@
|
||||
From 948c6794711458fd148a3fa62296cadeeb2ed631 Mon Sep 17 00:00:00 2001
|
||||
From: "Miss Islington (bot)"
|
||||
<31488909+miss-islington@users.noreply.github.com>
|
||||
Date: Fri, 28 Oct 2022 03:07:50 -0700
|
||||
Subject: [PATCH] [3.8] gh-98517: Fix buffer overflows in _sha3 module
|
||||
(GH-98519) (#98527)
|
||||
|
||||
This is a port of the applicable part of XKCP's fix [1] for
|
||||
CVE-2022-37454 and avoids the segmentation fault and the infinite
|
||||
loop in the test cases published in [2].
|
||||
|
||||
[1]: https://github.com/XKCP/XKCP/commit/fdc6fef075f4e81d6b1bc38364248975e08e340a
|
||||
[2]: https://mouha.be/sha-3-buffer-overflow/
|
||||
|
||||
Regression test added by: Gregory P. Smith [Google LLC] <greg@krypto.org>
|
||||
(cherry picked from commit 0e4e058602d93b88256ff90bbef501ba20be9dd3)
|
||||
|
||||
Co-authored-by: Theo Buehler <botovq@users.noreply.github.com>
|
||||
|
||||
CVE: CVE-2022-37454
|
||||
Upstream-Status: Backport [https://github.com/python/cpython/commit/948c6794711458fd148a3fa62296cadeeb2ed631]
|
||||
Signed-off-by: Pawan Badganchi <Pawan.Badganchi@kpit.com>
|
||||
---
|
||||
Lib/test/test_hashlib.py | 9 +++++++++
|
||||
.../2022-10-21-13-31-47.gh-issue-98517.SXXGfV.rst | 1 +
|
||||
Modules/_sha3/kcp/KeccakSponge.inc | 15 ++++++++-------
|
||||
3 files changed, 18 insertions(+), 7 deletions(-)
|
||||
create mode 100644 Misc/NEWS.d/next/Security/2022-10-21-13-31-47.gh-issue-98517.SXXGfV.rst
|
||||
|
||||
diff --git a/Lib/test/test_hashlib.py b/Lib/test/test_hashlib.py
|
||||
index 8b53d23ef525..e6cec4e306e5 100644
|
||||
--- a/Lib/test/test_hashlib.py
|
||||
+++ b/Lib/test/test_hashlib.py
|
||||
@@ -434,6 +434,15 @@ def test_case_md5_huge(self, size):
|
||||
def test_case_md5_uintmax(self, size):
|
||||
self.check('md5', b'A'*size, '28138d306ff1b8281f1a9067e1a1a2b3')
|
||||
|
||||
+ @unittest.skipIf(sys.maxsize < _4G - 1, 'test cannot run on 32-bit systems')
|
||||
+ @bigmemtest(size=_4G - 1, memuse=1, dry_run=False)
|
||||
+ def test_sha3_update_overflow(self, size):
|
||||
+ """Regression test for gh-98517 CVE-2022-37454."""
|
||||
+ h = hashlib.sha3_224()
|
||||
+ h.update(b'\x01')
|
||||
+ h.update(b'\x01'*0xffff_ffff)
|
||||
+ self.assertEqual(h.hexdigest(), '80762e8ce6700f114fec0f621fd97c4b9c00147fa052215294cceeed')
|
||||
+
|
||||
# use the three examples from Federal Information Processing Standards
|
||||
# Publication 180-1, Secure Hash Standard, 1995 April 17
|
||||
# http://www.itl.nist.gov/div897/pubs/fip180-1.htm
|
||||
diff --git a/Misc/NEWS.d/next/Security/2022-10-21-13-31-47.gh-issue-98517.SXXGfV.rst b/Misc/NEWS.d/next/Security/2022-10-21-13-31-47.gh-issue-98517.SXXGfV.rst
|
||||
new file mode 100644
|
||||
index 000000000000..2d23a6ad93c7
|
||||
--- /dev/null
|
||||
+++ b/Misc/NEWS.d/next/Security/2022-10-21-13-31-47.gh-issue-98517.SXXGfV.rst
|
||||
@@ -0,0 +1 @@
|
||||
+Port XKCP's fix for the buffer overflows in SHA-3 (CVE-2022-37454).
|
||||
diff --git a/Modules/_sha3/kcp/KeccakSponge.inc b/Modules/_sha3/kcp/KeccakSponge.inc
|
||||
index e10739deafa8..cf92e4db4d36 100644
|
||||
--- a/Modules/_sha3/kcp/KeccakSponge.inc
|
||||
+++ b/Modules/_sha3/kcp/KeccakSponge.inc
|
||||
@@ -171,7 +171,7 @@ int SpongeAbsorb(SpongeInstance *instance, const unsigned char *data, size_t dat
|
||||
i = 0;
|
||||
curData = data;
|
||||
while(i < dataByteLen) {
|
||||
- if ((instance->byteIOIndex == 0) && (dataByteLen >= (i + rateInBytes))) {
|
||||
+ if ((instance->byteIOIndex == 0) && (dataByteLen-i >= rateInBytes)) {
|
||||
#ifdef SnP_FastLoop_Absorb
|
||||
/* processing full blocks first */
|
||||
|
||||
@@ -199,10 +199,10 @@ int SpongeAbsorb(SpongeInstance *instance, const unsigned char *data, size_t dat
|
||||
}
|
||||
else {
|
||||
/* normal lane: using the message queue */
|
||||
-
|
||||
- partialBlock = (unsigned int)(dataByteLen - i);
|
||||
- if (partialBlock+instance->byteIOIndex > rateInBytes)
|
||||
+ if (dataByteLen-i > rateInBytes-instance->byteIOIndex)
|
||||
partialBlock = rateInBytes-instance->byteIOIndex;
|
||||
+ else
|
||||
+ partialBlock = (unsigned int)(dataByteLen - i);
|
||||
#ifdef KeccakReference
|
||||
displayBytes(1, "Block to be absorbed (part)", curData, partialBlock);
|
||||
#endif
|
||||
@@ -281,7 +281,7 @@ int SpongeSqueeze(SpongeInstance *instance, unsigned char *data, size_t dataByte
|
||||
i = 0;
|
||||
curData = data;
|
||||
while(i < dataByteLen) {
|
||||
- if ((instance->byteIOIndex == rateInBytes) && (dataByteLen >= (i + rateInBytes))) {
|
||||
+ if ((instance->byteIOIndex == rateInBytes) && (dataByteLen-i >= rateInBytes)) {
|
||||
for(j=dataByteLen-i; j>=rateInBytes; j-=rateInBytes) {
|
||||
SnP_Permute(instance->state);
|
||||
SnP_ExtractBytes(instance->state, curData, 0, rateInBytes);
|
||||
@@ -299,9 +299,10 @@ int SpongeSqueeze(SpongeInstance *instance, unsigned char *data, size_t dataByte
|
||||
SnP_Permute(instance->state);
|
||||
instance->byteIOIndex = 0;
|
||||
}
|
||||
- partialBlock = (unsigned int)(dataByteLen - i);
|
||||
- if (partialBlock+instance->byteIOIndex > rateInBytes)
|
||||
+ if (dataByteLen-i > rateInBytes-instance->byteIOIndex)
|
||||
partialBlock = rateInBytes-instance->byteIOIndex;
|
||||
+ else
|
||||
+ partialBlock = (unsigned int)(dataByteLen - i);
|
||||
i += partialBlock;
|
||||
|
||||
SnP_ExtractBytes(instance->state, curData, instance->byteIOIndex, partialBlock);
|
||||
80
meta/recipes-devtools/python/python3/CVE-2023-24329.patch
Normal file
80
meta/recipes-devtools/python/python3/CVE-2023-24329.patch
Normal file
@@ -0,0 +1,80 @@
|
||||
From 72d356e3584ebfb8e813a8e9f2cd3dccf233c0d9 Mon Sep 17 00:00:00 2001
|
||||
From: "Miss Islington (bot)"
|
||||
<31488909+miss-islington@users.noreply.github.com>
|
||||
Date: Sun, 13 Nov 2022 11:00:25 -0800
|
||||
Subject: [PATCH] gh-99418: Make urllib.parse.urlparse enforce that a scheme
|
||||
must begin with an alphabetical ASCII character. (GH-99421)
|
||||
|
||||
Prevent urllib.parse.urlparse from accepting schemes that don't begin with an alphabetical ASCII character.
|
||||
|
||||
RFC 3986 defines a scheme like this: `scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )`
|
||||
RFC 2234 defines an ALPHA like this: `ALPHA = %x41-5A / %x61-7A`
|
||||
|
||||
The WHATWG URL spec defines a scheme like this:
|
||||
`"A URL-scheme string must be one ASCII alpha, followed by zero or more of ASCII alphanumeric, U+002B (+), U+002D (-), and U+002E (.)."`
|
||||
(cherry picked from commit 439b9cfaf43080e91c4ad69f312f21fa098befc7)
|
||||
|
||||
Co-authored-by: Ben Kallus <49924171+kenballus@users.noreply.github.com>
|
||||
|
||||
Upstream-Status: Backport [https://github.com/python/cpython/commit/72d356e3584ebfb8e813a8e9f2cd3dccf233c0d9]
|
||||
CVE: CVE-2023-24329
|
||||
Signed-off-by: Vivek Kumbhar <vkumbhar@mvista.com>
|
||||
---
|
||||
Lib/test/test_urlparse.py | 18 ++++++++++++++++++
|
||||
Lib/urllib/parse.py | 2 +-
|
||||
...22-11-12-15-45-51.gh-issue-99418.FxfAXS.rst | 2 ++
|
||||
3 files changed, 21 insertions(+), 1 deletion(-)
|
||||
create mode 100644 Misc/NEWS.d/next/Library/2022-11-12-15-45-51.gh-issue-99418.FxfAXS.rst
|
||||
|
||||
diff --git a/Lib/test/test_urlparse.py b/Lib/test/test_urlparse.py
|
||||
index 0ad3bf1..e1aa913 100644
|
||||
--- a/Lib/test/test_urlparse.py
|
||||
+++ b/Lib/test/test_urlparse.py
|
||||
@@ -735,6 +735,24 @@ class UrlParseTestCase(unittest.TestCase):
|
||||
with self.assertRaises(ValueError):
|
||||
p.port
|
||||
|
||||
+ def test_attributes_bad_scheme(self):
|
||||
+ """Check handling of invalid schemes."""
|
||||
+ for bytes in (False, True):
|
||||
+ for parse in (urllib.parse.urlsplit, urllib.parse.urlparse):
|
||||
+ for scheme in (".", "+", "-", "0", "http&", "६http"):
|
||||
+ with self.subTest(bytes=bytes, parse=parse, scheme=scheme):
|
||||
+ url = scheme + "://www.example.net"
|
||||
+ if bytes:
|
||||
+ if url.isascii():
|
||||
+ url = url.encode("ascii")
|
||||
+ else:
|
||||
+ continue
|
||||
+ p = parse(url)
|
||||
+ if bytes:
|
||||
+ self.assertEqual(p.scheme, b"")
|
||||
+ else:
|
||||
+ self.assertEqual(p.scheme, "")
|
||||
+
|
||||
def test_attributes_without_netloc(self):
|
||||
# This example is straight from RFC 3261. It looks like it
|
||||
# should allow the username, hostname, and port to be filled
|
||||
diff --git a/Lib/urllib/parse.py b/Lib/urllib/parse.py
|
||||
index 979e6d2..2e7a3e2 100644
|
||||
--- a/Lib/urllib/parse.py
|
||||
+++ b/Lib/urllib/parse.py
|
||||
@@ -452,7 +452,7 @@ def urlsplit(url, scheme='', allow_fragments=True):
|
||||
clear_cache()
|
||||
netloc = query = fragment = ''
|
||||
i = url.find(':')
|
||||
- if i > 0:
|
||||
+ if i > 0 and url[0].isascii() and url[0].isalpha():
|
||||
if url[:i] == 'http': # optimize the common case
|
||||
url = url[i+1:]
|
||||
if url[:2] == '//':
|
||||
diff --git a/Misc/NEWS.d/next/Library/2022-11-12-15-45-51.gh-issue-99418.FxfAXS.rst b/Misc/NEWS.d/next/Library/2022-11-12-15-45-51.gh-issue-99418.FxfAXS.rst
|
||||
new file mode 100644
|
||||
index 0000000..0a06e7c
|
||||
--- /dev/null
|
||||
+++ b/Misc/NEWS.d/next/Library/2022-11-12-15-45-51.gh-issue-99418.FxfAXS.rst
|
||||
@@ -0,0 +1,2 @@
|
||||
+Fix bug in :func:`urllib.parse.urlparse` that causes URL schemes that begin
|
||||
+with a digit, a plus sign, or a minus sign to be parsed incorrectly.
|
||||
--
|
||||
2.25.1
|
||||
@@ -4,7 +4,7 @@ DESCRIPTION = "Python is a programming language that lets you work more quickly
|
||||
LICENSE = "PSF-2.0 & BSD-0-Clause"
|
||||
SECTION = "devel/python"
|
||||
|
||||
LIC_FILES_CHKSUM = "file://LICENSE;md5=c84eccf626bb6fde43e6ea5e28d8feb5"
|
||||
LIC_FILES_CHKSUM = "file://LICENSE;md5=07fc4b9a9c0c0e48050ed38a5e72552b"
|
||||
|
||||
SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.xz \
|
||||
file://run-ptest \
|
||||
@@ -34,8 +34,7 @@ SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.xz \
|
||||
file://0001-python3-Do-not-hardcode-lib-for-distutils.patch \
|
||||
file://0020-configure.ac-setup.py-do-not-add-a-curses-include-pa.patch \
|
||||
file://makerace.patch \
|
||||
file://CVE-2022-45061.patch \
|
||||
file://CVE-2022-37454.patch \
|
||||
file://CVE-2023-24329.patch \
|
||||
"
|
||||
|
||||
SRC_URI_append_class-native = " \
|
||||
@@ -44,8 +43,8 @@ SRC_URI_append_class-native = " \
|
||||
file://0001-Don-t-search-system-for-headers-libraries.patch \
|
||||
"
|
||||
|
||||
SRC_URI[md5sum] = "78710eed185b71f4198d354502ff62c9"
|
||||
SRC_URI[sha256sum] = "5d77e278271ba803e9909a41a4f3baca006181c93ada682a5e5fe8dc4a24c5f3"
|
||||
SRC_URI[md5sum] = "70223497e664524303ca2364208647e1"
|
||||
SRC_URI[sha256sum] = "2e54b0c68191f16552f6de2e97a2396540572a219f6bbb28591a137cecc490a9"
|
||||
|
||||
# exclude pre-releases for both python 2.x and 3.x
|
||||
UPSTREAM_CHECK_REGEX = "[Pp]ython-(?P<pver>\d+(\.\d+)+).tar"
|
||||
@@ -137,6 +137,7 @@ SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \
|
||||
file://CVE-2021-3409-4.patch \
|
||||
file://CVE-2021-3409-5.patch \
|
||||
file://hw-display-qxl-Pass-requested-buffer-size-to-qxl_phy.patch \
|
||||
file://CVE-2023-0330.patch \
|
||||
"
|
||||
UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar"
|
||||
|
||||
|
||||
77
meta/recipes-devtools/qemu/qemu/CVE-2023-0330.patch
Normal file
77
meta/recipes-devtools/qemu/qemu/CVE-2023-0330.patch
Normal file
@@ -0,0 +1,77 @@
|
||||
[Ubuntu note: remove fuzz-lsi53c895a-test.c changes since the file does not
|
||||
exist for this release]
|
||||
From b987718bbb1d0eabf95499b976212dd5f0120d75 Mon Sep 17 00:00:00 2001
|
||||
From: Thomas Huth <thuth@redhat.com>
|
||||
Date: Mon, 22 May 2023 11:10:11 +0200
|
||||
Subject: [PATCH] hw/scsi/lsi53c895a: Fix reentrancy issues in the LSI
|
||||
controller (CVE-2023-0330)
|
||||
|
||||
We cannot use the generic reentrancy guard in the LSI code, so
|
||||
we have to manually prevent endless reentrancy here. The problematic
|
||||
lsi_execute_script() function has already a way to detect whether
|
||||
too many instructions have been executed - we just have to slightly
|
||||
change the logic here that it also takes into account if the function
|
||||
has been called too often in a reentrant way.
|
||||
|
||||
The code in fuzz-lsi53c895a-test.c has been taken from an earlier
|
||||
patch by Mauro Matteo Cascella.
|
||||
|
||||
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1563
|
||||
Message-Id: <20230522091011.1082574-1-thuth@redhat.com>
|
||||
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
|
||||
Reviewed-by: Alexander Bulekov <alxndr@bu.edu>
|
||||
Signed-off-by: Thomas Huth <thuth@redhat.com>
|
||||
|
||||
Reference: https://launchpad.net/ubuntu/+source/qemu/1:4.2-3ubuntu6.27
|
||||
|
||||
Upstream-Status: Backport [import from ubuntu https://git.launchpad.net/ubuntu/+source/qemu/tree/debian/patches/CVE-2023-0330.patch?h=ubuntu/focal-security
|
||||
Upstream commit https://gitlab.com/qemu-project/qemu/-/commit/b987718bbb1d0eabf95499b976212dd5f0120d75]
|
||||
CVE: CVE-2023-0330
|
||||
Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
|
||||
---
|
||||
hw/scsi/lsi53c895a.c | 23 +++++++++++++++------
|
||||
tests/qtest/fuzz-lsi53c895a-test.c | 33 ++++++++++++++++++++++++++++++
|
||||
2 files changed, 50 insertions(+), 6 deletions(-)
|
||||
|
||||
--- qemu-4.2.orig/hw/scsi/lsi53c895a.c
|
||||
+++ qemu-4.2/hw/scsi/lsi53c895a.c
|
||||
@@ -1135,15 +1135,24 @@ static void lsi_execute_script(LSIState
|
||||
uint32_t addr, addr_high;
|
||||
int opcode;
|
||||
int insn_processed = 0;
|
||||
+ static int reentrancy_level;
|
||||
+
|
||||
+ reentrancy_level++;
|
||||
|
||||
s->istat1 |= LSI_ISTAT1_SRUN;
|
||||
again:
|
||||
- if (++insn_processed > LSI_MAX_INSN) {
|
||||
- /* Some windows drivers make the device spin waiting for a memory
|
||||
- location to change. If we have been executed a lot of code then
|
||||
- assume this is the case and force an unexpected device disconnect.
|
||||
- This is apparently sufficient to beat the drivers into submission.
|
||||
- */
|
||||
+ /*
|
||||
+ * Some windows drivers make the device spin waiting for a memory location
|
||||
+ * to change. If we have executed more than LSI_MAX_INSN instructions then
|
||||
+ * assume this is the case and force an unexpected device disconnect. This
|
||||
+ * is apparently sufficient to beat the drivers into submission.
|
||||
+ *
|
||||
+ * Another issue (CVE-2023-0330) can occur if the script is programmed to
|
||||
+ * trigger itself again and again. Avoid this problem by stopping after
|
||||
+ * being called multiple times in a reentrant way (8 is an arbitrary value
|
||||
+ * which should be enough for all valid use cases).
|
||||
+ */
|
||||
+ if (++insn_processed > LSI_MAX_INSN || reentrancy_level > 8) {
|
||||
if (!(s->sien0 & LSI_SIST0_UDC)) {
|
||||
qemu_log_mask(LOG_GUEST_ERROR,
|
||||
"lsi_scsi: inf. loop with UDC masked");
|
||||
@@ -1597,6 +1606,8 @@ again:
|
||||
}
|
||||
}
|
||||
trace_lsi_execute_script_stop();
|
||||
+
|
||||
+ reentrancy_level--;
|
||||
}
|
||||
|
||||
static uint8_t lsi_reg_readb(LSIState *s, int offset)
|
||||
@@ -14,6 +14,8 @@ SRC_URI = "https://github.com/apple/cups/releases/download/v${PV}/${BP}-source.t
|
||||
file://0003-cups_1.4.6.bb-Fix-build-on-ppc64.patch \
|
||||
file://0004-cups-fix-multilib-install-file-conflicts.patch\
|
||||
file://CVE-2022-26691.patch \
|
||||
file://CVE-2023-32324.patch \
|
||||
file://CVE-2023-34241.patch \
|
||||
"
|
||||
|
||||
UPSTREAM_CHECK_URI = "https://github.com/apple/cups/releases"
|
||||
|
||||
36
meta/recipes-extended/cups/cups/CVE-2023-32324.patch
Normal file
36
meta/recipes-extended/cups/cups/CVE-2023-32324.patch
Normal file
@@ -0,0 +1,36 @@
|
||||
From 07cbffd11107eed3aaf1c64e35552aec20f792da Mon Sep 17 00:00:00 2001
|
||||
From: Zdenek Dohnal <zdohnal@redhat.com>
|
||||
Date: Thu, 1 Jun 2023 12:04:00 +0200
|
||||
Subject: [PATCH] cups/string.c: Return if `size` is 0 (fixes CVE-2023-32324)
|
||||
|
||||
CVE: CVE-2023-32324
|
||||
Upstream-Status: Backport [https://github.com/OpenPrinting/cups/commit/fd8bc2d32589]
|
||||
|
||||
(cherry picked from commit fd8bc2d32589d1fd91fe1c0521be2a7c0462109e)
|
||||
Signed-off-by: Sanjay Chitroda <schitrod@cisco.com>
|
||||
---
|
||||
cups/string.c | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/cups/string.c b/cups/string.c
|
||||
index 93cdad19..6ef58515 100644
|
||||
--- a/cups/string.c
|
||||
+++ b/cups/string.c
|
||||
@@ -1,6 +1,7 @@
|
||||
/*
|
||||
* String functions for CUPS.
|
||||
*
|
||||
+ * Copyright © 2023 by OpenPrinting.
|
||||
* Copyright © 2007-2019 by Apple Inc.
|
||||
* Copyright © 1997-2007 by Easy Software Products.
|
||||
*
|
||||
@@ -730,6 +731,9 @@ _cups_strlcpy(char *dst, /* O - Destination string */
|
||||
size_t srclen; /* Length of source string */
|
||||
|
||||
|
||||
+ if (size == 0)
|
||||
+ return (0);
|
||||
+
|
||||
/*
|
||||
* Figure out how much room is needed...
|
||||
*/
|
||||
65
meta/recipes-extended/cups/cups/CVE-2023-34241.patch
Normal file
65
meta/recipes-extended/cups/cups/CVE-2023-34241.patch
Normal file
@@ -0,0 +1,65 @@
|
||||
From ffd290b4ab247f82722927ba9b21358daa16dbf1 Mon Sep 17 00:00:00 2001
|
||||
From: Rose <83477269+AtariDreams@users.noreply.github.com>
|
||||
Date: Thu, 1 Jun 2023 11:33:39 -0400
|
||||
Subject: [PATCH] Log result of httpGetHostname BEFORE closing the connection
|
||||
|
||||
httpClose frees the memory of con->http. This is problematic because httpGetHostname then tries to access the memory it points to.
|
||||
|
||||
We have to log the hostname first.
|
||||
|
||||
Upstream-Status: Backport [https://github.com/OpenPrinting/cups/commit/9809947a959e18409dcf562a3466ef246cb90cb2]
|
||||
CVE: CVE-2023-34241
|
||||
Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
|
||||
---
|
||||
scheduler/client.c | 16 +++++++---------
|
||||
1 file changed, 7 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/scheduler/client.c b/scheduler/client.c
|
||||
index 91e441188c..327473a4d1 100644
|
||||
--- a/scheduler/client.c
|
||||
+++ b/scheduler/client.c
|
||||
@@ -193,13 +193,11 @@ cupsdAcceptClient(cupsd_listener_t *lis)/* I - Listener socket */
|
||||
/*
|
||||
* Can't have an unresolved IP address with double-lookups enabled...
|
||||
*/
|
||||
-
|
||||
- httpClose(con->http);
|
||||
-
|
||||
cupsdLogClient(con, CUPSD_LOG_WARN,
|
||||
- "Name lookup failed - connection from %s closed!",
|
||||
+ "Name lookup failed - closing connection from %s!",
|
||||
httpGetHostname(con->http, NULL, 0));
|
||||
|
||||
+ httpClose(con->http);
|
||||
free(con);
|
||||
return;
|
||||
}
|
||||
@@ -235,11 +233,11 @@ cupsdAcceptClient(cupsd_listener_t *lis)/* I - Listener socket */
|
||||
* with double-lookups enabled...
|
||||
*/
|
||||
|
||||
- httpClose(con->http);
|
||||
-
|
||||
cupsdLogClient(con, CUPSD_LOG_WARN,
|
||||
- "IP lookup failed - connection from %s closed!",
|
||||
+ "IP lookup failed - closing connection from %s!",
|
||||
httpGetHostname(con->http, NULL, 0));
|
||||
+
|
||||
+ httpClose(con->http);
|
||||
free(con);
|
||||
return;
|
||||
}
|
||||
@@ -256,11 +254,11 @@ cupsdAcceptClient(cupsd_listener_t *lis)/* I - Listener socket */
|
||||
|
||||
if (!hosts_access(&wrap_req))
|
||||
{
|
||||
- httpClose(con->http);
|
||||
-
|
||||
cupsdLogClient(con, CUPSD_LOG_WARN,
|
||||
"Connection from %s refused by /etc/hosts.allow and "
|
||||
"/etc/hosts.deny rules.", httpGetHostname(con->http, NULL, 0));
|
||||
+
|
||||
+ httpClose(con->http);
|
||||
free(con);
|
||||
return;
|
||||
}
|
||||
46
meta/recipes-extended/sysstat/sysstat/CVE-2023-33204.patch
Normal file
46
meta/recipes-extended/sysstat/sysstat/CVE-2023-33204.patch
Normal file
@@ -0,0 +1,46 @@
|
||||
Origin: https://github.com/opencontainers/runc/commit/6f8dc568e6ab072bb8205b732f04e685bf9237c0
|
||||
Reviewed-by: Sylvain Beucler <beuc@debian.org>
|
||||
Last-Update: 2023-02-18
|
||||
|
||||
From 954ff2e2673cef48f0ed44668c466eab041db387 Mon Sep 17 00:00:00 2001
|
||||
From: Pavel Kopylov <pkopylov@cloudlinux.com>
|
||||
Date: Wed, 17 May 2023 11:33:45 +0200
|
||||
Subject: [PATCH] Fix an overflow which is still possible for some values.
|
||||
|
||||
CVE: CVE-2023-33204
|
||||
Upstream-Status: Backport [ upstream: https://github.com/sysstat/sysstat/commit/6f8dc568e6ab072bb8205b732f04e685bf9237c0
|
||||
debian: http://security.debian.org/debian-security/pool/updates/main/s/sysstat/sysstat_12.0.3-2+deb10u2.debian.tar.xz ]
|
||||
Signed-off-by: Lee Chee Yang <chee.yang.lee@intel.com>
|
||||
|
||||
---
|
||||
common.c | 7 +++++--
|
||||
1 file changed, 5 insertions(+), 2 deletions(-)
|
||||
|
||||
Index: sysstat-12.0.3/common.c
|
||||
===================================================================
|
||||
--- sysstat-12.0.3.orig/common.c
|
||||
+++ sysstat-12.0.3/common.c
|
||||
@@ -1449,15 +1449,16 @@ int parse_values(char *strargv, unsigned
|
||||
*/
|
||||
void check_overflow(size_t val1, size_t val2, size_t val3)
|
||||
{
|
||||
- if ((unsigned long long) val1 *
|
||||
- (unsigned long long) val2 *
|
||||
- (unsigned long long) val3 > UINT_MAX) {
|
||||
+ if ((val1 != 0) && (val2 != 0) && (val3 != 0) &&
|
||||
+ (((unsigned long long) UINT_MAX / (unsigned long long) val1 <
|
||||
+ (unsigned long long) val2) ||
|
||||
+ ((unsigned long long) UINT_MAX / ((unsigned long long) val1 * (unsigned long long) val2) <
|
||||
+ (unsigned long long) val3))) {
|
||||
#ifdef DEBUG
|
||||
- fprintf(stderr, "%s: Overflow detected (%llu). Aborting...\n",
|
||||
- __FUNCTION__,
|
||||
- (unsigned long long) val1 * (unsigned long long) val2 * (unsigned long long) val3);
|
||||
+ fprintf(stderr, "%s: Overflow detected (%u,%u,%u). Aborting...\n",
|
||||
+ __FUNCTION__, val1, val2, val3);
|
||||
#endif
|
||||
- exit(4);
|
||||
+ exit(4);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=a23a74b3f4caf9616230789d94217acb"
|
||||
|
||||
SRC_URI += "file://0001-configure.in-remove-check-for-chkconfig.patch \
|
||||
file://CVE-2022-39377.patch \
|
||||
file://CVE-2023-33204.patch \
|
||||
"
|
||||
|
||||
SRC_URI[md5sum] = "9dfff5fac24e35bd92fb7896debf2ffb"
|
||||
|
||||
@@ -6,7 +6,7 @@ SECTION = "base"
|
||||
LICENSE = "PD & BSD-3-Clause"
|
||||
LIC_FILES_CHKSUM = "file://LICENSE;md5=c679c9d6b02bc2757b3eaf8f53c43fba"
|
||||
|
||||
PV = "2022g"
|
||||
PV = "2023c"
|
||||
|
||||
SRC_URI =" http://www.iana.org/time-zones/repository/releases/tzcode${PV}.tar.gz;name=tzcode \
|
||||
http://www.iana.org/time-zones/repository/releases/tzdata${PV}.tar.gz;name=tzdata \
|
||||
@@ -14,5 +14,5 @@ SRC_URI =" http://www.iana.org/time-zones/repository/releases/tzcode${PV}.tar.gz
|
||||
|
||||
UPSTREAM_CHECK_URI = "http://www.iana.org/time-zones"
|
||||
|
||||
SRC_URI[tzcode.sha256sum] = "9610bb0b9656ff404c361a41f3286da53064b5469d84f00c9cb2314c8614da74"
|
||||
SRC_URI[tzdata.sha256sum] = "4491db8281ae94a84d939e427bdd83dc389f26764d27d9a5c52d782c16764478"
|
||||
SRC_URI[tzcode.sha256sum] = "46d17f2bb19ad73290f03a203006152e0fa0d7b11e5b71467c4a823811b214e7"
|
||||
SRC_URI[tzdata.sha256sum] = "3f510b5d1b4ae9bb38e485aa302a776b317fb3637bdb6404c4adf7b6cadd965c"
|
||||
|
||||
457
meta/recipes-graphics/jpeg/files/CVE-2020-35538-1.patch
Normal file
457
meta/recipes-graphics/jpeg/files/CVE-2020-35538-1.patch
Normal file
@@ -0,0 +1,457 @@
|
||||
From 9120a247436e84c0b4eea828cb11e8f665fcde30 Mon Sep 17 00:00:00 2001
|
||||
From: DRC <information@libjpeg-turbo.org>
|
||||
Date: Thu, 23 Jul 2020 21:24:38 -0500
|
||||
Subject: [PATCH] Fix jpeg_skip_scanlines() segfault w/merged upsamp
|
||||
|
||||
The additional segfault mentioned in #244 was due to the fact that
|
||||
the merged upsamplers use a different private structure than the
|
||||
non-merged upsamplers. jpeg_skip_scanlines() was assuming the latter, so
|
||||
when merged upsampling was enabled, jpeg_skip_scanlines() clobbered one
|
||||
of the IDCT method pointers in the merged upsampler's private structure.
|
||||
|
||||
For reasons unknown, the test image in #441 did not encounter this
|
||||
segfault (too small?), but it encountered an issue similar to the one
|
||||
fixed in 5bc43c7821df982f65aa1c738f67fbf7cba8bd69, whereby it was
|
||||
necessary to set up a dummy postprocessing function in
|
||||
read_and_discard_scanlines() when merged upsampling was enabled.
|
||||
Failing to do so caused either a segfault in merged_2v_upsample() (due
|
||||
to a NULL pointer being passed to jcopy_sample_rows()) or an error
|
||||
("Corrupt JPEG data: premature end of data segment"), depending on the
|
||||
number of scanlines skipped and whether the first scanline skipped was
|
||||
an odd- or even-numbered row.
|
||||
|
||||
Fixes #441
|
||||
Fixes #244 (for real this time)
|
||||
|
||||
Upstream-Status: Backport [https://github.com/libjpeg-turbo/libjpeg-turbo/commit/9120a247436e84c0b4eea828cb11e8f665fcde30]
|
||||
CVE: CVE-2020-35538
|
||||
Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
|
||||
---
|
||||
ChangeLog.md | 7 +++++
|
||||
jdapistd.c | 72 ++++++++++++++++++++++++++++++++++++++++++++++------
|
||||
jdmerge.c | 46 +++++++--------------------------
|
||||
jdmerge.h | 47 ++++++++++++++++++++++++++++++++++
|
||||
jdmrg565.c | 10 ++++----
|
||||
jdmrgext.c | 6 ++---
|
||||
6 files changed, 135 insertions(+), 53 deletions(-)
|
||||
create mode 100644 jdmerge.h
|
||||
|
||||
diff --git a/ChangeLog.md b/ChangeLog.md
|
||||
index 2ebfe71..19d18fa 100644
|
||||
--- a/ChangeLog.md
|
||||
+++ b/ChangeLog.md
|
||||
@@ -54,6 +54,13 @@ a 16-bit binary PGM file into an RGB image buffer.
|
||||
generated when using the `tjLoadImage()` function to load a 16-bit binary PPM
|
||||
file into an extended RGB image buffer.
|
||||
|
||||
+2. Fixed segfaults or "Corrupt JPEG data: premature end of data segment" errors
|
||||
+in `jpeg_skip_scanlines()` that occurred when decompressing 4:2:2 or 4:2:0 JPEG
|
||||
+images using the merged (non-fancy) upsampling algorithms (that is, when
|
||||
+setting `cinfo.do_fancy_upsampling` to `FALSE`.) 2.0.0[6] was a similar fix,
|
||||
+but it did not cover all cases.
|
||||
+
|
||||
+
|
||||
2.0.3
|
||||
=====
|
||||
|
||||
diff --git a/jdapistd.c b/jdapistd.c
|
||||
index 2c808fa..91da642 100644
|
||||
--- a/jdapistd.c
|
||||
+++ b/jdapistd.c
|
||||
@@ -4,7 +4,7 @@
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1994-1996, Thomas G. Lane.
|
||||
* libjpeg-turbo Modifications:
|
||||
- * Copyright (C) 2010, 2015-2018, D. R. Commander.
|
||||
+ * Copyright (C) 2010, 2015-2018, 2020, D. R. Commander.
|
||||
* Copyright (C) 2015, Google, Inc.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
@@ -21,6 +21,8 @@
|
||||
#include "jinclude.h"
|
||||
#include "jdmainct.h"
|
||||
#include "jdcoefct.h"
|
||||
+#include "jdmaster.h"
|
||||
+#include "jdmerge.h"
|
||||
#include "jdsample.h"
|
||||
#include "jmemsys.h"
|
||||
|
||||
@@ -304,6 +306,16 @@ noop_quantize(j_decompress_ptr cinfo, JSAMPARRAY input_buf,
|
||||
}
|
||||
|
||||
|
||||
+/* Dummy postprocessing function used by jpeg_skip_scanlines() */
|
||||
+LOCAL(void)
|
||||
+noop_post_process (j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
+ JDIMENSION *in_row_group_ctr,
|
||||
+ JDIMENSION in_row_groups_avail, JSAMPARRAY output_buf,
|
||||
+ JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail)
|
||||
+{
|
||||
+}
|
||||
+
|
||||
+
|
||||
/*
|
||||
* In some cases, it is best to call jpeg_read_scanlines() and discard the
|
||||
* output, rather than skipping the scanlines, because this allows us to
|
||||
@@ -316,11 +328,17 @@ LOCAL(void)
|
||||
read_and_discard_scanlines(j_decompress_ptr cinfo, JDIMENSION num_lines)
|
||||
{
|
||||
JDIMENSION n;
|
||||
+ my_master_ptr master = (my_master_ptr)cinfo->master;
|
||||
void (*color_convert) (j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
JDIMENSION input_row, JSAMPARRAY output_buf,
|
||||
int num_rows) = NULL;
|
||||
void (*color_quantize) (j_decompress_ptr cinfo, JSAMPARRAY input_buf,
|
||||
JSAMPARRAY output_buf, int num_rows) = NULL;
|
||||
+ void (*post_process_data) (j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
+ JDIMENSION *in_row_group_ctr,
|
||||
+ JDIMENSION in_row_groups_avail,
|
||||
+ JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
|
||||
+ JDIMENSION out_rows_avail) = NULL;
|
||||
|
||||
if (cinfo->cconvert && cinfo->cconvert->color_convert) {
|
||||
color_convert = cinfo->cconvert->color_convert;
|
||||
@@ -332,6 +350,12 @@ read_and_discard_scanlines(j_decompress_ptr cinfo, JDIMENSION num_lines)
|
||||
cinfo->cquantize->color_quantize = noop_quantize;
|
||||
}
|
||||
|
||||
+ if (master->using_merged_upsample && cinfo->post &&
|
||||
+ cinfo->post->post_process_data) {
|
||||
+ post_process_data = cinfo->post->post_process_data;
|
||||
+ cinfo->post->post_process_data = noop_post_process;
|
||||
+ }
|
||||
+
|
||||
for (n = 0; n < num_lines; n++)
|
||||
jpeg_read_scanlines(cinfo, NULL, 1);
|
||||
|
||||
@@ -340,6 +364,9 @@ read_and_discard_scanlines(j_decompress_ptr cinfo, JDIMENSION num_lines)
|
||||
|
||||
if (color_quantize)
|
||||
cinfo->cquantize->color_quantize = color_quantize;
|
||||
+
|
||||
+ if (post_process_data)
|
||||
+ cinfo->post->post_process_data = post_process_data;
|
||||
}
|
||||
|
||||
|
||||
@@ -382,7 +409,7 @@ jpeg_skip_scanlines(j_decompress_ptr cinfo, JDIMENSION num_lines)
|
||||
{
|
||||
my_main_ptr main_ptr = (my_main_ptr)cinfo->main;
|
||||
my_coef_ptr coef = (my_coef_ptr)cinfo->coef;
|
||||
- my_upsample_ptr upsample = (my_upsample_ptr)cinfo->upsample;
|
||||
+ my_master_ptr master = (my_master_ptr)cinfo->master;
|
||||
JDIMENSION i, x;
|
||||
int y;
|
||||
JDIMENSION lines_per_iMCU_row, lines_left_in_iMCU_row, lines_after_iMCU_row;
|
||||
@@ -445,8 +472,16 @@ jpeg_skip_scanlines(j_decompress_ptr cinfo, JDIMENSION num_lines)
|
||||
main_ptr->buffer_full = FALSE;
|
||||
main_ptr->rowgroup_ctr = 0;
|
||||
main_ptr->context_state = CTX_PREPARE_FOR_IMCU;
|
||||
- upsample->next_row_out = cinfo->max_v_samp_factor;
|
||||
- upsample->rows_to_go = cinfo->output_height - cinfo->output_scanline;
|
||||
+ if (master->using_merged_upsample) {
|
||||
+ my_merged_upsample_ptr upsample =
|
||||
+ (my_merged_upsample_ptr)cinfo->upsample;
|
||||
+ upsample->spare_full = FALSE;
|
||||
+ upsample->rows_to_go = cinfo->output_height - cinfo->output_scanline;
|
||||
+ } else {
|
||||
+ my_upsample_ptr upsample = (my_upsample_ptr)cinfo->upsample;
|
||||
+ upsample->next_row_out = cinfo->max_v_samp_factor;
|
||||
+ upsample->rows_to_go = cinfo->output_height - cinfo->output_scanline;
|
||||
+ }
|
||||
}
|
||||
|
||||
/* Skipping is much simpler when context rows are not required. */
|
||||
@@ -458,8 +493,16 @@ jpeg_skip_scanlines(j_decompress_ptr cinfo, JDIMENSION num_lines)
|
||||
cinfo->output_scanline += lines_left_in_iMCU_row;
|
||||
main_ptr->buffer_full = FALSE;
|
||||
main_ptr->rowgroup_ctr = 0;
|
||||
- upsample->next_row_out = cinfo->max_v_samp_factor;
|
||||
- upsample->rows_to_go = cinfo->output_height - cinfo->output_scanline;
|
||||
+ if (master->using_merged_upsample) {
|
||||
+ my_merged_upsample_ptr upsample =
|
||||
+ (my_merged_upsample_ptr)cinfo->upsample;
|
||||
+ upsample->spare_full = FALSE;
|
||||
+ upsample->rows_to_go = cinfo->output_height - cinfo->output_scanline;
|
||||
+ } else {
|
||||
+ my_upsample_ptr upsample = (my_upsample_ptr)cinfo->upsample;
|
||||
+ upsample->next_row_out = cinfo->max_v_samp_factor;
|
||||
+ upsample->rows_to_go = cinfo->output_height - cinfo->output_scanline;
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -494,7 +537,14 @@ jpeg_skip_scanlines(j_decompress_ptr cinfo, JDIMENSION num_lines)
|
||||
cinfo->output_iMCU_row += lines_to_skip / lines_per_iMCU_row;
|
||||
increment_simple_rowgroup_ctr(cinfo, lines_to_read);
|
||||
}
|
||||
- upsample->rows_to_go = cinfo->output_height - cinfo->output_scanline;
|
||||
+ if (master->using_merged_upsample) {
|
||||
+ my_merged_upsample_ptr upsample =
|
||||
+ (my_merged_upsample_ptr)cinfo->upsample;
|
||||
+ upsample->rows_to_go = cinfo->output_height - cinfo->output_scanline;
|
||||
+ } else {
|
||||
+ my_upsample_ptr upsample = (my_upsample_ptr)cinfo->upsample;
|
||||
+ upsample->rows_to_go = cinfo->output_height - cinfo->output_scanline;
|
||||
+ }
|
||||
return num_lines;
|
||||
}
|
||||
|
||||
@@ -535,7 +585,13 @@ jpeg_skip_scanlines(j_decompress_ptr cinfo, JDIMENSION num_lines)
|
||||
* bit odd, since "rows_to_go" seems to be redundantly keeping track of
|
||||
* output_scanline.
|
||||
*/
|
||||
- upsample->rows_to_go = cinfo->output_height - cinfo->output_scanline;
|
||||
+ if (master->using_merged_upsample) {
|
||||
+ my_merged_upsample_ptr upsample = (my_merged_upsample_ptr)cinfo->upsample;
|
||||
+ upsample->rows_to_go = cinfo->output_height - cinfo->output_scanline;
|
||||
+ } else {
|
||||
+ my_upsample_ptr upsample = (my_upsample_ptr)cinfo->upsample;
|
||||
+ upsample->rows_to_go = cinfo->output_height - cinfo->output_scanline;
|
||||
+ }
|
||||
|
||||
/* Always skip the requested number of lines. */
|
||||
return num_lines;
|
||||
diff --git a/jdmerge.c b/jdmerge.c
|
||||
index dff5a35..833ad67 100644
|
||||
--- a/jdmerge.c
|
||||
+++ b/jdmerge.c
|
||||
@@ -5,7 +5,7 @@
|
||||
* Copyright (C) 1994-1996, Thomas G. Lane.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
|
||||
- * Copyright (C) 2009, 2011, 2014-2015, D. R. Commander.
|
||||
+ * Copyright (C) 2009, 2011, 2014-2015, 2020, D. R. Commander.
|
||||
* Copyright (C) 2013, Linaro Limited.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
@@ -40,41 +40,13 @@
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
+#include "jdmerge.h"
|
||||
#include "jsimd.h"
|
||||
#include "jconfigint.h"
|
||||
|
||||
#ifdef UPSAMPLE_MERGING_SUPPORTED
|
||||
|
||||
|
||||
-/* Private subobject */
|
||||
-
|
||||
-typedef struct {
|
||||
- struct jpeg_upsampler pub; /* public fields */
|
||||
-
|
||||
- /* Pointer to routine to do actual upsampling/conversion of one row group */
|
||||
- void (*upmethod) (j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
- JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);
|
||||
-
|
||||
- /* Private state for YCC->RGB conversion */
|
||||
- int *Cr_r_tab; /* => table for Cr to R conversion */
|
||||
- int *Cb_b_tab; /* => table for Cb to B conversion */
|
||||
- JLONG *Cr_g_tab; /* => table for Cr to G conversion */
|
||||
- JLONG *Cb_g_tab; /* => table for Cb to G conversion */
|
||||
-
|
||||
- /* For 2:1 vertical sampling, we produce two output rows at a time.
|
||||
- * We need a "spare" row buffer to hold the second output row if the
|
||||
- * application provides just a one-row buffer; we also use the spare
|
||||
- * to discard the dummy last row if the image height is odd.
|
||||
- */
|
||||
- JSAMPROW spare_row;
|
||||
- boolean spare_full; /* T if spare buffer is occupied */
|
||||
-
|
||||
- JDIMENSION out_row_width; /* samples per output row */
|
||||
- JDIMENSION rows_to_go; /* counts rows remaining in image */
|
||||
-} my_upsampler;
|
||||
-
|
||||
-typedef my_upsampler *my_upsample_ptr;
|
||||
-
|
||||
#define SCALEBITS 16 /* speediest right-shift on some machines */
|
||||
#define ONE_HALF ((JLONG)1 << (SCALEBITS - 1))
|
||||
#define FIX(x) ((JLONG)((x) * (1L << SCALEBITS) + 0.5))
|
||||
@@ -189,7 +161,7 @@ typedef my_upsampler *my_upsample_ptr;
|
||||
LOCAL(void)
|
||||
build_ycc_rgb_table(j_decompress_ptr cinfo)
|
||||
{
|
||||
- my_upsample_ptr upsample = (my_upsample_ptr)cinfo->upsample;
|
||||
+ my_merged_upsample_ptr upsample = (my_merged_upsample_ptr)cinfo->upsample;
|
||||
int i;
|
||||
JLONG x;
|
||||
SHIFT_TEMPS
|
||||
@@ -232,7 +204,7 @@ build_ycc_rgb_table(j_decompress_ptr cinfo)
|
||||
METHODDEF(void)
|
||||
start_pass_merged_upsample(j_decompress_ptr cinfo)
|
||||
{
|
||||
- my_upsample_ptr upsample = (my_upsample_ptr)cinfo->upsample;
|
||||
+ my_merged_upsample_ptr upsample = (my_merged_upsample_ptr)cinfo->upsample;
|
||||
|
||||
/* Mark the spare buffer empty */
|
||||
upsample->spare_full = FALSE;
|
||||
@@ -254,7 +226,7 @@ merged_2v_upsample(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail)
|
||||
/* 2:1 vertical sampling case: may need a spare row. */
|
||||
{
|
||||
- my_upsample_ptr upsample = (my_upsample_ptr)cinfo->upsample;
|
||||
+ my_merged_upsample_ptr upsample = (my_merged_upsample_ptr)cinfo->upsample;
|
||||
JSAMPROW work_ptrs[2];
|
||||
JDIMENSION num_rows; /* number of rows returned to caller */
|
||||
|
||||
@@ -305,7 +277,7 @@ merged_1v_upsample(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail)
|
||||
/* 1:1 vertical sampling case: much easier, never need a spare row. */
|
||||
{
|
||||
- my_upsample_ptr upsample = (my_upsample_ptr)cinfo->upsample;
|
||||
+ my_merged_upsample_ptr upsample = (my_merged_upsample_ptr)cinfo->upsample;
|
||||
|
||||
/* Just do the upsampling. */
|
||||
(*upsample->upmethod) (cinfo, input_buf, *in_row_group_ctr,
|
||||
@@ -566,11 +538,11 @@ h2v2_merged_upsample_565D(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
GLOBAL(void)
|
||||
jinit_merged_upsampler(j_decompress_ptr cinfo)
|
||||
{
|
||||
- my_upsample_ptr upsample;
|
||||
+ my_merged_upsample_ptr upsample;
|
||||
|
||||
- upsample = (my_upsample_ptr)
|
||||
+ upsample = (my_merged_upsample_ptr)
|
||||
(*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
|
||||
- sizeof(my_upsampler));
|
||||
+ sizeof(my_merged_upsampler));
|
||||
cinfo->upsample = (struct jpeg_upsampler *)upsample;
|
||||
upsample->pub.start_pass = start_pass_merged_upsample;
|
||||
upsample->pub.need_context_rows = FALSE;
|
||||
diff --git a/jdmerge.h b/jdmerge.h
|
||||
new file mode 100644
|
||||
index 0000000..b583396
|
||||
--- /dev/null
|
||||
+++ b/jdmerge.h
|
||||
@@ -0,0 +1,47 @@
|
||||
+/*
|
||||
+ * jdmerge.h
|
||||
+ *
|
||||
+ * This file was part of the Independent JPEG Group's software:
|
||||
+ * Copyright (C) 1994-1996, Thomas G. Lane.
|
||||
+ * libjpeg-turbo Modifications:
|
||||
+ * Copyright (C) 2020, D. R. Commander.
|
||||
+ * For conditions of distribution and use, see the accompanying README.ijg
|
||||
+ * file.
|
||||
+ */
|
||||
+
|
||||
+#define JPEG_INTERNALS
|
||||
+#include "jpeglib.h"
|
||||
+
|
||||
+#ifdef UPSAMPLE_MERGING_SUPPORTED
|
||||
+
|
||||
+
|
||||
+/* Private subobject */
|
||||
+
|
||||
+typedef struct {
|
||||
+ struct jpeg_upsampler pub; /* public fields */
|
||||
+
|
||||
+ /* Pointer to routine to do actual upsampling/conversion of one row group */
|
||||
+ void (*upmethod) (j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
+ JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);
|
||||
+
|
||||
+ /* Private state for YCC->RGB conversion */
|
||||
+ int *Cr_r_tab; /* => table for Cr to R conversion */
|
||||
+ int *Cb_b_tab; /* => table for Cb to B conversion */
|
||||
+ JLONG *Cr_g_tab; /* => table for Cr to G conversion */
|
||||
+ JLONG *Cb_g_tab; /* => table for Cb to G conversion */
|
||||
+
|
||||
+ /* For 2:1 vertical sampling, we produce two output rows at a time.
|
||||
+ * We need a "spare" row buffer to hold the second output row if the
|
||||
+ * application provides just a one-row buffer; we also use the spare
|
||||
+ * to discard the dummy last row if the image height is odd.
|
||||
+ */
|
||||
+ JSAMPROW spare_row;
|
||||
+ boolean spare_full; /* T if spare buffer is occupied */
|
||||
+
|
||||
+ JDIMENSION out_row_width; /* samples per output row */
|
||||
+ JDIMENSION rows_to_go; /* counts rows remaining in image */
|
||||
+} my_merged_upsampler;
|
||||
+
|
||||
+typedef my_merged_upsampler *my_merged_upsample_ptr;
|
||||
+
|
||||
+#endif /* UPSAMPLE_MERGING_SUPPORTED */
|
||||
diff --git a/jdmrg565.c b/jdmrg565.c
|
||||
index 1b87e37..53f1e16 100644
|
||||
--- a/jdmrg565.c
|
||||
+++ b/jdmrg565.c
|
||||
@@ -5,7 +5,7 @@
|
||||
* Copyright (C) 1994-1996, Thomas G. Lane.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2013, Linaro Limited.
|
||||
- * Copyright (C) 2014-2015, 2018, D. R. Commander.
|
||||
+ * Copyright (C) 2014-2015, 2018, 2020, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
@@ -19,7 +19,7 @@ h2v1_merged_upsample_565_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
JDIMENSION in_row_group_ctr,
|
||||
JSAMPARRAY output_buf)
|
||||
{
|
||||
- my_upsample_ptr upsample = (my_upsample_ptr)cinfo->upsample;
|
||||
+ my_merged_upsample_ptr upsample = (my_merged_upsample_ptr)cinfo->upsample;
|
||||
register int y, cred, cgreen, cblue;
|
||||
int cb, cr;
|
||||
register JSAMPROW outptr;
|
||||
@@ -90,7 +90,7 @@ h2v1_merged_upsample_565D_internal(j_decompress_ptr cinfo,
|
||||
JDIMENSION in_row_group_ctr,
|
||||
JSAMPARRAY output_buf)
|
||||
{
|
||||
- my_upsample_ptr upsample = (my_upsample_ptr)cinfo->upsample;
|
||||
+ my_merged_upsample_ptr upsample = (my_merged_upsample_ptr)cinfo->upsample;
|
||||
register int y, cred, cgreen, cblue;
|
||||
int cb, cr;
|
||||
register JSAMPROW outptr;
|
||||
@@ -163,7 +163,7 @@ h2v2_merged_upsample_565_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
JDIMENSION in_row_group_ctr,
|
||||
JSAMPARRAY output_buf)
|
||||
{
|
||||
- my_upsample_ptr upsample = (my_upsample_ptr)cinfo->upsample;
|
||||
+ my_merged_upsample_ptr upsample = (my_merged_upsample_ptr)cinfo->upsample;
|
||||
register int y, cred, cgreen, cblue;
|
||||
int cb, cr;
|
||||
register JSAMPROW outptr0, outptr1;
|
||||
@@ -259,7 +259,7 @@ h2v2_merged_upsample_565D_internal(j_decompress_ptr cinfo,
|
||||
JDIMENSION in_row_group_ctr,
|
||||
JSAMPARRAY output_buf)
|
||||
{
|
||||
- my_upsample_ptr upsample = (my_upsample_ptr)cinfo->upsample;
|
||||
+ my_merged_upsample_ptr upsample = (my_merged_upsample_ptr)cinfo->upsample;
|
||||
register int y, cred, cgreen, cblue;
|
||||
int cb, cr;
|
||||
register JSAMPROW outptr0, outptr1;
|
||||
diff --git a/jdmrgext.c b/jdmrgext.c
|
||||
index b1c27df..c9a44d8 100644
|
||||
--- a/jdmrgext.c
|
||||
+++ b/jdmrgext.c
|
||||
@@ -4,7 +4,7 @@
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1994-1996, Thomas G. Lane.
|
||||
* libjpeg-turbo Modifications:
|
||||
- * Copyright (C) 2011, 2015, D. R. Commander.
|
||||
+ * Copyright (C) 2011, 2015, 2020, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
@@ -25,7 +25,7 @@ h2v1_merged_upsample_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
JDIMENSION in_row_group_ctr,
|
||||
JSAMPARRAY output_buf)
|
||||
{
|
||||
- my_upsample_ptr upsample = (my_upsample_ptr)cinfo->upsample;
|
||||
+ my_merged_upsample_ptr upsample = (my_merged_upsample_ptr)cinfo->upsample;
|
||||
register int y, cred, cgreen, cblue;
|
||||
int cb, cr;
|
||||
register JSAMPROW outptr;
|
||||
@@ -97,7 +97,7 @@ h2v2_merged_upsample_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
JDIMENSION in_row_group_ctr,
|
||||
JSAMPARRAY output_buf)
|
||||
{
|
||||
- my_upsample_ptr upsample = (my_upsample_ptr)cinfo->upsample;
|
||||
+ my_merged_upsample_ptr upsample = (my_merged_upsample_ptr)cinfo->upsample;
|
||||
register int y, cred, cgreen, cblue;
|
||||
int cb, cr;
|
||||
register JSAMPROW outptr0, outptr1;
|
||||
--
|
||||
2.25.1
|
||||
|
||||
400
meta/recipes-graphics/jpeg/files/CVE-2020-35538-2.patch
Normal file
400
meta/recipes-graphics/jpeg/files/CVE-2020-35538-2.patch
Normal file
@@ -0,0 +1,400 @@
|
||||
From a46c111d9f3642f0ef3819e7298846ccc61869e0 Mon Sep 17 00:00:00 2001
|
||||
From: DRC <information@libjpeg-turbo.org>
|
||||
Date: Mon, 27 Jul 2020 14:21:23 -0500
|
||||
Subject: [PATCH] Further jpeg_skip_scanlines() fixes
|
||||
|
||||
- Introduce a partial image decompression regression test script that
|
||||
validates the correctness of jpeg_skip_scanlines() and
|
||||
jpeg_crop_scanlines() for a variety of cropping regions and libjpeg
|
||||
settings.
|
||||
|
||||
This regression test catches the following issues:
|
||||
#182, fixed in 5bc43c7
|
||||
#237, fixed in 6e95c08
|
||||
#244, fixed in 398c1e9
|
||||
#441, fully fixed in this commit
|
||||
|
||||
It does not catch the following issues:
|
||||
#194, fixed in 773040f
|
||||
#244 (additional segfault), fixed in
|
||||
9120a24
|
||||
|
||||
- Modify the libjpeg-turbo regression test suite (make test) so that it
|
||||
checks for the issue reported in #441 (segfault in
|
||||
jpeg_skip_scanlines() when used with 4:2:0 merged upsampling/color
|
||||
conversion.)
|
||||
|
||||
- Fix issues in jpeg_skip_scanlines() that caused incorrect output with
|
||||
h2v2 (4:2:0) merged upsampling/color conversion. The previous commit
|
||||
fixed the segfault reported in #441, but that was a symptom of a
|
||||
larger problem. Because merged 4:2:0 upsampling uses a "spare row"
|
||||
buffer, it is necessary to allow the upsampler to run when skipping
|
||||
rows (fancy 4:2:0 upsampling, which uses context rows, also requires
|
||||
this.) Otherwise, if skipping starts at an odd-numbered row, the
|
||||
output image will be incorrect.
|
||||
|
||||
- Throw an error if jpeg_skip_scanlines() is called with two-pass color
|
||||
quantization enabled. With two-pass color quantization, the first
|
||||
pass occurs within jpeg_start_decompress(), so subsequent calls to
|
||||
jpeg_skip_scanlines() interfere with the multipass state and prevent
|
||||
the second pass from occurring during subsequent calls to
|
||||
jpeg_read_scanlines().
|
||||
|
||||
Upstream-Status: Backport [https://github.com/libjpeg-turbo/libjpeg-turbo/commit/a46c111d9f3642f0ef3819e7298846ccc61869e0]
|
||||
CVE: CVE-2020-35538
|
||||
Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
|
||||
---
|
||||
CMakeLists.txt | 9 +++--
|
||||
ChangeLog.md | 15 +++++---
|
||||
croptest.in | 95 ++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
jdapistd.c | 70 +++++++++++--------------------------
|
||||
libjpeg.txt | 6 ++--
|
||||
5 files changed, 136 insertions(+), 59 deletions(-)
|
||||
create mode 100755 croptest.in
|
||||
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index aee74c9..de451f4 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -753,7 +753,7 @@ else()
|
||||
set(MD5_PPM_3x2_IFAST fd283664b3b49127984af0a7f118fccd)
|
||||
set(MD5_JPEG_420_ISLOW_ARI e986fb0a637a8d833d96e8a6d6d84ea1)
|
||||
set(MD5_JPEG_444_ISLOW_PROGARI 0a8f1c8f66e113c3cf635df0a475a617)
|
||||
- set(MD5_PPM_420M_IFAST_ARI 72b59a99bcf1de24c5b27d151bde2437)
|
||||
+ set(MD5_PPM_420M_IFAST_ARI 57251da28a35b46eecb7177d82d10e0e)
|
||||
set(MD5_JPEG_420_ISLOW 9a68f56bc76e466aa7e52f415d0f4a5f)
|
||||
set(MD5_PPM_420M_ISLOW_2_1 9f9de8c0612f8d06869b960b05abf9c9)
|
||||
set(MD5_PPM_420M_ISLOW_15_8 b6875bc070720b899566cc06459b63b7)
|
||||
@@ -1131,7 +1131,7 @@ foreach(libtype ${TEST_LIBTYPES})
|
||||
|
||||
if(WITH_ARITH_DEC)
|
||||
# CC: RGB->YCC SAMP: h2v2 merged IDCT: ifast ENT: arith
|
||||
- add_bittest(djpeg 420m-ifast-ari "-fast;-ppm"
|
||||
+ add_bittest(djpeg 420m-ifast-ari "-fast;-skip;1,20;-ppm"
|
||||
testout_420m_ifast_ari.ppm ${TESTIMAGES}/testimgari.jpg
|
||||
${MD5_PPM_420M_IFAST_ARI})
|
||||
|
||||
@@ -1266,6 +1266,11 @@ endforeach()
|
||||
add_custom_target(testclean COMMAND ${CMAKE_COMMAND} -P
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/cmakescripts/testclean.cmake)
|
||||
|
||||
+configure_file(croptest.in croptest @ONLY)
|
||||
+add_custom_target(croptest
|
||||
+ COMMAND echo croptest
|
||||
+ COMMAND ${BASH} ${CMAKE_CURRENT_BINARY_DIR}/croptest)
|
||||
+
|
||||
if(WITH_TURBOJPEG)
|
||||
configure_file(tjbenchtest.in tjbenchtest @ONLY)
|
||||
configure_file(tjexampletest.in tjexampletest @ONLY)
|
||||
diff --git a/ChangeLog.md b/ChangeLog.md
|
||||
index 19d18fa..4562eff 100644
|
||||
--- a/ChangeLog.md
|
||||
+++ b/ChangeLog.md
|
||||
@@ -54,11 +54,16 @@ a 16-bit binary PGM file into an RGB image buffer.
|
||||
generated when using the `tjLoadImage()` function to load a 16-bit binary PPM
|
||||
file into an extended RGB image buffer.
|
||||
|
||||
-2. Fixed segfaults or "Corrupt JPEG data: premature end of data segment" errors
|
||||
-in `jpeg_skip_scanlines()` that occurred when decompressing 4:2:2 or 4:2:0 JPEG
|
||||
-images using the merged (non-fancy) upsampling algorithms (that is, when
|
||||
-setting `cinfo.do_fancy_upsampling` to `FALSE`.) 2.0.0[6] was a similar fix,
|
||||
-but it did not cover all cases.
|
||||
+2. Fixed or worked around multiple issues with `jpeg_skip_scanlines()`:
|
||||
+
|
||||
+ - Fixed segfaults or "Corrupt JPEG data: premature end of data segment"
|
||||
+errors in `jpeg_skip_scanlines()` that occurred when decompressing 4:2:2 or
|
||||
+4:2:0 JPEG images using merged (non-fancy) upsampling/color conversion (that
|
||||
+is, when setting `cinfo.do_fancy_upsampling` to `FALSE`.) 2.0.0[6] was a
|
||||
+similar fix, but it did not cover all cases.
|
||||
+ - `jpeg_skip_scanlines()` now throws an error if two-pass color
|
||||
+quantization is enabled. Two-pass color quantization never worked properly
|
||||
+with `jpeg_skip_scanlines()`, and the issues could not readily be fixed.
|
||||
|
||||
|
||||
2.0.3
|
||||
diff --git a/croptest.in b/croptest.in
|
||||
new file mode 100755
|
||||
index 0000000..7e3c293
|
||||
--- /dev/null
|
||||
+++ b/croptest.in
|
||||
@@ -0,0 +1,95 @@
|
||||
+#!/bin/bash
|
||||
+
|
||||
+set -u
|
||||
+set -e
|
||||
+trap onexit INT
|
||||
+trap onexit TERM
|
||||
+trap onexit EXIT
|
||||
+
|
||||
+onexit()
|
||||
+{
|
||||
+ if [ -d $OUTDIR ]; then
|
||||
+ rm -rf $OUTDIR
|
||||
+ fi
|
||||
+}
|
||||
+
|
||||
+runme()
|
||||
+{
|
||||
+ echo \*\*\* $*
|
||||
+ $*
|
||||
+}
|
||||
+
|
||||
+IMAGE=vgl_6548_0026a.bmp
|
||||
+WIDTH=128
|
||||
+HEIGHT=95
|
||||
+IMGDIR=@CMAKE_CURRENT_SOURCE_DIR@/testimages
|
||||
+OUTDIR=`mktemp -d /tmp/__croptest_output.XXXXXX`
|
||||
+EXEDIR=@CMAKE_CURRENT_BINARY_DIR@
|
||||
+
|
||||
+if [ -d $OUTDIR ]; then
|
||||
+ rm -rf $OUTDIR
|
||||
+fi
|
||||
+mkdir -p $OUTDIR
|
||||
+
|
||||
+exec >$EXEDIR/croptest.log
|
||||
+
|
||||
+echo "============================================================"
|
||||
+echo "$IMAGE ($WIDTH x $HEIGHT)"
|
||||
+echo "============================================================"
|
||||
+echo
|
||||
+
|
||||
+for PROGARG in "" -progressive; do
|
||||
+
|
||||
+ cp $IMGDIR/$IMAGE $OUTDIR
|
||||
+ basename=`basename $IMAGE .bmp`
|
||||
+ echo "------------------------------------------------------------"
|
||||
+ echo "Generating test images"
|
||||
+ echo "------------------------------------------------------------"
|
||||
+ echo
|
||||
+ runme $EXEDIR/cjpeg $PROGARG -grayscale -outfile $OUTDIR/${basename}_GRAY.jpg $IMGDIR/${basename}.bmp
|
||||
+ runme $EXEDIR/cjpeg $PROGARG -sample 2x2 -outfile $OUTDIR/${basename}_420.jpg $IMGDIR/${basename}.bmp
|
||||
+ runme $EXEDIR/cjpeg $PROGARG -sample 2x1 -outfile $OUTDIR/${basename}_422.jpg $IMGDIR/${basename}.bmp
|
||||
+ runme $EXEDIR/cjpeg $PROGARG -sample 1x2 -outfile $OUTDIR/${basename}_440.jpg $IMGDIR/${basename}.bmp
|
||||
+ runme $EXEDIR/cjpeg $PROGARG -sample 1x1 -outfile $OUTDIR/${basename}_444.jpg $IMGDIR/${basename}.bmp
|
||||
+ echo
|
||||
+
|
||||
+ for NSARG in "" -nosmooth; do
|
||||
+
|
||||
+ for COLORSARG in "" "-colors 256 -dither none -onepass"; do
|
||||
+
|
||||
+ for Y in {0..16}; do
|
||||
+
|
||||
+ for H in {1..16}; do
|
||||
+
|
||||
+ X=$(( (Y*16)%128 ))
|
||||
+ W=$(( WIDTH-X-7 ))
|
||||
+ if [ $Y -le 15 ]; then
|
||||
+ CROPSPEC="${W}x${H}+${X}+${Y}"
|
||||
+ else
|
||||
+ Y2=$(( HEIGHT-H ));
|
||||
+ CROPSPEC="${W}x${H}+${X}+${Y2}"
|
||||
+ fi
|
||||
+
|
||||
+ echo "------------------------------------------------------------"
|
||||
+ echo $PROGARG $NSARG $COLORSARG -crop $CROPSPEC
|
||||
+ echo "------------------------------------------------------------"
|
||||
+ echo
|
||||
+ for samp in GRAY 420 422 440 444; do
|
||||
+ $EXEDIR/djpeg $NSARG $COLORSARG -rgb -outfile $OUTDIR/${basename}_${samp}_full.ppm $OUTDIR/${basename}_${samp}.jpg
|
||||
+ convert -crop $CROPSPEC $OUTDIR/${basename}_${samp}_full.ppm $OUTDIR/${basename}_${samp}_ref.ppm
|
||||
+ runme $EXEDIR/djpeg $NSARG $COLORSARG -crop $CROPSPEC -rgb -outfile $OUTDIR/${basename}_${samp}.ppm $OUTDIR/${basename}_${samp}.jpg
|
||||
+ runme cmp $OUTDIR/${basename}_${samp}.ppm $OUTDIR/${basename}_${samp}_ref.ppm
|
||||
+ done
|
||||
+ echo
|
||||
+
|
||||
+ done
|
||||
+
|
||||
+ done
|
||||
+
|
||||
+ done
|
||||
+
|
||||
+ done
|
||||
+
|
||||
+done
|
||||
+
|
||||
+echo SUCCESS!
|
||||
diff --git a/jdapistd.c b/jdapistd.c
|
||||
index 91da642..c502909 100644
|
||||
--- a/jdapistd.c
|
||||
+++ b/jdapistd.c
|
||||
@@ -306,16 +306,6 @@ noop_quantize(j_decompress_ptr cinfo, JSAMPARRAY input_buf,
|
||||
}
|
||||
|
||||
|
||||
-/* Dummy postprocessing function used by jpeg_skip_scanlines() */
|
||||
-LOCAL(void)
|
||||
-noop_post_process (j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
- JDIMENSION *in_row_group_ctr,
|
||||
- JDIMENSION in_row_groups_avail, JSAMPARRAY output_buf,
|
||||
- JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail)
|
||||
-{
|
||||
-}
|
||||
-
|
||||
-
|
||||
/*
|
||||
* In some cases, it is best to call jpeg_read_scanlines() and discard the
|
||||
* output, rather than skipping the scanlines, because this allows us to
|
||||
@@ -329,16 +319,12 @@ read_and_discard_scanlines(j_decompress_ptr cinfo, JDIMENSION num_lines)
|
||||
{
|
||||
JDIMENSION n;
|
||||
my_master_ptr master = (my_master_ptr)cinfo->master;
|
||||
+ JSAMPARRAY scanlines = NULL;
|
||||
void (*color_convert) (j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
JDIMENSION input_row, JSAMPARRAY output_buf,
|
||||
int num_rows) = NULL;
|
||||
void (*color_quantize) (j_decompress_ptr cinfo, JSAMPARRAY input_buf,
|
||||
JSAMPARRAY output_buf, int num_rows) = NULL;
|
||||
- void (*post_process_data) (j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
- JDIMENSION *in_row_group_ctr,
|
||||
- JDIMENSION in_row_groups_avail,
|
||||
- JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
|
||||
- JDIMENSION out_rows_avail) = NULL;
|
||||
|
||||
if (cinfo->cconvert && cinfo->cconvert->color_convert) {
|
||||
color_convert = cinfo->cconvert->color_convert;
|
||||
@@ -350,23 +336,19 @@ read_and_discard_scanlines(j_decompress_ptr cinfo, JDIMENSION num_lines)
|
||||
cinfo->cquantize->color_quantize = noop_quantize;
|
||||
}
|
||||
|
||||
- if (master->using_merged_upsample && cinfo->post &&
|
||||
- cinfo->post->post_process_data) {
|
||||
- post_process_data = cinfo->post->post_process_data;
|
||||
- cinfo->post->post_process_data = noop_post_process;
|
||||
+ if (master->using_merged_upsample && cinfo->max_v_samp_factor == 2) {
|
||||
+ my_merged_upsample_ptr upsample = (my_merged_upsample_ptr)cinfo->upsample;
|
||||
+ scanlines = &upsample->spare_row;
|
||||
}
|
||||
|
||||
for (n = 0; n < num_lines; n++)
|
||||
- jpeg_read_scanlines(cinfo, NULL, 1);
|
||||
+ jpeg_read_scanlines(cinfo, scanlines, 1);
|
||||
|
||||
if (color_convert)
|
||||
cinfo->cconvert->color_convert = color_convert;
|
||||
|
||||
if (color_quantize)
|
||||
cinfo->cquantize->color_quantize = color_quantize;
|
||||
-
|
||||
- if (post_process_data)
|
||||
- cinfo->post->post_process_data = post_process_data;
|
||||
}
|
||||
|
||||
|
||||
@@ -380,6 +362,12 @@ increment_simple_rowgroup_ctr(j_decompress_ptr cinfo, JDIMENSION rows)
|
||||
{
|
||||
JDIMENSION rows_left;
|
||||
my_main_ptr main_ptr = (my_main_ptr)cinfo->main;
|
||||
+ my_master_ptr master = (my_master_ptr)cinfo->master;
|
||||
+
|
||||
+ if (master->using_merged_upsample && cinfo->max_v_samp_factor == 2) {
|
||||
+ read_and_discard_scanlines(cinfo, rows);
|
||||
+ return;
|
||||
+ }
|
||||
|
||||
/* Increment the counter to the next row group after the skipped rows. */
|
||||
main_ptr->rowgroup_ctr += rows / cinfo->max_v_samp_factor;
|
||||
@@ -410,11 +398,16 @@ jpeg_skip_scanlines(j_decompress_ptr cinfo, JDIMENSION num_lines)
|
||||
my_main_ptr main_ptr = (my_main_ptr)cinfo->main;
|
||||
my_coef_ptr coef = (my_coef_ptr)cinfo->coef;
|
||||
my_master_ptr master = (my_master_ptr)cinfo->master;
|
||||
+ my_upsample_ptr upsample = (my_upsample_ptr)cinfo->upsample;
|
||||
JDIMENSION i, x;
|
||||
int y;
|
||||
JDIMENSION lines_per_iMCU_row, lines_left_in_iMCU_row, lines_after_iMCU_row;
|
||||
JDIMENSION lines_to_skip, lines_to_read;
|
||||
|
||||
+ /* Two-pass color quantization is not supported. */
|
||||
+ if (cinfo->quantize_colors && cinfo->two_pass_quantize)
|
||||
+ ERREXIT(cinfo, JERR_NOTIMPL);
|
||||
+
|
||||
if (cinfo->global_state != DSTATE_SCANNING)
|
||||
ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
|
||||
|
||||
@@ -472,13 +465,7 @@ jpeg_skip_scanlines(j_decompress_ptr cinfo, JDIMENSION num_lines)
|
||||
main_ptr->buffer_full = FALSE;
|
||||
main_ptr->rowgroup_ctr = 0;
|
||||
main_ptr->context_state = CTX_PREPARE_FOR_IMCU;
|
||||
- if (master->using_merged_upsample) {
|
||||
- my_merged_upsample_ptr upsample =
|
||||
- (my_merged_upsample_ptr)cinfo->upsample;
|
||||
- upsample->spare_full = FALSE;
|
||||
- upsample->rows_to_go = cinfo->output_height - cinfo->output_scanline;
|
||||
- } else {
|
||||
- my_upsample_ptr upsample = (my_upsample_ptr)cinfo->upsample;
|
||||
+ if (!master->using_merged_upsample) {
|
||||
upsample->next_row_out = cinfo->max_v_samp_factor;
|
||||
upsample->rows_to_go = cinfo->output_height - cinfo->output_scanline;
|
||||
}
|
||||
@@ -493,13 +480,7 @@ jpeg_skip_scanlines(j_decompress_ptr cinfo, JDIMENSION num_lines)
|
||||
cinfo->output_scanline += lines_left_in_iMCU_row;
|
||||
main_ptr->buffer_full = FALSE;
|
||||
main_ptr->rowgroup_ctr = 0;
|
||||
- if (master->using_merged_upsample) {
|
||||
- my_merged_upsample_ptr upsample =
|
||||
- (my_merged_upsample_ptr)cinfo->upsample;
|
||||
- upsample->spare_full = FALSE;
|
||||
- upsample->rows_to_go = cinfo->output_height - cinfo->output_scanline;
|
||||
- } else {
|
||||
- my_upsample_ptr upsample = (my_upsample_ptr)cinfo->upsample;
|
||||
+ if (!master->using_merged_upsample) {
|
||||
upsample->next_row_out = cinfo->max_v_samp_factor;
|
||||
upsample->rows_to_go = cinfo->output_height - cinfo->output_scanline;
|
||||
}
|
||||
@@ -537,14 +518,8 @@ jpeg_skip_scanlines(j_decompress_ptr cinfo, JDIMENSION num_lines)
|
||||
cinfo->output_iMCU_row += lines_to_skip / lines_per_iMCU_row;
|
||||
increment_simple_rowgroup_ctr(cinfo, lines_to_read);
|
||||
}
|
||||
- if (master->using_merged_upsample) {
|
||||
- my_merged_upsample_ptr upsample =
|
||||
- (my_merged_upsample_ptr)cinfo->upsample;
|
||||
- upsample->rows_to_go = cinfo->output_height - cinfo->output_scanline;
|
||||
- } else {
|
||||
- my_upsample_ptr upsample = (my_upsample_ptr)cinfo->upsample;
|
||||
+ if (!master->using_merged_upsample)
|
||||
upsample->rows_to_go = cinfo->output_height - cinfo->output_scanline;
|
||||
- }
|
||||
return num_lines;
|
||||
}
|
||||
|
||||
@@ -585,13 +560,8 @@ jpeg_skip_scanlines(j_decompress_ptr cinfo, JDIMENSION num_lines)
|
||||
* bit odd, since "rows_to_go" seems to be redundantly keeping track of
|
||||
* output_scanline.
|
||||
*/
|
||||
- if (master->using_merged_upsample) {
|
||||
- my_merged_upsample_ptr upsample = (my_merged_upsample_ptr)cinfo->upsample;
|
||||
+ if (!master->using_merged_upsample)
|
||||
upsample->rows_to_go = cinfo->output_height - cinfo->output_scanline;
|
||||
- } else {
|
||||
- my_upsample_ptr upsample = (my_upsample_ptr)cinfo->upsample;
|
||||
- upsample->rows_to_go = cinfo->output_height - cinfo->output_scanline;
|
||||
- }
|
||||
|
||||
/* Always skip the requested number of lines. */
|
||||
return num_lines;
|
||||
diff --git a/libjpeg.txt b/libjpeg.txt
|
||||
index c50cf90..c233ecb 100644
|
||||
--- a/libjpeg.txt
|
||||
+++ b/libjpeg.txt
|
||||
@@ -3,7 +3,7 @@ USING THE IJG JPEG LIBRARY
|
||||
This file was part of the Independent JPEG Group's software:
|
||||
Copyright (C) 1994-2013, Thomas G. Lane, Guido Vollbeding.
|
||||
libjpeg-turbo Modifications:
|
||||
-Copyright (C) 2010, 2014-2018, D. R. Commander.
|
||||
+Copyright (C) 2010, 2014-2018, 2020, D. R. Commander.
|
||||
Copyright (C) 2015, Google, Inc.
|
||||
For conditions of distribution and use, see the accompanying README.ijg file.
|
||||
|
||||
@@ -750,7 +750,9 @@ multiple rows in the JPEG image.
|
||||
|
||||
Suspending data sources are not supported by this function. Calling
|
||||
jpeg_skip_scanlines() with a suspending data source will result in undefined
|
||||
-behavior.
|
||||
+behavior. Two-pass color quantization is also not supported by this function.
|
||||
+Calling jpeg_skip_scanlines() with two-pass color quantization enabled will
|
||||
+result in an error.
|
||||
|
||||
jpeg_skip_scanlines() will not allow skipping past the bottom of the image. If
|
||||
the value of num_lines is large enough to skip past the bottom of the image,
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@@ -14,6 +14,8 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BPN}-${PV}.tar.gz \
|
||||
file://0001-libjpeg-turbo-fix-package_qa-error.patch \
|
||||
file://CVE-2020-13790.patch \
|
||||
file://CVE-2021-46822.patch \
|
||||
file://CVE-2020-35538-1.patch \
|
||||
file://CVE-2020-35538-2.patch \
|
||||
"
|
||||
|
||||
SRC_URI[md5sum] = "d01d9e0c28c27bc0de9f4e2e8ff49855"
|
||||
|
||||
111
meta/recipes-graphics/xorg-lib/libx11/CVE-2023-3138.patch
Normal file
111
meta/recipes-graphics/xorg-lib/libx11/CVE-2023-3138.patch
Normal file
@@ -0,0 +1,111 @@
|
||||
From 304a654a0d57bf0f00d8998185f0360332cfa36c Mon Sep 17 00:00:00 2001
|
||||
From: Alan Coopersmith <alan.coopersmith@oracle.com>
|
||||
Date: Sat, 10 Jun 2023 16:30:07 -0700
|
||||
Subject: [PATCH] InitExt.c: Add bounds checks for extension request, event, &
|
||||
error codes
|
||||
|
||||
Fixes CVE-2023-3138: X servers could return values from XQueryExtension
|
||||
that would cause Xlib to write entries out-of-bounds of the arrays to
|
||||
store them, though this would only overwrite other parts of the Display
|
||||
struct, not outside the bounds allocated for that structure.
|
||||
|
||||
Reported-by: Gregory James DUCK <gjduck@gmail.com>
|
||||
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
||||
|
||||
CVE: CVE-2023-3138
|
||||
Upstream-Status: Backport [https://gitlab.freedesktop.org/xorg/lib/libx11/-/commit/304a654a0d57bf0f00d8998185f0360332cfa36c.patch]
|
||||
Signed-off-by: Poonam Jadhav <poonam.jadhav@kpit.com>
|
||||
---
|
||||
src/InitExt.c | 42 ++++++++++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 42 insertions(+)
|
||||
|
||||
diff --git a/src/InitExt.c b/src/InitExt.c
|
||||
index 4de46f15..afc00a6b 100644
|
||||
--- a/src/InitExt.c
|
||||
+++ b/src/InitExt.c
|
||||
@@ -33,6 +33,18 @@ from The Open Group.
|
||||
#include <X11/Xos.h>
|
||||
#include <stdio.h>
|
||||
|
||||
+/* The X11 protocol spec reserves events 64 through 127 for extensions */
|
||||
+#ifndef LastExtensionEvent
|
||||
+#define LastExtensionEvent 127
|
||||
+#endif
|
||||
+
|
||||
+/* The X11 protocol spec reserves requests 128 through 255 for extensions */
|
||||
+#ifndef LastExtensionRequest
|
||||
+#define FirstExtensionRequest 128
|
||||
+#define LastExtensionRequest 255
|
||||
+#endif
|
||||
+
|
||||
+
|
||||
/*
|
||||
* This routine is used to link a extension in so it will be called
|
||||
* at appropriate times.
|
||||
@@ -242,6 +254,12 @@ WireToEventType XESetWireToEvent(
|
||||
WireToEventType proc) /* routine to call when converting event */
|
||||
{
|
||||
register WireToEventType oldproc;
|
||||
+ if (event_number < 0 ||
|
||||
+ event_number > LastExtensionEvent) {
|
||||
+ fprintf(stderr, "Xlib: ignoring invalid extension event %d\n",
|
||||
+ event_number);
|
||||
+ return (WireToEventType)_XUnknownWireEvent;
|
||||
+ }
|
||||
if (proc == NULL) proc = (WireToEventType)_XUnknownWireEvent;
|
||||
LockDisplay (dpy);
|
||||
oldproc = dpy->event_vec[event_number];
|
||||
@@ -263,6 +281,12 @@ WireToEventCookieType XESetWireToEventCookie(
|
||||
)
|
||||
{
|
||||
WireToEventCookieType oldproc;
|
||||
+ if (extension < FirstExtensionRequest ||
|
||||
+ extension > LastExtensionRequest) {
|
||||
+ fprintf(stderr, "Xlib: ignoring invalid extension opcode %d\n",
|
||||
+ extension);
|
||||
+ return (WireToEventCookieType)_XUnknownWireEventCookie;
|
||||
+ }
|
||||
if (proc == NULL) proc = (WireToEventCookieType)_XUnknownWireEventCookie;
|
||||
LockDisplay (dpy);
|
||||
oldproc = dpy->generic_event_vec[extension & 0x7F];
|
||||
@@ -284,6 +308,12 @@ CopyEventCookieType XESetCopyEventCookie(
|
||||
)
|
||||
{
|
||||
CopyEventCookieType oldproc;
|
||||
+ if (extension < FirstExtensionRequest ||
|
||||
+ extension > LastExtensionRequest) {
|
||||
+ fprintf(stderr, "Xlib: ignoring invalid extension opcode %d\n",
|
||||
+ extension);
|
||||
+ return (CopyEventCookieType)_XUnknownCopyEventCookie;
|
||||
+ }
|
||||
if (proc == NULL) proc = (CopyEventCookieType)_XUnknownCopyEventCookie;
|
||||
LockDisplay (dpy);
|
||||
oldproc = dpy->generic_event_copy_vec[extension & 0x7F];
|
||||
@@ -305,6 +335,12 @@ EventToWireType XESetEventToWire(
|
||||
EventToWireType proc) /* routine to call when converting event */
|
||||
{
|
||||
register EventToWireType oldproc;
|
||||
+ if (event_number < 0 ||
|
||||
+ event_number > LastExtensionEvent) {
|
||||
+ fprintf(stderr, "Xlib: ignoring invalid extension event %d\n",
|
||||
+ event_number);
|
||||
+ return (EventToWireType)_XUnknownNativeEvent;
|
||||
+ }
|
||||
if (proc == NULL) proc = (EventToWireType) _XUnknownNativeEvent;
|
||||
LockDisplay (dpy);
|
||||
oldproc = dpy->wire_vec[event_number];
|
||||
@@ -325,6 +361,12 @@ WireToErrorType XESetWireToError(
|
||||
WireToErrorType proc) /* routine to call when converting error */
|
||||
{
|
||||
register WireToErrorType oldproc = NULL;
|
||||
+ if (error_number < 0 ||
|
||||
+ error_number > LastExtensionError) {
|
||||
+ fprintf(stderr, "Xlib: ignoring invalid extension error %d\n",
|
||||
+ error_number);
|
||||
+ return (WireToErrorType)_XDefaultWireError;
|
||||
+ }
|
||||
if (proc == NULL) proc = (WireToErrorType)_XDefaultWireError;
|
||||
LockDisplay (dpy);
|
||||
if (!dpy->error_vec) {
|
||||
--
|
||||
GitLab
|
||||
@@ -18,6 +18,7 @@ SRC_URI += "file://Fix-hanging-issue-in-_XReply.patch \
|
||||
file://CVE-2021-31535.patch \
|
||||
file://CVE-2022-3554.patch \
|
||||
file://CVE-2022-3555.patch \
|
||||
file://CVE-2023-3138.patch \
|
||||
"
|
||||
|
||||
SRC_URI[md5sum] = "55adbfb6d4370ecac5e70598c4e7eed2"
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
Add 'install-ptest' rule.
|
||||
|
||||
Signed-off-by: Tudor Florea <tudor.florea@enea.com>
|
||||
Upstream-Status: Pending
|
||||
|
||||
diff -ruN a/Makefile.am b/Makefile.am
|
||||
--- a/Makefile.am 2013-07-12 17:11:05.278331557 +0200
|
||||
+++ b/Makefile.am 2013-07-12 17:14:27.033788016 +0200
|
||||
@@ -204,6 +204,16 @@
|
||||
|
||||
distclean-local: $(DISTCLEAN_LOCAL_HOOKS)
|
||||
|
||||
+install-ptest:
|
||||
+ @$(MKDIR_P) $(DESTDIR)/testsuite
|
||||
+ @for file in $(TESTSUITE); do \
|
||||
+ install $$file $(DESTDIR)/testsuite; \
|
||||
+ done;
|
||||
+ @sed -e 's/^Makefile/_Makefile/' < Makefile > $(DESTDIR)/Makefile
|
||||
+ @$(MKDIR_P) $(DESTDIR)/tools
|
||||
+ @cp $(noinst_SCRIPTS) $(noinst_PROGRAMS) $(DESTDIR)/tools
|
||||
+ @cp -r testsuite/rootfs testsuite/.libs $(DESTDIR)/testsuite
|
||||
+
|
||||
# ------------------------------------------------------------------------------
|
||||
# custom release helpers
|
||||
# ------------------------------------------------------------------------------
|
||||
@@ -134,7 +134,7 @@ LIC_FILES_CHKSUM = "file://LICENCE.Abilis;md5=b5ee3f410780e56711ad48eadc22b8bc \
|
||||
"
|
||||
# WHENCE checksum is defined separately to ease overriding it if
|
||||
# class-devupstream is selected.
|
||||
WHENCE_CHKSUM = "0782deea054d4b1b7f10c92c3a245da4"
|
||||
WHENCE_CHKSUM = "a0997fc7a9af4e46d96529d6ef13b58a"
|
||||
|
||||
# These are not common licenses, set NO_GENERIC_LICENSE for them
|
||||
# so that the license files will be copied from fetched source
|
||||
@@ -212,7 +212,7 @@ SRC_URI:class-devupstream = "git://git.kernel.org/pub/scm/linux/kernel/git/firmw
|
||||
# Pin this to the 20220509 release, override this in local.conf
|
||||
SRCREV:class-devupstream ?= "b19cbdca78ab2adfd210c91be15a22568e8b8cae"
|
||||
|
||||
SRC_URI[sha256sum] = "c3f9ad2bb5311cce2490f37a8052f836703d6936aabd840246b6576f1f71f607"
|
||||
SRC_URI[sha256sum] = "8b1acfa16f1ee94732a6acb50d9d6c835cf53af11068bd89ed207bbe04a1e951"
|
||||
|
||||
inherit allarch
|
||||
|
||||
@@ -11,13 +11,13 @@ python () {
|
||||
raise bb.parse.SkipRecipe("Set PREFERRED_PROVIDER_virtual/kernel to linux-yocto-rt to enable it")
|
||||
}
|
||||
|
||||
SRCREV_machine ?= "c705bb899d37bbd61a87a2f850e4d6f04613a908"
|
||||
SRCREV_meta ?= "c7d5b73674d53f51772862b951d8cc56683ef04f"
|
||||
SRCREV_machine ?= "8d8179549a233e7517523ac12887016451da2e20"
|
||||
SRCREV_meta ?= "465d61ba36f5c7e32d1fddef078d5d2068fcc2cc"
|
||||
|
||||
SRC_URI = "git://git.yoctoproject.org/linux-yocto.git;branch=${KBRANCH};name=machine \
|
||||
git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-5.4;destsuffix=${KMETA}"
|
||||
|
||||
LINUX_VERSION ?= "5.4.243"
|
||||
LINUX_VERSION ?= "5.4.248"
|
||||
|
||||
LIC_FILES_CHKSUM = "file://COPYING;md5=bbea815ee2795b2f4230826c0c6b8814"
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ KCONFIG_MODE = "--allnoconfig"
|
||||
|
||||
require recipes-kernel/linux/linux-yocto.inc
|
||||
|
||||
LINUX_VERSION ?= "5.4.243"
|
||||
LINUX_VERSION ?= "5.4.248"
|
||||
LIC_FILES_CHKSUM = "file://COPYING;md5=bbea815ee2795b2f4230826c0c6b8814"
|
||||
|
||||
DEPENDS += "${@bb.utils.contains('ARCH', 'x86', 'elfutils-native', '', d)}"
|
||||
@@ -15,9 +15,9 @@ DEPENDS += "openssl-native util-linux-native"
|
||||
KMETA = "kernel-meta"
|
||||
KCONF_BSP_AUDIT_LEVEL = "2"
|
||||
|
||||
SRCREV_machine_qemuarm ?= "140d4ff6bab1e5959377d4974ade490c837ef9cc"
|
||||
SRCREV_machine ?= "66990885cd865944a093b47ee7164ef2838f75a3"
|
||||
SRCREV_meta ?= "c7d5b73674d53f51772862b951d8cc56683ef04f"
|
||||
SRCREV_machine_qemuarm ?= "ca5368c73bab4eb276a8e721df28c02ceb8f3eeb"
|
||||
SRCREV_machine ?= "abb579170926348d1518bc1a2de8cb1cdf403808"
|
||||
SRCREV_meta ?= "465d61ba36f5c7e32d1fddef078d5d2068fcc2cc"
|
||||
|
||||
PV = "${LINUX_VERSION}+git${SRCPV}"
|
||||
|
||||
|
||||
@@ -12,16 +12,16 @@ KBRANCH_qemux86 ?= "v5.4/standard/base"
|
||||
KBRANCH_qemux86-64 ?= "v5.4/standard/base"
|
||||
KBRANCH_qemumips64 ?= "v5.4/standard/mti-malta64"
|
||||
|
||||
SRCREV_machine_qemuarm ?= "3c105623bdba36118195e9c188d728edcc00345a"
|
||||
SRCREV_machine_qemuarm64 ?= "993c666984249097d093ee71eb3dffa0844fef6c"
|
||||
SRCREV_machine_qemumips ?= "2469bc35f1c2ef5ab2e85b7b705b32e33c6350c7"
|
||||
SRCREV_machine_qemuppc ?= "98229034b888ad319d7d030d279381a671c41dc0"
|
||||
SRCREV_machine_qemuriscv64 ?= "ba7e46214a9d60247170245cc09e2e1faf6622a1"
|
||||
SRCREV_machine_qemux86 ?= "ba7e46214a9d60247170245cc09e2e1faf6622a1"
|
||||
SRCREV_machine_qemux86-64 ?= "ba7e46214a9d60247170245cc09e2e1faf6622a1"
|
||||
SRCREV_machine_qemumips64 ?= "fb1936fa93be6bfd1b18cd8568cfc5b279904fa5"
|
||||
SRCREV_machine ?= "ba7e46214a9d60247170245cc09e2e1faf6622a1"
|
||||
SRCREV_meta ?= "c7d5b73674d53f51772862b951d8cc56683ef04f"
|
||||
SRCREV_machine_qemuarm ?= "68775a8671944b96c6a1ee795809f81149951f2d"
|
||||
SRCREV_machine_qemuarm64 ?= "54bc3d459501d8df9baf093a34d8bb676c207a07"
|
||||
SRCREV_machine_qemumips ?= "ba2d346cc66307fa6332b9fb86eb8ca66f30ebcd"
|
||||
SRCREV_machine_qemuppc ?= "6703d4c7c75fab78e0c72227a98aba8071d5b1c3"
|
||||
SRCREV_machine_qemuriscv64 ?= "d18af0e8acb7c4cb245739fa8165a44845ff2ba0"
|
||||
SRCREV_machine_qemux86 ?= "d18af0e8acb7c4cb245739fa8165a44845ff2ba0"
|
||||
SRCREV_machine_qemux86-64 ?= "d18af0e8acb7c4cb245739fa8165a44845ff2ba0"
|
||||
SRCREV_machine_qemumips64 ?= "66cac7d41a43594760f6ac48e848d73315cc5dd3"
|
||||
SRCREV_machine ?= "d18af0e8acb7c4cb245739fa8165a44845ff2ba0"
|
||||
SRCREV_meta ?= "465d61ba36f5c7e32d1fddef078d5d2068fcc2cc"
|
||||
|
||||
# remap qemuarm to qemuarma15 for the 5.4 kernel
|
||||
# KMACHINE_qemuarm ?= "qemuarma15"
|
||||
@@ -30,7 +30,7 @@ SRC_URI = "git://git.yoctoproject.org/linux-yocto.git;name=machine;branch=${KBRA
|
||||
git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-5.4;destsuffix=${KMETA}"
|
||||
|
||||
LIC_FILES_CHKSUM = "file://COPYING;md5=bbea815ee2795b2f4230826c0c6b8814"
|
||||
LINUX_VERSION ?= "5.4.243"
|
||||
LINUX_VERSION ?= "5.4.248"
|
||||
|
||||
DEPENDS += "${@bb.utils.contains('ARCH', 'x86', 'elfutils-native', '', d)}"
|
||||
DEPENDS += "openssl-native util-linux-native"
|
||||
|
||||
@@ -5,7 +5,7 @@ LICENSE = "ISC"
|
||||
LIC_FILES_CHKSUM = "file://LICENSE;md5=07c4f6dea3845b02a18dc00c8c87699c"
|
||||
|
||||
SRC_URI = "https://www.kernel.org/pub/software/network/${BPN}/${BP}.tar.xz"
|
||||
SRC_URI[sha256sum] = "fe81e8a8694dc4753a45087a1c4c7e1b48dee5a59f5f796ce374ea550f0b2e73"
|
||||
SRC_URI[sha256sum] = "f254d08ab3765aeae2b856222e11a95d44aef519a6663877c71ef68fae4c8c12"
|
||||
|
||||
inherit bin_package allarch
|
||||
|
||||
29
meta/recipes-multimedia/libpng/files/run-ptest
Normal file
29
meta/recipes-multimedia/libpng/files/run-ptest
Normal file
@@ -0,0 +1,29 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -eux
|
||||
|
||||
./pngfix pngtest.png &> log.txt 2>&1
|
||||
|
||||
if grep -i "OK" log.txt 2>&1 ; then
|
||||
echo "PASS: pngfix passed"
|
||||
else
|
||||
echo "FAIL: pngfix failed"
|
||||
fi
|
||||
rm -f log.txt
|
||||
|
||||
./pngtest pngtest.png &> log.txt 2>&1
|
||||
|
||||
if grep -i "PASS" log.txt 2>&1 ; then
|
||||
echo "PASS: pngtest passed"
|
||||
else
|
||||
echo "FAIL: pngtest failed"
|
||||
fi
|
||||
rm -f log.txt
|
||||
|
||||
for i in pngstest timepng; do
|
||||
if "./${i}" pngtest.png 2>&1; then
|
||||
echo "PASS: $i"
|
||||
else
|
||||
echo "FAIL: $i"
|
||||
fi
|
||||
done
|
||||
@@ -10,7 +10,10 @@ DEPENDS = "zlib"
|
||||
|
||||
LIBV = "16"
|
||||
|
||||
SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BPN}${LIBV}/${BP}.tar.xz"
|
||||
SRC_URI = "\
|
||||
${SOURCEFORGE_MIRROR}/${BPN}/${BPN}${LIBV}/${BP}.tar.xz \
|
||||
file://run-ptest \
|
||||
"
|
||||
SRC_URI[md5sum] = "015e8e15db1eecde5f2eb9eb5b6e59e9"
|
||||
SRC_URI[sha256sum] = "505e70834d35383537b6491e7ae8641f1a4bed1876dbfe361201fc80868d88ca"
|
||||
|
||||
@@ -20,7 +23,7 @@ UPSTREAM_CHECK_URI = "http://libpng.org/pub/png/libpng.html"
|
||||
|
||||
BINCONFIG = "${bindir}/libpng-config ${bindir}/libpng16-config"
|
||||
|
||||
inherit autotools binconfig-disabled pkgconfig
|
||||
inherit autotools binconfig-disabled pkgconfig ptest
|
||||
|
||||
# Work around missing symbols
|
||||
EXTRA_OECONF_append_class-target = " ${@bb.utils.contains("TUNE_FEATURES", "neon", "--enable-arm-neon=on", "--enable-arm-neon=off" ,d)}"
|
||||
@@ -33,3 +36,11 @@ BBCLASSEXTEND = "native nativesdk"
|
||||
|
||||
# CVE-2019-17371 is actually a memory leak in gif2png 2.x
|
||||
CVE_CHECK_WHITELIST += "CVE-2019-17371"
|
||||
|
||||
do_install_ptest() {
|
||||
install -m644 "${S}/pngtest.png" "${D}${PTEST_PATH}"
|
||||
install -m755 "${B}/.libs/pngfix" "${D}${PTEST_PATH}"
|
||||
install -m755 "${B}/.libs/pngtest" "${D}${PTEST_PATH}"
|
||||
install -m755 "${B}/.libs/pngstest" "${D}${PTEST_PATH}"
|
||||
install -m755 "${B}/.libs/timepng" "${D}${PTEST_PATH}"
|
||||
}
|
||||
|
||||
197
meta/recipes-support/curl/curl/CVE-2023-28320-fol1.patch
Normal file
197
meta/recipes-support/curl/curl/CVE-2023-28320-fol1.patch
Normal file
@@ -0,0 +1,197 @@
|
||||
From f446258f0269a62289cca0210157cb8558d0edc3 Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Stenberg <daniel@haxx.se>
|
||||
Date: Tue, 16 May 2023 23:40:42 +0200
|
||||
Subject: [PATCH] hostip: include easy_lock.h before using
|
||||
GLOBAL_INIT_IS_THREADSAFE
|
||||
|
||||
Since that header file is the only place that define can be defined.
|
||||
|
||||
Reported-by: Marc Deslauriers
|
||||
|
||||
Follow-up to 13718030ad4b3209
|
||||
|
||||
Closes #11121
|
||||
|
||||
Upstream-Status: Backport [https://github.com/curl/curl/commit/f446258f0269a62289cca0210157cb8558d0edc3]
|
||||
CVE: CVE-2023-28320
|
||||
Signed-off-by: Vivek Kumbhar <vkumbhar@mvista.com>
|
||||
---
|
||||
lib/easy_lock.h | 109 ++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
lib/hostip.c | 10 ++---
|
||||
lib/hostip.h | 9 ----
|
||||
3 files changed, 113 insertions(+), 15 deletions(-)
|
||||
create mode 100644 lib/easy_lock.h
|
||||
|
||||
diff --git a/lib/easy_lock.h b/lib/easy_lock.h
|
||||
new file mode 100644
|
||||
index 0000000..6399a39
|
||||
--- /dev/null
|
||||
+++ b/lib/easy_lock.h
|
||||
@@ -0,0 +1,109 @@
|
||||
+#ifndef HEADER_CURL_EASY_LOCK_H
|
||||
+#define HEADER_CURL_EASY_LOCK_H
|
||||
+/***************************************************************************
|
||||
+ * _ _ ____ _
|
||||
+ * Project ___| | | | _ \| |
|
||||
+ * / __| | | | |_) | |
|
||||
+ * | (__| |_| | _ <| |___
|
||||
+ * \___|\___/|_| \_\_____|
|
||||
+ *
|
||||
+ * Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
+ *
|
||||
+ * This software is licensed as described in the file COPYING, which
|
||||
+ * you should have received as part of this distribution. The terms
|
||||
+ * are also available at https://curl.se/docs/copyright.html.
|
||||
+ *
|
||||
+ * You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
+ * copies of the Software, and permit persons to whom the Software is
|
||||
+ * furnished to do so, under the terms of the COPYING file.
|
||||
+ *
|
||||
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
+ * KIND, either express or implied.
|
||||
+ *
|
||||
+ * SPDX-License-Identifier: curl
|
||||
+ *
|
||||
+ ***************************************************************************/
|
||||
+
|
||||
+#include "curl_setup.h"
|
||||
+
|
||||
+#define GLOBAL_INIT_IS_THREADSAFE
|
||||
+
|
||||
+#if defined(_WIN32_WINNT) && _WIN32_WINNT >= 0x600
|
||||
+
|
||||
+#ifdef __MINGW32__
|
||||
+#ifndef __MINGW64_VERSION_MAJOR
|
||||
+#if (__MINGW32_MAJOR_VERSION < 5) || \
|
||||
+ (__MINGW32_MAJOR_VERSION == 5 && __MINGW32_MINOR_VERSION == 0)
|
||||
+/* mingw >= 5.0.1 defines SRWLOCK, and slightly different from MS define */
|
||||
+typedef PVOID SRWLOCK, *PSRWLOCK;
|
||||
+#endif
|
||||
+#endif
|
||||
+#ifndef SRWLOCK_INIT
|
||||
+#define SRWLOCK_INIT NULL
|
||||
+#endif
|
||||
+#endif /* __MINGW32__ */
|
||||
+
|
||||
+#define curl_simple_lock SRWLOCK
|
||||
+#define CURL_SIMPLE_LOCK_INIT SRWLOCK_INIT
|
||||
+
|
||||
+#define curl_simple_lock_lock(m) AcquireSRWLockExclusive(m)
|
||||
+#define curl_simple_lock_unlock(m) ReleaseSRWLockExclusive(m)
|
||||
+
|
||||
+#elif defined(HAVE_ATOMIC) && defined(HAVE_STDATOMIC_H)
|
||||
+#include <stdatomic.h>
|
||||
+#if defined(HAVE_SCHED_YIELD)
|
||||
+#include <sched.h>
|
||||
+#endif
|
||||
+
|
||||
+#define curl_simple_lock atomic_int
|
||||
+#define CURL_SIMPLE_LOCK_INIT 0
|
||||
+
|
||||
+/* a clang-thing */
|
||||
+#ifndef __has_builtin
|
||||
+#define __has_builtin(x) 0
|
||||
+#endif
|
||||
+
|
||||
+#ifndef __INTEL_COMPILER
|
||||
+/* The Intel compiler tries to look like GCC *and* clang *and* lies in its
|
||||
+ __has_builtin() function, so override it. */
|
||||
+
|
||||
+/* if GCC on i386/x86_64 or if the built-in is present */
|
||||
+#if ( (defined(__GNUC__) && !defined(__clang__)) && \
|
||||
+ (defined(__i386__) || defined(__x86_64__))) || \
|
||||
+ __has_builtin(__builtin_ia32_pause)
|
||||
+#define HAVE_BUILTIN_IA32_PAUSE
|
||||
+#endif
|
||||
+
|
||||
+#endif
|
||||
+
|
||||
+static inline void curl_simple_lock_lock(curl_simple_lock *lock)
|
||||
+{
|
||||
+ for(;;) {
|
||||
+ if(!atomic_exchange_explicit(lock, true, memory_order_acquire))
|
||||
+ break;
|
||||
+ /* Reduce cache coherency traffic */
|
||||
+ while(atomic_load_explicit(lock, memory_order_relaxed)) {
|
||||
+ /* Reduce load (not mandatory) */
|
||||
+#ifdef HAVE_BUILTIN_IA32_PAUSE
|
||||
+ __builtin_ia32_pause();
|
||||
+#elif defined(__aarch64__)
|
||||
+ __asm__ volatile("yield" ::: "memory");
|
||||
+#elif defined(HAVE_SCHED_YIELD)
|
||||
+ sched_yield();
|
||||
+#endif
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static inline void curl_simple_lock_unlock(curl_simple_lock *lock)
|
||||
+{
|
||||
+ atomic_store_explicit(lock, false, memory_order_release);
|
||||
+}
|
||||
+
|
||||
+#else
|
||||
+
|
||||
+#undef GLOBAL_INIT_IS_THREADSAFE
|
||||
+
|
||||
+#endif
|
||||
+
|
||||
+#endif /* HEADER_CURL_EASY_LOCK_H */
|
||||
diff --git a/lib/hostip.c b/lib/hostip.c
|
||||
index 5231a74..d5bf881 100644
|
||||
--- a/lib/hostip.c
|
||||
+++ b/lib/hostip.c
|
||||
@@ -68,6 +68,8 @@
|
||||
#include "curl_memory.h"
|
||||
#include "memdebug.h"
|
||||
|
||||
+#include "easy_lock.h"
|
||||
+
|
||||
#if defined(CURLRES_SYNCH) && \
|
||||
defined(HAVE_ALARM) && \
|
||||
defined(SIGALRM) && \
|
||||
@@ -77,10 +79,6 @@
|
||||
#define USE_ALARM_TIMEOUT
|
||||
#endif
|
||||
|
||||
-#ifdef USE_ALARM_TIMEOUT
|
||||
-#include "easy_lock.h"
|
||||
-#endif
|
||||
-
|
||||
#define MAX_HOSTCACHE_LEN (255 + 7) /* max FQDN + colon + port number + zero */
|
||||
|
||||
/*
|
||||
@@ -259,8 +257,8 @@ void Curl_hostcache_prune(struct Curl_easy *data)
|
||||
/* Beware this is a global and unique instance. This is used to store the
|
||||
return address that we can jump back to from inside a signal handler. This
|
||||
is not thread-safe stuff. */
|
||||
-sigjmp_buf curl_jmpenv;
|
||||
-curl_simple_lock curl_jmpenv_lock;
|
||||
+static sigjmp_buf curl_jmpenv;
|
||||
+static curl_simple_lock curl_jmpenv_lock;
|
||||
#endif
|
||||
|
||||
/* lookup address, returns entry if found and not stale */
|
||||
diff --git a/lib/hostip.h b/lib/hostip.h
|
||||
index baf1e58..d7f73d9 100644
|
||||
--- a/lib/hostip.h
|
||||
+++ b/lib/hostip.h
|
||||
@@ -196,15 +196,6 @@ Curl_cache_addr(struct Curl_easy *data, Curl_addrinfo *addr,
|
||||
#define CURL_INADDR_NONE INADDR_NONE
|
||||
#endif
|
||||
|
||||
-#ifdef HAVE_SIGSETJMP
|
||||
-/* Forward-declaration of variable defined in hostip.c. Beware this
|
||||
- * is a global and unique instance. This is used to store the return
|
||||
- * address that we can jump back to from inside a signal handler.
|
||||
- * This is not thread-safe stuff.
|
||||
- */
|
||||
-extern sigjmp_buf curl_jmpenv;
|
||||
-#endif
|
||||
-
|
||||
/*
|
||||
* Function provided by the resolver backend to set DNS servers to use.
|
||||
*/
|
||||
--
|
||||
2.25.1
|
||||
|
||||
86
meta/recipes-support/curl/curl/CVE-2023-28320.patch
Normal file
86
meta/recipes-support/curl/curl/CVE-2023-28320.patch
Normal file
@@ -0,0 +1,86 @@
|
||||
From 13718030ad4b3209a7583b4f27f683cd3a6fa5f2 Mon Sep 17 00:00:00 2001
|
||||
From: Harry Sintonen <sintonen@iki.fi>
|
||||
Date: Tue, 25 Apr 2023 09:22:26 +0200
|
||||
Subject: [PATCH] hostip: add locks around use of global buffer for alarm()
|
||||
|
||||
When building with the sync name resolver and timeout ability we now
|
||||
require thread-safety to be present to enable it.
|
||||
|
||||
Closes #11030
|
||||
|
||||
Upstream-Status: Backport [https://github.com/curl/curl/commit/13718030ad4b3209a7583b4f27f683cd3a6fa5f2]
|
||||
CVE: CVE-2023-28320
|
||||
Signed-off-by: Vivek Kumbhar <vkumbhar@mvista.com>
|
||||
---
|
||||
lib/hostip.c | 19 +++++++++++++++----
|
||||
1 file changed, 15 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/lib/hostip.c b/lib/hostip.c
|
||||
index f5bb634..5231a74 100644
|
||||
--- a/lib/hostip.c
|
||||
+++ b/lib/hostip.c
|
||||
@@ -68,12 +68,19 @@
|
||||
#include "curl_memory.h"
|
||||
#include "memdebug.h"
|
||||
|
||||
-#if defined(CURLRES_SYNCH) && \
|
||||
- defined(HAVE_ALARM) && defined(SIGALRM) && defined(HAVE_SIGSETJMP)
|
||||
+#if defined(CURLRES_SYNCH) && \
|
||||
+ defined(HAVE_ALARM) && \
|
||||
+ defined(SIGALRM) && \
|
||||
+ defined(HAVE_SIGSETJMP) && \
|
||||
+ defined(GLOBAL_INIT_IS_THREADSAFE)
|
||||
/* alarm-based timeouts can only be used with all the dependencies satisfied */
|
||||
#define USE_ALARM_TIMEOUT
|
||||
#endif
|
||||
|
||||
+#ifdef USE_ALARM_TIMEOUT
|
||||
+#include "easy_lock.h"
|
||||
+#endif
|
||||
+
|
||||
#define MAX_HOSTCACHE_LEN (255 + 7) /* max FQDN + colon + port number + zero */
|
||||
|
||||
/*
|
||||
@@ -248,11 +255,12 @@ void Curl_hostcache_prune(struct Curl_easy *data)
|
||||
Curl_share_unlock(data, CURL_LOCK_DATA_DNS);
|
||||
}
|
||||
|
||||
-#ifdef HAVE_SIGSETJMP
|
||||
+#ifdef USE_ALARM_TIMEOUT
|
||||
/* Beware this is a global and unique instance. This is used to store the
|
||||
return address that we can jump back to from inside a signal handler. This
|
||||
is not thread-safe stuff. */
|
||||
sigjmp_buf curl_jmpenv;
|
||||
+curl_simple_lock curl_jmpenv_lock;
|
||||
#endif
|
||||
|
||||
/* lookup address, returns entry if found and not stale */
|
||||
@@ -614,7 +622,6 @@ enum resolve_t Curl_resolv(struct connectdata *conn,
|
||||
static
|
||||
RETSIGTYPE alarmfunc(int sig)
|
||||
{
|
||||
- /* this is for "-ansi -Wall -pedantic" to stop complaining! (rabe) */
|
||||
(void)sig;
|
||||
siglongjmp(curl_jmpenv, 1);
|
||||
}
|
||||
@@ -695,6 +702,8 @@ enum resolve_t Curl_resolv_timeout(struct connectdata *conn,
|
||||
This should be the last thing we do before calling Curl_resolv(),
|
||||
as otherwise we'd have to worry about variables that get modified
|
||||
before we invoke Curl_resolv() (and thus use "volatile"). */
|
||||
+ curl_simple_lock_lock(&curl_jmpenv_lock);
|
||||
+
|
||||
if(sigsetjmp(curl_jmpenv, 1)) {
|
||||
/* this is coming from a siglongjmp() after an alarm signal */
|
||||
failf(data, "name lookup timed out");
|
||||
@@ -763,6 +772,8 @@ clean_up:
|
||||
#endif
|
||||
#endif /* HAVE_SIGACTION */
|
||||
|
||||
+ curl_simple_lock_unlock(&curl_jmpenv_lock);
|
||||
+
|
||||
/* switch back the alarm() to either zero or to what it was before minus
|
||||
the time we spent until now! */
|
||||
if(prev_alarm) {
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@@ -50,6 +50,8 @@ SRC_URI = "https://curl.haxx.se/download/curl-${PV}.tar.bz2 \
|
||||
file://CVE-2023-27535-pre1.patch \
|
||||
file://CVE-2023-27535.patch \
|
||||
file://CVE-2023-27536.patch \
|
||||
file://CVE-2023-28320.patch \
|
||||
file://CVE-2023-28320-fol1.patch \
|
||||
"
|
||||
|
||||
SRC_URI[md5sum] = "ec5fc263f898a3dfef08e805f1ecca42"
|
||||
|
||||
52
meta/recipes-support/libcap/files/CVE-2023-2602.patch
Normal file
52
meta/recipes-support/libcap/files/CVE-2023-2602.patch
Normal file
@@ -0,0 +1,52 @@
|
||||
Backport of:
|
||||
|
||||
From bc6b36682f188020ee4770fae1d41bde5b2c97bb Mon Sep 17 00:00:00 2001
|
||||
From: "Andrew G. Morgan" <morgan@kernel.org>
|
||||
Date: Wed, 3 May 2023 19:18:36 -0700
|
||||
Subject: Correct the check of pthread_create()'s return value.
|
||||
|
||||
This function returns a positive number (errno) on error, so the code
|
||||
wasn't previously freeing some memory in this situation.
|
||||
|
||||
Discussion:
|
||||
|
||||
https://stackoverflow.com/a/3581020/14760867
|
||||
|
||||
Credit for finding this bug in libpsx goes to David Gstir of
|
||||
X41 D-Sec GmbH (https://x41-dsec.de/) who performed a security
|
||||
audit of the libcap source code in April of 2023. The audit
|
||||
was sponsored by the Open Source Technology Improvement Fund
|
||||
(https://ostif.org/).
|
||||
|
||||
Audit ref: LCAP-CR-23-01 (CVE-2023-2602)
|
||||
|
||||
Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
|
||||
|
||||
Upstream-Status: Backport [import from ubuntu https://git.launchpad.net/ubuntu/+source/libcap2/tree/debian/patches/CVE-2023-2602.patch?h=ubuntu/focal-security
|
||||
Upstream commit https://git.kernel.org/pub/scm/libs/libcap/libcap.git/commit/?id=bc6b36682f188020ee4770fae1d41bde5b2c97bb]
|
||||
CVE: CVE-2023-2602
|
||||
Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
|
||||
---
|
||||
psx/psx.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/libcap/psx.c
|
||||
+++ b/libcap/psx.c
|
||||
@@ -272,7 +272,7 @@ int psx_pthread_create(pthread_t *thread
|
||||
|
||||
psx_wait_for_idle();
|
||||
int ret = pthread_create(thread, attr, start_routine, arg);
|
||||
- if (ret != -1) {
|
||||
+ if (ret == 0) {
|
||||
psx_do_registration(*thread);
|
||||
}
|
||||
psx_resume_idle();
|
||||
@@ -287,7 +287,7 @@ int __wrap_pthread_create(pthread_t *thr
|
||||
void *(*start_routine) (void *), void *arg) {
|
||||
psx_wait_for_idle();
|
||||
int ret = __real_pthread_create(thread, attr, start_routine, arg);
|
||||
- if (ret != -1) {
|
||||
+ if (ret == 0) {
|
||||
psx_do_registration(*thread);
|
||||
}
|
||||
psx_resume_idle();
|
||||
58
meta/recipes-support/libcap/files/CVE-2023-2603.patch
Normal file
58
meta/recipes-support/libcap/files/CVE-2023-2603.patch
Normal file
@@ -0,0 +1,58 @@
|
||||
Backport of:
|
||||
|
||||
From 422bec25ae4a1ab03fd4d6f728695ed279173b18 Mon Sep 17 00:00:00 2001
|
||||
From: "Andrew G. Morgan" <morgan@kernel.org>
|
||||
Date: Wed, 3 May 2023 19:44:22 -0700
|
||||
Subject: Large strings can confuse libcap's internal strdup code.
|
||||
|
||||
Avoid something subtle with really long strings: 1073741823 should
|
||||
be enough for anybody. This is an improved fix over something attempted
|
||||
in libcap-2.55 to address some static analysis findings.
|
||||
|
||||
Reviewing the library, cap_proc_root() and cap_launcher_set_chroot()
|
||||
are the only two calls where the library is potentially exposed to a
|
||||
user controlled string input.
|
||||
|
||||
Credit for finding this bug in libcap goes to Richard Weinberger of
|
||||
X41 D-Sec GmbH (https://x41-dsec.de/) who performed a security audit
|
||||
of the libcap source code in April of 2023. The audit was sponsored
|
||||
by the Open Source Technology Improvement Fund (https://ostif.org/).
|
||||
|
||||
Audit ref: LCAP-CR-23-02 (CVE-2023-2603)
|
||||
|
||||
Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
|
||||
|
||||
Upstream-Status: Backport [import from ubuntu https://git.launchpad.net/ubuntu/+source/libcap2/tree/debian/patches/CVE-2023-2603.patch?h=ubuntu/focal-security
|
||||
Upstream commit https://git.kernel.org/pub/scm/libs/libcap/libcap.git/commit/?id=422bec25ae4a1ab03fd4d6f728695ed279173b18]
|
||||
CVE: CVE-2023-2603
|
||||
Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
|
||||
---
|
||||
libcap/cap_alloc.c | 12 +++++++-----
|
||||
1 file changed, 7 insertions(+), 5 deletions(-)
|
||||
|
||||
--- a/libcap/cap_alloc.c
|
||||
+++ b/libcap/cap_alloc.c
|
||||
@@ -76,13 +76,22 @@ cap_t cap_init(void)
|
||||
char *_libcap_strdup(const char *old)
|
||||
{
|
||||
__u32 *raw_data;
|
||||
+ size_t len;
|
||||
|
||||
if (old == NULL) {
|
||||
errno = EINVAL;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
- raw_data = malloc( sizeof(__u32) + strlen(old) + 1 );
|
||||
+ len = strlen(old);
|
||||
+ if ((len & 0x3fffffff) != len) {
|
||||
+ _cap_debug("len is too long for libcap to manage");
|
||||
+ errno = EINVAL;
|
||||
+ return NULL;
|
||||
+ }
|
||||
+ len += sizeof(__u32) + 1;
|
||||
+
|
||||
+ raw_data = malloc(len);
|
||||
if (raw_data == NULL) {
|
||||
errno = ENOMEM;
|
||||
return NULL;
|
||||
@@ -13,6 +13,8 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/libs/security/linux-privs/${BPN}2/${BPN}-${
|
||||
file://0001-ensure-the-XATTR_NAME_CAPS-is-defined-when-it-is-use.patch \
|
||||
file://0002-tests-do-not-run-target-executables.patch \
|
||||
file://0001-tests-do-not-statically-link-a-test.patch \
|
||||
file://CVE-2023-2602.patch \
|
||||
file://CVE-2023-2603.patch \
|
||||
"
|
||||
SRC_URI[md5sum] = "7416119c9fdcfd0e8dd190a432c668e9"
|
||||
SRC_URI[sha256sum] = "1005e3d227f2340ad1e3360ef8b69d15e3c72a29c09f4894d7aac038bd26e2be"
|
||||
|
||||
@@ -19,8 +19,8 @@ SRC_URI = "git://github.com/vim/vim.git;branch=master;protocol=https \
|
||||
file://no-path-adjust.patch \
|
||||
"
|
||||
|
||||
PV .= ".1527"
|
||||
SRCREV = "c28e7a2b2f23dbd246a1ad7ad7aaa6f7ab2e5887"
|
||||
PV .= ".1592"
|
||||
SRCREV = "29b4c513b11deb37f0e0538df53d195f602fa42c"
|
||||
|
||||
# Remove when 8.3 is out
|
||||
UPSTREAM_VERSION_UNKNOWN = "1"
|
||||
|
||||
@@ -15,7 +15,7 @@ class Dot(object):
|
||||
def __init__(self):
|
||||
parser = argparse.ArgumentParser(
|
||||
description="Analyse recipe-depends.dot generated by bitbake -g",
|
||||
epilog="Use %(prog)s --help to get help")
|
||||
formatter_class=argparse.RawDescriptionHelpFormatter)
|
||||
parser.add_argument("dotfile",
|
||||
help = "Specify the dotfile", nargs = 1, action='store', default='')
|
||||
parser.add_argument("-k", "--key",
|
||||
@@ -32,6 +32,21 @@ class Dot(object):
|
||||
" For example, A->B, B->C, A->C, then A->C can be removed.",
|
||||
action="store_true", default=False)
|
||||
|
||||
parser.epilog = """
|
||||
Examples:
|
||||
First generate the .dot file:
|
||||
bitbake -g core-image-minimal
|
||||
|
||||
To find out why a package is being built:
|
||||
%(prog)s -k <package> -w ./task-depends.dot
|
||||
|
||||
To find out what a package depends on:
|
||||
%(prog)s -k <package> -d ./task-depends.dot
|
||||
|
||||
Reduce the .dot file packages only, no tasks:
|
||||
%(prog)s -r ./task-depends.dot
|
||||
"""
|
||||
|
||||
self.args = parser.parse_args()
|
||||
|
||||
if len(sys.argv) != 3 and len(sys.argv) < 5:
|
||||
@@ -99,6 +114,10 @@ class Dot(object):
|
||||
if key == "meta-world-pkgdata":
|
||||
continue
|
||||
dep = m.group(2)
|
||||
key = key.split('.')[0]
|
||||
dep = dep.split('.')[0]
|
||||
if key == dep:
|
||||
continue
|
||||
if key in depends:
|
||||
if not key in depends[key]:
|
||||
depends[key].add(dep)
|
||||
|
||||
@@ -974,17 +974,14 @@ class BaseConfig(object):
|
||||
else:
|
||||
self.nfs_server = '192.168.7.1'
|
||||
|
||||
# Figure out a new nfs_instance to allow multiple qemus running.
|
||||
ps = subprocess.check_output(("ps", "auxww")).decode('utf-8')
|
||||
pattern = '/bin/unfsd .* -i .*\.pid -e .*/exports([0-9]+) '
|
||||
all_instances = re.findall(pattern, ps, re.M)
|
||||
if all_instances:
|
||||
all_instances.sort(key=int)
|
||||
self.nfs_instance = int(all_instances.pop()) + 1
|
||||
|
||||
nfsd_port = 3049 + 2 * self.nfs_instance
|
||||
mountd_port = 3048 + 2 * self.nfs_instance
|
||||
nfsd_port = 3048 + self.nfs_instance
|
||||
lockdir = "/tmp/qemu-port-locks"
|
||||
self.make_lock_dir(lockdir)
|
||||
while not self.check_free_port('localhost', nfsd_port, lockdir):
|
||||
self.nfs_instance += 1
|
||||
nfsd_port += 1
|
||||
|
||||
mountd_port = nfsd_port
|
||||
# Export vars for runqemu-export-rootfs
|
||||
export_dict = {
|
||||
'NFS_INSTANCE': self.nfs_instance,
|
||||
@@ -1034,6 +1031,17 @@ class BaseConfig(object):
|
||||
self.set('NETWORK_CMD', '-netdev bridge,br=%s,id=net0,helper=%s -device virtio-net-pci,netdev=net0 ' % (
|
||||
self.net_bridge, os.path.join(self.bindir_native, 'qemu-oe-bridge-helper')))
|
||||
|
||||
def make_lock_dir(self, lockdir):
|
||||
if not os.path.exists(lockdir):
|
||||
# There might be a race issue when multi runqemu processess are
|
||||
# running at the same time.
|
||||
try:
|
||||
os.mkdir(lockdir)
|
||||
os.chmod(lockdir, 0o777)
|
||||
except FileExistsError:
|
||||
pass
|
||||
return
|
||||
|
||||
def setup_slirp(self):
|
||||
"""Setup user networking"""
|
||||
|
||||
@@ -1052,14 +1060,7 @@ class BaseConfig(object):
|
||||
mac = 2
|
||||
|
||||
lockdir = "/tmp/qemu-port-locks"
|
||||
if not os.path.exists(lockdir):
|
||||
# There might be a race issue when multi runqemu processess are
|
||||
# running at the same time.
|
||||
try:
|
||||
os.mkdir(lockdir)
|
||||
os.chmod(lockdir, 0o777)
|
||||
except FileExistsError:
|
||||
pass
|
||||
self.make_lock_dir(lockdir)
|
||||
|
||||
# Find a free port to avoid conflicts
|
||||
for p in ports[:]:
|
||||
@@ -1099,14 +1100,7 @@ class BaseConfig(object):
|
||||
logger.error("ip: %s" % ip)
|
||||
raise OEPathError("runqemu-ifup, runqemu-ifdown or ip not found")
|
||||
|
||||
if not os.path.exists(lockdir):
|
||||
# There might be a race issue when multi runqemu processess are
|
||||
# running at the same time.
|
||||
try:
|
||||
os.mkdir(lockdir)
|
||||
os.chmod(lockdir, 0o777)
|
||||
except FileExistsError:
|
||||
pass
|
||||
self.make_lock_dir(lockdir)
|
||||
|
||||
cmd = (ip, 'link')
|
||||
logger.debug('Running %s...' % str(cmd))
|
||||
@@ -1423,13 +1417,13 @@ class BaseConfig(object):
|
||||
logger.debug('Running %s' % str(cmd))
|
||||
subprocess.check_call(cmd)
|
||||
self.release_taplock()
|
||||
self.release_portlock()
|
||||
|
||||
if self.nfs_running:
|
||||
logger.info("Shutting down the userspace NFS server...")
|
||||
cmd = ("runqemu-export-rootfs", "stop", self.rootfs)
|
||||
logger.debug('Running %s' % str(cmd))
|
||||
subprocess.check_call(cmd)
|
||||
self.release_portlock()
|
||||
|
||||
if self.saved_stty:
|
||||
subprocess.check_call(("stty", self.saved_stty))
|
||||
|
||||
Reference in New Issue
Block a user