mirror of
https://git.yoctoproject.org/poky
synced 2026-02-21 08:59:41 +01:00
Compare commits
33 Commits
yocto-3.1.
...
yocto-3.1.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4aad5914ef | ||
|
|
23322786e0 | ||
|
|
139225f0ba | ||
|
|
fc24cd1948 | ||
|
|
1fc880e165 | ||
|
|
9243169d4f | ||
|
|
f97bd9abe6 | ||
|
|
59180eb474 | ||
|
|
2340b1dbb9 | ||
|
|
0b85e5d610 | ||
|
|
ef2da8f28e | ||
|
|
5373e681cf | ||
|
|
98dd6e4cac | ||
|
|
ae4acc9f81 | ||
|
|
cfd2eaa0e1 | ||
|
|
5b956ef359 | ||
|
|
54846f581e | ||
|
|
b361f2a931 | ||
|
|
0c3dfb682d | ||
|
|
7c7fc0de71 | ||
|
|
354f571f61 | ||
|
|
883102b9b8 | ||
|
|
b365d212dc | ||
|
|
c4499b85f7 | ||
|
|
c35c1e15f0 | ||
|
|
820e8891b8 | ||
|
|
b9ae8da74e | ||
|
|
038831674e | ||
|
|
25606f450d | ||
|
|
9e7f4a7db2 | ||
|
|
e4946bd39e | ||
|
|
97810ff2d7 | ||
|
|
d323923047 |
@@ -52,6 +52,12 @@ class WgetProgressHandler(bb.progress.LineFilterProgressHandler):
|
||||
|
||||
|
||||
class Wget(FetchMethod):
|
||||
|
||||
# CDNs like CloudFlare may do a 'browser integrity test' which can fail
|
||||
# with the standard wget/urllib User-Agent, so pretend to be a modern
|
||||
# browser.
|
||||
user_agent = "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:84.0) Gecko/20100101 Firefox/84.0"
|
||||
|
||||
"""Class to fetch urls via 'wget'"""
|
||||
def supports(self, ud, d):
|
||||
"""
|
||||
@@ -303,7 +309,7 @@ class Wget(FetchMethod):
|
||||
# Some servers (FusionForge, as used on Alioth) require that the
|
||||
# optional Accept header is set.
|
||||
r.add_header("Accept", "*/*")
|
||||
r.add_header("User-Agent", "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.12) Gecko/20101027 Ubuntu/9.10 (karmic) Firefox/3.6.12")
|
||||
r.add_header("User-Agent", self.user_agent)
|
||||
def add_basic_auth(login_str, request):
|
||||
'''Adds Basic auth to http request, pass in login:password as string'''
|
||||
import base64
|
||||
@@ -407,9 +413,8 @@ class Wget(FetchMethod):
|
||||
"""
|
||||
f = tempfile.NamedTemporaryFile()
|
||||
with tempfile.TemporaryDirectory(prefix="wget-index-") as workdir, tempfile.NamedTemporaryFile(dir=workdir, prefix="wget-listing-") as f:
|
||||
agent = "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.12) Gecko/20101027 Ubuntu/9.10 (karmic) Firefox/3.6.12"
|
||||
fetchcmd = self.basecmd
|
||||
fetchcmd += " -O " + f.name + " --user-agent='" + agent + "' '" + uri + "'"
|
||||
fetchcmd += " -O " + f.name + " --user-agent='" + self.user_agent + "' '" + uri + "'"
|
||||
try:
|
||||
self._runwget(ud, d, fetchcmd, True, workdir=workdir)
|
||||
fetchresult = f.read()
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
DISTRO : "3.1.18"
|
||||
DISTRO : "3.1.19"
|
||||
DISTRO_NAME_NO_CAP : "dunfell"
|
||||
DISTRO_NAME : "Dunfell"
|
||||
DISTRO_NAME_NO_CAP_MINUS_ONE : "zeus"
|
||||
YOCTO_DOC_VERSION : "3.1.18"
|
||||
YOCTO_DOC_VERSION : "3.1.19"
|
||||
YOCTO_DOC_VERSION_MINUS_ONE : "3.0.4"
|
||||
DISTRO_REL_TAG : "yocto-3.1.18"
|
||||
DOCCONF_VERSION : "3.1.18"
|
||||
DISTRO_REL_TAG : "yocto-3.1.19"
|
||||
DOCCONF_VERSION : "3.1.19"
|
||||
BITBAKE_SERIES : "1.46"
|
||||
POKYVERSION : "23.0.18"
|
||||
POKYVERSION : "23.0.19"
|
||||
YOCTO_POKY : "poky-&DISTRO_NAME_NO_CAP;-&POKYVERSION;"
|
||||
YOCTO_DL_URL : "https://downloads.yoctoproject.org"
|
||||
YOCTO_AB_URL : "https://autobuilder.yoctoproject.org"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
DISTRO = "poky"
|
||||
DISTRO_NAME = "Poky (Yocto Project Reference Distro)"
|
||||
DISTRO_VERSION = "3.1.18"
|
||||
DISTRO_VERSION = "3.1.19"
|
||||
DISTRO_CODENAME = "dunfell"
|
||||
SDK_VENDOR = "-pokysdk"
|
||||
SDK_VERSION = "${@d.getVar('DISTRO_VERSION').replace('snapshot-${DATE}', 'snapshot')}"
|
||||
|
||||
@@ -30,8 +30,9 @@ bin_package_do_install () {
|
||||
bbfatal bin_package has nothing to install. Be sure the SRC_URI unpacks into S.
|
||||
fi
|
||||
cd ${S}
|
||||
install -d ${D}${base_prefix}
|
||||
tar --no-same-owner --exclude='./patches' --exclude='./.pc' -cpf - . \
|
||||
| tar --no-same-owner -xpf - -C ${D}
|
||||
| tar --no-same-owner -xpf - -C ${D}${base_prefix}
|
||||
}
|
||||
|
||||
FILES_${PN} = "/"
|
||||
|
||||
@@ -452,12 +452,14 @@ def package_qa_check_buildpaths(path, name, d, elf, messages):
|
||||
"""
|
||||
Check for build paths inside target files and error if not found in the whitelist
|
||||
"""
|
||||
import stat
|
||||
# Ignore .debug files, not interesting
|
||||
if path.find(".debug") != -1:
|
||||
return
|
||||
|
||||
# Ignore symlinks
|
||||
if os.path.islink(path):
|
||||
# Ignore symlinks/devs/fifos
|
||||
mode = os.lstat(path).st_mode
|
||||
if stat.S_ISLNK(mode) or stat.S_ISBLK(mode) or stat.S_ISFIFO(mode) or stat.S_ISCHR(mode) or stat.S_ISSOCK(mode):
|
||||
return
|
||||
|
||||
tmpdir = bytes(d.getVar('TMPDIR'), encoding="utf-8")
|
||||
|
||||
@@ -61,7 +61,7 @@ HOST_LD_KERNEL_ARCH ?= "${TARGET_LD_KERNEL_ARCH}"
|
||||
TARGET_AR_KERNEL_ARCH ?= ""
|
||||
HOST_AR_KERNEL_ARCH ?= "${TARGET_AR_KERNEL_ARCH}"
|
||||
|
||||
KERNEL_CC = "${CCACHE}${HOST_PREFIX}gcc ${HOST_CC_KERNEL_ARCH} -fuse-ld=bfd ${DEBUG_PREFIX_MAP} -fdebug-prefix-map=${STAGING_KERNEL_DIR}=${KERNEL_SRC_PATH}"
|
||||
KERNEL_CC = "${CCACHE}${HOST_PREFIX}gcc ${HOST_CC_KERNEL_ARCH} -fuse-ld=bfd ${DEBUG_PREFIX_MAP} -fdebug-prefix-map=${STAGING_KERNEL_DIR}=${KERNEL_SRC_PATH} -fdebug-prefix-map=${STAGING_KERNEL_BUILDDIR}=${KERNEL_SRC_PATH}"
|
||||
KERNEL_LD = "${CCACHE}${HOST_PREFIX}ld.bfd ${HOST_LD_KERNEL_ARCH}"
|
||||
KERNEL_AR = "${CCACHE}${HOST_PREFIX}ar ${HOST_AR_KERNEL_ARCH}"
|
||||
TOOLCHAIN = "gcc"
|
||||
|
||||
@@ -56,6 +56,9 @@ FIT_HASH_ALG ?= "sha256"
|
||||
# fitImage Signature Algo
|
||||
FIT_SIGN_ALG ?= "rsa2048"
|
||||
|
||||
# fitImage Padding Algo
|
||||
FIT_PAD_ALG ?= "pkcs-1.5"
|
||||
|
||||
#
|
||||
# Emit the fitImage ITS header
|
||||
#
|
||||
@@ -250,6 +253,7 @@ fitimage_emit_section_config() {
|
||||
|
||||
conf_csum="${FIT_HASH_ALG}"
|
||||
conf_sign_algo="${FIT_SIGN_ALG}"
|
||||
conf_padding_algo="${FIT_PAD_ALG}"
|
||||
if [ "${UBOOT_SIGN_ENABLE}" = "1" ] ; then
|
||||
conf_sign_keyname="${UBOOT_SIGN_KEYNAME}"
|
||||
fi
|
||||
@@ -333,6 +337,7 @@ EOF
|
||||
signature-1 {
|
||||
algo = "${conf_csum},${conf_sign_algo}";
|
||||
key-name-hint = "${conf_sign_keyname}";
|
||||
padding = "${conf_padding_algo}";
|
||||
${sign_line}
|
||||
};
|
||||
EOF
|
||||
|
||||
@@ -305,7 +305,7 @@ rootfs_trim_schemas () {
|
||||
}
|
||||
|
||||
rootfs_check_host_user_contaminated () {
|
||||
contaminated="${WORKDIR}/host-user-contaminated.txt"
|
||||
contaminated="${S}/host-user-contaminated.txt"
|
||||
HOST_USER_UID="$(PSEUDO_UNLOAD=1 id -u)"
|
||||
HOST_USER_GID="$(PSEUDO_UNLOAD=1 id -g)"
|
||||
|
||||
|
||||
@@ -114,9 +114,10 @@ def get_patched_cves(d):
|
||||
for url in oe.patch.src_patches(d):
|
||||
patch_file = bb.fetch.decodeurl(url)[2]
|
||||
|
||||
# Remote compressed patches may not be unpacked, so silently ignore them
|
||||
if not os.path.isfile(patch_file):
|
||||
bb.error("File Not found: %s" % patch_file)
|
||||
raise FileNotFoundError
|
||||
bb.warn("%s does not exist, cannot extract CVE list" % patch_file)
|
||||
continue
|
||||
|
||||
# Check patch file name for CVE ID
|
||||
fname_match = cve_file_name_match.search(patch_file)
|
||||
|
||||
@@ -187,6 +187,8 @@ class TestImage(OESelftestTestCase):
|
||||
self.skipTest('virgl isn\'t working with Fedora 34')
|
||||
if distro and distro == 'fedora-35':
|
||||
self.skipTest('virgl isn\'t working with Fedora 35')
|
||||
if distro and distro == 'fedora-36':
|
||||
self.skipTest('virgl isn\'t working with Fedora 36')
|
||||
if distro and distro == 'opensuseleap-15.0':
|
||||
self.skipTest('virgl isn\'t working with Opensuse 15.0')
|
||||
|
||||
|
||||
178
meta/recipes-bsp/grub/files/CVE-2021-3695.patch
Normal file
178
meta/recipes-bsp/grub/files/CVE-2021-3695.patch
Normal file
@@ -0,0 +1,178 @@
|
||||
From 0693d672abcf720419f86c56bda6428c540e2bb1 Mon Sep 17 00:00:00 2001
|
||||
From: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
Date: Wed, 20 Jul 2022 10:01:35 +0530
|
||||
Subject: [PATCH] CVE-2021-3695
|
||||
|
||||
Upstream-Status: Backport [https://git.savannah.gnu.org/gitweb/?p=grub.git;a=commit;h=e623866d9286410156e8b9d2c82d6253a1b22d08]
|
||||
CVE: CVE-2021-3695
|
||||
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
|
||||
video/readers/png: Drop greyscale support to fix heap out-of-bounds write
|
||||
|
||||
A 16-bit greyscale PNG without alpha is processed in the following loop:
|
||||
|
||||
for (i = 0; i < (data->image_width * data->image_height);
|
||||
i++, d1 += 4, d2 += 2)
|
||||
{
|
||||
d1[R3] = d2[1];
|
||||
d1[G3] = d2[1];
|
||||
d1[B3] = d2[1];
|
||||
}
|
||||
|
||||
The increment of d1 is wrong. d1 is incremented by 4 bytes per iteration,
|
||||
but there are only 3 bytes allocated for storage. This means that image
|
||||
data will overwrite somewhat-attacker-controlled parts of memory - 3 bytes
|
||||
out of every 4 following the end of the image.
|
||||
|
||||
This has existed since greyscale support was added in 2013 in commit
|
||||
3ccf16dff98f (grub-core/video/readers/png.c: Support grayscale).
|
||||
|
||||
Saving starfield.png as a 16-bit greyscale image without alpha in the gimp
|
||||
and attempting to load it causes grub-emu to crash - I don't think this code
|
||||
has ever worked.
|
||||
|
||||
Delete all PNG greyscale support.
|
||||
|
||||
Fixes: CVE-2021-3695
|
||||
|
||||
Signed-off-by: Daniel Axtens <dja@axtens.net>
|
||||
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
|
||||
---
|
||||
grub-core/video/readers/png.c | 89 ++++-------------------------------
|
||||
1 file changed, 8 insertions(+), 81 deletions(-)
|
||||
|
||||
diff --git a/grub-core/video/readers/png.c b/grub-core/video/readers/png.c
|
||||
index 0157ff7..db4a9d4 100644
|
||||
--- a/grub-core/video/readers/png.c
|
||||
+++ b/grub-core/video/readers/png.c
|
||||
@@ -100,7 +100,7 @@ struct grub_png_data
|
||||
|
||||
unsigned image_width, image_height;
|
||||
int bpp, is_16bit;
|
||||
- int raw_bytes, is_gray, is_alpha, is_palette;
|
||||
+ int raw_bytes, is_alpha, is_palette;
|
||||
int row_bytes, color_bits;
|
||||
grub_uint8_t *image_data;
|
||||
|
||||
@@ -280,13 +280,13 @@ grub_png_decode_image_header (struct grub_png_data *data)
|
||||
data->bpp = 3;
|
||||
else
|
||||
{
|
||||
- data->is_gray = 1;
|
||||
- data->bpp = 1;
|
||||
+ return grub_error (GRUB_ERR_BAD_FILE_TYPE,
|
||||
+ "png: color type not supported");
|
||||
}
|
||||
|
||||
if ((color_bits != 8) && (color_bits != 16)
|
||||
&& (color_bits != 4
|
||||
- || !(data->is_gray || data->is_palette)))
|
||||
+ || !data->is_palette))
|
||||
return grub_error (GRUB_ERR_BAD_FILE_TYPE,
|
||||
"png: bit depth must be 8 or 16");
|
||||
|
||||
@@ -315,7 +315,7 @@ grub_png_decode_image_header (struct grub_png_data *data)
|
||||
}
|
||||
|
||||
#ifndef GRUB_CPU_WORDS_BIGENDIAN
|
||||
- if (data->is_16bit || data->is_gray || data->is_palette)
|
||||
+ if (data->is_16bit || data->is_palette)
|
||||
#endif
|
||||
{
|
||||
data->image_data = grub_calloc (data->image_height, data->row_bytes);
|
||||
@@ -859,27 +859,8 @@ grub_png_convert_image (struct grub_png_data *data)
|
||||
int shift;
|
||||
int mask = (1 << data->color_bits) - 1;
|
||||
unsigned j;
|
||||
- if (data->is_gray)
|
||||
- {
|
||||
- /* Generic formula is
|
||||
- (0xff * i) / ((1U << data->color_bits) - 1)
|
||||
- but for allowed bit depth of 1, 2 and for it's
|
||||
- equivalent to
|
||||
- (0xff / ((1U << data->color_bits) - 1)) * i
|
||||
- Precompute the multipliers to avoid division.
|
||||
- */
|
||||
-
|
||||
- const grub_uint8_t multipliers[5] = { 0xff, 0xff, 0x55, 0x24, 0x11 };
|
||||
- for (i = 0; i < (1U << data->color_bits); i++)
|
||||
- {
|
||||
- grub_uint8_t col = multipliers[data->color_bits] * i;
|
||||
- palette[i][0] = col;
|
||||
- palette[i][1] = col;
|
||||
- palette[i][2] = col;
|
||||
- }
|
||||
- }
|
||||
- else
|
||||
- grub_memcpy (palette, data->palette, 3 << data->color_bits);
|
||||
+
|
||||
+ grub_memcpy (palette, data->palette, 3 << data->color_bits);
|
||||
d1c = d1;
|
||||
d2c = d2;
|
||||
for (j = 0; j < data->image_height; j++, d1c += data->image_width * 3,
|
||||
@@ -917,61 +898,7 @@ grub_png_convert_image (struct grub_png_data *data)
|
||||
return;
|
||||
}
|
||||
|
||||
- if (data->is_gray)
|
||||
- {
|
||||
- switch (data->bpp)
|
||||
- {
|
||||
- case 4:
|
||||
- /* 16-bit gray with alpha. */
|
||||
- for (i = 0; i < (data->image_width * data->image_height);
|
||||
- i++, d1 += 4, d2 += 4)
|
||||
- {
|
||||
- d1[R4] = d2[3];
|
||||
- d1[G4] = d2[3];
|
||||
- d1[B4] = d2[3];
|
||||
- d1[A4] = d2[1];
|
||||
- }
|
||||
- break;
|
||||
- case 2:
|
||||
- if (data->is_16bit)
|
||||
- /* 16-bit gray without alpha. */
|
||||
- {
|
||||
- for (i = 0; i < (data->image_width * data->image_height);
|
||||
- i++, d1 += 4, d2 += 2)
|
||||
- {
|
||||
- d1[R3] = d2[1];
|
||||
- d1[G3] = d2[1];
|
||||
- d1[B3] = d2[1];
|
||||
- }
|
||||
- }
|
||||
- else
|
||||
- /* 8-bit gray with alpha. */
|
||||
- {
|
||||
- for (i = 0; i < (data->image_width * data->image_height);
|
||||
- i++, d1 += 4, d2 += 2)
|
||||
- {
|
||||
- d1[R4] = d2[1];
|
||||
- d1[G4] = d2[1];
|
||||
- d1[B4] = d2[1];
|
||||
- d1[A4] = d2[0];
|
||||
- }
|
||||
- }
|
||||
- break;
|
||||
- /* 8-bit gray without alpha. */
|
||||
- case 1:
|
||||
- for (i = 0; i < (data->image_width * data->image_height);
|
||||
- i++, d1 += 3, d2++)
|
||||
- {
|
||||
- d1[R3] = d2[0];
|
||||
- d1[G3] = d2[0];
|
||||
- d1[B3] = d2[0];
|
||||
- }
|
||||
- break;
|
||||
- }
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
- {
|
||||
+ {
|
||||
/* Only copy the upper 8 bit. */
|
||||
#ifndef GRUB_CPU_WORDS_BIGENDIAN
|
||||
for (i = 0; i < (data->image_width * data->image_height * data->bpp >> 1);
|
||||
--
|
||||
2.25.1
|
||||
|
||||
46
meta/recipes-bsp/grub/files/CVE-2021-3696.patch
Normal file
46
meta/recipes-bsp/grub/files/CVE-2021-3696.patch
Normal file
@@ -0,0 +1,46 @@
|
||||
From b18ce59d6496a9313d75f9497a0efac61dcf4191 Mon Sep 17 00:00:00 2001
|
||||
From: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
Date: Wed, 20 Jul 2022 10:05:42 +0530
|
||||
Subject: [PATCH] CVE-2021-3696
|
||||
|
||||
Upstream-Status: Backport [https://git.savannah.gnu.org/gitweb/?p=grub.git;a=commit;h=210245129c932dc9e1c2748d9d35524fb95b5042]
|
||||
CVE: CVE-2021-3696
|
||||
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
|
||||
video/readers/png: Avoid heap OOB R/W inserting huff table items
|
||||
|
||||
In fuzzing we observed crashes where a code would attempt to be inserted
|
||||
into a huffman table before the start, leading to a set of heap OOB reads
|
||||
and writes as table entries with negative indices were shifted around and
|
||||
the new code written in.
|
||||
|
||||
Catch the case where we would underflow the array and bail.
|
||||
|
||||
Fixes: CVE-2021-3696
|
||||
Signed-off-by: Daniel Axtens <dja@axtens.net>
|
||||
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
|
||||
---
|
||||
grub-core/video/readers/png.c | 7 +++++++
|
||||
1 file changed, 7 insertions(+)
|
||||
|
||||
diff --git a/grub-core/video/readers/png.c b/grub-core/video/readers/png.c
|
||||
index 36b3f10..3c05951 100644
|
||||
--- a/grub-core/video/readers/png.c
|
||||
+++ b/grub-core/video/readers/png.c
|
||||
@@ -416,6 +416,13 @@ grub_png_insert_huff_item (struct huff_table *ht, int code, int len)
|
||||
for (i = len; i < ht->max_length; i++)
|
||||
n += ht->maxval[i];
|
||||
|
||||
+ if (n > ht->num_values)
|
||||
+ {
|
||||
+ grub_error (GRUB_ERR_BAD_FILE_TYPE,
|
||||
+ "png: out of range inserting huffman table item");
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
for (i = 0; i < n; i++)
|
||||
ht->values[ht->num_values - i] = ht->values[ht->num_values - i - 1];
|
||||
|
||||
--
|
||||
2.25.1
|
||||
|
||||
82
meta/recipes-bsp/grub/files/CVE-2021-3697.patch
Normal file
82
meta/recipes-bsp/grub/files/CVE-2021-3697.patch
Normal file
@@ -0,0 +1,82 @@
|
||||
From 4de9de9d14f4ac27229e45514627534e32cc4406 Mon Sep 17 00:00:00 2001
|
||||
From: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
Date: Tue, 19 Jul 2022 11:13:02 +0530
|
||||
Subject: [PATCH] CVE-2021-3697
|
||||
|
||||
Upstream-Status: Backport [https://git.savannah.gnu.org/gitweb/?p=grub.git;a=commit;h=22a3f97d39f6a10b08ad7fd1cc47c4dcd10413f6]
|
||||
CVE: CVE-2021-3697
|
||||
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
|
||||
video/readers/jpeg: Block int underflow -> wild pointer write
|
||||
|
||||
Certain 1 px wide images caused a wild pointer write in
|
||||
grub_jpeg_ycrcb_to_rgb(). This was caused because in grub_jpeg_decode_data(),
|
||||
we have the following loop:
|
||||
|
||||
for (; data->r1 < nr1 && (!data->dri || rst);
|
||||
data->r1++, data->bitmap_ptr += (vb * data->image_width - hb * nc1) * 3)
|
||||
|
||||
We did not check if vb * width >= hb * nc1.
|
||||
|
||||
On a 64-bit platform, if that turns out to be negative, it will underflow,
|
||||
be interpreted as unsigned 64-bit, then be added to the 64-bit pointer, so
|
||||
we see data->bitmap_ptr jump, e.g.:
|
||||
|
||||
0x6180_0000_0480 to
|
||||
0x6181_0000_0498
|
||||
^
|
||||
~--- carry has occurred and this pointer is now far away from
|
||||
any object.
|
||||
|
||||
On a 32-bit platform, it will decrement the pointer, creating a pointer
|
||||
that won't crash but will overwrite random data.
|
||||
|
||||
Catch the underflow and error out.
|
||||
|
||||
Fixes: CVE-2021-3697
|
||||
|
||||
Signed-off-by: Daniel Axtens <dja@axtens.net>
|
||||
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
|
||||
---
|
||||
grub-core/video/readers/jpeg.c | 10 +++++++++-
|
||||
1 file changed, 9 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/grub-core/video/readers/jpeg.c b/grub-core/video/readers/jpeg.c
|
||||
index 31359a4..545a60b 100644
|
||||
--- a/grub-core/video/readers/jpeg.c
|
||||
+++ b/grub-core/video/readers/jpeg.c
|
||||
@@ -23,6 +23,7 @@
|
||||
#include <grub/mm.h>
|
||||
#include <grub/misc.h>
|
||||
#include <grub/bufio.h>
|
||||
+#include <grub/safemath.h>
|
||||
|
||||
GRUB_MOD_LICENSE ("GPLv3+");
|
||||
|
||||
@@ -617,6 +618,7 @@ static grub_err_t
|
||||
grub_jpeg_decode_data (struct grub_jpeg_data *data)
|
||||
{
|
||||
unsigned c1, vb, hb, nr1, nc1;
|
||||
+ unsigned stride_a, stride_b, stride;
|
||||
int rst = data->dri;
|
||||
|
||||
vb = 8 << data->log_vs;
|
||||
@@ -624,8 +626,14 @@ grub_jpeg_decode_data (struct grub_jpeg_data *data)
|
||||
nr1 = (data->image_height + vb - 1) >> (3 + data->log_vs);
|
||||
nc1 = (data->image_width + hb - 1) >> (3 + data->log_hs);
|
||||
|
||||
+ if (grub_mul(vb, data->image_width, &stride_a) ||
|
||||
+ grub_mul(hb, nc1, &stride_b) ||
|
||||
+ grub_sub(stride_a, stride_b, &stride))
|
||||
+ return grub_error (GRUB_ERR_BAD_FILE_TYPE,
|
||||
+ "jpeg: cannot decode image with these dimensions");
|
||||
+
|
||||
for (; data->r1 < nr1 && (!data->dri || rst);
|
||||
- data->r1++, data->bitmap_ptr += (vb * data->image_width - hb * nc1) * 3)
|
||||
+ data->r1++, data->bitmap_ptr += stride * 3)
|
||||
for (c1 = 0; c1 < nc1 && (!data->dri || rst);
|
||||
c1++, rst--, data->bitmap_ptr += hb * 3)
|
||||
{
|
||||
--
|
||||
2.25.1
|
||||
|
||||
60
meta/recipes-bsp/grub/files/CVE-2022-28733.patch
Normal file
60
meta/recipes-bsp/grub/files/CVE-2022-28733.patch
Normal file
@@ -0,0 +1,60 @@
|
||||
From 415fb5eb83cbd3b5cfc25ac1290f2de4fe3d231c Mon Sep 17 00:00:00 2001
|
||||
From: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
Date: Mon, 1 Aug 2022 10:48:34 +0530
|
||||
Subject: [PATCH] CVE-2022-28733
|
||||
|
||||
Upstream-Status: Backport [https://git.savannah.gnu.org/gitweb/?p=grub.git;a=commit;h=3e4817538de828319ba6d59ced2fbb9b5ca13287]
|
||||
CVE: CVE-2022-28733
|
||||
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
|
||||
net/ip: Do IP fragment maths safely
|
||||
|
||||
We can receive packets with invalid IP fragmentation information. This
|
||||
can lead to rsm->total_len underflowing and becoming very large.
|
||||
|
||||
Then, in grub_netbuff_alloc(), we add to this very large number, which can
|
||||
cause it to overflow and wrap back around to a small positive number.
|
||||
The allocation then succeeds, but the resulting buffer is too small and
|
||||
subsequent operations can write past the end of the buffer.
|
||||
|
||||
Catch the underflow here.
|
||||
|
||||
Fixes: CVE-2022-28733
|
||||
|
||||
Signed-off-by: Daniel Axtens <dja@axtens.net>
|
||||
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
|
||||
---
|
||||
grub-core/net/ip.c | 10 +++++++++-
|
||||
1 file changed, 9 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/grub-core/net/ip.c b/grub-core/net/ip.c
|
||||
index ea5edf8..74e4e8b 100644
|
||||
--- a/grub-core/net/ip.c
|
||||
+++ b/grub-core/net/ip.c
|
||||
@@ -25,6 +25,7 @@
|
||||
#include <grub/net/netbuff.h>
|
||||
#include <grub/mm.h>
|
||||
#include <grub/priority_queue.h>
|
||||
+#include <grub/safemath.h>
|
||||
#include <grub/time.h>
|
||||
|
||||
struct iphdr {
|
||||
@@ -512,7 +513,14 @@ grub_net_recv_ip4_packets (struct grub_net_buff *nb,
|
||||
{
|
||||
rsm->total_len = (8 * (grub_be_to_cpu16 (iph->frags) & OFFSET_MASK)
|
||||
+ (nb->tail - nb->data));
|
||||
- rsm->total_len -= ((iph->verhdrlen & 0xf) * sizeof (grub_uint32_t));
|
||||
+
|
||||
+ if (grub_sub (rsm->total_len, (iph->verhdrlen & 0xf) * sizeof (grub_uint32_t),
|
||||
+ &rsm->total_len))
|
||||
+ {
|
||||
+ grub_dprintf ("net", "IP reassembly size underflow\n");
|
||||
+ return GRUB_ERR_NONE;
|
||||
+ }
|
||||
+
|
||||
rsm->asm_netbuff = grub_netbuff_alloc (rsm->total_len);
|
||||
if (!rsm->asm_netbuff)
|
||||
{
|
||||
--
|
||||
2.25.1
|
||||
|
||||
67
meta/recipes-bsp/grub/files/CVE-2022-28734.patch
Normal file
67
meta/recipes-bsp/grub/files/CVE-2022-28734.patch
Normal file
@@ -0,0 +1,67 @@
|
||||
From f03f09c2a07eae7f3a4646e33a406ae2689afb9e Mon Sep 17 00:00:00 2001
|
||||
From: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
Date: Mon, 1 Aug 2022 10:59:41 +0530
|
||||
Subject: [PATCH] CVE-2022-28734
|
||||
|
||||
Upstream-Status: Backport [https://git.savannah.gnu.org/gitweb/?p=grub.git;a=commit;h=b26b4c08e7119281ff30d0fb4a6169bd2afa8fe4]
|
||||
CVE: CVE-2022-28734
|
||||
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
|
||||
net/http: Fix OOB write for split http headers
|
||||
|
||||
GRUB has special code for handling an http header that is split
|
||||
across two packets.
|
||||
|
||||
The code tracks the end of line by looking for a "\n" byte. The
|
||||
code for split headers has always advanced the pointer just past the
|
||||
end of the line, whereas the code that handles unsplit headers does
|
||||
not advance the pointer. This extra advance causes the length to be
|
||||
one greater, which breaks an assumption in parse_line(), leading to
|
||||
it writing a NUL byte one byte past the end of the buffer where we
|
||||
reconstruct the line from the two packets.
|
||||
|
||||
It's conceivable that an attacker controlled set of packets could
|
||||
cause this to zero out the first byte of the "next" pointer of the
|
||||
grub_mm_region structure following the current_line buffer.
|
||||
|
||||
Do not advance the pointer in the split header case.
|
||||
|
||||
Fixes: CVE-2022-28734
|
||||
---
|
||||
grub-core/net/http.c | 12 +++++++++---
|
||||
1 file changed, 9 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/grub-core/net/http.c b/grub-core/net/http.c
|
||||
index 5aa4ad3..a220d21 100644
|
||||
--- a/grub-core/net/http.c
|
||||
+++ b/grub-core/net/http.c
|
||||
@@ -68,7 +68,15 @@ parse_line (grub_file_t file, http_data_t data, char *ptr, grub_size_t len)
|
||||
char *end = ptr + len;
|
||||
while (end > ptr && *(end - 1) == '\r')
|
||||
end--;
|
||||
+
|
||||
+ /* LF without CR. */
|
||||
+ if (end == ptr + len)
|
||||
+ {
|
||||
+ data->errmsg = grub_strdup (_("invalid HTTP header - LF without CR"));
|
||||
+ return GRUB_ERR_NONE;
|
||||
+ }
|
||||
*end = 0;
|
||||
+
|
||||
/* Trailing CRLF. */
|
||||
if (data->in_chunk_len == 1)
|
||||
{
|
||||
@@ -190,9 +198,7 @@ http_receive (grub_net_tcp_socket_t sock __attribute__ ((unused)),
|
||||
int have_line = 1;
|
||||
char *t;
|
||||
ptr = grub_memchr (nb->data, '\n', nb->tail - nb->data);
|
||||
- if (ptr)
|
||||
- ptr++;
|
||||
- else
|
||||
+ if (ptr == NULL)
|
||||
{
|
||||
have_line = 0;
|
||||
ptr = (char *) nb->tail;
|
||||
--
|
||||
2.25.1
|
||||
|
||||
275
meta/recipes-bsp/grub/files/CVE-2022-28736.patch
Normal file
275
meta/recipes-bsp/grub/files/CVE-2022-28736.patch
Normal file
@@ -0,0 +1,275 @@
|
||||
From 431a111c60095fc973d83fe9209f26f29ce78784 Mon Sep 17 00:00:00 2001
|
||||
From: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
Date: Mon, 1 Aug 2022 11:17:17 +0530
|
||||
Subject: [PATCH] CVE-2022-28736
|
||||
|
||||
Upstream-Status: Backport [https://git.savannah.gnu.org/gitweb/?p=grub.git;a=commit;h=04c86e0bb7b58fc2f913f798cdb18934933e532d]
|
||||
CVE: CVE-2022-28736
|
||||
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
|
||||
loader/efi/chainloader: Use grub_loader_set_ex()
|
||||
|
||||
This ports the EFI chainloader to use grub_loader_set_ex() in order to fix
|
||||
a use-after-free bug that occurs when grub_cmd_chainloader() is executed
|
||||
more than once before a boot attempt is performed.
|
||||
|
||||
Fixes: CVE-2022-28736
|
||||
|
||||
Signed-off-by: Chris Coulson <chris.coulson@canonical.com>
|
||||
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
|
||||
---
|
||||
grub-core/commands/boot.c | 66 ++++++++++++++++++++++++++----
|
||||
grub-core/loader/efi/chainloader.c | 46 +++++++++++----------
|
||||
include/grub/loader.h | 5 +++
|
||||
3 files changed, 87 insertions(+), 30 deletions(-)
|
||||
|
||||
diff --git a/grub-core/commands/boot.c b/grub-core/commands/boot.c
|
||||
index bbca81e..6151478 100644
|
||||
--- a/grub-core/commands/boot.c
|
||||
+++ b/grub-core/commands/boot.c
|
||||
@@ -27,10 +27,20 @@
|
||||
|
||||
GRUB_MOD_LICENSE ("GPLv3+");
|
||||
|
||||
-static grub_err_t (*grub_loader_boot_func) (void);
|
||||
-static grub_err_t (*grub_loader_unload_func) (void);
|
||||
+static grub_err_t (*grub_loader_boot_func) (void *context);
|
||||
+static grub_err_t (*grub_loader_unload_func) (void *context);
|
||||
+static void *grub_loader_context;
|
||||
static int grub_loader_flags;
|
||||
|
||||
+struct grub_simple_loader_hooks
|
||||
+{
|
||||
+ grub_err_t (*boot) (void);
|
||||
+ grub_err_t (*unload) (void);
|
||||
+};
|
||||
+
|
||||
+/* Don't heap allocate this to avoid making grub_loader_set() fallible. */
|
||||
+static struct grub_simple_loader_hooks simple_loader_hooks;
|
||||
+
|
||||
struct grub_preboot
|
||||
{
|
||||
grub_err_t (*preboot_func) (int);
|
||||
@@ -44,6 +54,29 @@ static int grub_loader_loaded;
|
||||
static struct grub_preboot *preboots_head = 0,
|
||||
*preboots_tail = 0;
|
||||
|
||||
+static grub_err_t
|
||||
+grub_simple_boot_hook (void *context)
|
||||
+{
|
||||
+ struct grub_simple_loader_hooks *hooks;
|
||||
+
|
||||
+ hooks = (struct grub_simple_loader_hooks *) context;
|
||||
+ return hooks->boot ();
|
||||
+}
|
||||
+
|
||||
+static grub_err_t
|
||||
+grub_simple_unload_hook (void *context)
|
||||
+{
|
||||
+ struct grub_simple_loader_hooks *hooks;
|
||||
+ grub_err_t ret;
|
||||
+
|
||||
+ hooks = (struct grub_simple_loader_hooks *) context;
|
||||
+
|
||||
+ ret = hooks->unload ();
|
||||
+ grub_memset (hooks, 0, sizeof (*hooks));
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
int
|
||||
grub_loader_is_loaded (void)
|
||||
{
|
||||
@@ -110,28 +143,45 @@ grub_loader_unregister_preboot_hook (struct grub_preboot *hnd)
|
||||
}
|
||||
|
||||
void
|
||||
-grub_loader_set (grub_err_t (*boot) (void),
|
||||
- grub_err_t (*unload) (void),
|
||||
- int flags)
|
||||
+grub_loader_set_ex (grub_err_t (*boot) (void *context),
|
||||
+ grub_err_t (*unload) (void *context),
|
||||
+ void *context,
|
||||
+ int flags)
|
||||
{
|
||||
if (grub_loader_loaded && grub_loader_unload_func)
|
||||
- grub_loader_unload_func ();
|
||||
+ grub_loader_unload_func (grub_loader_context);
|
||||
|
||||
grub_loader_boot_func = boot;
|
||||
grub_loader_unload_func = unload;
|
||||
+ grub_loader_context = context;
|
||||
grub_loader_flags = flags;
|
||||
|
||||
grub_loader_loaded = 1;
|
||||
}
|
||||
|
||||
+void
|
||||
+grub_loader_set (grub_err_t (*boot) (void),
|
||||
+ grub_err_t (*unload) (void),
|
||||
+ int flags)
|
||||
+{
|
||||
+ grub_loader_set_ex (grub_simple_boot_hook,
|
||||
+ grub_simple_unload_hook,
|
||||
+ &simple_loader_hooks,
|
||||
+ flags);
|
||||
+
|
||||
+ simple_loader_hooks.boot = boot;
|
||||
+ simple_loader_hooks.unload = unload;
|
||||
+}
|
||||
+
|
||||
void
|
||||
grub_loader_unset(void)
|
||||
{
|
||||
if (grub_loader_loaded && grub_loader_unload_func)
|
||||
- grub_loader_unload_func ();
|
||||
+ grub_loader_unload_func (grub_loader_context);
|
||||
|
||||
grub_loader_boot_func = 0;
|
||||
grub_loader_unload_func = 0;
|
||||
+ grub_loader_context = 0;
|
||||
|
||||
grub_loader_loaded = 0;
|
||||
}
|
||||
@@ -158,7 +208,7 @@ grub_loader_boot (void)
|
||||
return err;
|
||||
}
|
||||
}
|
||||
- err = (grub_loader_boot_func) ();
|
||||
+ err = (grub_loader_boot_func) (grub_loader_context);
|
||||
|
||||
for (cur = preboots_tail; cur; cur = cur->prev)
|
||||
if (! err)
|
||||
diff --git a/grub-core/loader/efi/chainloader.c b/grub-core/loader/efi/chainloader.c
|
||||
index a8d7b91..93a028a 100644
|
||||
--- a/grub-core/loader/efi/chainloader.c
|
||||
+++ b/grub-core/loader/efi/chainloader.c
|
||||
@@ -44,33 +44,28 @@ GRUB_MOD_LICENSE ("GPLv3+");
|
||||
|
||||
static grub_dl_t my_mod;
|
||||
|
||||
-static grub_efi_physical_address_t address;
|
||||
-static grub_efi_uintn_t pages;
|
||||
-static grub_efi_device_path_t *file_path;
|
||||
-static grub_efi_handle_t image_handle;
|
||||
-static grub_efi_char16_t *cmdline;
|
||||
-
|
||||
static grub_err_t
|
||||
-grub_chainloader_unload (void)
|
||||
+grub_chainloader_unload (void *context)
|
||||
{
|
||||
+ grub_efi_handle_t image_handle = (grub_efi_handle_t) context;
|
||||
+ grub_efi_loaded_image_t *loaded_image;
|
||||
grub_efi_boot_services_t *b;
|
||||
|
||||
+ loaded_image = grub_efi_get_loaded_image (image_handle);
|
||||
+ if (loaded_image != NULL)
|
||||
+ grub_free (loaded_image->load_options);
|
||||
+
|
||||
b = grub_efi_system_table->boot_services;
|
||||
efi_call_1 (b->unload_image, image_handle);
|
||||
- efi_call_2 (b->free_pages, address, pages);
|
||||
-
|
||||
- grub_free (file_path);
|
||||
- grub_free (cmdline);
|
||||
- cmdline = 0;
|
||||
- file_path = 0;
|
||||
|
||||
grub_dl_unref (my_mod);
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
|
||||
static grub_err_t
|
||||
-grub_chainloader_boot (void)
|
||||
+grub_chainloader_boot (void *context)
|
||||
{
|
||||
+ grub_efi_handle_t image_handle = (grub_efi_handle_t) context;
|
||||
grub_efi_boot_services_t *b;
|
||||
grub_efi_status_t status;
|
||||
grub_efi_uintn_t exit_data_size;
|
||||
@@ -139,7 +134,7 @@ make_file_path (grub_efi_device_path_t *dp, const char *filename)
|
||||
char *dir_start;
|
||||
char *dir_end;
|
||||
grub_size_t size;
|
||||
- grub_efi_device_path_t *d;
|
||||
+ grub_efi_device_path_t *d, *file_path;
|
||||
|
||||
dir_start = grub_strchr (filename, ')');
|
||||
if (! dir_start)
|
||||
@@ -215,11 +210,15 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)),
|
||||
grub_efi_status_t status;
|
||||
grub_efi_boot_services_t *b;
|
||||
grub_device_t dev = 0;
|
||||
- grub_efi_device_path_t *dp = 0;
|
||||
+ grub_efi_device_path_t *dp = NULL, *file_path = NULL;
|
||||
grub_efi_loaded_image_t *loaded_image;
|
||||
char *filename;
|
||||
void *boot_image = 0;
|
||||
grub_efi_handle_t dev_handle = 0;
|
||||
+ grub_efi_physical_address_t address = 0;
|
||||
+ grub_efi_uintn_t pages = 0;
|
||||
+ grub_efi_char16_t *cmdline = NULL;
|
||||
+ grub_efi_handle_t image_handle = NULL;
|
||||
|
||||
if (argc == 0)
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected"));
|
||||
@@ -227,11 +226,6 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)),
|
||||
|
||||
grub_dl_ref (my_mod);
|
||||
|
||||
- /* Initialize some global variables. */
|
||||
- address = 0;
|
||||
- image_handle = 0;
|
||||
- file_path = 0;
|
||||
-
|
||||
b = grub_efi_system_table->boot_services;
|
||||
|
||||
file = grub_file_open (filename, GRUB_FILE_TYPE_EFI_CHAINLOADED_IMAGE);
|
||||
@@ -401,7 +395,11 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)),
|
||||
grub_file_close (file);
|
||||
grub_device_close (dev);
|
||||
|
||||
- grub_loader_set (grub_chainloader_boot, grub_chainloader_unload, 0);
|
||||
+ /* We're finished with the source image buffer and file path now. */
|
||||
+ efi_call_2 (b->free_pages, address, pages);
|
||||
+ grub_free (file_path);
|
||||
+
|
||||
+ grub_loader_set_ex (grub_chainloader_boot, grub_chainloader_unload, image_handle, 0);
|
||||
return 0;
|
||||
|
||||
fail:
|
||||
@@ -412,11 +410,15 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)),
|
||||
if (file)
|
||||
grub_file_close (file);
|
||||
|
||||
+ grub_free (cmdline);
|
||||
grub_free (file_path);
|
||||
|
||||
if (address)
|
||||
efi_call_2 (b->free_pages, address, pages);
|
||||
|
||||
+ if (image_handle != NULL)
|
||||
+ efi_call_1 (b->unload_image, image_handle);
|
||||
+
|
||||
grub_dl_unref (my_mod);
|
||||
|
||||
return grub_errno;
|
||||
diff --git a/include/grub/loader.h b/include/grub/loader.h
|
||||
index 7f82a49..3071a50 100644
|
||||
--- a/include/grub/loader.h
|
||||
+++ b/include/grub/loader.h
|
||||
@@ -39,6 +39,11 @@ void EXPORT_FUNC (grub_loader_set) (grub_err_t (*boot) (void),
|
||||
grub_err_t (*unload) (void),
|
||||
int flags);
|
||||
|
||||
+void EXPORT_FUNC (grub_loader_set_ex) (grub_err_t (*boot) (void *context),
|
||||
+ grub_err_t (*unload) (void *context),
|
||||
+ void *context,
|
||||
+ int flags);
|
||||
+
|
||||
/* Unset current loader, if any. */
|
||||
void EXPORT_FUNC (grub_loader_unset) (void);
|
||||
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@@ -95,7 +95,13 @@ SRC_URI = "${GNU_MIRROR}/grub/grub-${PV}.tar.gz \
|
||||
file://0044-script-execute-Fix-NULL-dereference-in-grub_script_e.patch \
|
||||
file://0045-commands-ls-Require-device_name-is-not-NULL-before-p.patch \
|
||||
file://0046-script-execute-Avoid-crash-when-using-outside-a-func.patch \
|
||||
file://CVE-2021-3981.patch\
|
||||
file://CVE-2021-3981.patch \
|
||||
file://CVE-2021-3695.patch \
|
||||
file://CVE-2021-3696.patch \
|
||||
file://CVE-2021-3697.patch \
|
||||
file://CVE-2022-28733.patch \
|
||||
file://CVE-2022-28734.patch \
|
||||
file://CVE-2022-28736.patch \
|
||||
"
|
||||
SRC_URI[md5sum] = "5ce674ca6b2612d8939b9e6abed32934"
|
||||
SRC_URI[sha256sum] = "f10c85ae3e204dbaec39ae22fa3c5e99f0665417e91c2cb49b7e5031658ba6ea"
|
||||
|
||||
@@ -190,7 +190,7 @@ FILES_${PN}-sftp-server = "${libexecdir}/sftp-server"
|
||||
FILES_${PN}-misc = "${bindir}/ssh* ${libexecdir}/ssh*"
|
||||
FILES_${PN}-keygen = "${bindir}/ssh-keygen"
|
||||
|
||||
RDEPENDS_${PN} += "${PN}-scp ${PN}-ssh ${PN}-sshd ${PN}-keygen"
|
||||
RDEPENDS_${PN} += "${PN}-scp ${PN}-ssh ${PN}-sshd ${PN}-keygen ${PN}-sftp-server"
|
||||
RDEPENDS_${PN}-sshd += "${PN}-keygen ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam-plugin-keyinit pam-plugin-loginuid', '', d)}"
|
||||
RRECOMMENDS_${PN}-sshd_append_class-target = "\
|
||||
${@bb.utils.filter('PACKAGECONFIG', 'rng-tools', d)} \
|
||||
|
||||
@@ -24,7 +24,7 @@ IMAGE_FSTYPES = "wic.vmdk"
|
||||
|
||||
inherit core-image setuptools3
|
||||
|
||||
SRCREV ?= "08bd8cc1148b7b8b353ba5002560b0c2b3973a71"
|
||||
SRCREV ?= "23322786e02469c08e3db007043da1091bf0f466"
|
||||
SRC_URI = "git://git.yoctoproject.org/poky;branch=dunfell \
|
||||
file://Yocto_Build_Appliance.vmx \
|
||||
file://Yocto_Build_Appliance.vmxf \
|
||||
|
||||
@@ -129,7 +129,7 @@ do_install () {
|
||||
update-rc.d -r ${D} rmnologin.sh start 99 2 3 4 5 .
|
||||
update-rc.d -r ${D} sendsigs start 20 0 6 .
|
||||
update-rc.d -r ${D} urandom start 38 S 0 6 .
|
||||
update-rc.d -r ${D} umountnfs.sh start 31 0 1 6 .
|
||||
update-rc.d -r ${D} umountnfs.sh stop 31 0 1 6 .
|
||||
update-rc.d -r ${D} umountfs start 40 0 6 .
|
||||
update-rc.d -r ${D} reboot start 90 6 .
|
||||
update-rc.d -r ${D} halt start 90 0 .
|
||||
|
||||
@@ -0,0 +1,813 @@
|
||||
From b5125000917810731bc28055c0445d571121f80e Mon Sep 17 00:00:00 2001
|
||||
From: Nick Wellnhofer <wellnhofer@aevum.de>
|
||||
Date: Thu, 21 Apr 2022 00:45:58 +0200
|
||||
Subject: [PATCH] Port gentest.py to Python 3
|
||||
|
||||
Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/libxml2/-/commit/343fc1421cdae097fa6c4cffeb1a065a40be6bbb]
|
||||
|
||||
* fixes:
|
||||
|
||||
make[1]: 'testReader' is up to date.
|
||||
File "../libxml2-2.9.10/gentest.py", line 11
|
||||
print "libxml2 python bindings not available, skipping testapi.c generation"
|
||||
^
|
||||
SyntaxError: Missing parentheses in call to 'print'. Did you mean print("libxml2 python bindings not available, skipping testapi.c generation")?
|
||||
make[1]: [Makefile:2078: testapi.c] Error 1 (ignored)
|
||||
|
||||
...
|
||||
|
||||
make[1]: 'testReader' is up to date.
|
||||
File "../libxml2-2.9.10/gentest.py", line 271
|
||||
return 1
|
||||
^
|
||||
TabError: inconsistent use of tabs and spaces in indentation
|
||||
make[1]: [Makefile:2078: testapi.c] Error 1 (ignored)
|
||||
|
||||
...
|
||||
|
||||
aarch64-oe-linux-gcc: error: testapi.c: No such file or directory
|
||||
aarch64-oe-linux-gcc: fatal error: no input files
|
||||
compilation terminated.
|
||||
make[1]: *** [Makefile:1275: testapi.o] Error 1
|
||||
|
||||
But there is still a bit mystery why it worked before, because check-am
|
||||
calls gentest.py with $(PYTHON), so it ignores the shebang in the script
|
||||
and libxml2 is using python3native (through python3targetconfig.bbclass)
|
||||
so something like:
|
||||
|
||||
libxml2/2.9.10-r0/recipe-sysroot-native/usr/bin/python3-native/python3 gentest.py
|
||||
|
||||
But that still fails (now without SyntaxError) with:
|
||||
libxml2 python bindings not available, skipping testapi.c generation
|
||||
|
||||
because we don't have dependency on libxml2-native (to provide libxml2
|
||||
python bindings form python3native) and exported PYTHON_SITE_PACKAGES
|
||||
might be useless (e.g. /usr/lib/python3.8/site-packages on Ubuntu-22.10
|
||||
which uses python 3.10 and there is no site-packages with libxml2)
|
||||
|
||||
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
|
||||
---
|
||||
gentest.py | 421 ++++++++++++++++++++++++++---------------------------
|
||||
1 file changed, 209 insertions(+), 212 deletions(-)
|
||||
|
||||
diff --git a/gentest.py b/gentest.py
|
||||
index b763300..0756706 100755
|
||||
--- a/gentest.py
|
||||
+++ b/gentest.py
|
||||
@@ -8,7 +8,7 @@ import string
|
||||
try:
|
||||
import libxml2
|
||||
except:
|
||||
- print "libxml2 python bindings not available, skipping testapi.c generation"
|
||||
+ print("libxml2 python bindings not available, skipping testapi.c generation")
|
||||
sys.exit(0)
|
||||
|
||||
if len(sys.argv) > 1:
|
||||
@@ -227,7 +227,7 @@ extra_post_call = {
|
||||
if (old != NULL) {
|
||||
xmlUnlinkNode(old);
|
||||
xmlFreeNode(old) ; old = NULL ; }
|
||||
- ret_val = NULL;""",
|
||||
+\t ret_val = NULL;""",
|
||||
"xmlTextMerge":
|
||||
"""if ((first != NULL) && (first->type != XML_TEXT_NODE)) {
|
||||
xmlUnlinkNode(second);
|
||||
@@ -236,7 +236,7 @@ extra_post_call = {
|
||||
"""if ((ret_val != NULL) && (ret_val != ncname) &&
|
||||
(ret_val != prefix) && (ret_val != memory))
|
||||
xmlFree(ret_val);
|
||||
- ret_val = NULL;""",
|
||||
+\t ret_val = NULL;""",
|
||||
"xmlNewDocElementContent":
|
||||
"""xmlFreeDocElementContent(doc, ret_val); ret_val = NULL;""",
|
||||
"xmlDictReference": "xmlDictFree(dict);",
|
||||
@@ -268,29 +268,29 @@ modules = []
|
||||
def is_skipped_module(name):
|
||||
for mod in skipped_modules:
|
||||
if mod == name:
|
||||
- return 1
|
||||
+ return 1
|
||||
return 0
|
||||
|
||||
def is_skipped_function(name):
|
||||
for fun in skipped_functions:
|
||||
if fun == name:
|
||||
- return 1
|
||||
+ return 1
|
||||
# Do not test destructors
|
||||
- if string.find(name, 'Free') != -1:
|
||||
+ if name.find('Free') != -1:
|
||||
return 1
|
||||
return 0
|
||||
|
||||
def is_skipped_memcheck(name):
|
||||
for fun in skipped_memcheck:
|
||||
if fun == name:
|
||||
- return 1
|
||||
+ return 1
|
||||
return 0
|
||||
|
||||
missing_types = {}
|
||||
def add_missing_type(name, func):
|
||||
try:
|
||||
list = missing_types[name]
|
||||
- list.append(func)
|
||||
+ list.append(func)
|
||||
except:
|
||||
missing_types[name] = [func]
|
||||
|
||||
@@ -310,7 +310,7 @@ def add_missing_functions(name, module):
|
||||
missing_functions_nr = missing_functions_nr + 1
|
||||
try:
|
||||
list = missing_functions[module]
|
||||
- list.append(name)
|
||||
+ list.append(name)
|
||||
except:
|
||||
missing_functions[module] = [name]
|
||||
|
||||
@@ -319,45 +319,45 @@ def add_missing_functions(name, module):
|
||||
#
|
||||
|
||||
def type_convert(str, name, info, module, function, pos):
|
||||
-# res = string.replace(str, " ", " ")
|
||||
-# res = string.replace(str, " ", " ")
|
||||
-# res = string.replace(str, " ", " ")
|
||||
- res = string.replace(str, " *", "_ptr")
|
||||
-# res = string.replace(str, "*", "_ptr")
|
||||
- res = string.replace(res, " ", "_")
|
||||
+# res = str.replace(" ", " ")
|
||||
+# res = str.replace(" ", " ")
|
||||
+# res = str.replace(" ", " ")
|
||||
+ res = str.replace(" *", "_ptr")
|
||||
+# res = str.replace("*", "_ptr")
|
||||
+ res = res.replace(" ", "_")
|
||||
if res == 'const_char_ptr':
|
||||
- if string.find(name, "file") != -1 or \
|
||||
- string.find(name, "uri") != -1 or \
|
||||
- string.find(name, "URI") != -1 or \
|
||||
- string.find(info, "filename") != -1 or \
|
||||
- string.find(info, "URI") != -1 or \
|
||||
- string.find(info, "URL") != -1:
|
||||
- if string.find(function, "Save") != -1 or \
|
||||
- string.find(function, "Create") != -1 or \
|
||||
- string.find(function, "Write") != -1 or \
|
||||
- string.find(function, "Fetch") != -1:
|
||||
- return('fileoutput')
|
||||
- return('filepath')
|
||||
+ if name.find("file") != -1 or \
|
||||
+ name.find("uri") != -1 or \
|
||||
+ name.find("URI") != -1 or \
|
||||
+ info.find("filename") != -1 or \
|
||||
+ info.find("URI") != -1 or \
|
||||
+ info.find("URL") != -1:
|
||||
+ if function.find("Save") != -1 or \
|
||||
+ function.find("Create") != -1 or \
|
||||
+ function.find("Write") != -1 or \
|
||||
+ function.find("Fetch") != -1:
|
||||
+ return('fileoutput')
|
||||
+ return('filepath')
|
||||
if res == 'void_ptr':
|
||||
if module == 'nanoftp' and name == 'ctx':
|
||||
- return('xmlNanoFTPCtxtPtr')
|
||||
+ return('xmlNanoFTPCtxtPtr')
|
||||
if function == 'xmlNanoFTPNewCtxt' or \
|
||||
- function == 'xmlNanoFTPConnectTo' or \
|
||||
- function == 'xmlNanoFTPOpen':
|
||||
- return('xmlNanoFTPCtxtPtr')
|
||||
+ function == 'xmlNanoFTPConnectTo' or \
|
||||
+ function == 'xmlNanoFTPOpen':
|
||||
+ return('xmlNanoFTPCtxtPtr')
|
||||
if module == 'nanohttp' and name == 'ctx':
|
||||
- return('xmlNanoHTTPCtxtPtr')
|
||||
- if function == 'xmlNanoHTTPMethod' or \
|
||||
- function == 'xmlNanoHTTPMethodRedir' or \
|
||||
- function == 'xmlNanoHTTPOpen' or \
|
||||
- function == 'xmlNanoHTTPOpenRedir':
|
||||
- return('xmlNanoHTTPCtxtPtr');
|
||||
+ return('xmlNanoHTTPCtxtPtr')
|
||||
+ if function == 'xmlNanoHTTPMethod' or \
|
||||
+ function == 'xmlNanoHTTPMethodRedir' or \
|
||||
+ function == 'xmlNanoHTTPOpen' or \
|
||||
+ function == 'xmlNanoHTTPOpenRedir':
|
||||
+ return('xmlNanoHTTPCtxtPtr');
|
||||
if function == 'xmlIOHTTPOpen':
|
||||
- return('xmlNanoHTTPCtxtPtr')
|
||||
- if string.find(name, "data") != -1:
|
||||
- return('userdata')
|
||||
- if string.find(name, "user") != -1:
|
||||
- return('userdata')
|
||||
+ return('xmlNanoHTTPCtxtPtr')
|
||||
+ if name.find("data") != -1:
|
||||
+ return('userdata')
|
||||
+ if name.find("user") != -1:
|
||||
+ return('userdata')
|
||||
if res == 'xmlDoc_ptr':
|
||||
res = 'xmlDocPtr'
|
||||
if res == 'xmlNode_ptr':
|
||||
@@ -366,18 +366,18 @@ def type_convert(str, name, info, module, function, pos):
|
||||
res = 'xmlDictPtr'
|
||||
if res == 'xmlNodePtr' and pos != 0:
|
||||
if (function == 'xmlAddChild' and pos == 2) or \
|
||||
- (function == 'xmlAddChildList' and pos == 2) or \
|
||||
+ (function == 'xmlAddChildList' and pos == 2) or \
|
||||
(function == 'xmlAddNextSibling' and pos == 2) or \
|
||||
(function == 'xmlAddSibling' and pos == 2) or \
|
||||
(function == 'xmlDocSetRootElement' and pos == 2) or \
|
||||
(function == 'xmlReplaceNode' and pos == 2) or \
|
||||
(function == 'xmlTextMerge') or \
|
||||
- (function == 'xmlAddPrevSibling' and pos == 2):
|
||||
- return('xmlNodePtr_in');
|
||||
+ (function == 'xmlAddPrevSibling' and pos == 2):
|
||||
+ return('xmlNodePtr_in');
|
||||
if res == 'const xmlBufferPtr':
|
||||
res = 'xmlBufferPtr'
|
||||
if res == 'xmlChar_ptr' and name == 'name' and \
|
||||
- string.find(function, "EatName") != -1:
|
||||
+ function.find("EatName") != -1:
|
||||
return('eaten_name')
|
||||
if res == 'void_ptr*':
|
||||
res = 'void_ptr_ptr'
|
||||
@@ -393,7 +393,7 @@ def type_convert(str, name, info, module, function, pos):
|
||||
res = 'debug_FILE_ptr';
|
||||
if res == 'int' and name == 'options':
|
||||
if module == 'parser' or module == 'xmlreader':
|
||||
- res = 'parseroptions'
|
||||
+ res = 'parseroptions'
|
||||
|
||||
return res
|
||||
|
||||
@@ -402,28 +402,28 @@ known_param_types = []
|
||||
def is_known_param_type(name):
|
||||
for type in known_param_types:
|
||||
if type == name:
|
||||
- return 1
|
||||
+ return 1
|
||||
return name[-3:] == 'Ptr' or name[-4:] == '_ptr'
|
||||
|
||||
def generate_param_type(name, rtype):
|
||||
global test
|
||||
for type in known_param_types:
|
||||
if type == name:
|
||||
- return
|
||||
+ return
|
||||
for type in generated_param_types:
|
||||
if type == name:
|
||||
- return
|
||||
+ return
|
||||
|
||||
if name[-3:] == 'Ptr' or name[-4:] == '_ptr':
|
||||
if rtype[0:6] == 'const ':
|
||||
- crtype = rtype[6:]
|
||||
- else:
|
||||
- crtype = rtype
|
||||
+ crtype = rtype[6:]
|
||||
+ else:
|
||||
+ crtype = rtype
|
||||
|
||||
define = 0
|
||||
- if modules_defines.has_key(module):
|
||||
- test.write("#ifdef %s\n" % (modules_defines[module]))
|
||||
- define = 1
|
||||
+ if module in modules_defines:
|
||||
+ test.write("#ifdef %s\n" % (modules_defines[module]))
|
||||
+ define = 1
|
||||
test.write("""
|
||||
#define gen_nb_%s 1
|
||||
static %s gen_%s(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
|
||||
@@ -433,7 +433,7 @@ static void des_%s(int no ATTRIBUTE_UNUSED, %s val ATTRIBUTE_UNUSED, int nr ATTR
|
||||
}
|
||||
""" % (name, crtype, name, name, rtype))
|
||||
if define == 1:
|
||||
- test.write("#endif\n\n")
|
||||
+ test.write("#endif\n\n")
|
||||
add_generated_param_type(name)
|
||||
|
||||
#
|
||||
@@ -445,7 +445,7 @@ known_return_types = []
|
||||
def is_known_return_type(name):
|
||||
for type in known_return_types:
|
||||
if type == name:
|
||||
- return 1
|
||||
+ return 1
|
||||
return 0
|
||||
|
||||
#
|
||||
@@ -471,7 +471,7 @@ def compare_and_save():
|
||||
try:
|
||||
os.system("rm testapi.c; mv testapi.c.new testapi.c")
|
||||
except:
|
||||
- os.system("mv testapi.c.new testapi.c")
|
||||
+ os.system("mv testapi.c.new testapi.c")
|
||||
print("Updated testapi.c")
|
||||
else:
|
||||
print("Generated testapi.c is identical")
|
||||
@@ -481,17 +481,17 @@ while line != "":
|
||||
if line == "/* CUT HERE: everything below that line is generated */\n":
|
||||
break;
|
||||
if line[0:15] == "#define gen_nb_":
|
||||
- type = string.split(line[15:])[0]
|
||||
- known_param_types.append(type)
|
||||
+ type = line[15:].split()[0]
|
||||
+ known_param_types.append(type)
|
||||
if line[0:19] == "static void desret_":
|
||||
- type = string.split(line[19:], '(')[0]
|
||||
- known_return_types.append(type)
|
||||
+ type = line[19:].split('(')[0]
|
||||
+ known_return_types.append(type)
|
||||
test.write(line)
|
||||
line = input.readline()
|
||||
input.close()
|
||||
|
||||
if line == "":
|
||||
- print "Could not find the CUT marker in testapi.c skipping generation"
|
||||
+ print("Could not find the CUT marker in testapi.c skipping generation")
|
||||
test.close()
|
||||
sys.exit(0)
|
||||
|
||||
@@ -505,7 +505,7 @@ test.write("/* CUT HERE: everything below that line is generated */\n")
|
||||
#
|
||||
doc = libxml2.readFile(srcPref + 'doc/libxml2-api.xml', None, 0)
|
||||
if doc == None:
|
||||
- print "Failed to load doc/libxml2-api.xml"
|
||||
+ print("Failed to load doc/libxml2-api.xml")
|
||||
sys.exit(1)
|
||||
ctxt = doc.xpathNewContext()
|
||||
|
||||
@@ -519,9 +519,9 @@ for arg in args:
|
||||
mod = arg.xpathEval('string(../@file)')
|
||||
func = arg.xpathEval('string(../@name)')
|
||||
if (mod not in skipped_modules) and (func not in skipped_functions):
|
||||
- type = arg.xpathEval('string(@type)')
|
||||
- if not argtypes.has_key(type):
|
||||
- argtypes[type] = func
|
||||
+ type = arg.xpathEval('string(@type)')
|
||||
+ if type not in argtypes:
|
||||
+ argtypes[type] = func
|
||||
|
||||
# similarly for return types
|
||||
rettypes = {}
|
||||
@@ -531,8 +531,8 @@ for ret in rets:
|
||||
func = ret.xpathEval('string(../@name)')
|
||||
if (mod not in skipped_modules) and (func not in skipped_functions):
|
||||
type = ret.xpathEval('string(@type)')
|
||||
- if not rettypes.has_key(type):
|
||||
- rettypes[type] = func
|
||||
+ if type not in rettypes:
|
||||
+ rettypes[type] = func
|
||||
|
||||
#
|
||||
# Generate constructors and return type handling for all enums
|
||||
@@ -549,49 +549,49 @@ for enum in enums:
|
||||
continue;
|
||||
define = 0
|
||||
|
||||
- if argtypes.has_key(name) and is_known_param_type(name) == 0:
|
||||
- values = ctxt.xpathEval("/api/symbols/enum[@type='%s']" % name)
|
||||
- i = 0
|
||||
- vals = []
|
||||
- for value in values:
|
||||
- vname = value.xpathEval('string(@name)')
|
||||
- if vname == None:
|
||||
- continue;
|
||||
- i = i + 1
|
||||
- if i >= 5:
|
||||
- break;
|
||||
- vals.append(vname)
|
||||
- if vals == []:
|
||||
- print "Didn't find any value for enum %s" % (name)
|
||||
- continue
|
||||
- if modules_defines.has_key(module):
|
||||
- test.write("#ifdef %s\n" % (modules_defines[module]))
|
||||
- define = 1
|
||||
- test.write("#define gen_nb_%s %d\n" % (name, len(vals)))
|
||||
- test.write("""static %s gen_%s(int no, int nr ATTRIBUTE_UNUSED) {\n""" %
|
||||
- (name, name))
|
||||
- i = 1
|
||||
- for value in vals:
|
||||
- test.write(" if (no == %d) return(%s);\n" % (i, value))
|
||||
- i = i + 1
|
||||
- test.write(""" return(0);
|
||||
+ if (name in argtypes) and is_known_param_type(name) == 0:
|
||||
+ values = ctxt.xpathEval("/api/symbols/enum[@type='%s']" % name)
|
||||
+ i = 0
|
||||
+ vals = []
|
||||
+ for value in values:
|
||||
+ vname = value.xpathEval('string(@name)')
|
||||
+ if vname == None:
|
||||
+ continue;
|
||||
+ i = i + 1
|
||||
+ if i >= 5:
|
||||
+ break;
|
||||
+ vals.append(vname)
|
||||
+ if vals == []:
|
||||
+ print("Didn't find any value for enum %s" % (name))
|
||||
+ continue
|
||||
+ if module in modules_defines:
|
||||
+ test.write("#ifdef %s\n" % (modules_defines[module]))
|
||||
+ define = 1
|
||||
+ test.write("#define gen_nb_%s %d\n" % (name, len(vals)))
|
||||
+ test.write("""static %s gen_%s(int no, int nr ATTRIBUTE_UNUSED) {\n""" %
|
||||
+ (name, name))
|
||||
+ i = 1
|
||||
+ for value in vals:
|
||||
+ test.write(" if (no == %d) return(%s);\n" % (i, value))
|
||||
+ i = i + 1
|
||||
+ test.write(""" return(0);
|
||||
}
|
||||
|
||||
static void des_%s(int no ATTRIBUTE_UNUSED, %s val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
|
||||
}
|
||||
|
||||
""" % (name, name));
|
||||
- known_param_types.append(name)
|
||||
+ known_param_types.append(name)
|
||||
|
||||
if (is_known_return_type(name) == 0) and (name in rettypes):
|
||||
- if define == 0 and modules_defines.has_key(module):
|
||||
- test.write("#ifdef %s\n" % (modules_defines[module]))
|
||||
- define = 1
|
||||
+ if define == 0 and (module in modules_defines):
|
||||
+ test.write("#ifdef %s\n" % (modules_defines[module]))
|
||||
+ define = 1
|
||||
test.write("""static void desret_%s(%s val ATTRIBUTE_UNUSED) {
|
||||
}
|
||||
|
||||
""" % (name, name))
|
||||
- known_return_types.append(name)
|
||||
+ known_return_types.append(name)
|
||||
if define == 1:
|
||||
test.write("#endif\n\n")
|
||||
|
||||
@@ -615,9 +615,9 @@ for file in headers:
|
||||
# do not test deprecated APIs
|
||||
#
|
||||
desc = file.xpathEval('string(description)')
|
||||
- if string.find(desc, 'DEPRECATED') != -1:
|
||||
- print "Skipping deprecated interface %s" % name
|
||||
- continue;
|
||||
+ if desc.find('DEPRECATED') != -1:
|
||||
+ print("Skipping deprecated interface %s" % name)
|
||||
+ continue;
|
||||
|
||||
test.write("#include <libxml/%s.h>\n" % name)
|
||||
modules.append(name)
|
||||
@@ -679,7 +679,7 @@ def generate_test(module, node):
|
||||
# and store the informations for the generation
|
||||
#
|
||||
try:
|
||||
- args = node.xpathEval("arg")
|
||||
+ args = node.xpathEval("arg")
|
||||
except:
|
||||
args = []
|
||||
t_args = []
|
||||
@@ -687,37 +687,37 @@ def generate_test(module, node):
|
||||
for arg in args:
|
||||
n = n + 1
|
||||
rtype = arg.xpathEval("string(@type)")
|
||||
- if rtype == 'void':
|
||||
- break;
|
||||
- info = arg.xpathEval("string(@info)")
|
||||
- nam = arg.xpathEval("string(@name)")
|
||||
+ if rtype == 'void':
|
||||
+ break;
|
||||
+ info = arg.xpathEval("string(@info)")
|
||||
+ nam = arg.xpathEval("string(@name)")
|
||||
type = type_convert(rtype, nam, info, module, name, n)
|
||||
- if is_known_param_type(type) == 0:
|
||||
- add_missing_type(type, name);
|
||||
- no_gen = 1
|
||||
+ if is_known_param_type(type) == 0:
|
||||
+ add_missing_type(type, name);
|
||||
+ no_gen = 1
|
||||
if (type[-3:] == 'Ptr' or type[-4:] == '_ptr') and \
|
||||
- rtype[0:6] == 'const ':
|
||||
- crtype = rtype[6:]
|
||||
- else:
|
||||
- crtype = rtype
|
||||
- t_args.append((nam, type, rtype, crtype, info))
|
||||
+ rtype[0:6] == 'const ':
|
||||
+ crtype = rtype[6:]
|
||||
+ else:
|
||||
+ crtype = rtype
|
||||
+ t_args.append((nam, type, rtype, crtype, info))
|
||||
|
||||
try:
|
||||
- rets = node.xpathEval("return")
|
||||
+ rets = node.xpathEval("return")
|
||||
except:
|
||||
rets = []
|
||||
t_ret = None
|
||||
for ret in rets:
|
||||
rtype = ret.xpathEval("string(@type)")
|
||||
- info = ret.xpathEval("string(@info)")
|
||||
+ info = ret.xpathEval("string(@info)")
|
||||
type = type_convert(rtype, 'return', info, module, name, 0)
|
||||
- if rtype == 'void':
|
||||
- break
|
||||
- if is_known_return_type(type) == 0:
|
||||
- add_missing_type(type, name);
|
||||
- no_gen = 1
|
||||
- t_ret = (type, rtype, info)
|
||||
- break
|
||||
+ if rtype == 'void':
|
||||
+ break
|
||||
+ if is_known_return_type(type) == 0:
|
||||
+ add_missing_type(type, name);
|
||||
+ no_gen = 1
|
||||
+ t_ret = (type, rtype, info)
|
||||
+ break
|
||||
|
||||
if no_gen == 0:
|
||||
for t_arg in t_args:
|
||||
@@ -733,7 +733,7 @@ test_%s(void) {
|
||||
|
||||
if no_gen == 1:
|
||||
add_missing_functions(name, module)
|
||||
- test.write("""
|
||||
+ test.write("""
|
||||
/* missing type support */
|
||||
return(test_ret);
|
||||
}
|
||||
@@ -742,22 +742,22 @@ test_%s(void) {
|
||||
return
|
||||
|
||||
try:
|
||||
- conds = node.xpathEval("cond")
|
||||
- for cond in conds:
|
||||
- test.write("#if %s\n" % (cond.get_content()))
|
||||
- nb_cond = nb_cond + 1
|
||||
+ conds = node.xpathEval("cond")
|
||||
+ for cond in conds:
|
||||
+ test.write("#if %s\n" % (cond.get_content()))
|
||||
+ nb_cond = nb_cond + 1
|
||||
except:
|
||||
pass
|
||||
|
||||
define = 0
|
||||
- if function_defines.has_key(name):
|
||||
+ if name in function_defines:
|
||||
test.write("#ifdef %s\n" % (function_defines[name]))
|
||||
- define = 1
|
||||
+ define = 1
|
||||
|
||||
# Declare the memory usage counter
|
||||
no_mem = is_skipped_memcheck(name)
|
||||
if no_mem == 0:
|
||||
- test.write(" int mem_base;\n");
|
||||
+ test.write(" int mem_base;\n");
|
||||
|
||||
# Declare the return value
|
||||
if t_ret != None:
|
||||
@@ -766,29 +766,29 @@ test_%s(void) {
|
||||
# Declare the arguments
|
||||
for arg in t_args:
|
||||
(nam, type, rtype, crtype, info) = arg;
|
||||
- # add declaration
|
||||
- test.write(" %s %s; /* %s */\n" % (crtype, nam, info))
|
||||
- test.write(" int n_%s;\n" % (nam))
|
||||
+ # add declaration
|
||||
+ test.write(" %s %s; /* %s */\n" % (crtype, nam, info))
|
||||
+ test.write(" int n_%s;\n" % (nam))
|
||||
test.write("\n")
|
||||
|
||||
# Cascade loop on of each argument list of values
|
||||
for arg in t_args:
|
||||
(nam, type, rtype, crtype, info) = arg;
|
||||
- #
|
||||
- test.write(" for (n_%s = 0;n_%s < gen_nb_%s;n_%s++) {\n" % (
|
||||
- nam, nam, type, nam))
|
||||
+ #
|
||||
+ test.write(" for (n_%s = 0;n_%s < gen_nb_%s;n_%s++) {\n" % (
|
||||
+ nam, nam, type, nam))
|
||||
|
||||
# log the memory usage
|
||||
if no_mem == 0:
|
||||
- test.write(" mem_base = xmlMemBlocks();\n");
|
||||
+ test.write(" mem_base = xmlMemBlocks();\n");
|
||||
|
||||
# prepare the call
|
||||
i = 0;
|
||||
for arg in t_args:
|
||||
(nam, type, rtype, crtype, info) = arg;
|
||||
- #
|
||||
- test.write(" %s = gen_%s(n_%s, %d);\n" % (nam, type, nam, i))
|
||||
- i = i + 1;
|
||||
+ #
|
||||
+ test.write(" %s = gen_%s(n_%s, %d);\n" % (nam, type, nam, i))
|
||||
+ i = i + 1;
|
||||
|
||||
# add checks to avoid out-of-bounds array access
|
||||
i = 0;
|
||||
@@ -797,7 +797,7 @@ test_%s(void) {
|
||||
# assume that "size", "len", and "start" parameters apply to either
|
||||
# the nearest preceding or following char pointer
|
||||
if type == "int" and (nam == "size" or nam == "len" or nam == "start"):
|
||||
- for j in range(i - 1, -1, -1) + range(i + 1, len(t_args)):
|
||||
+ for j in (*range(i - 1, -1, -1), *range(i + 1, len(t_args))):
|
||||
(bnam, btype) = t_args[j][:2]
|
||||
if btype == "const_char_ptr" or btype == "const_xmlChar_ptr":
|
||||
test.write(
|
||||
@@ -806,42 +806,42 @@ test_%s(void) {
|
||||
" continue;\n"
|
||||
% (bnam, nam, bnam))
|
||||
break
|
||||
- i = i + 1;
|
||||
+ i = i + 1;
|
||||
|
||||
# do the call, and clanup the result
|
||||
- if extra_pre_call.has_key(name):
|
||||
- test.write(" %s\n"% (extra_pre_call[name]))
|
||||
+ if name in extra_pre_call:
|
||||
+ test.write(" %s\n"% (extra_pre_call[name]))
|
||||
if t_ret != None:
|
||||
- test.write("\n ret_val = %s(" % (name))
|
||||
- need = 0
|
||||
- for arg in t_args:
|
||||
- (nam, type, rtype, crtype, info) = arg
|
||||
- if need:
|
||||
- test.write(", ")
|
||||
- else:
|
||||
- need = 1
|
||||
- if rtype != crtype:
|
||||
- test.write("(%s)" % rtype)
|
||||
- test.write("%s" % nam);
|
||||
- test.write(");\n")
|
||||
- if extra_post_call.has_key(name):
|
||||
- test.write(" %s\n"% (extra_post_call[name]))
|
||||
- test.write(" desret_%s(ret_val);\n" % t_ret[0])
|
||||
+ test.write("\n ret_val = %s(" % (name))
|
||||
+ need = 0
|
||||
+ for arg in t_args:
|
||||
+ (nam, type, rtype, crtype, info) = arg
|
||||
+ if need:
|
||||
+ test.write(", ")
|
||||
+ else:
|
||||
+ need = 1
|
||||
+ if rtype != crtype:
|
||||
+ test.write("(%s)" % rtype)
|
||||
+ test.write("%s" % nam);
|
||||
+ test.write(");\n")
|
||||
+ if name in extra_post_call:
|
||||
+ test.write(" %s\n"% (extra_post_call[name]))
|
||||
+ test.write(" desret_%s(ret_val);\n" % t_ret[0])
|
||||
else:
|
||||
- test.write("\n %s(" % (name));
|
||||
- need = 0;
|
||||
- for arg in t_args:
|
||||
- (nam, type, rtype, crtype, info) = arg;
|
||||
- if need:
|
||||
- test.write(", ")
|
||||
- else:
|
||||
- need = 1
|
||||
- if rtype != crtype:
|
||||
- test.write("(%s)" % rtype)
|
||||
- test.write("%s" % nam)
|
||||
- test.write(");\n")
|
||||
- if extra_post_call.has_key(name):
|
||||
- test.write(" %s\n"% (extra_post_call[name]))
|
||||
+ test.write("\n %s(" % (name));
|
||||
+ need = 0;
|
||||
+ for arg in t_args:
|
||||
+ (nam, type, rtype, crtype, info) = arg;
|
||||
+ if need:
|
||||
+ test.write(", ")
|
||||
+ else:
|
||||
+ need = 1
|
||||
+ if rtype != crtype:
|
||||
+ test.write("(%s)" % rtype)
|
||||
+ test.write("%s" % nam)
|
||||
+ test.write(");\n")
|
||||
+ if name in extra_post_call:
|
||||
+ test.write(" %s\n"% (extra_post_call[name]))
|
||||
|
||||
test.write(" call_tests++;\n");
|
||||
|
||||
@@ -849,32 +849,32 @@ test_%s(void) {
|
||||
i = 0;
|
||||
for arg in t_args:
|
||||
(nam, type, rtype, crtype, info) = arg;
|
||||
- # This is a hack to prevent generating a destructor for the
|
||||
- # 'input' argument in xmlTextReaderSetup. There should be
|
||||
- # a better, more generic way to do this!
|
||||
- if string.find(info, 'destroy') == -1:
|
||||
- test.write(" des_%s(n_%s, " % (type, nam))
|
||||
- if rtype != crtype:
|
||||
- test.write("(%s)" % rtype)
|
||||
- test.write("%s, %d);\n" % (nam, i))
|
||||
- i = i + 1;
|
||||
+ # This is a hack to prevent generating a destructor for the
|
||||
+ # 'input' argument in xmlTextReaderSetup. There should be
|
||||
+ # a better, more generic way to do this!
|
||||
+ if info.find('destroy') == -1:
|
||||
+ test.write(" des_%s(n_%s, " % (type, nam))
|
||||
+ if rtype != crtype:
|
||||
+ test.write("(%s)" % rtype)
|
||||
+ test.write("%s, %d);\n" % (nam, i))
|
||||
+ i = i + 1;
|
||||
|
||||
test.write(" xmlResetLastError();\n");
|
||||
# Check the memory usage
|
||||
if no_mem == 0:
|
||||
- test.write(""" if (mem_base != xmlMemBlocks()) {
|
||||
+ test.write(""" if (mem_base != xmlMemBlocks()) {
|
||||
printf("Leak of %%d blocks found in %s",
|
||||
- xmlMemBlocks() - mem_base);
|
||||
- test_ret++;
|
||||
+\t xmlMemBlocks() - mem_base);
|
||||
+\t test_ret++;
|
||||
""" % (name));
|
||||
- for arg in t_args:
|
||||
- (nam, type, rtype, crtype, info) = arg;
|
||||
- test.write(""" printf(" %%d", n_%s);\n""" % (nam))
|
||||
- test.write(""" printf("\\n");\n""")
|
||||
- test.write(" }\n")
|
||||
+ for arg in t_args:
|
||||
+ (nam, type, rtype, crtype, info) = arg;
|
||||
+ test.write(""" printf(" %%d", n_%s);\n""" % (nam))
|
||||
+ test.write(""" printf("\\n");\n""")
|
||||
+ test.write(" }\n")
|
||||
|
||||
for arg in t_args:
|
||||
- test.write(" }\n")
|
||||
+ test.write(" }\n")
|
||||
|
||||
test.write(" function_tests++;\n")
|
||||
#
|
||||
@@ -882,7 +882,7 @@ test_%s(void) {
|
||||
#
|
||||
while nb_cond > 0:
|
||||
test.write("#endif\n")
|
||||
- nb_cond = nb_cond -1
|
||||
+ nb_cond = nb_cond -1
|
||||
if define == 1:
|
||||
test.write("#endif\n")
|
||||
|
||||
@@ -900,10 +900,10 @@ test_%s(void) {
|
||||
for module in modules:
|
||||
# gather all the functions exported by that module
|
||||
try:
|
||||
- functions = ctxt.xpathEval("/api/symbols/function[@file='%s']" % (module))
|
||||
+ functions = ctxt.xpathEval("/api/symbols/function[@file='%s']" % (module))
|
||||
except:
|
||||
- print "Failed to gather functions from module %s" % (module)
|
||||
- continue;
|
||||
+ print("Failed to gather functions from module %s" % (module))
|
||||
+ continue;
|
||||
|
||||
# iterate over all functions in the module generating the test
|
||||
i = 0
|
||||
@@ -923,14 +923,14 @@ test_%s(void) {
|
||||
# iterate over all functions in the module generating the call
|
||||
for function in functions:
|
||||
name = function.xpathEval('string(@name)')
|
||||
- if is_skipped_function(name):
|
||||
- continue
|
||||
- test.write(" test_ret += test_%s();\n" % (name))
|
||||
+ if is_skipped_function(name):
|
||||
+ continue
|
||||
+ test.write(" test_ret += test_%s();\n" % (name))
|
||||
|
||||
# footer
|
||||
test.write("""
|
||||
if (test_ret != 0)
|
||||
- printf("Module %s: %%d errors\\n", test_ret);
|
||||
+\tprintf("Module %s: %%d errors\\n", test_ret);
|
||||
return(test_ret);
|
||||
}
|
||||
""" % (module))
|
||||
@@ -948,7 +948,7 @@ test.write(""" return(0);
|
||||
}
|
||||
""");
|
||||
|
||||
-print "Generated test for %d modules and %d functions" %(len(modules), nb_tests)
|
||||
+print("Generated test for %d modules and %d functions" %(len(modules), nb_tests))
|
||||
|
||||
compare_and_save()
|
||||
|
||||
@@ -960,11 +960,8 @@ for missing in missing_types.keys():
|
||||
n = len(missing_types[missing])
|
||||
missing_list.append((n, missing))
|
||||
|
||||
-def compare_missing(a, b):
|
||||
- return b[0] - a[0]
|
||||
-
|
||||
-missing_list.sort(compare_missing)
|
||||
-print "Missing support for %d functions and %d types see missing.lst" % (missing_functions_nr, len(missing_list))
|
||||
+missing_list.sort(key=lambda a: a[0])
|
||||
+print("Missing support for %d functions and %d types see missing.lst" % (missing_functions_nr, len(missing_list)))
|
||||
lst = open("missing.lst", "w")
|
||||
lst.write("Missing support for %d types" % (len(missing_list)))
|
||||
lst.write("\n")
|
||||
@@ -974,9 +971,9 @@ for miss in missing_list:
|
||||
for n in missing_types[miss[1]]:
|
||||
i = i + 1
|
||||
if i > 5:
|
||||
- lst.write(" ...")
|
||||
- break
|
||||
- lst.write(" %s" % (n))
|
||||
+ lst.write(" ...")
|
||||
+ break
|
||||
+ lst.write(" %s" % (n))
|
||||
lst.write("\n")
|
||||
lst.write("\n")
|
||||
lst.write("\n")
|
||||
@@ -32,6 +32,7 @@ SRC_URI += "http://www.w3.org/XML/Test/xmlts20080827.tar.gz;subdir=${BP};name=te
|
||||
file://CVE-2022-23308-fix-regression.patch \
|
||||
file://CVE-2022-29824-dependent.patch \
|
||||
file://CVE-2022-29824.patch \
|
||||
file://0001-Port-gentest.py-to-Python-3.patch \
|
||||
"
|
||||
|
||||
SRC_URI[archive.sha256sum] = "593b7b751dd18c2d6abcd0c4bcb29efc203d0b4373a6df98e3a455ea74ae2813"
|
||||
@@ -89,6 +90,16 @@ do_configure_prepend () {
|
||||
}
|
||||
|
||||
do_compile_ptest() {
|
||||
# Make sure that testapi.c is newer than gentests.py, because
|
||||
# with reproducible builds, they will both get e.g. Jan 1 1970
|
||||
# modification time from SOURCE_DATE_EPOCH and then check-am
|
||||
# might try to rebuild_testapi, which will fail even with
|
||||
# 0001-Port-gentest.py-to-Python-3.patch, because it needs
|
||||
# libxml2 module (libxml2-native dependency and correctly
|
||||
# set PYTHON_SITE_PACKAGES), it's easier to
|
||||
# just rely on pre-generated testapi.c from the release
|
||||
touch ${S}/testapi.c
|
||||
|
||||
oe_runmake check-am
|
||||
}
|
||||
|
||||
|
||||
44
meta/recipes-core/zlib/zlib/CVE-2022-37434.patch
Normal file
44
meta/recipes-core/zlib/zlib/CVE-2022-37434.patch
Normal file
@@ -0,0 +1,44 @@
|
||||
From 8617d83d6939754ae3a04fc2d22daa18eeea2a43 Mon Sep 17 00:00:00 2001
|
||||
From: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
Date: Wed, 17 Aug 2022 10:15:57 +0530
|
||||
Subject: [PATCH] CVE-2022-37434
|
||||
|
||||
Upstream-Status: Backport [https://github.com/madler/zlib/commit/eff308af425b67093bab25f80f1ae950166bece1 & https://github.com/madler/zlib/commit/1eb7682f845ac9e9bf9ae35bbfb3bad5dacbd91d]
|
||||
CVE: CVE-2022-37434
|
||||
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
|
||||
Fix a bug when getting a gzip header extra field with inflate().
|
||||
|
||||
If the extra field was larger than the space the user provided with
|
||||
inflateGetHeader(), and if multiple calls of inflate() delivered
|
||||
the extra header data, then there could be a buffer overflow of the
|
||||
provided space. This commit assures that provided space is not
|
||||
exceeded.
|
||||
|
||||
Fix extra field processing bug that dereferences NULL state->head.
|
||||
|
||||
The recent commit to fix a gzip header extra field processing bug
|
||||
introduced the new bug fixed here.
|
||||
---
|
||||
inflate.c | 5 +++--
|
||||
1 file changed, 3 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/inflate.c b/inflate.c
|
||||
index ac333e8..cd01857 100644
|
||||
--- a/inflate.c
|
||||
+++ b/inflate.c
|
||||
@@ -759,8 +759,9 @@ int flush;
|
||||
if (copy > have) copy = have;
|
||||
if (copy) {
|
||||
if (state->head != Z_NULL &&
|
||||
- state->head->extra != Z_NULL) {
|
||||
- len = state->head->extra_len - state->length;
|
||||
+ state->head->extra != Z_NULL &&
|
||||
+ (len = state->head->extra_len - state->length) <
|
||||
+ state->head->extra_max) {
|
||||
zmemcpy(state->head->extra + len, next,
|
||||
len + copy > state->head->extra_max ?
|
||||
state->head->extra_max - len : copy);
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@@ -10,6 +10,7 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/libpng/${BPN}/${PV}/${BPN}-${PV}.tar.xz \
|
||||
file://ldflags-tests.patch \
|
||||
file://CVE-2018-25032.patch \
|
||||
file://run-ptest \
|
||||
file://CVE-2022-37434.patch \
|
||||
"
|
||||
UPSTREAM_CHECK_URI = "http://zlib.net/"
|
||||
|
||||
|
||||
@@ -37,6 +37,7 @@ EXTRA_CPAN_BUILD_FLAGS = "--create_packlist=0"
|
||||
|
||||
do_install_append () {
|
||||
rm -rf ${D}${docdir}/perl/html
|
||||
sed -i "s:^#!.*:#!/usr/bin/env perl:" ${D}${bindir}/config_data
|
||||
}
|
||||
|
||||
do_install_ptest() {
|
||||
|
||||
@@ -98,6 +98,8 @@ SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \
|
||||
file://CVE-2020-13253_4.patch \
|
||||
file://CVE-2020-13253_5.patch \
|
||||
file://CVE-2020-13791.patch \
|
||||
file://CVE-2022-35414.patch \
|
||||
file://CVE-2020-27821.patch \
|
||||
"
|
||||
UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar"
|
||||
|
||||
|
||||
73
meta/recipes-devtools/qemu/qemu/CVE-2020-27821.patch
Normal file
73
meta/recipes-devtools/qemu/qemu/CVE-2020-27821.patch
Normal file
@@ -0,0 +1,73 @@
|
||||
From 15222d4636d742f3395fd211fad0cd7e36d9f43e Mon Sep 17 00:00:00 2001
|
||||
From: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
Date: Tue, 16 Aug 2022 10:07:01 +0530
|
||||
Subject: [PATCH] CVE-2020-27821
|
||||
|
||||
Upstream-Status: Backport [https://git.qemu.org/?p=qemu.git;a=commit;h=4bfb024bc76973d40a359476dc0291f46e435442]
|
||||
CVE: CVE-2020-27821
|
||||
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
|
||||
memory: clamp cached translation in case it points to an MMIO region
|
||||
|
||||
In using the address_space_translate_internal API, address_space_cache_init
|
||||
forgot one piece of advice that can be found in the code for
|
||||
address_space_translate_internal:
|
||||
|
||||
/* MMIO registers can be expected to perform full-width accesses based only
|
||||
* on their address, without considering adjacent registers that could
|
||||
* decode to completely different MemoryRegions. When such registers
|
||||
* exist (e.g. I/O ports 0xcf8 and 0xcf9 on most PC chipsets), MMIO
|
||||
* regions overlap wildly. For this reason we cannot clamp the accesses
|
||||
* here.
|
||||
*
|
||||
* If the length is small (as is the case for address_space_ldl/stl),
|
||||
* everything works fine. If the incoming length is large, however,
|
||||
* the caller really has to do the clamping through memory_access_size.
|
||||
*/
|
||||
|
||||
address_space_cache_init is exactly one such case where "the incoming length
|
||||
is large", therefore we need to clamp the resulting length---not to
|
||||
memory_access_size though, since we are not doing an access yet, but to
|
||||
the size of the resulting section. This ensures that subsequent accesses
|
||||
to the cached MemoryRegionSection will be in range.
|
||||
|
||||
With this patch, the enclosed testcase notices that the used ring does
|
||||
not fit into the MSI-X table and prints a "qemu-system-x86_64: Cannot map used"
|
||||
error.
|
||||
|
||||
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
||||
---
|
||||
exec.c | 10 ++++++++++
|
||||
1 file changed, 10 insertions(+)
|
||||
|
||||
diff --git a/exec.c b/exec.c
|
||||
index 2d6add46..1360051a 100644
|
||||
--- a/exec.c
|
||||
+++ b/exec.c
|
||||
@@ -3632,6 +3632,7 @@ int64_t address_space_cache_init(MemoryRegionCache *cache,
|
||||
AddressSpaceDispatch *d;
|
||||
hwaddr l;
|
||||
MemoryRegion *mr;
|
||||
+ Int128 diff;
|
||||
|
||||
assert(len > 0);
|
||||
|
||||
@@ -3640,6 +3641,15 @@ int64_t address_space_cache_init(MemoryRegionCache *cache,
|
||||
d = flatview_to_dispatch(cache->fv);
|
||||
cache->mrs = *address_space_translate_internal(d, addr, &cache->xlat, &l, true);
|
||||
|
||||
+ /*
|
||||
+ * cache->xlat is now relative to cache->mrs.mr, not to the section itself.
|
||||
+ * Take that into account to compute how many bytes are there between
|
||||
+ * cache->xlat and the end of the section.
|
||||
+ */
|
||||
+ diff = int128_sub(cache->mrs.size,
|
||||
+ int128_make64(cache->xlat - cache->mrs.offset_within_region));
|
||||
+ l = int128_get64(int128_min(diff, int128_make64(l)));
|
||||
+
|
||||
mr = cache->mrs.mr;
|
||||
memory_region_ref(mr);
|
||||
if (memory_access_is_direct(mr, is_write)) {
|
||||
--
|
||||
2.25.1
|
||||
|
||||
53
meta/recipes-devtools/qemu/qemu/CVE-2022-35414.patch
Normal file
53
meta/recipes-devtools/qemu/qemu/CVE-2022-35414.patch
Normal file
@@ -0,0 +1,53 @@
|
||||
From 09a07b5b39c87423df9e8f6574c19a14d36beac5 Mon Sep 17 00:00:00 2001
|
||||
From: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
Date: Wed, 27 Jul 2022 10:34:12 +0530
|
||||
Subject: [PATCH] CVE-2022-35414
|
||||
|
||||
Upstream-Status: Backport [https://github.com/qemu/qemu/commit/418ade7849ce7641c0f7333718caf5091a02fd4c]
|
||||
CVE: CVE-2022-35414
|
||||
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
---
|
||||
exec.c | 13 ++++++++++++-
|
||||
1 file changed, 12 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/exec.c b/exec.c
|
||||
index 43c70ffb..2d6add46 100644
|
||||
--- a/exec.c
|
||||
+++ b/exec.c
|
||||
@@ -685,7 +685,7 @@ static void tcg_iommu_free_notifier_list(CPUState *cpu)
|
||||
|
||||
/* Called from RCU critical section */
|
||||
MemoryRegionSection *
|
||||
-address_space_translate_for_iotlb(CPUState *cpu, int asidx, hwaddr addr,
|
||||
+address_space_translate_for_iotlb(CPUState *cpu, int asidx, hwaddr orig_addr,
|
||||
hwaddr *xlat, hwaddr *plen,
|
||||
MemTxAttrs attrs, int *prot)
|
||||
{
|
||||
@@ -694,6 +694,7 @@ address_space_translate_for_iotlb(CPUState *cpu, int asidx, hwaddr addr,
|
||||
IOMMUMemoryRegionClass *imrc;
|
||||
IOMMUTLBEntry iotlb;
|
||||
int iommu_idx;
|
||||
+ hwaddr addr = orig_addr;
|
||||
AddressSpaceDispatch *d = atomic_rcu_read(&cpu->cpu_ases[asidx].memory_dispatch);
|
||||
|
||||
for (;;) {
|
||||
@@ -737,6 +738,16 @@ address_space_translate_for_iotlb(CPUState *cpu, int asidx, hwaddr addr,
|
||||
return section;
|
||||
|
||||
translate_fail:
|
||||
+ /*
|
||||
+ * We should be given a page-aligned address -- certainly
|
||||
+ * tlb_set_page_with_attrs() does so. The page offset of xlat
|
||||
+ * is used to index sections[], and PHYS_SECTION_UNASSIGNED = 0.
|
||||
+ * The page portion of xlat will be logged by memory_region_access_valid()
|
||||
+ * when this memory access is rejected, so use the original untranslated
|
||||
+ * physical address.
|
||||
+ */
|
||||
+ assert((orig_addr & ~TARGET_PAGE_MASK) == 0);
|
||||
+ *xlat = orig_addr;
|
||||
return &d->map.sections[PHYS_SECTION_UNASSIGNED];
|
||||
}
|
||||
#endif
|
||||
--
|
||||
2.25.1
|
||||
|
||||
155
meta/recipes-extended/libtirpc/libtirpc/CVE-2021-46828.patch
Normal file
155
meta/recipes-extended/libtirpc/libtirpc/CVE-2021-46828.patch
Normal file
@@ -0,0 +1,155 @@
|
||||
From 48309e7cb230fc539c3edab0b3363f8ce973194f Mon Sep 17 00:00:00 2001
|
||||
From: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
Date: Thu, 28 Jul 2022 09:11:04 +0530
|
||||
Subject: [PATCH] CVE-2021-46828
|
||||
|
||||
Upstream-Status: Backport [http://git.linux-nfs.org/?p=steved/libtirpc.git;a=commit;h=86529758570cef4c73fb9b9c4104fdc510f701ed}
|
||||
CVE: CVE-2021-46828
|
||||
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
---
|
||||
src/svc.c | 17 +++++++++++++-
|
||||
src/svc_vc.c | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++-
|
||||
2 files changed, 77 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/svc.c b/src/svc.c
|
||||
index 6db164b..3a8709f 100644
|
||||
--- a/src/svc.c
|
||||
+++ b/src/svc.c
|
||||
@@ -57,7 +57,7 @@
|
||||
|
||||
#define max(a, b) (a > b ? a : b)
|
||||
|
||||
-static SVCXPRT **__svc_xports;
|
||||
+SVCXPRT **__svc_xports;
|
||||
int __svc_maxrec;
|
||||
|
||||
/*
|
||||
@@ -194,6 +194,21 @@ __xprt_do_unregister (xprt, dolock)
|
||||
rwlock_unlock (&svc_fd_lock);
|
||||
}
|
||||
|
||||
+int
|
||||
+svc_open_fds()
|
||||
+{
|
||||
+ int ix;
|
||||
+ int nfds = 0;
|
||||
+
|
||||
+ rwlock_rdlock (&svc_fd_lock);
|
||||
+ for (ix = 0; ix < svc_max_pollfd; ++ix) {
|
||||
+ if (svc_pollfd[ix].fd != -1)
|
||||
+ nfds++;
|
||||
+ }
|
||||
+ rwlock_unlock (&svc_fd_lock);
|
||||
+ return (nfds);
|
||||
+}
|
||||
+
|
||||
/*
|
||||
* Add a service program to the callout list.
|
||||
* The dispatch routine will be called when a rpc request for this
|
||||
diff --git a/src/svc_vc.c b/src/svc_vc.c
|
||||
index c23cd36..1729963 100644
|
||||
--- a/src/svc_vc.c
|
||||
+++ b/src/svc_vc.c
|
||||
@@ -64,6 +64,8 @@
|
||||
|
||||
|
||||
extern rwlock_t svc_fd_lock;
|
||||
+extern SVCXPRT **__svc_xports;
|
||||
+extern int svc_open_fds();
|
||||
|
||||
static SVCXPRT *makefd_xprt(int, u_int, u_int);
|
||||
static bool_t rendezvous_request(SVCXPRT *, struct rpc_msg *);
|
||||
@@ -82,6 +84,7 @@ static void svc_vc_ops(SVCXPRT *);
|
||||
static bool_t svc_vc_control(SVCXPRT *xprt, const u_int rq, void *in);
|
||||
static bool_t svc_vc_rendezvous_control (SVCXPRT *xprt, const u_int rq,
|
||||
void *in);
|
||||
+static int __svc_destroy_idle(int timeout);
|
||||
|
||||
struct cf_rendezvous { /* kept in xprt->xp_p1 for rendezvouser */
|
||||
u_int sendsize;
|
||||
@@ -312,13 +315,14 @@ done:
|
||||
return (xprt);
|
||||
}
|
||||
|
||||
+
|
||||
/*ARGSUSED*/
|
||||
static bool_t
|
||||
rendezvous_request(xprt, msg)
|
||||
SVCXPRT *xprt;
|
||||
struct rpc_msg *msg;
|
||||
{
|
||||
- int sock, flags;
|
||||
+ int sock, flags, nfds, cnt;
|
||||
struct cf_rendezvous *r;
|
||||
struct cf_conn *cd;
|
||||
struct sockaddr_storage addr;
|
||||
@@ -378,6 +382,16 @@ again:
|
||||
|
||||
gettimeofday(&cd->last_recv_time, NULL);
|
||||
|
||||
+ nfds = svc_open_fds();
|
||||
+ if (nfds >= (_rpc_dtablesize() / 5) * 4) {
|
||||
+ /* destroy idle connections */
|
||||
+ cnt = __svc_destroy_idle(15);
|
||||
+ if (cnt == 0) {
|
||||
+ /* destroy least active */
|
||||
+ __svc_destroy_idle(0);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
return (FALSE); /* there is never an rpc msg to be processed */
|
||||
}
|
||||
|
||||
@@ -819,3 +833,49 @@ __svc_clean_idle(fd_set *fds, int timeout, bool_t cleanblock)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
+
|
||||
+static int
|
||||
+__svc_destroy_idle(int timeout)
|
||||
+{
|
||||
+ int i, ncleaned = 0;
|
||||
+ SVCXPRT *xprt, *least_active;
|
||||
+ struct timeval tv, tdiff, tmax;
|
||||
+ struct cf_conn *cd;
|
||||
+
|
||||
+ gettimeofday(&tv, NULL);
|
||||
+ tmax.tv_sec = tmax.tv_usec = 0;
|
||||
+ least_active = NULL;
|
||||
+ rwlock_wrlock(&svc_fd_lock);
|
||||
+
|
||||
+ for (i = 0; i <= svc_max_pollfd; i++) {
|
||||
+ if (svc_pollfd[i].fd == -1)
|
||||
+ continue;
|
||||
+ xprt = __svc_xports[i];
|
||||
+ if (xprt == NULL || xprt->xp_ops == NULL ||
|
||||
+ xprt->xp_ops->xp_recv != svc_vc_recv)
|
||||
+ continue;
|
||||
+ cd = (struct cf_conn *)xprt->xp_p1;
|
||||
+ if (!cd->nonblock)
|
||||
+ continue;
|
||||
+ if (timeout == 0) {
|
||||
+ timersub(&tv, &cd->last_recv_time, &tdiff);
|
||||
+ if (timercmp(&tdiff, &tmax, >)) {
|
||||
+ tmax = tdiff;
|
||||
+ least_active = xprt;
|
||||
+ }
|
||||
+ continue;
|
||||
+ }
|
||||
+ if (tv.tv_sec - cd->last_recv_time.tv_sec > timeout) {
|
||||
+ __xprt_unregister_unlocked(xprt);
|
||||
+ __svc_vc_dodestroy(xprt);
|
||||
+ ncleaned++;
|
||||
+ }
|
||||
+ }
|
||||
+ if (timeout == 0 && least_active != NULL) {
|
||||
+ __xprt_unregister_unlocked(least_active);
|
||||
+ __svc_vc_dodestroy(least_active);
|
||||
+ ncleaned++;
|
||||
+ }
|
||||
+ rwlock_unlock(&svc_fd_lock);
|
||||
+ return (ncleaned);
|
||||
+}
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@@ -9,7 +9,9 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=f835cce8852481e4b2bbbdd23b5e47f3 \
|
||||
|
||||
PROVIDES = "virtual/librpc"
|
||||
|
||||
SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BP}.tar.bz2"
|
||||
SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BP}.tar.bz2 \
|
||||
file://CVE-2021-46828.patch \
|
||||
"
|
||||
UPSTREAM_CHECK_URI = "https://sourceforge.net/projects/libtirpc/files/libtirpc/"
|
||||
UPSTREAM_CHECK_REGEX = "(?P<pver>\d+(\.\d+)+)/"
|
||||
SRC_URI[md5sum] = "b25f9cc18bfad50f7c446c77f4ae00bb"
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
From bdf3a2630c02a63803309cf0ad4b274234c814ce Mon Sep 17 00:00:00 2001
|
||||
From: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
Date: Tue, 9 Aug 2022 09:45:42 +0530
|
||||
Subject: [PATCH] CVE-2021-46829
|
||||
|
||||
Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/gdk-pixbuf/-/commit/5398f04d772f7f8baf5265715696ed88db0f0512]
|
||||
CVE: CVE-2021-46829
|
||||
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
---
|
||||
gdk-pixbuf/io-gif-animation.c | 21 +++++++++++++--------
|
||||
1 file changed, 13 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/gdk-pixbuf/io-gif-animation.c b/gdk-pixbuf/io-gif-animation.c
|
||||
index d742963..9544391 100644
|
||||
--- a/gdk-pixbuf/io-gif-animation.c
|
||||
+++ b/gdk-pixbuf/io-gif-animation.c
|
||||
@@ -364,7 +364,7 @@ composite_frame (GdkPixbufGifAnim *anim, GdkPixbufFrame *frame)
|
||||
for (i = 0; i < n_indexes; i++) {
|
||||
guint8 index = index_buffer[i];
|
||||
guint x, y;
|
||||
- int offset;
|
||||
+ gsize offset;
|
||||
|
||||
if (index == frame->transparent_index)
|
||||
continue;
|
||||
@@ -374,11 +374,13 @@ composite_frame (GdkPixbufGifAnim *anim, GdkPixbufFrame *frame)
|
||||
if (x >= anim->width || y >= anim->height)
|
||||
continue;
|
||||
|
||||
- offset = y * gdk_pixbuf_get_rowstride (anim->last_frame_data) + x * 4;
|
||||
- pixels[offset + 0] = frame->color_map[index * 3 + 0];
|
||||
- pixels[offset + 1] = frame->color_map[index * 3 + 1];
|
||||
- pixels[offset + 2] = frame->color_map[index * 3 + 2];
|
||||
- pixels[offset + 3] = 255;
|
||||
+ if (g_size_checked_mul (&offset, gdk_pixbuf_get_rowstride (anim->last_frame_data), y) &&
|
||||
+ g_size_checked_add (&offset, offset, x * 4)) {
|
||||
+ pixels[offset + 0] = frame->color_map[index * 3 + 0];
|
||||
+ pixels[offset + 1] = frame->color_map[index * 3 + 1];
|
||||
+ pixels[offset + 2] = frame->color_map[index * 3 + 2];
|
||||
+ pixels[offset + 3] = 255;
|
||||
+ }
|
||||
}
|
||||
|
||||
out:
|
||||
@@ -443,8 +445,11 @@ gdk_pixbuf_gif_anim_iter_get_pixbuf (GdkPixbufAnimationIter *anim_iter)
|
||||
x_end = MIN (anim->last_frame->x_offset + anim->last_frame->width, anim->width);
|
||||
y_end = MIN (anim->last_frame->y_offset + anim->last_frame->height, anim->height);
|
||||
for (y = anim->last_frame->y_offset; y < y_end; y++) {
|
||||
- guchar *line = pixels + y * gdk_pixbuf_get_rowstride (anim->last_frame_data) + anim->last_frame->x_offset * 4;
|
||||
- memset (line, 0, (x_end - anim->last_frame->x_offset) * 4);
|
||||
+ gsize offset;
|
||||
+ if (g_size_checked_mul (&offset, gdk_pixbuf_get_rowstride (anim->last_frame_data), y) &&
|
||||
+ g_size_checked_add (&offset, offset, anim->last_frame->x_offset * 4)) {
|
||||
+ memset (pixels + offset, 0, (x_end - anim->last_frame->x_offset) * 4);
|
||||
+ }
|
||||
}
|
||||
break;
|
||||
case GDK_PIXBUF_FRAME_REVERT:
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@@ -26,6 +26,7 @@ SRC_URI = "${GNOME_MIRROR}/${BPN}/${MAJ_VER}/${BPN}-${PV}.tar.xz \
|
||||
file://missing-test-data.patch \
|
||||
file://CVE-2020-29385.patch \
|
||||
file://CVE-2021-20240.patch \
|
||||
file://CVE-2021-46829.patch \
|
||||
"
|
||||
|
||||
SRC_URI_append_class-target = " \
|
||||
|
||||
133
meta/recipes-graphics/jpeg/files/CVE-2021-46822.patch
Normal file
133
meta/recipes-graphics/jpeg/files/CVE-2021-46822.patch
Normal file
@@ -0,0 +1,133 @@
|
||||
From f35fd27ec641c42d6b115bfa595e483ec58188d2 Mon Sep 17 00:00:00 2001
|
||||
From: DRC <information@libjpeg-turbo.org>
|
||||
Date: Tue, 6 Apr 2021 12:51:03 -0500
|
||||
Subject: [PATCH] tjLoadImage: Fix issues w/loading 16-bit PPMs/PGMs
|
||||
|
||||
- The PPM reader now throws an error rather than segfaulting (due to a
|
||||
buffer overrun) if an application attempts to load a 16-bit PPM file
|
||||
into a grayscale uncompressed image buffer. No known applications
|
||||
allowed that (not even the test applications in libjpeg-turbo),
|
||||
because that mode of operation was never expected to work and did not
|
||||
work under any circumstances. (In fact, it was necessary to modify
|
||||
TJBench in order to reproduce the issue outside of a fuzzing
|
||||
environment.) This was purely a matter of making the library bow out
|
||||
gracefully rather than crash if an application tries to do something
|
||||
really stupid.
|
||||
|
||||
- The PPM reader now throws an error rather than generating incorrect
|
||||
pixels if an application attempts to load a 16-bit PGM file into an
|
||||
RGB uncompressed image buffer.
|
||||
|
||||
- The PPM reader now correctly loads 16-bit PPM files into extended
|
||||
RGB uncompressed image buffers. (Previously it generated incorrect
|
||||
pixels unless the input colorspace was JCS_RGB or JCS_EXT_RGB.)
|
||||
|
||||
The only way that users could have potentially encountered these issues
|
||||
was through the tjLoadImage() function. cjpeg and TJBench were
|
||||
unaffected.
|
||||
|
||||
CVE: CVE-2021-46822
|
||||
Upstream-Status: Backport [https://github.com/libjpeg-turbo/libjpeg-turbo/commit/f35fd27ec641c42d6b115bfa595e483ec58188d2.patch]
|
||||
Comment: Refreshed hunks from ChangeLog.md
|
||||
Refreshed hunks from rdppm.c
|
||||
|
||||
Signed-off-by: Bhabu Bindu <bhabu.bindu@kpit.com>
|
||||
|
||||
---
|
||||
ChangeLog.md | 10 ++++++++++
|
||||
rdppm.c | 26 ++++++++++++++++++++------
|
||||
2 files changed, 30 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/ChangeLog.md b/ChangeLog.md
|
||||
index 968969c6b..12e730a0e 100644
|
||||
--- a/ChangeLog.md
|
||||
+++ b/ChangeLog.md
|
||||
@@ -44,6 +44,15 @@
|
||||
that maximum value was less than 255. libjpeg-turbo 1.5.0 already included a
|
||||
similar fix for binary PPM/PGM files with maximum values greater than 255.
|
||||
|
||||
+7. The PPM reader now throws an error, rather than segfaulting (due to a buffer
|
||||
+overrun) or generating incorrect pixels, if an application attempts to use the
|
||||
+`tjLoadImage()` function to load a 16-bit binary PPM file (a binary PPM file
|
||||
+with a maximum value greater than 255) into a grayscale image buffer or to load
|
||||
+a 16-bit binary PGM file into an RGB image buffer.
|
||||
+
|
||||
+8. Fixed an issue in the PPM reader that caused incorrect pixels to be
|
||||
+generated when using the `tjLoadImage()` function to load a 16-bit binary PPM
|
||||
+file into an extended RGB image buffer.
|
||||
|
||||
2.0.3
|
||||
=====
|
||||
diff --git a/rdppm.c b/rdppm.c
|
||||
index c4c937e8a..6ac8fdbf7 100644
|
||||
--- a/rdppm.c
|
||||
+++ b/rdppm.c
|
||||
@@ -5,7 +5,7 @@
|
||||
* Copyright (C) 1991-1997, Thomas G. Lane.
|
||||
* Modified 2009 by Bill Allombert, Guido Vollbeding.
|
||||
* libjpeg-turbo Modifications:
|
||||
- * Copyright (C) 2015-2017, 2020, D. R. Commander.
|
||||
+ * Copyright (C) 2015-2017, 2020-2021, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
@@ -516,6 +516,11 @@ get_word_rgb_row(j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
|
||||
register JSAMPLE *rescale = source->rescale;
|
||||
JDIMENSION col;
|
||||
unsigned int maxval = source->maxval;
|
||||
+ register int rindex = rgb_red[cinfo->in_color_space];
|
||||
+ register int gindex = rgb_green[cinfo->in_color_space];
|
||||
+ register int bindex = rgb_blue[cinfo->in_color_space];
|
||||
+ register int aindex = alpha_index[cinfo->in_color_space];
|
||||
+ register int ps = rgb_pixelsize[cinfo->in_color_space];
|
||||
|
||||
if (!ReadOK(source->pub.input_file, source->iobuffer, source->buffer_width))
|
||||
ERREXIT(cinfo, JERR_INPUT_EOF);
|
||||
@@ -527,17 +532,20 @@ get_word_rgb_row(j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
|
||||
temp |= UCH(*bufferptr++);
|
||||
if (temp > maxval)
|
||||
ERREXIT(cinfo, JERR_PPM_OUTOFRANGE);
|
||||
- *ptr++ = rescale[temp];
|
||||
+ ptr[rindex] = rescale[temp];
|
||||
temp = UCH(*bufferptr++) << 8;
|
||||
temp |= UCH(*bufferptr++);
|
||||
if (temp > maxval)
|
||||
ERREXIT(cinfo, JERR_PPM_OUTOFRANGE);
|
||||
- *ptr++ = rescale[temp];
|
||||
+ ptr[gindex] = rescale[temp];
|
||||
temp = UCH(*bufferptr++) << 8;
|
||||
temp |= UCH(*bufferptr++);
|
||||
if (temp > maxval)
|
||||
ERREXIT(cinfo, JERR_PPM_OUTOFRANGE);
|
||||
- *ptr++ = rescale[temp];
|
||||
+ ptr[bindex] = rescale[temp];
|
||||
+ if (aindex >= 0)
|
||||
+ ptr[aindex] = 0xFF;
|
||||
+ ptr += ps;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
@@ -624,7 +632,10 @@ start_input_ppm(j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
|
||||
cinfo->in_color_space = JCS_GRAYSCALE;
|
||||
TRACEMS2(cinfo, 1, JTRC_PGM, w, h);
|
||||
if (maxval > 255) {
|
||||
- source->pub.get_pixel_rows = get_word_gray_row;
|
||||
+ if (cinfo->in_color_space == JCS_GRAYSCALE)
|
||||
+ source->pub.get_pixel_rows = get_word_gray_row;
|
||||
+ else
|
||||
+ ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);
|
||||
} else if (maxval == MAXJSAMPLE && sizeof(JSAMPLE) == sizeof(U_CHAR) &&
|
||||
cinfo->in_color_space == JCS_GRAYSCALE) {
|
||||
source->pub.get_pixel_rows = get_raw_row;
|
||||
@@ -657,7 +657,10 @@
|
||||
cinfo->in_color_space = JCS_EXT_RGB;
|
||||
TRACEMS2(cinfo, 1, JTRC_PPM, w, h);
|
||||
if (maxval > 255) {
|
||||
- source->pub.get_pixel_rows = get_word_rgb_row;
|
||||
+ if (IsExtRGB(cinfo->in_color_space))
|
||||
+ source->pub.get_pixel_rows = get_word_rgb_row;
|
||||
+ else
|
||||
+ ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);
|
||||
} else if (maxval == MAXJSAMPLE && sizeof(JSAMPLE) == sizeof(U_CHAR) &&
|
||||
(cinfo->in_color_space == JCS_EXT_RGB
|
||||
#if RGB_RED == 0 && RGB_GREEN == 1 && RGB_BLUE == 2 && RGB_PIXELSIZE == 3
|
||||
@@ -13,6 +13,7 @@ DEPENDS_append_x86_class-target = " nasm-native"
|
||||
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 \
|
||||
"
|
||||
|
||||
SRC_URI[md5sum] = "d01d9e0c28c27bc0de9f4e2e8ff49855"
|
||||
|
||||
@@ -27,7 +27,6 @@ LICENSE = "\
|
||||
& Firmware-go7007 \
|
||||
& Firmware-GPLv2 \
|
||||
& Firmware-hfi1_firmware \
|
||||
& Firmware-i2400m \
|
||||
& Firmware-i915 \
|
||||
& Firmware-ibt_firmware \
|
||||
& Firmware-ice \
|
||||
@@ -57,7 +56,6 @@ LICENSE = "\
|
||||
& Firmware-rtlwifi_firmware \
|
||||
& Firmware-imx-sdma_firmware \
|
||||
& Firmware-siano \
|
||||
& Firmware-tda7706-firmware \
|
||||
& Firmware-ti-connectivity \
|
||||
& Firmware-ti-keystone \
|
||||
& Firmware-ueagle-atm4-firmware \
|
||||
@@ -69,7 +67,6 @@ LICENSE = "\
|
||||
& WHENCE \
|
||||
"
|
||||
|
||||
WHENCE_CHKSUM = "385947b278a6646ae4c3d39ba8c9b1bb"
|
||||
LIC_FILES_CHKSUM = "file://LICENCE.Abilis;md5=b5ee3f410780e56711ad48eadc22b8bc \
|
||||
file://LICENCE.adsp_sst;md5=615c45b91a5a4a9fe046d6ab9a2df728 \
|
||||
file://LICENCE.agere;md5=af0133de6b4a9b2522defd5f188afd31 \
|
||||
@@ -92,7 +89,6 @@ LIC_FILES_CHKSUM = "file://LICENCE.Abilis;md5=b5ee3f410780e56711ad48eadc22b8bc \
|
||||
file://LICENCE.go7007;md5=c0bb9f6aaaba55b0529ee9b30aa66beb \
|
||||
file://GPL-2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
|
||||
file://LICENSE.hfi1_firmware;md5=5e7b6e586ce7339d12689e49931ad444 \
|
||||
file://LICENCE.i2400m;md5=14b901969e23c41881327c0d9e4b7d36 \
|
||||
file://LICENSE.i915;md5=2b0b2e0d20984affd4490ba2cba02570 \
|
||||
file://LICENCE.ibt_firmware;md5=fdbee1ddfe0fb7ab0b2fcd6b454a366b \
|
||||
file://LICENSE.ice;md5=742ab4850f2670792940e6d15c974b2f \
|
||||
@@ -124,7 +120,6 @@ LIC_FILES_CHKSUM = "file://LICENCE.Abilis;md5=b5ee3f410780e56711ad48eadc22b8bc \
|
||||
file://LICENCE.rtlwifi_firmware.txt;md5=00d06cfd3eddd5a2698948ead2ad54a5 \
|
||||
file://LICENSE.sdma_firmware;md5=51e8c19ecc2270f4b8ea30341ad63ce9 \
|
||||
file://LICENCE.siano;md5=4556c1bf830067f12ca151ad953ec2a5 \
|
||||
file://LICENCE.tda7706-firmware.txt;md5=835997cf5e3c131d0dddd695c7d9103e \
|
||||
file://LICENCE.ti-connectivity;md5=c5e02be633f1499c109d1652514d85ec \
|
||||
file://LICENCE.ti-keystone;md5=3a86335d32864b0bef996bee26cc0f2c \
|
||||
file://LICENCE.ueagle-atm4-firmware;md5=4ed7ea6b507ccc583b9d594417714118 \
|
||||
@@ -135,6 +130,9 @@ LIC_FILES_CHKSUM = "file://LICENCE.Abilis;md5=b5ee3f410780e56711ad48eadc22b8bc \
|
||||
file://LICENCE.xc5000c;md5=12b02efa3049db65d524aeb418dd87ca \
|
||||
file://WHENCE;md5=${WHENCE_CHKSUM} \
|
||||
"
|
||||
# WHENCE checksum is defined separately to ease overriding it if
|
||||
# class-devupstream is selected.
|
||||
WHENCE_CHKSUM = "def08711eb23ba967fb7e1f8cff66178"
|
||||
|
||||
# These are not common licenses, set NO_GENERIC_LICENSE for them
|
||||
# so that the license files will be copied from fetched source
|
||||
@@ -160,7 +158,6 @@ NO_GENERIC_LICENSE[Firmware-fw_sst_0f28] = "LICENCE.fw_sst_0f28"
|
||||
NO_GENERIC_LICENSE[Firmware-go7007] = "LICENCE.go7007"
|
||||
NO_GENERIC_LICENSE[Firmware-GPLv2] = "GPL-2"
|
||||
NO_GENERIC_LICENSE[Firmware-hfi1_firmware] = "LICENSE.hfi1_firmware"
|
||||
NO_GENERIC_LICENSE[Firmware-i2400m] = "LICENCE.i2400m"
|
||||
NO_GENERIC_LICENSE[Firmware-i915] = "LICENSE.i915"
|
||||
NO_GENERIC_LICENSE[Firmware-ibt_firmware] = "LICENCE.ibt_firmware"
|
||||
NO_GENERIC_LICENSE[Firmware-ice] = "LICENSE.ice"
|
||||
@@ -191,7 +188,6 @@ NO_GENERIC_LICENSE[Firmware-ralink-firmware] = "LICENCE.ralink-firmware.txt"
|
||||
NO_GENERIC_LICENSE[Firmware-rtlwifi_firmware] = "LICENCE.rtlwifi_firmware.txt"
|
||||
NO_GENERIC_LICENSE[Firmware-siano] = "LICENCE.siano"
|
||||
NO_GENERIC_LICENSE[Firmware-imx-sdma_firmware] = "LICENSE.sdma_firmware"
|
||||
NO_GENERIC_LICENSE[Firmware-tda7706-firmware] = "LICENCE.tda7706-firmware.txt"
|
||||
NO_GENERIC_LICENSE[Firmware-ti-connectivity] = "LICENCE.ti-connectivity"
|
||||
NO_GENERIC_LICENSE[Firmware-ti-keystone] = "LICENCE.ti-keystone"
|
||||
NO_GENERIC_LICENSE[Firmware-ueagle-atm4-firmware] = "LICENCE.ueagle-atm4-firmware"
|
||||
@@ -213,7 +209,7 @@ SRC_URI:class-devupstream = "git://git.kernel.org/pub/scm/linux/kernel/git/firmw
|
||||
# Pin this to the 20220509 release, override this in local.conf
|
||||
SRCREV:class-devupstream ?= "b19cbdca78ab2adfd210c91be15a22568e8b8cae"
|
||||
|
||||
SRC_URI[sha256sum] = "faf3aedf89530e61f4fa1e8c7303dead9127cc24416945647797d079feb12837"
|
||||
SRC_URI[sha256sum] = "0abec827a035c82bdcabdf82aa37ded247bc682ef05861bd409ea6f477bab81d"
|
||||
|
||||
inherit allarch
|
||||
|
||||
@@ -1020,7 +1016,6 @@ LICENSE_${PN} = "\
|
||||
& Firmware-fw_sst_0f28 \
|
||||
& Firmware-go7007 \
|
||||
& Firmware-hfi1_firmware \
|
||||
& Firmware-i2400m \
|
||||
& Firmware-ibt_firmware \
|
||||
& Firmware-it913x \
|
||||
& Firmware-IntcSST2 \
|
||||
@@ -1041,7 +1036,6 @@ LICENSE_${PN} = "\
|
||||
& Firmware-ralink-firmware \
|
||||
& Firmware-imx-sdma_firmware \
|
||||
& Firmware-siano \
|
||||
& Firmware-tda7706-firmware \
|
||||
& Firmware-ti-connectivity \
|
||||
& Firmware-ti-keystone \
|
||||
& Firmware-ueagle-atm4-firmware \
|
||||
@@ -11,13 +11,13 @@ python () {
|
||||
raise bb.parse.SkipRecipe("Set PREFERRED_PROVIDER_virtual/kernel to linux-yocto-rt to enable it")
|
||||
}
|
||||
|
||||
SRCREV_machine ?= "cc478e363cc35064b58a871a4cc535aa973c5891"
|
||||
SRCREV_meta ?= "aaaf9f090dfb3160154b24fbc2f9a6e669babc87"
|
||||
SRCREV_machine ?= "f6c9d6db383201a730e8d638995eae82acd4d8e7"
|
||||
SRCREV_meta ?= "028688aaad2b64e353d771ba5505a8666cd01696"
|
||||
|
||||
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.205"
|
||||
LINUX_VERSION ?= "5.4.209"
|
||||
|
||||
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.205"
|
||||
LINUX_VERSION ?= "5.4.209"
|
||||
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 ?= "6a3e65256e24a2ff0e4e9fcd877987fb8afd12f2"
|
||||
SRCREV_machine ?= "d730b865a7cb7ff89efcf8ac725ca247283f3eeb"
|
||||
SRCREV_meta ?= "aaaf9f090dfb3160154b24fbc2f9a6e669babc87"
|
||||
SRCREV_machine_qemuarm ?= "8f087017ff03465fa8d318c06a7e4e072c533daf"
|
||||
SRCREV_machine ?= "a4b7263158de8713dc85c5171aed99e3424a9f7c"
|
||||
SRCREV_meta ?= "028688aaad2b64e353d771ba5505a8666cd01696"
|
||||
|
||||
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 ?= "943e7e1f32e61dc7dd7a7029062e789219d81b14"
|
||||
SRCREV_machine_qemuarm64 ?= "24d18667d92b460ee33480942306a0d9c80c491b"
|
||||
SRCREV_machine_qemumips ?= "2d469a0343033962ecea678491852aa9457b8ff6"
|
||||
SRCREV_machine_qemuppc ?= "85932dee050f49fa824fd9b49af7b8159fe28a8e"
|
||||
SRCREV_machine_qemuriscv64 ?= "8a59dfded81659402005acfb06fbb00b71c8ce86"
|
||||
SRCREV_machine_qemux86 ?= "8a59dfded81659402005acfb06fbb00b71c8ce86"
|
||||
SRCREV_machine_qemux86-64 ?= "8a59dfded81659402005acfb06fbb00b71c8ce86"
|
||||
SRCREV_machine_qemumips64 ?= "0edbd472c7f0b51994d20d07bb26ead379dc10ed"
|
||||
SRCREV_machine ?= "8a59dfded81659402005acfb06fbb00b71c8ce86"
|
||||
SRCREV_meta ?= "aaaf9f090dfb3160154b24fbc2f9a6e669babc87"
|
||||
SRCREV_machine_qemuarm ?= "4fefb5a57ecb9bc5c6aab38319f773b02c894e6b"
|
||||
SRCREV_machine_qemuarm64 ?= "407b5fa877ca8993a405542fa4c3d73584e8ea98"
|
||||
SRCREV_machine_qemumips ?= "1bfe5d39c9f954f0ac2480115f4750f39500d4f4"
|
||||
SRCREV_machine_qemuppc ?= "753def987b630ed41686223b5dc252436757e893"
|
||||
SRCREV_machine_qemuriscv64 ?= "90d5f03a7c79ccd5c02e0579049d22cf2686da9b"
|
||||
SRCREV_machine_qemux86 ?= "90d5f03a7c79ccd5c02e0579049d22cf2686da9b"
|
||||
SRCREV_machine_qemux86-64 ?= "90d5f03a7c79ccd5c02e0579049d22cf2686da9b"
|
||||
SRCREV_machine_qemumips64 ?= "b391bfc877fe8ae41e579ffd4bcd814b4ad438ea"
|
||||
SRCREV_machine ?= "90d5f03a7c79ccd5c02e0579049d22cf2686da9b"
|
||||
SRCREV_meta ?= "028688aaad2b64e353d771ba5505a8666cd01696"
|
||||
|
||||
# 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.205"
|
||||
LINUX_VERSION ?= "5.4.209"
|
||||
|
||||
DEPENDS += "${@bb.utils.contains('ARCH', 'x86', 'elfutils-native', '', d)}"
|
||||
DEPENDS += "openssl-native util-linux-native"
|
||||
|
||||
@@ -41,7 +41,7 @@ PACKAGECONFIG[unwind] = "-Dlibunwind=enabled,-Dlibunwind=disabled,libunwind"
|
||||
PACKAGECONFIG[dw] = "-Dlibdw=enabled,-Dlibdw=disabled,elfutils"
|
||||
PACKAGECONFIG[bash-completion] = "-Dbash-completion=enabled,-Dbash-completion=disabled,bash-completion"
|
||||
PACKAGECONFIG[tools] = "-Dtools=enabled,-Dtools=disabled"
|
||||
PACKAGECONFIG[setcap] = ",,libcap libcap-native"
|
||||
PACKAGECONFIG[setcap] = "-Dptp-helper-permissions=capabilities,,libcap libcap-native"
|
||||
|
||||
# TODO: put this in a gettext.bbclass patch
|
||||
def gettext_oemeson(d):
|
||||
|
||||
@@ -0,0 +1,183 @@
|
||||
From 8261237113a53cd21029c4a8cbb62c47b4c19523 Mon Sep 17 00:00:00 2001
|
||||
From: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
Date: Wed, 27 Jul 2022 11:30:18 +0530
|
||||
Subject: [PATCH] CVE-2022-2056 CVE-2022-2057 CVE-2022-2058
|
||||
|
||||
Upstream-Status: Backport [https://gitlab.com/libtiff/libtiff/-/commit/dd1bcc7abb26094e93636e85520f0d8f81ab0fab]
|
||||
CVE: CVE-2022-2056 CVE-2022-2057 CVE-2022-2058
|
||||
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
---
|
||||
libtiff/tif_aux.c | 9 +++++++
|
||||
libtiff/tiffiop.h | 1 +
|
||||
tools/tiffcrop.c | 62 ++++++++++++++++++++++++++---------------------
|
||||
3 files changed, 44 insertions(+), 28 deletions(-)
|
||||
|
||||
diff --git a/libtiff/tif_aux.c b/libtiff/tif_aux.c
|
||||
index 8188db5..3dac542 100644
|
||||
--- a/libtiff/tif_aux.c
|
||||
+++ b/libtiff/tif_aux.c
|
||||
@@ -402,6 +402,15 @@ float _TIFFClampDoubleToFloat( double val )
|
||||
return (float)val;
|
||||
}
|
||||
|
||||
+uint32 _TIFFClampDoubleToUInt32(double val)
|
||||
+{
|
||||
+ if( val < 0 )
|
||||
+ return 0;
|
||||
+ if( val > 0xFFFFFFFFU || val != val )
|
||||
+ return 0xFFFFFFFFU;
|
||||
+ return (uint32)val;
|
||||
+}
|
||||
+
|
||||
int _TIFFSeekOK(TIFF* tif, toff_t off)
|
||||
{
|
||||
/* Huge offsets, especially -1 / UINT64_MAX, can cause issues */
|
||||
diff --git a/libtiff/tiffiop.h b/libtiff/tiffiop.h
|
||||
index 45a7932..c6f6f93 100644
|
||||
--- a/libtiff/tiffiop.h
|
||||
+++ b/libtiff/tiffiop.h
|
||||
@@ -393,6 +393,7 @@ extern double _TIFFUInt64ToDouble(uint64);
|
||||
extern float _TIFFUInt64ToFloat(uint64);
|
||||
|
||||
extern float _TIFFClampDoubleToFloat(double);
|
||||
+extern uint32 _TIFFClampDoubleToUInt32(double);
|
||||
|
||||
extern tmsize_t
|
||||
_TIFFReadEncodedStripAndAllocBuffer(TIFF* tif, uint32 strip,
|
||||
diff --git a/tools/tiffcrop.c b/tools/tiffcrop.c
|
||||
index c2c2052..79dd0a0 100644
|
||||
--- a/tools/tiffcrop.c
|
||||
+++ b/tools/tiffcrop.c
|
||||
@@ -5141,17 +5141,17 @@ computeInputPixelOffsets(struct crop_mask *crop, struct image_data *image,
|
||||
{
|
||||
if ((crop->res_unit == RESUNIT_INCH) || (crop->res_unit == RESUNIT_CENTIMETER))
|
||||
{
|
||||
- x1 = (uint32) (crop->corners[i].X1 * scale * xres);
|
||||
- x2 = (uint32) (crop->corners[i].X2 * scale * xres);
|
||||
- y1 = (uint32) (crop->corners[i].Y1 * scale * yres);
|
||||
- y2 = (uint32) (crop->corners[i].Y2 * scale * yres);
|
||||
+ x1 = _TIFFClampDoubleToUInt32(crop->corners[i].X1 * scale * xres);
|
||||
+ x2 = _TIFFClampDoubleToUInt32(crop->corners[i].X2 * scale * xres);
|
||||
+ y1 = _TIFFClampDoubleToUInt32(crop->corners[i].Y1 * scale * yres);
|
||||
+ y2 = _TIFFClampDoubleToUInt32(crop->corners[i].Y2 * scale * yres);
|
||||
}
|
||||
else
|
||||
{
|
||||
- x1 = (uint32) (crop->corners[i].X1);
|
||||
- x2 = (uint32) (crop->corners[i].X2);
|
||||
- y1 = (uint32) (crop->corners[i].Y1);
|
||||
- y2 = (uint32) (crop->corners[i].Y2);
|
||||
+ x1 = _TIFFClampDoubleToUInt32(crop->corners[i].X1);
|
||||
+ x2 = _TIFFClampDoubleToUInt32(crop->corners[i].X2);
|
||||
+ y1 = _TIFFClampDoubleToUInt32(crop->corners[i].Y1);
|
||||
+ y2 = _TIFFClampDoubleToUInt32(crop->corners[i].Y2);
|
||||
}
|
||||
if (x1 < 1)
|
||||
crop->regionlist[i].x1 = 0;
|
||||
@@ -5214,17 +5214,17 @@ computeInputPixelOffsets(struct crop_mask *crop, struct image_data *image,
|
||||
{
|
||||
if (crop->res_unit != RESUNIT_INCH && crop->res_unit != RESUNIT_CENTIMETER)
|
||||
{ /* User has specified pixels as reference unit */
|
||||
- tmargin = (uint32)(crop->margins[0]);
|
||||
- lmargin = (uint32)(crop->margins[1]);
|
||||
- bmargin = (uint32)(crop->margins[2]);
|
||||
- rmargin = (uint32)(crop->margins[3]);
|
||||
+ tmargin = _TIFFClampDoubleToUInt32(crop->margins[0]);
|
||||
+ lmargin = _TIFFClampDoubleToUInt32(crop->margins[1]);
|
||||
+ bmargin = _TIFFClampDoubleToUInt32(crop->margins[2]);
|
||||
+ rmargin = _TIFFClampDoubleToUInt32(crop->margins[3]);
|
||||
}
|
||||
else
|
||||
{ /* inches or centimeters specified */
|
||||
- tmargin = (uint32)(crop->margins[0] * scale * yres);
|
||||
- lmargin = (uint32)(crop->margins[1] * scale * xres);
|
||||
- bmargin = (uint32)(crop->margins[2] * scale * yres);
|
||||
- rmargin = (uint32)(crop->margins[3] * scale * xres);
|
||||
+ tmargin = _TIFFClampDoubleToUInt32(crop->margins[0] * scale * yres);
|
||||
+ lmargin = _TIFFClampDoubleToUInt32(crop->margins[1] * scale * xres);
|
||||
+ bmargin = _TIFFClampDoubleToUInt32(crop->margins[2] * scale * yres);
|
||||
+ rmargin = _TIFFClampDoubleToUInt32(crop->margins[3] * scale * xres);
|
||||
}
|
||||
|
||||
if ((lmargin + rmargin) > image->width)
|
||||
@@ -5254,24 +5254,24 @@ computeInputPixelOffsets(struct crop_mask *crop, struct image_data *image,
|
||||
if (crop->res_unit != RESUNIT_INCH && crop->res_unit != RESUNIT_CENTIMETER)
|
||||
{
|
||||
if (crop->crop_mode & CROP_WIDTH)
|
||||
- width = (uint32)crop->width;
|
||||
+ width = _TIFFClampDoubleToUInt32(crop->width);
|
||||
else
|
||||
width = image->width - lmargin - rmargin;
|
||||
|
||||
if (crop->crop_mode & CROP_LENGTH)
|
||||
- length = (uint32)crop->length;
|
||||
+ length = _TIFFClampDoubleToUInt32(crop->length);
|
||||
else
|
||||
length = image->length - tmargin - bmargin;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (crop->crop_mode & CROP_WIDTH)
|
||||
- width = (uint32)(crop->width * scale * image->xres);
|
||||
+ width = _TIFFClampDoubleToUInt32(crop->width * scale * image->xres);
|
||||
else
|
||||
width = image->width - lmargin - rmargin;
|
||||
|
||||
if (crop->crop_mode & CROP_LENGTH)
|
||||
- length = (uint32)(crop->length * scale * image->yres);
|
||||
+ length = _TIFFClampDoubleToUInt32(crop->length * scale * image->yres);
|
||||
else
|
||||
length = image->length - tmargin - bmargin;
|
||||
}
|
||||
@@ -5670,13 +5670,13 @@ computeOutputPixelOffsets (struct crop_mask *crop, struct image_data *image,
|
||||
{
|
||||
if (page->res_unit == RESUNIT_INCH || page->res_unit == RESUNIT_CENTIMETER)
|
||||
{ /* inches or centimeters specified */
|
||||
- hmargin = (uint32)(page->hmargin * scale * page->hres * ((image->bps + 7)/ 8));
|
||||
- vmargin = (uint32)(page->vmargin * scale * page->vres * ((image->bps + 7)/ 8));
|
||||
+ hmargin = _TIFFClampDoubleToUInt32(page->hmargin * scale * page->hres * ((image->bps + 7) / 8));
|
||||
+ vmargin = _TIFFClampDoubleToUInt32(page->vmargin * scale * page->vres * ((image->bps + 7) / 8));
|
||||
}
|
||||
else
|
||||
{ /* Otherwise user has specified pixels as reference unit */
|
||||
- hmargin = (uint32)(page->hmargin * scale * ((image->bps + 7)/ 8));
|
||||
- vmargin = (uint32)(page->vmargin * scale * ((image->bps + 7)/ 8));
|
||||
+ hmargin = _TIFFClampDoubleToUInt32(page->hmargin * scale * ((image->bps + 7) / 8));
|
||||
+ vmargin = _TIFFClampDoubleToUInt32(page->vmargin * scale * ((image->bps + 7) / 8));
|
||||
}
|
||||
|
||||
if ((hmargin * 2.0) > (pwidth * page->hres))
|
||||
@@ -5714,13 +5714,13 @@ computeOutputPixelOffsets (struct crop_mask *crop, struct image_data *image,
|
||||
{
|
||||
if (page->mode & PAGE_MODE_PAPERSIZE )
|
||||
{
|
||||
- owidth = (uint32)((pwidth * page->hres) - (hmargin * 2));
|
||||
- olength = (uint32)((plength * page->vres) - (vmargin * 2));
|
||||
+ owidth = _TIFFClampDoubleToUInt32((pwidth * page->hres) - (hmargin * 2));
|
||||
+ olength = _TIFFClampDoubleToUInt32((plength * page->vres) - (vmargin * 2));
|
||||
}
|
||||
else
|
||||
{
|
||||
- owidth = (uint32)(iwidth - (hmargin * 2 * page->hres));
|
||||
- olength = (uint32)(ilength - (vmargin * 2 * page->vres));
|
||||
+ owidth = _TIFFClampDoubleToUInt32(iwidth - (hmargin * 2 * page->hres));
|
||||
+ olength = _TIFFClampDoubleToUInt32(ilength - (vmargin * 2 * page->vres));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5729,6 +5729,12 @@ computeOutputPixelOffsets (struct crop_mask *crop, struct image_data *image,
|
||||
if (olength > ilength)
|
||||
olength = ilength;
|
||||
|
||||
+ if (owidth == 0 || olength == 0)
|
||||
+ {
|
||||
+ TIFFError("computeOutputPixelOffsets", "Integer overflow when calculating the number of pages");
|
||||
+ exit(EXIT_FAILURE);
|
||||
+ }
|
||||
+
|
||||
/* Compute the number of pages required for Portrait or Landscape */
|
||||
switch (page->orient)
|
||||
{
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@@ -24,6 +24,7 @@ SRC_URI = "http://download.osgeo.org/libtiff/tiff-${PV}.tar.gz \
|
||||
file://CVE-2022-0909.patch \
|
||||
file://CVE-2022-0891.patch \
|
||||
file://CVE-2022-0924.patch \
|
||||
file://CVE-2022-2056-CVE-2022-2057-CVE-2022-2058.patch \
|
||||
"
|
||||
SRC_URI[md5sum] = "2165e7aba557463acc0664e71a3ed424"
|
||||
SRC_URI[sha256sum] = "5d29f32517dadb6dbcd1255ea5bbc93a2b54b94fbf83653b4d65c7d6775b8634"
|
||||
|
||||
44
meta/recipes-support/gnupg/gnupg/CVE-2022-34903.patch
Normal file
44
meta/recipes-support/gnupg/gnupg/CVE-2022-34903.patch
Normal file
@@ -0,0 +1,44 @@
|
||||
From 2f05fc96b1332caf97176841b1152da3f0aa16a8 Mon Sep 17 00:00:00 2001
|
||||
From: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
Date: Fri, 22 Jul 2022 17:52:36 +0530
|
||||
Subject: [PATCH] CVE-2022-34903
|
||||
|
||||
Upstream-Status: Backport [https://git.gnupg.org/cgi-bin/gitweb.cgi?p=gnupg.git;a=commit;h=34c649b3601383cd11dbc76221747ec16fd68e1b]
|
||||
CVE: CVE-2022-34903
|
||||
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
---
|
||||
g10/cpr.c | 13 ++++---------
|
||||
1 file changed, 4 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/g10/cpr.c b/g10/cpr.c
|
||||
index d502e8b..bc4b715 100644
|
||||
--- a/g10/cpr.c
|
||||
+++ b/g10/cpr.c
|
||||
@@ -328,20 +328,15 @@ write_status_text_and_buffer (int no, const char *string,
|
||||
}
|
||||
first = 0;
|
||||
}
|
||||
- for (esc=0, s=buffer, n=len; n && !esc; s++, n--)
|
||||
+ for (esc=0, s=buffer, n=len; n; s++, n--)
|
||||
{
|
||||
if (*s == '%' || *(const byte*)s <= lower_limit
|
||||
|| *(const byte*)s == 127 )
|
||||
esc = 1;
|
||||
if (wrap && ++count > wrap)
|
||||
- {
|
||||
- dowrap=1;
|
||||
- break;
|
||||
- }
|
||||
- }
|
||||
- if (esc)
|
||||
- {
|
||||
- s--; n++;
|
||||
+ dowrap=1;
|
||||
+ if (esc || dowrap)
|
||||
+ break;
|
||||
}
|
||||
if (s != buffer)
|
||||
es_fwrite (buffer, s-buffer, 1, statusfp);
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@@ -20,6 +20,7 @@ SRC_URI = "${GNUPG_MIRROR}/${BPN}/${BPN}-${PV}.tar.bz2 \
|
||||
file://0003-dirmngr-uses-libgpg-error.patch \
|
||||
file://0004-autogen.sh-fix-find-version-for-beta-checking.patch \
|
||||
file://0001-Woverride-init-is-not-needed-with-gcc-9.patch \
|
||||
file://CVE-2022-34903.patch \
|
||||
"
|
||||
SRC_URI_append_class-native = " file://0001-configure.ac-use-a-custom-value-for-the-location-of-.patch \
|
||||
file://relocate.patch"
|
||||
|
||||
282
meta/recipes-support/gnutls/gnutls/CVE-2022-2509.patch
Normal file
282
meta/recipes-support/gnutls/gnutls/CVE-2022-2509.patch
Normal file
@@ -0,0 +1,282 @@
|
||||
From 9835638d4e1f37781a47e777c76d5bb14218929b Mon Sep 17 00:00:00 2001
|
||||
From: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
Date: Tue, 16 Aug 2022 12:23:14 +0530
|
||||
Subject: [PATCH] CVE-2022-2509
|
||||
|
||||
Upstream-Status: Backport [https://gitlab.com/gnutls/gnutls/-/commit/ce37f9eb265dbe9b6d597f5767449e8ee95848e2]
|
||||
CVE: CVE-2022-2509
|
||||
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
---
|
||||
NEWS | 4 +
|
||||
lib/x509/pkcs7.c | 3 +-
|
||||
tests/Makefile.am | 2 +-
|
||||
tests/pkcs7-verify-double-free.c | 215 +++++++++++++++++++++++++++++++
|
||||
4 files changed, 222 insertions(+), 2 deletions(-)
|
||||
create mode 100644 tests/pkcs7-verify-double-free.c
|
||||
|
||||
diff --git a/NEWS b/NEWS
|
||||
index 755a67c..ba70bb3 100644
|
||||
--- a/NEWS
|
||||
+++ b/NEWS
|
||||
@@ -7,6 +7,10 @@ See the end for copying conditions.
|
||||
|
||||
* Version 3.6.14 (released 2020-06-03)
|
||||
|
||||
+** libgnutls: Fixed double free during verification of pkcs7 signatures.
|
||||
+ Reported by Jaak Ristioja (#1383). [GNUTLS-SA-2022-07-07, CVSS: medium]
|
||||
+ [CVE-2022-2509]
|
||||
+
|
||||
** libgnutls: Fixed insecure session ticket key construction, since 3.6.4.
|
||||
The TLS server would not bind the session ticket encryption key with a
|
||||
value supplied by the application until the initial key rotation, allowing
|
||||
diff --git a/lib/x509/pkcs7.c b/lib/x509/pkcs7.c
|
||||
index 98669e8..ccbc69d 100644
|
||||
--- a/lib/x509/pkcs7.c
|
||||
+++ b/lib/x509/pkcs7.c
|
||||
@@ -1318,7 +1318,8 @@ gnutls_x509_crt_t find_signer(gnutls_pkcs7_t pkcs7, gnutls_x509_trust_list_t tl,
|
||||
issuer = find_verified_issuer_of(pkcs7, issuer, purpose, vflags);
|
||||
|
||||
if (issuer != NULL && gnutls_x509_crt_check_issuer(issuer, issuer)) {
|
||||
- if (prev) gnutls_x509_crt_deinit(prev);
|
||||
+ if (prev && prev != signer)
|
||||
+ gnutls_x509_crt_deinit(prev);
|
||||
prev = issuer;
|
||||
break;
|
||||
}
|
||||
diff --git a/tests/Makefile.am b/tests/Makefile.am
|
||||
index 11a083c..cd43a0f 100644
|
||||
--- a/tests/Makefile.am
|
||||
+++ b/tests/Makefile.am
|
||||
@@ -219,7 +219,7 @@ ctests += mini-record-2 simple gnutls_hmac_fast set_pkcs12_cred cert certuniquei
|
||||
tls-record-size-limit-asym dh-compute ecdh-compute sign-verify-data-newapi \
|
||||
sign-verify-newapi sign-verify-deterministic iov aead-cipher-vec \
|
||||
tls13-without-timeout-func buffer status-request-revoked \
|
||||
- set_x509_ocsp_multi_cli kdf-api keylog-func \
|
||||
+ set_x509_ocsp_multi_cli kdf-api keylog-func pkcs7-verify-double-free \
|
||||
dtls_hello_random_value tls_hello_random_value x509cert-dntypes
|
||||
|
||||
if HAVE_SECCOMP_TESTS
|
||||
diff --git a/tests/pkcs7-verify-double-free.c b/tests/pkcs7-verify-double-free.c
|
||||
new file mode 100644
|
||||
index 0000000..fadf307
|
||||
--- /dev/null
|
||||
+++ b/tests/pkcs7-verify-double-free.c
|
||||
@@ -0,0 +1,215 @@
|
||||
+/*
|
||||
+ * Copyright (C) 2022 Red Hat, Inc.
|
||||
+ *
|
||||
+ * Author: Zoltan Fridrich
|
||||
+ *
|
||||
+ * This file is part of GnuTLS.
|
||||
+ *
|
||||
+ * GnuTLS 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.
|
||||
+ *
|
||||
+ * GnuTLS 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 GnuTLS. If not, see <https://www.gnu.org/licenses/>.
|
||||
+ */
|
||||
+
|
||||
+#ifdef HAVE_CONFIG_H
|
||||
+#include <config.h>
|
||||
+#endif
|
||||
+
|
||||
+#include <stdio.h>
|
||||
+#include <gnutls/pkcs7.h>
|
||||
+#include <gnutls/x509.h>
|
||||
+
|
||||
+#include "utils.h"
|
||||
+
|
||||
+static char rca_pem[] =
|
||||
+ "-----BEGIN CERTIFICATE-----\n"
|
||||
+ "MIIDCjCCAfKgAwIBAgIBATANBgkqhkiG9w0BAQsFADAVMRMwEQYDVQQKDApFeGFt\n"
|
||||
+ "cGxlIENBMCAXDTE3MDcyMTE0NDMzNloYDzIyMjIwNzIxMTQ0MzM2WjAVMRMwEQYD\n"
|
||||
+ "VQQKDApFeGFtcGxlIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA\n"
|
||||
+ "v8hnKPJ/IA0SQB/A/a0Uh+npZ67vsgIMrtTQo0r0kJkmkBz5323xO3DVuJfB3QmX\n"
|
||||
+ "v9zvoeCQLuDvWar5Aixfxgm6s5Q+yPvJj9t3NebDrU+Y4+qyewBIJUF8EF/5iBPC\n"
|
||||
+ "ZHONmzbfIRWvQWGGgb2CRcOHp2J7AY/QLB6LsWPaLjs/DHva28Q13JaTTHIpdu8v\n"
|
||||
+ "t6vHr0nXf66DN4MvtoF3N+o+v3snJCMsfXOqASi4tbWR7gtOfCfiz9uBjh0W2Dut\n"
|
||||
+ "/jclBQkJkLe6esNSM+f4YiOpctVDjmfj8yoHCp394vt0wFqhG38wsTFAyVP6qIcf\n"
|
||||
+ "5zoSu9ovEt2cTkhnZHjiiwIDAQABo2MwYTAPBgNVHRMBAf8EBTADAQH/MA4GA1Ud\n"
|
||||
+ "DwEB/wQEAwIBBjAdBgNVHQ4EFgQUhjeO6Uc5imbjOl2I2ltVA27Hu9YwHwYDVR0j\n"
|
||||
+ "BBgwFoAUhjeO6Uc5imbjOl2I2ltVA27Hu9YwDQYJKoZIhvcNAQELBQADggEBAD+r\n"
|
||||
+ "i/7FsbG0OFKGF2+JOnth6NjJQcMfM8LiglqAuBUijrv7vltoZ0Z3FJH1Vi4OeMXn\n"
|
||||
+ "l7X/9tWUve0uFl75MfjDrf0+lCEdYRY1LCba2BrUgpbbkLywVUdnbsvndehegCgS\n"
|
||||
+ "jss2/zys3Hlo3ZaHlTMQ/NQ4nrxcxkjOvkZSEOqgxJTLpzm6pr7YUts4k6c6lNiB\n"
|
||||
+ "FSiJiDzsJCmWR9C3fBbUlfDfTJYGN3JwqX270KchXDElo8gNoDnF7jBMpLFFSEKm\n"
|
||||
+ "MyfbNLX/srh+CEfZaN/OZV4A3MQ0L8vQEp6M4CJhvRLIuMVabZ2coJ0AzystrOMU\n"
|
||||
+ "LirBWjg89RoAjFQ7bTE=\n"
|
||||
+ "-----END CERTIFICATE-----\n";
|
||||
+
|
||||
+static char ca_pem[] =
|
||||
+ "-----BEGIN CERTIFICATE-----\n"
|
||||
+ "MIIDFzCCAf+gAwIBAgIBAjANBgkqhkiG9w0BAQsFADAVMRMwEQYDVQQKDApFeGFt\n"
|
||||
+ "cGxlIENBMCAXDTE3MDcyMTE0NDQzNFoYDzIyMjIwNzIxMTQ0NDM0WjAiMSAwHgYD\n"
|
||||
+ "VQQKDBdFeGFtcGxlIGludGVybWVkaWF0ZSBDQTCCASIwDQYJKoZIhvcNAQEBBQAD\n"
|
||||
+ "ggEPADCCAQoCggEBAKb9ACB8u//sP6MfNU1OsVw68xz3eTPLgKxS0vpqexm6iGVg\n"
|
||||
+ "ug/o9uYRLzqiEukv/eyz9WzHmY7sqlOJjOFdv92+SaNg79Jc51WHPFXgea4/qyfr\n"
|
||||
+ "4y14PGs0SNxm6T44sXurUs7cXydQVUgnq2VCaWFOTUdxXoAWkV8r8GaUoPD/klVz\n"
|
||||
+ "RqxSZVETmX1XBKhsMnnov41kRwVph2C+VfUspsbaUZaz/o/S1/nokhXRACzKsMBr\n"
|
||||
+ "obqiGxbY35uVzsmbAW5ErhQz98AWJL3Bub1fsEMXg6OEMmPH4AtX888dTIYZNw0E\n"
|
||||
+ "bUIESspz1kjJQTtVQDHTprhwz16YiSVeUonlLgMCAwEAAaNjMGEwDwYDVR0TAQH/\n"
|
||||
+ "BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFPBjxDWjMhjXERirKF9O\n"
|
||||
+ "o/5Cllc5MB8GA1UdIwQYMBaAFIY3julHOYpm4zpdiNpbVQNux7vWMA0GCSqGSIb3\n"
|
||||
+ "DQEBCwUAA4IBAQCTm+vv3hBa6lL5IT+Fw8aTxQ2Ne7mZ5oyazhvXYwwfKNMX3SML\n"
|
||||
+ "W2JdPaL64ZwbxxxYvW401o5Z0CEgru3YFrsqB/hEdl0Uf8UWWJmE1rRa+miTmbjt\n"
|
||||
+ "lrLNCWdrs6CiwvsPITTHg7jevB4KyZYsTSxQFcyr3N3xF+6EmOTC4IkhPPnXYXcp\n"
|
||||
+ "248ih+WOavSYoRvzgB/Dip1WnPYU2mfIV3O8JReRryngA0TzWCLPLUoWR3R4jwtC\n"
|
||||
+ "+1uSLoqaenz3qv3F1WEbke37az9YJuXx/5D8CqFQiZ62TUUtI6fYd8mkMBM4Qfh6\n"
|
||||
+ "NW9XrCkI9wlpL5K9HllhuW0BhKeJkuPpyQ2p\n"
|
||||
+ "-----END CERTIFICATE-----\n";
|
||||
+
|
||||
+static char ee_pem[] =
|
||||
+ "-----BEGIN CERTIFICATE-----\n"
|
||||
+ "MIIDIjCCAgqgAwIBAgIBATANBgkqhkiG9w0BAQsFADAiMSAwHgYDVQQKDBdFeGFt\n"
|
||||
+ "cGxlIGludGVybWVkaWF0ZSBDQTAgFw0yMjA3MjExNDQ1MzdaGA8yMjIyMDcyMTE0\n"
|
||||
+ "NDUzN1owFTETMBEGA1UEAwwKSm9obiBTbWl0aDCCASIwDQYJKoZIhvcNAQEBBQAD\n"
|
||||
+ "ggEPADCCAQoCggEBAMb1uuxppBFY+WVD45iyHUq7DkIJNNOI/JRaybVJfPktWq2E\n"
|
||||
+ "eNe7XhV05KKnqZTbDO2iYqNHqGhZ8pz/IstDRTZP3z/q1vXTG0P9Gx28rEy5TaUY\n"
|
||||
+ "QjtD+ZoFUQm0ORMDBjd8jikqtJ87hKeuOPMH4rzdydotMaPQSm7KLzHBGBr6gg7z\n"
|
||||
+ "g1IxPWkhMyHapoMqqrhjwjzoTY97UIXpZTEoIA+KpEC8f9CciBtL0i1MPBjWozB6\n"
|
||||
+ "Jma9q5iEwZXuRr3cnPYeIPlK2drgDZCMuSFcYiT8ApLw5OhKqY1m2EvfZ2ox2s9R\n"
|
||||
+ "68/HzYdPi3kZwiNEtlBvMlpt5yKBJAflp76d7DkCAwEAAaNuMGwwCwYDVR0PBAQD\n"
|
||||
+ "AgWgMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAdBgNVHQ4EFgQUc+Mi\n"
|
||||
+ "kr8WMCk00SQo+P2iggp/oQkwHwYDVR0jBBgwFoAU8GPENaMyGNcRGKsoX06j/kKW\n"
|
||||
+ "VzkwDQYJKoZIhvcNAQELBQADggEBAKU9+CUR0Jcfybd1+8Aqgh1RH96yQygnVuyt\n"
|
||||
+ "Na9rFz4fM3ij9tGXDHXrkZw8bW1dWLU9quu8zeTxKxc3aiDIw739Alz0tukttDo7\n"
|
||||
+ "dW7YqIb77zsIsWB9p7G9dlxT6ieUy+5IKk69BbeK8KR0vAciAG4KVQxPhuPy/LGX\n"
|
||||
+ "PzqlJIJ4h61s3UOroReHPB1keLZgpORqrvtpClOmABH9TLFRJA/WFg8Q2XYB/p0x\n"
|
||||
+ "l/pWiaoBC+8wK9cDoMUK5yOwXeuCLffCb+UlAD0+z/qxJ2pisE8E9X8rRKRrWI+i\n"
|
||||
+ "G7LtJCEn86EQK8KuRlJxKgj8lClZhoULB0oL4jbblBuNow9WRmM=\n"
|
||||
+ "-----END CERTIFICATE-----\n";
|
||||
+
|
||||
+static char msg_pem[] =
|
||||
+ "-----BEGIN PKCS7-----\n"
|
||||
+ "MIIK2QYJKoZIhvcNAQcCoIIKyjCCCsYCAQExDTALBglghkgBZQMEAgEwCwYJKoZI\n"
|
||||
+ "hvcNAQcBoIIJTzCCAwowggHyoAMCAQICAQEwDQYJKoZIhvcNAQELBQAwFTETMBEG\n"
|
||||
+ "A1UECgwKRXhhbXBsZSBDQTAgFw0xNzA3MjExNDQzMjFaGA8yMjIyMDcyMTE0NDMy\n"
|
||||
+ "MVowFTETMBEGA1UECgwKRXhhbXBsZSBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEP\n"
|
||||
+ "ADCCAQoCggEBAL51eyE4j8wAKQKMGlO9HEY2iaGvsdPSJmidSdmCi1jnNK39Lx4Y\n"
|
||||
+ "31h279hSHF5wtI6VM91HHfeLf1mjEZHlKrXXJQzBPLpbHWapD778drHBitOP8e56\n"
|
||||
+ "fDMIfofLV4tkMk8690vPe4cJH1UHGspMyz6EQF9kPRaW80XtMV/6dalgL/9Esmaw\n"
|
||||
+ "XBNPJAS1VutDuXQkJ/3/rWFLmkpYHHtGPjX782YRmT1s+VOVTsLqmKx0TEL8A381\n"
|
||||
+ "bbElHPUAMjPcyWR5qqA8KWnS5Dwqk3LwI0AvuhQytCq0S7Xl4DXauvxwTRXv0UU7\n"
|
||||
+ "W8r3MLAw9DnlnJiD/RFjw5rbGO3wMePk/qUCAwEAAaNjMGEwDwYDVR0TAQH/BAUw\n"
|
||||
+ "AwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFIh2KRoKJoe2VtpOwWMkRAkR\n"
|
||||
+ "mLWKMB8GA1UdIwQYMBaAFIh2KRoKJoe2VtpOwWMkRAkRmLWKMA0GCSqGSIb3DQEB\n"
|
||||
+ "CwUAA4IBAQBovvlOjoy0MCT5U0eWfcPQQjY4Ssrn3IiPNlVkqSNo+FHX+2baTLVQ\n"
|
||||
+ "5QTHxwXwzdIJiwtjFWDdGEQXqmuIvnFG+u/whGbeg6oQygfnQ5Y+q6epOxCsPgLQ\n"
|
||||
+ "mKKEaF7mvh8DauUx4QSbYCNGCctOZuB1vlN9bJ3/5QbH+2pFPOfCr5CAyPDwHo6S\n"
|
||||
+ "qO3yPcutRwT9xS7gXEHM9HhLp+DmdCGh4eVBPiFilyZm1d92lWxU8oxoSfXgzDT/\n"
|
||||
+ "GCzlMykNZNs4JD9QmiRClP/3U0dQbOhah/Fda+N+L90xaqEgGcvwKKZa3pzo59pl\n"
|
||||
+ "BbkcIP4YPyHeinwkgAn5UVJg9DOxNCS0MIIDFzCCAf+gAwIBAgIBAjANBgkqhkiG\n"
|
||||
+ "9w0BAQsFADAVMRMwEQYDVQQKDApFeGFtcGxlIENBMCAXDTE3MDcyMTE0NDQxM1oY\n"
|
||||
+ "DzIyMjIwNzIxMTQ0NDEzWjAiMSAwHgYDVQQKDBdFeGFtcGxlIGludGVybWVkaWF0\n"
|
||||
+ "ZSBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMPFDEvDANwvhviu\n"
|
||||
+ "pwXTvaKyxyX94jVu1wgAhIRyQBVRiMbrn8MEufLG8oA0vKd8s92gv/lWe1jFb2rn\n"
|
||||
+ "91jMkZWsjWjiJFD6SzqFfBo+XxOGikEqO1MAf92UqavmSGlXVRG1Vy7T7dWibZP0\n"
|
||||
+ "WODhHYWayR0Y6owSz5IqNfrHXzDME+lSJxHgRFI7pK+b0OgiVmvyXDKFPvyU6GrP\n"
|
||||
+ "lxXDi/XbjyPvC5gpiwtTgm+s8KERwmdlfZUNjkh2PpHx1g1joijHT3wIvO/Pek1E\n"
|
||||
+ "C+Xs6w3XxGgL6TTL7FDuv4AjZVX9KK66/yBhX3aN8bkqAg+hs9XNk3zzWC0XEFOS\n"
|
||||
+ "Qoh2va0CAwEAAaNjMGEwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYw\n"
|
||||
+ "HQYDVR0OBBYEFHwi/7dUWGjkMWJctOm7MCjjQj1cMB8GA1UdIwQYMBaAFIh2KRoK\n"
|
||||
+ "Joe2VtpOwWMkRAkRmLWKMA0GCSqGSIb3DQEBCwUAA4IBAQCF6sHCBdYRwBwvfCve\n"
|
||||
+ "og9cPnmPqZrG4AtmSvtoSsMvgvKb/4z3/gG8oPtTBkeRcAHoMoEp/oA+B2ylwIAc\n"
|
||||
+ "S5U7jx+lYH/Pqih0X/OcOLbaMv8uzGSGQxk+L9LuuIT6E/THfRRIPEvkDkzC+/uk\n"
|
||||
+ "7vUbG17bSEWeF0o/6sjzAY2aH1jnbCDyu0UC78GXkc6bZ5QlH98uLMDMrOmqcZjS\n"
|
||||
+ "JFfvuRDQyKV5yBdBkYaobsIWSQDsgYxJzf/2y8c3r+HXqT+jhrXPWJ3btgMPxpu7\n"
|
||||
+ "E8KmoFgp9EM+48oYlXJ66rk08/KjaVmgN7R+Hm3e2+MFT2kme4fBKalLjcazTe3x\n"
|
||||
+ "0FisMIIDIjCCAgqgAwIBAgIBATANBgkqhkiG9w0BAQsFADAiMSAwHgYDVQQKDBdF\n"
|
||||
+ "eGFtcGxlIGludGVybWVkaWF0ZSBDQTAgFw0yMjA3MjExNDQ1MzBaGA8yMjIyMDcy\n"
|
||||
+ "MTE0NDUzMVowFTETMBEGA1UEAwwKSm9obiBTbWl0aDCCASIwDQYJKoZIhvcNAQEB\n"
|
||||
+ "BQADggEPADCCAQoCggEBAMjhSqhdD5RjmOm6W3hG7zkgKBP9whRN/SipcdEMlkgc\n"
|
||||
+ "F/U3QMu66qIfKwheNdWalC1JLtruLDWP92ysa6Vw+CCG8aSax1AgB//RKQB7kgPA\n"
|
||||
+ "9js9hi/oCdBmCv2HJxhWSLz+MVoxgzW4C7S9FenI+btxe/99Uw4nOw7kwjsYDLKr\n"
|
||||
+ "tMw8myv7aCW/63CuBYGtohiZupM3RI3kKFcZots+KRPLlZpjv+I2h9xSln8VxKNb\n"
|
||||
+ "XiMrYwGfHB7iX7ghe1TvFjKatEUhsqa7AvIq7nfe/cyq97f0ODQO814njgZtk5iQ\n"
|
||||
+ "JVavXHdhTVaypt1HdAFMuHX5UATylHxx9tRCgSIijUsCAwEAAaNuMGwwCwYDVR0P\n"
|
||||
+ "BAQDAgWgMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAdBgNVHQ4EFgQU\n"
|
||||
+ "31+vHl4E/2Jpnwinbzf+d7usshcwHwYDVR0jBBgwFoAUfCL/t1RYaOQxYly06bsw\n"
|
||||
+ "KONCPVwwDQYJKoZIhvcNAQELBQADggEBAAWe63DcNwmleQ3INFGDJZ/m2I/R/cBa\n"
|
||||
+ "nnrxgR5Ey1ljHdA/x1z1JLTGmGVwqGExs5DNG9Q//Pmc9pZ1yPa8J4Xf8AvFcmkY\n"
|
||||
+ "mWoH1HvW0xu/RF1UN5SAoD2PRQ+Vq4OSPD58IlEu/u4o1wZV7Wl91Cv6VNpiAb63\n"
|
||||
+ "j9PA1YacOpOtcRqG59Vuj9HFm9f30ejHVo2+KJcpo290cR3Zg4fOm8mtjeMdt/QS\n"
|
||||
+ "Atq+RqPAQ7yxqvEEv8zPIZj2kAOQm3mh/yYqBrR68lQUD/dBTP7ApIZkhUK3XK6U\n"
|
||||
+ "nf9JvoF6Fn2+Cnqb//FLBgHSnoeqeQNwDLUXTsD02iYxHzJrhokSY4YxggFQMIIB\n"
|
||||
+ "TAIBATAnMCIxIDAeBgNVBAoMF0V4YW1wbGUgaW50ZXJtZWRpYXRlIENBAgEBMAsG\n"
|
||||
+ "CWCGSAFlAwQCATANBgkqhkiG9w0BAQEFAASCAQATHg6wNsBcs/Ub1GQfKwTpKCk5\n"
|
||||
+ "8QXuNnZ0u7b6mKgrSY2Gf47fpL2aRgaR+BAQncbctu5EH/IL38pWjaGtOhFAj/5q\n"
|
||||
+ "7luVQW11kuyJN3Bd/dtLqawWOwMmAIEigw6X50l5ZHnEVzFfxt+RKTNhk4XWVtbi\n"
|
||||
+ "2iIlITOplW0rnvxYAwCxKL9ocaB7etK8au7ixMxbFp75Ts4iLX8dhlAFdCuFCk8k\n"
|
||||
+ "B8mi9HHuwr3QYRqMPW61hu1wBL3yB8eoZNOwPXb0gkIh6ZvgptxgQzm/cc+Iw9fP\n"
|
||||
+ "QkR0fTM7ElJ5QZmSV98AUbZDHmDvpmcjcUxfSPMc3IoT8T300usRu7QHqKJi\n"
|
||||
+ "-----END PKCS7-----\n";
|
||||
+
|
||||
+const gnutls_datum_t rca_datum = { (void *)rca_pem, sizeof(rca_pem) - 1 };
|
||||
+const gnutls_datum_t ca_datum = { (void *)ca_pem, sizeof(ca_pem) - 1 };
|
||||
+const gnutls_datum_t ee_datum = { (void *)ee_pem, sizeof(ee_pem) - 1 };
|
||||
+const gnutls_datum_t msg_datum = { (void *)msg_pem, sizeof(msg_pem) - 1 };
|
||||
+
|
||||
+static void tls_log_func(int level, const char *str)
|
||||
+{
|
||||
+ fprintf(stderr, "%s |<%d>| %s", "err", level, str);
|
||||
+}
|
||||
+
|
||||
+#define CHECK(X)\
|
||||
+{\
|
||||
+ r = X;\
|
||||
+ if (r < 0)\
|
||||
+ fail("error in %d: %s\n", __LINE__, gnutls_strerror(r));\
|
||||
+}\
|
||||
+
|
||||
+void doit(void)
|
||||
+{
|
||||
+ int r;
|
||||
+ gnutls_x509_crt_t rca_cert = NULL;
|
||||
+ gnutls_x509_crt_t ca_cert = NULL;
|
||||
+ gnutls_x509_crt_t ee_cert = NULL;
|
||||
+ gnutls_x509_trust_list_t tlist = NULL;
|
||||
+ gnutls_pkcs7_t pkcs7 = NULL;
|
||||
+ gnutls_datum_t data = { (unsigned char *)"xxx", 3 };
|
||||
+
|
||||
+ if (debug) {
|
||||
+ gnutls_global_set_log_function(tls_log_func);
|
||||
+ gnutls_global_set_log_level(4711);
|
||||
+ }
|
||||
+
|
||||
+ // Import certificates
|
||||
+ CHECK(gnutls_x509_crt_init(&rca_cert));
|
||||
+ CHECK(gnutls_x509_crt_import(rca_cert, &rca_datum, GNUTLS_X509_FMT_PEM));
|
||||
+ CHECK(gnutls_x509_crt_init(&ca_cert));
|
||||
+ CHECK(gnutls_x509_crt_import(ca_cert, &ca_datum, GNUTLS_X509_FMT_PEM));
|
||||
+ CHECK(gnutls_x509_crt_init(&ee_cert));
|
||||
+ CHECK(gnutls_x509_crt_import(ee_cert, &ee_datum, GNUTLS_X509_FMT_PEM));
|
||||
+
|
||||
+ // Setup trust store
|
||||
+ CHECK(gnutls_x509_trust_list_init(&tlist, 0));
|
||||
+ CHECK(gnutls_x509_trust_list_add_named_crt(tlist, rca_cert, "rca", 3, 0));
|
||||
+ CHECK(gnutls_x509_trust_list_add_named_crt(tlist, ca_cert, "ca", 2, 0));
|
||||
+ CHECK(gnutls_x509_trust_list_add_named_crt(tlist, ee_cert, "ee", 2, 0));
|
||||
+
|
||||
+ // Setup pkcs7 structure
|
||||
+ CHECK(gnutls_pkcs7_init(&pkcs7));
|
||||
+ CHECK(gnutls_pkcs7_import(pkcs7, &msg_datum, GNUTLS_X509_FMT_PEM));
|
||||
+
|
||||
+ // Signature verification
|
||||
+ gnutls_pkcs7_verify(pkcs7, tlist, NULL, 0, 0, &data, 0);
|
||||
+
|
||||
+ gnutls_x509_crt_deinit(rca_cert);
|
||||
+ gnutls_x509_crt_deinit(ca_cert);
|
||||
+ gnutls_x509_crt_deinit(ee_cert);
|
||||
+ gnutls_x509_trust_list_deinit(tlist, 0);
|
||||
+ gnutls_pkcs7_deinit(pkcs7);
|
||||
+}
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@@ -25,6 +25,7 @@ SRC_URI = "https://www.gnupg.org/ftp/gcrypt/gnutls/v${SHRT_VER}/gnutls-${PV}.tar
|
||||
file://CVE-2020-24659.patch \
|
||||
file://CVE-2021-20231.patch \
|
||||
file://CVE-2021-20232.patch \
|
||||
file://CVE-2022-2509.patch \
|
||||
"
|
||||
|
||||
SRC_URI[sha256sum] = "5630751adec7025b8ef955af4d141d00d252a985769f51b4059e5affa3d39d63"
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
The creation of the LINGUAS file is duplicated for each desktop file
|
||||
which can lead the commands to race against each other. Rework
|
||||
the makefile to avoid this as the expense of leaving the file on disk.
|
||||
|
||||
Upstream-Status: Pending
|
||||
RP 2021/2/15
|
||||
|
||||
Index: git/src/po/Makefile
|
||||
===================================================================
|
||||
--- git.orig/src/po/Makefile
|
||||
+++ git/src/po/Makefile
|
||||
@@ -207,17 +207,16 @@ $(PACKAGE).pot: $(PO_INPUTLIST) $(PO_VIM
|
||||
# Delete the temporary files
|
||||
rm *.js
|
||||
|
||||
-vim.desktop: vim.desktop.in $(POFILES)
|
||||
+LINGUAS:
|
||||
echo $(LANGUAGES) | tr " " "\n" |sed -e '/\./d' | sort > LINGUAS
|
||||
+
|
||||
+vim.desktop: vim.desktop.in $(POFILES) LINGUAS
|
||||
$(MSGFMT) --desktop -d . --template vim.desktop.in -o tmp_vim.desktop
|
||||
- rm -f LINGUAS
|
||||
if command -v desktop-file-validate; then desktop-file-validate tmp_vim.desktop; fi
|
||||
mv tmp_vim.desktop vim.desktop
|
||||
|
||||
-gvim.desktop: gvim.desktop.in $(POFILES)
|
||||
- echo $(LANGUAGES) | tr " " "\n" |sed -e '/\./d' | sort > LINGUAS
|
||||
+gvim.desktop: gvim.desktop.in $(POFILES) LINGUAS
|
||||
$(MSGFMT) --desktop -d . --template gvim.desktop.in -o tmp_gvim.desktop
|
||||
- rm -f LINGUAS
|
||||
if command -v desktop-file-validate; then desktop-file-validate tmp_gvim.desktop; fi
|
||||
mv tmp_gvim.desktop gvim.desktop
|
||||
|
||||
@@ -18,11 +18,10 @@ SRC_URI = "git://github.com/vim/vim.git;branch=master;protocol=https \
|
||||
file://vim-add-knob-whether-elf.h-are-checked.patch \
|
||||
file://0001-src-Makefile-improve-reproducibility.patch \
|
||||
file://no-path-adjust.patch \
|
||||
file://racefix.patch \
|
||||
"
|
||||
|
||||
PV .= ".0021"
|
||||
SRCREV = "5e59ea54c0c37c2f84770f068d95280069828774"
|
||||
PV .= ".0115"
|
||||
SRCREV = "6747cf1671bd41cddee77c65b3f9a70509f968db"
|
||||
|
||||
# Remove when 8.3 is out
|
||||
UPSTREAM_VERSION_UNKNOWN = "1"
|
||||
@@ -94,6 +93,11 @@ EXTRA_OECONF = " \
|
||||
STRIP=/bin/true \
|
||||
"
|
||||
|
||||
# Some host distros don't have it, disable consistently
|
||||
# also disable on dunfell target builds
|
||||
EXTRA_OECONF_append_class-native = " vim_cv_timer_create=no"
|
||||
EXTRA_OECONF_append_class-target = " vim_cv_timer_create=no"
|
||||
|
||||
do_install() {
|
||||
autotools_do_install
|
||||
|
||||
|
||||
Reference in New Issue
Block a user