mirror of
https://git.yoctoproject.org/poky
synced 2026-01-29 21:08:42 +01:00
Compare commits
77 Commits
yocto-5.2.
...
yocto-4.1.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d3cda9a3e0 | ||
|
|
80d22fc07f | ||
|
|
c35857bd24 | ||
|
|
d8917f76bc | ||
|
|
d5add7c5b7 | ||
|
|
e65081b949 | ||
|
|
027ec0ecf5 | ||
|
|
54fb46c66e | ||
|
|
63e80a0233 | ||
|
|
c689d5d4e3 | ||
|
|
2ac597044a | ||
|
|
79434a17eb | ||
|
|
25f355e0ef | ||
|
|
186d179614 | ||
|
|
975e3fb53c | ||
|
|
e881560619 | ||
|
|
6054c58908 | ||
|
|
cb9d9fd076 | ||
|
|
7b401c7540 | ||
|
|
62c4b68a11 | ||
|
|
1b5b1ba8fb | ||
|
|
6bded7cb12 | ||
|
|
d18ec217b3 | ||
|
|
0771c25330 | ||
|
|
f02d7f4547 | ||
|
|
d051fc188b | ||
|
|
22c5e7fa3e | ||
|
|
cd873bc5de | ||
|
|
2f52d04e17 | ||
|
|
3d58ac1ddd | ||
|
|
e6428f3c1c | ||
|
|
db48ca5830 | ||
|
|
23cf93f091 | ||
|
|
9921f0a250 | ||
|
|
cd89ca53ed | ||
|
|
290ce3525f | ||
|
|
c3911e12f6 | ||
|
|
ad8bd886a4 | ||
|
|
b0bf1ab118 | ||
|
|
e57c26ea29 | ||
|
|
baccaad9a0 | ||
|
|
c5c4cbb024 | ||
|
|
394054d7ca | ||
|
|
27e0f91aaa | ||
|
|
079bb45350 | ||
|
|
2dd06fb636 | ||
|
|
8ed9ff8919 | ||
|
|
86eaa373a7 | ||
|
|
b0b966ad07 | ||
|
|
fc5bc29d1b | ||
|
|
8a3bbee311 | ||
|
|
b1b1c9232f | ||
|
|
cc4b3a0040 | ||
|
|
900420392d | ||
|
|
03f1b28c6d | ||
|
|
692a8ab550 | ||
|
|
94270812fa | ||
|
|
570e56775b | ||
|
|
0dfef83aa5 | ||
|
|
adaa8ad2a5 | ||
|
|
811f8a09eb | ||
|
|
72157834c6 | ||
|
|
25cfdd66e4 | ||
|
|
33711d546d | ||
|
|
1c94f9d64b | ||
|
|
e6daf39c9b | ||
|
|
7ffb05dd16 | ||
|
|
8074213da8 | ||
|
|
f435cff54a | ||
|
|
a6586821f0 | ||
|
|
0bc04f5e6d | ||
|
|
6b9db5a99b | ||
|
|
6672cbe670 | ||
|
|
c58059d282 | ||
|
|
ec08faf2e4 | ||
|
|
7aa3ed5c37 | ||
|
|
b6d633e7f3 |
@@ -330,7 +330,8 @@ Removal (Override Style Syntax)
|
||||
|
||||
You can remove values from lists using the removal override style
|
||||
syntax. Specifying a value for removal causes all occurrences of that
|
||||
value to be removed from the variable.
|
||||
value to be removed from the variable. Unlike ":append" and ":prepend",
|
||||
there is no need to add a leading or trailing space to the value.
|
||||
|
||||
When you use this syntax, BitBake expects one or more strings.
|
||||
Surrounding spaces and spacing are preserved. Here is an example::
|
||||
@@ -421,6 +422,12 @@ documentation to a BitBake variable as follows::
|
||||
|
||||
CACHE[doc] = "The directory holding the cache of the metadata."
|
||||
|
||||
.. note::
|
||||
|
||||
Variable flag names starting with an underscore (``_``) character
|
||||
are allowed but are ignored by ``d.getVarFlags("VAR")``
|
||||
in Python code. Such flag names are used internally by BitBake.
|
||||
|
||||
Inline Python Variable Expansion
|
||||
--------------------------------
|
||||
|
||||
|
||||
@@ -484,29 +484,55 @@ overview of their function and contents.
|
||||
for it to work.
|
||||
|
||||
:term:`BB_PRESSURE_MAX_CPU`
|
||||
The threshold for maximum CPU pressure before BitBake prevents the
|
||||
scheduling of new tasks. Once the :term:`BB_PRESSURE_MAX_CPU` threshold
|
||||
is exceeded, new tasks are not started until the pressure subsides to
|
||||
below the threshold. If :term:`BB_PRESSURE_MAX_CPU` is not set, CPU
|
||||
pressure is not monitored. A threshold can be set in ``conf/local.conf``
|
||||
as::
|
||||
Specifies a maximum CPU pressure threshold, above which BitBake's
|
||||
scheduler will not start new tasks (providing there is at least
|
||||
one active task). If no value is set, CPU pressure is not
|
||||
monitored when starting tasks.
|
||||
|
||||
The pressure data is calculated based upon what Linux kernels since
|
||||
version 4.20 expose under ``/proc/pressure``. The threshold represents
|
||||
the difference in "total" pressure from the previous second. The
|
||||
minimum value is 1.0 (extremely slow builds) and the maximum is
|
||||
1000000 (a pressure value unlikely to ever be reached).
|
||||
|
||||
This threshold can be set in ``conf/local.conf`` as::
|
||||
|
||||
BB_PRESSURE_MAX_CPU = "500"
|
||||
|
||||
:term:`BB_PRESSURE_MAX_IO`
|
||||
The threshold for maximum IO pressure experienced before BitBake
|
||||
prevents the scheduling of new tasks. The IO pressure is regulated in the
|
||||
same way as :term:`BB_PRESSURE_MAX_CPU`. At this point in time,
|
||||
experiments show that IO pressure tends to be short-lived and regulating
|
||||
just the CPU can help to reduce it.
|
||||
Specifies a maximum I/O pressure threshold, above which BitBake's
|
||||
scheduler will not start new tasks (providing there is at least
|
||||
one active task). If no value is set, I/O pressure is not
|
||||
monitored when starting tasks.
|
||||
|
||||
The pressure data is calculated based upon what Linux kernels since
|
||||
version 4.20 expose under ``/proc/pressure``. The threshold represents
|
||||
the difference in "total" pressure from the previous second. The
|
||||
minimum value is 1.0 (extremely slow builds) and the maximum is
|
||||
1000000 (a pressure value unlikely to ever be reached).
|
||||
|
||||
At this point in time, experiments show that IO pressure tends to
|
||||
be short-lived and regulating just the CPU with
|
||||
:term:`BB_PRESSURE_MAX_CPU` can help to reduce it.
|
||||
|
||||
:term:`BB_PRESSURE_MAX_MEMORY`
|
||||
The threshold for maximum memory pressure experienced before BitBake
|
||||
prevents the scheduling of new tasks. The memory pressure is regulated in
|
||||
the same way as :term:`BB_PRESSURE_MAX_CPU`. Note that any memory
|
||||
pressure indicates that a system is being pushed beyond its capacity. At
|
||||
this point in time, experiments show that memory pressure tends to be
|
||||
short-lived and regulating just the CPU can help to reduce it.
|
||||
|
||||
Specifies a maximum memory pressure threshold, above which BitBake's
|
||||
scheduler will not start new tasks (providing there is at least
|
||||
one active task). If no value is set, memory pressure is not
|
||||
monitored when starting tasks.
|
||||
|
||||
The pressure data is calculated based upon what Linux kernels since
|
||||
version 4.20 expose under ``/proc/pressure``. The threshold represents
|
||||
the difference in "total" pressure from the previous second. The
|
||||
minimum value is 1.0 (extremely slow builds) and the maximum is
|
||||
1000000 (a pressure value unlikely to ever be reached).
|
||||
|
||||
Memory pressure is experienced when time is spent swapping,
|
||||
refaulting pages from the page cache or performing direct reclaim.
|
||||
This is why memory pressure is rarely seen, but setting this variable
|
||||
might be useful as a last resort to prevent OOM errors if they are
|
||||
occurring during builds.
|
||||
|
||||
:term:`BB_RUNFMT`
|
||||
Specifies the name of the executable script files (i.e. run files)
|
||||
|
||||
@@ -42,7 +42,7 @@ class AsyncServerConnection(object):
|
||||
|
||||
# Read protocol and version
|
||||
client_protocol = await self.reader.readline()
|
||||
if client_protocol is None:
|
||||
if not client_protocol:
|
||||
return
|
||||
|
||||
(client_proto_name, client_proto_version) = client_protocol.decode('utf-8').rstrip().split()
|
||||
@@ -59,7 +59,7 @@ class AsyncServerConnection(object):
|
||||
# an empty line to signal the end of the headers
|
||||
while True:
|
||||
line = await self.reader.readline()
|
||||
if line is None:
|
||||
if not line:
|
||||
return
|
||||
|
||||
line = line.decode('utf-8').rstrip()
|
||||
|
||||
@@ -243,7 +243,7 @@ class Git(FetchMethod):
|
||||
for name in ud.names:
|
||||
ud.unresolvedrev[name] = 'HEAD'
|
||||
|
||||
ud.basecmd = d.getVar("FETCHCMD_git") or "git -c core.fsyncobjectfiles=0 -c gc.autoDetach=false -c core.pager=cat"
|
||||
ud.basecmd = d.getVar("FETCHCMD_git") or "git -c gc.autoDetach=false -c core.pager=cat"
|
||||
|
||||
write_tarballs = d.getVar("BB_GENERATE_MIRROR_TARBALLS") or "0"
|
||||
ud.write_tarballs = write_tarballs != "0" or ud.rebaseable
|
||||
|
||||
@@ -1331,12 +1331,14 @@ class URLHandle(unittest.TestCase):
|
||||
"cvs://anoncvs:anonymous@cvs.handhelds.org/cvs;tag=V0-99-81;module=familiar/dist/ipkg" : ('cvs', 'cvs.handhelds.org', '/cvs', 'anoncvs', 'anonymous', collections.OrderedDict([('tag', 'V0-99-81'), ('module', 'familiar/dist/ipkg')])),
|
||||
"git://git.openembedded.org/bitbake;branch=@foo" : ('git', 'git.openembedded.org', '/bitbake', '', '', {'branch': '@foo'}),
|
||||
"file://somelocation;someparam=1": ('file', '', 'somelocation', '', '', {'someparam': '1'}),
|
||||
r'git://s.o-me_ONE:!#$%^&*()-_={}[]\|:?,.<>~`@git.openembedded.org/bitbake;branch=main': ('git', 'git.openembedded.org', '/bitbake', 's.o-me_ONE', r'!#$%^&*()-_={}[]\|:?,.<>~`', {'branch': 'main'}),
|
||||
}
|
||||
# we require a pathname to encodeurl but users can still pass such urls to
|
||||
# decodeurl and we need to handle them
|
||||
decodedata = datatable.copy()
|
||||
decodedata.update({
|
||||
"http://somesite.net;someparam=1": ('http', 'somesite.net', '/', '', '', {'someparam': '1'}),
|
||||
"npmsw://some.registry.url;package=@pkg;version=latest": ('npmsw', 'some.registry.url', '/', '', '', {'package': '@pkg', 'version': 'latest'}),
|
||||
})
|
||||
|
||||
def test_decodeurl(self):
|
||||
@@ -1869,7 +1871,7 @@ class GitShallowTest(FetcherTest):
|
||||
self.add_empty_file('bsub', cwd=smdir)
|
||||
|
||||
self.git('submodule init', cwd=self.srcdir)
|
||||
self.git('submodule add file://%s' % smdir, cwd=self.srcdir)
|
||||
self.git('-c protocol.file.allow=always submodule add file://%s' % smdir, cwd=self.srcdir)
|
||||
self.git('submodule update', cwd=self.srcdir)
|
||||
self.git('commit -m submodule -a', cwd=self.srcdir)
|
||||
|
||||
@@ -1899,7 +1901,7 @@ class GitShallowTest(FetcherTest):
|
||||
self.add_empty_file('bsub', cwd=smdir)
|
||||
|
||||
self.git('submodule init', cwd=self.srcdir)
|
||||
self.git('submodule add file://%s' % smdir, cwd=self.srcdir)
|
||||
self.git('-c protocol.file.allow=always submodule add file://%s' % smdir, cwd=self.srcdir)
|
||||
self.git('submodule update', cwd=self.srcdir)
|
||||
self.git('commit -m submodule -a', cwd=self.srcdir)
|
||||
|
||||
|
||||
@@ -547,7 +547,12 @@ def md5_file(filename):
|
||||
Return the hex string representation of the MD5 checksum of filename.
|
||||
"""
|
||||
import hashlib
|
||||
return _hasher(hashlib.new('MD5', usedforsecurity=False), filename)
|
||||
try:
|
||||
sig = hashlib.new('MD5', usedforsecurity=False)
|
||||
except TypeError:
|
||||
# Some configurations don't appear to support two arguments
|
||||
sig = hashlib.new('MD5')
|
||||
return _hasher(sig, filename)
|
||||
|
||||
def sha256_file(filename):
|
||||
"""
|
||||
|
||||
@@ -49,6 +49,31 @@ class LayerIndexPlugin(ActionPlugin):
|
||||
else:
|
||||
logger.plain("Repository %s needs to be fetched" % url)
|
||||
return subdir, layername, layerdir
|
||||
elif os.path.exists(repodir) and branch:
|
||||
"""
|
||||
If the repo is already cloned, ensure it is on the correct branch,
|
||||
switching branches if necessary and possible.
|
||||
"""
|
||||
base_cmd = ['git', '--git-dir=%s/.git' % repodir, '--work-tree=%s' % repodir]
|
||||
cmd = base_cmd + ['branch']
|
||||
completed_proc = subprocess.run(cmd, text=True, capture_output=True)
|
||||
if completed_proc.returncode:
|
||||
logger.error("Unable to validate repo %s (%s)" % (repodir, stderr))
|
||||
return None, None, None
|
||||
else:
|
||||
if branch != completed_proc.stdout[2:-1]:
|
||||
cmd = base_cmd + ['status', '--short']
|
||||
completed_proc = subprocess.run(cmd, text=True, capture_output=True)
|
||||
if completed_proc.stdout.count('\n') != 0:
|
||||
logger.warning("There are uncommitted changes in repo %s" % repodir)
|
||||
cmd = base_cmd + ['checkout', branch]
|
||||
completed_proc = subprocess.run(cmd, text=True, capture_output=True)
|
||||
if completed_proc.returncode:
|
||||
# Could be due to original shallow clone on a different branch for example
|
||||
logger.error("Unable to automatically switch %s to desired branch '%s' (%s)"
|
||||
% (repodir, branch, completed_proc.stderr))
|
||||
return None, None, None
|
||||
return subdir, layername, layerdir
|
||||
elif os.path.exists(layerdir):
|
||||
return subdir, layername, layerdir
|
||||
else:
|
||||
|
||||
@@ -2798,7 +2798,14 @@ class ParserReflect(object):
|
||||
def signature(self):
|
||||
try:
|
||||
import hashlib
|
||||
except ImportError:
|
||||
raise RuntimeError("Unable to import hashlib")
|
||||
try:
|
||||
sig = hashlib.new('MD5', usedforsecurity=False)
|
||||
except TypeError:
|
||||
# Some configurations don't appear to support two arguments
|
||||
sig = hashlib.new('MD5')
|
||||
try:
|
||||
if self.start:
|
||||
sig.update(self.start.encode('latin-1'))
|
||||
if self.prec:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
DISTRO = "poky"
|
||||
DISTRO_NAME = "Poky (Yocto Project Reference Distro)"
|
||||
#DISTRO_VERSION = "4.1+snapshot-${METADATA_REVISION}"
|
||||
DISTRO_VERSION = "4.1"
|
||||
DISTRO_VERSION = "4.1.1"
|
||||
DISTRO_CODENAME = "langdale"
|
||||
SDK_VENDOR = "-pokysdk"
|
||||
SDK_VERSION = "${@d.getVar('DISTRO_VERSION').replace('snapshot-${METADATA_REVISION}', 'snapshot')}"
|
||||
|
||||
@@ -90,6 +90,7 @@ BB_GIT_SHALLOW:pn-binutils-cross-${TARGET_ARCH} = "1"
|
||||
BB_GIT_SHALLOW:pn-binutils-cross-canadian-${TRANSLATED_TARGET_ARCH} = "1"
|
||||
BB_GIT_SHALLOW:pn-binutils-cross-testsuite = "1"
|
||||
BB_GIT_SHALLOW:pn-binutils-crosssdk-${SDK_SYS} = "1"
|
||||
BB_GIT_SHALLOW:pn-binutils-native = "1"
|
||||
BB_GIT_SHALLOW:pn-glibc = "1"
|
||||
PREMIRRORS += "git://sourceware.org/git/glibc.git https://downloads.yoctoproject.org/mirror/sources/ \
|
||||
git://sourceware.org/git/binutils-gdb.git https://downloads.yoctoproject.org/mirror/sources/"
|
||||
|
||||
@@ -504,6 +504,14 @@ def check_tar_version(sanity_data):
|
||||
version = result.split()[3]
|
||||
if bb.utils.vercmp_string_op(version, "1.28", "<"):
|
||||
return "Your version of tar is older than 1.28 and does not have the support needed to enable reproducible builds. Please install a newer version of tar (you could use the project's buildtools-tarball from our last release or use scripts/install-buildtools).\n"
|
||||
|
||||
try:
|
||||
result = subprocess.check_output(["tar", "--help"], stderr=subprocess.STDOUT).decode('utf-8')
|
||||
if "--xattrs" not in result:
|
||||
return "Your tar doesn't support --xattrs, please use GNU tar.\n"
|
||||
except subprocess.CalledProcessError as e:
|
||||
return "Unable to execute tar --help, exit code %d\n%s\n" % (e.returncode, e.output)
|
||||
|
||||
return None
|
||||
|
||||
# We use git parameters and functionality only found in 1.7.8 or later
|
||||
|
||||
@@ -496,7 +496,7 @@ fitimage_assemble() {
|
||||
ramdiskcount=$3
|
||||
setupcount=""
|
||||
bootscr_id=""
|
||||
rm -f $1 arch/${ARCH}/boot/$2
|
||||
rm -f $1 ${KERNEL_OUTPUT_DIR}/$2
|
||||
|
||||
if [ -n "${UBOOT_SIGN_IMG_KEYNAME}" -a "${UBOOT_SIGN_KEYNAME}" = "${UBOOT_SIGN_IMG_KEYNAME}" ]; then
|
||||
bbfatal "Keys used to sign images and configuration nodes must be different."
|
||||
@@ -529,9 +529,9 @@ fitimage_assemble() {
|
||||
continue
|
||||
fi
|
||||
|
||||
DTB_PATH="arch/${ARCH}/boot/dts/$DTB"
|
||||
DTB_PATH="${KERNEL_OUTPUT_DIR}/dts/$DTB"
|
||||
if [ ! -e "$DTB_PATH" ]; then
|
||||
DTB_PATH="arch/${ARCH}/boot/$DTB"
|
||||
DTB_PATH="${KERNEL_OUTPUT_DIR}/$DTB"
|
||||
fi
|
||||
|
||||
DTB=$(echo "$DTB" | tr '/' '_')
|
||||
@@ -574,9 +574,9 @@ fitimage_assemble() {
|
||||
#
|
||||
# Step 4: Prepare a setup section. (For x86)
|
||||
#
|
||||
if [ -e arch/${ARCH}/boot/setup.bin ]; then
|
||||
if [ -e ${KERNEL_OUTPUT_DIR}/setup.bin ]; then
|
||||
setupcount=1
|
||||
fitimage_emit_section_setup $1 $setupcount arch/${ARCH}/boot/setup.bin
|
||||
fitimage_emit_section_setup $1 $setupcount ${KERNEL_OUTPUT_DIR}/setup.bin
|
||||
fi
|
||||
|
||||
#
|
||||
@@ -650,7 +650,7 @@ fitimage_assemble() {
|
||||
${UBOOT_MKIMAGE} \
|
||||
${@'-D "${UBOOT_MKIMAGE_DTCOPTS}"' if len('${UBOOT_MKIMAGE_DTCOPTS}') else ''} \
|
||||
-f $1 \
|
||||
arch/${ARCH}/boot/$2
|
||||
${KERNEL_OUTPUT_DIR}/$2
|
||||
|
||||
#
|
||||
# Step 8: Sign the image and add public key to U-Boot dtb
|
||||
@@ -667,7 +667,7 @@ fitimage_assemble() {
|
||||
${@'-D "${UBOOT_MKIMAGE_DTCOPTS}"' if len('${UBOOT_MKIMAGE_DTCOPTS}') else ''} \
|
||||
-F -k "${UBOOT_SIGN_KEYDIR}" \
|
||||
$add_key_to_u_boot \
|
||||
-r arch/${ARCH}/boot/$2 \
|
||||
-r ${KERNEL_OUTPUT_DIR}/$2 \
|
||||
${UBOOT_MKIMAGE_SIGN_ARGS}
|
||||
fi
|
||||
}
|
||||
@@ -770,7 +770,7 @@ kernel_do_deploy:append() {
|
||||
|
||||
if [ "${INITRAMFS_IMAGE_BUNDLE}" != "1" ]; then
|
||||
bbnote "Copying fitImage-${INITRAMFS_IMAGE} file..."
|
||||
install -m 0644 ${B}/arch/${ARCH}/boot/fitImage-${INITRAMFS_IMAGE} "$deployDir/fitImage-${INITRAMFS_IMAGE_NAME}-${KERNEL_FIT_NAME}${KERNEL_FIT_BIN_EXT}"
|
||||
install -m 0644 ${B}/${KERNEL_OUTPUT_DIR}/fitImage-${INITRAMFS_IMAGE} "$deployDir/fitImage-${INITRAMFS_IMAGE_NAME}-${KERNEL_FIT_NAME}${KERNEL_FIT_BIN_EXT}"
|
||||
if [ -n "${KERNEL_FIT_LINK_NAME}" ] ; then
|
||||
ln -snf fitImage-${INITRAMFS_IMAGE_NAME}-${KERNEL_FIT_NAME}${KERNEL_FIT_BIN_EXT} "$deployDir/fitImage-${INITRAMFS_IMAGE_NAME}-${KERNEL_FIT_LINK_NAME}"
|
||||
fi
|
||||
|
||||
@@ -506,7 +506,7 @@ python do_config_analysis() {
|
||||
try:
|
||||
analysis = subprocess.check_output(['symbol_why.py', '--dotconfig', '{}'.format( d.getVar('B') + '/.config' ), '--blame', c], cwd=s, env=env ).decode('utf-8')
|
||||
except subprocess.CalledProcessError as e:
|
||||
bb.fatal( "config analysis failed: %s" % e.output.decode('utf-8'))
|
||||
bb.fatal( "config analysis failed when running '%s': %s" % (" ".join(e.cmd), e.output.decode('utf-8')))
|
||||
|
||||
outfile = d.getVar( 'CONFIG_ANALYSIS_FILE' )
|
||||
|
||||
@@ -514,7 +514,7 @@ python do_config_analysis() {
|
||||
try:
|
||||
analysis = subprocess.check_output(['symbol_why.py', '--dotconfig', '{}'.format( d.getVar('B') + '/.config' ), '--summary', '--extended', '--sanity', c], cwd=s, env=env ).decode('utf-8')
|
||||
except subprocess.CalledProcessError as e:
|
||||
bb.fatal( "config analysis failed: %s" % e.output.decode('utf-8'))
|
||||
bb.fatal( "config analysis failed when running '%s': %s" % (" ".join(e.cmd), e.output.decode('utf-8')))
|
||||
|
||||
outfile = d.getVar( 'CONFIG_AUDIT_FILE' )
|
||||
|
||||
@@ -575,7 +575,7 @@ python do_kernel_configcheck() {
|
||||
try:
|
||||
analysis = subprocess.check_output(['symbol_why.py', '--dotconfig', '{}'.format( d.getVar('B') + '/.config' ), '--mismatches', extra_params], cwd=s, env=env ).decode('utf-8')
|
||||
except subprocess.CalledProcessError as e:
|
||||
bb.fatal( "config analysis failed: %s" % e.output.decode('utf-8'))
|
||||
bb.fatal( "config analysis failed when running '%s': %s" % (" ".join(e.cmd), e.output.decode('utf-8')))
|
||||
|
||||
if analysis:
|
||||
outfile = "{}/{}/cfg/mismatch.txt".format( s, kmeta )
|
||||
@@ -597,7 +597,7 @@ python do_kernel_configcheck() {
|
||||
try:
|
||||
analysis = subprocess.check_output(['symbol_why.py', '--dotconfig', '{}'.format( d.getVar('B') + '/.config' ), '--invalid', extra_params], cwd=s, env=env ).decode('utf-8')
|
||||
except subprocess.CalledProcessError as e:
|
||||
bb.fatal( "config analysis failed: %s" % e.output.decode('utf-8'))
|
||||
bb.fatal( "config analysis failed when running '%s': %s" % (" ".join(e.cmd), e.output.decode('utf-8')))
|
||||
|
||||
if analysis:
|
||||
outfile = "{}/{}/cfg/invalid.txt".format(s,kmeta)
|
||||
@@ -616,7 +616,7 @@ python do_kernel_configcheck() {
|
||||
try:
|
||||
analysis = subprocess.check_output(['symbol_why.py', '--dotconfig', '{}'.format( d.getVar('B') + '/.config' ), '--sanity'], cwd=s, env=env ).decode('utf-8')
|
||||
except subprocess.CalledProcessError as e:
|
||||
bb.fatal( "config analysis failed: %s" % e.output.decode('utf-8'))
|
||||
bb.fatal( "config analysis failed when running '%s': %s" % (" ".join(e.cmd), e.output.decode('utf-8')))
|
||||
|
||||
if analysis:
|
||||
outfile = "{}/{}/cfg/redefinition.txt".format(s,kmeta)
|
||||
|
||||
@@ -594,9 +594,7 @@ do_shared_workdir () {
|
||||
}
|
||||
|
||||
# We don't need to stage anything, not the modules/firmware since those would clash with linux-firmware
|
||||
sysroot_stage_all () {
|
||||
:
|
||||
}
|
||||
SYSROOT_DIRS = ""
|
||||
|
||||
KERNEL_CONFIG_COMMAND ?= "oe_runmake_call -C ${S} O=${B} olddefconfig || oe_runmake -C ${S} O=${B} oldnoconfig"
|
||||
|
||||
|
||||
@@ -102,7 +102,11 @@ python do_create_overlayfs_units() {
|
||||
overlayMountPoints = d.getVarFlags("OVERLAYFS_MOUNT_POINT")
|
||||
for mountPoint in overlayMountPoints:
|
||||
bb.debug(1, "Process variable flag %s" % mountPoint)
|
||||
for lower in d.getVarFlag('OVERLAYFS_WRITABLE_PATHS', mountPoint).split():
|
||||
lowerList = d.getVarFlag('OVERLAYFS_WRITABLE_PATHS', mountPoint)
|
||||
if not lowerList:
|
||||
bb.note("No mount points defined for %s flag, skipping" % (mountPoint))
|
||||
continue
|
||||
for lower in lowerList.split():
|
||||
bb.debug(1, "Prepare mount unit for %s with data mount point %s" %
|
||||
(lower, d.getVarFlag('OVERLAYFS_MOUNT_POINT', mountPoint)))
|
||||
prepareUnits(d.getVarFlag('OVERLAYFS_MOUNT_POINT', mountPoint), lower)
|
||||
|
||||
@@ -231,19 +231,19 @@ TARGET_POINTER_WIDTH[powerpc64le] = "64"
|
||||
TARGET_C_INT_WIDTH[powerpc64le] = "64"
|
||||
MAX_ATOMIC_WIDTH[powerpc64le] = "64"
|
||||
|
||||
## riscv32-unknown-linux-{gnu, musl}
|
||||
DATA_LAYOUT[riscv32] = "e-m:e-p:32:32-i64:64-n32-S128"
|
||||
TARGET_ENDIAN[riscv32] = "little"
|
||||
TARGET_POINTER_WIDTH[riscv32] = "32"
|
||||
TARGET_C_INT_WIDTH[riscv32] = "32"
|
||||
MAX_ATOMIC_WIDTH[riscv32] = "32"
|
||||
## riscv32gc-unknown-linux-{gnu, musl}
|
||||
DATA_LAYOUT[riscv32gc] = "e-m:e-p:32:32-i64:64-n32-S128"
|
||||
TARGET_ENDIAN[riscv32gc] = "little"
|
||||
TARGET_POINTER_WIDTH[riscv32gc] = "32"
|
||||
TARGET_C_INT_WIDTH[riscv32gc] = "32"
|
||||
MAX_ATOMIC_WIDTH[riscv32gc] = "32"
|
||||
|
||||
## riscv64-unknown-linux-{gnu, musl}
|
||||
DATA_LAYOUT[riscv64] = "e-m:e-p:64:64-i64:64-i128:128-n64-S128"
|
||||
TARGET_ENDIAN[riscv64] = "little"
|
||||
TARGET_POINTER_WIDTH[riscv64] = "64"
|
||||
TARGET_C_INT_WIDTH[riscv64] = "64"
|
||||
MAX_ATOMIC_WIDTH[riscv64] = "64"
|
||||
## riscv64gc-unknown-linux-{gnu, musl}
|
||||
DATA_LAYOUT[riscv64gc] = "e-m:e-p:64:64-i64:64-i128:128-n64-S128"
|
||||
TARGET_ENDIAN[riscv64gc] = "little"
|
||||
TARGET_POINTER_WIDTH[riscv64gc] = "64"
|
||||
TARGET_C_INT_WIDTH[riscv64gc] = "64"
|
||||
MAX_ATOMIC_WIDTH[riscv64gc] = "64"
|
||||
|
||||
# Convert a normal arch (HOST_ARCH, TARGET_ARCH, BUILD_ARCH, etc) to something
|
||||
# rust's internals won't choke on.
|
||||
@@ -258,9 +258,21 @@ def arch_to_rust_target_arch(arch):
|
||||
return "arm"
|
||||
elif arch == "powerpc64le":
|
||||
return "powerpc64"
|
||||
elif arch == "riscv32gc":
|
||||
return "riscv32"
|
||||
elif arch == "riscv64gc":
|
||||
return "riscv64"
|
||||
else:
|
||||
return arch
|
||||
|
||||
# Convert a rust target string to a llvm-compatible triplet
|
||||
def rust_sys_to_llvm_target(sys):
|
||||
if sys.startswith('riscv32gc-'):
|
||||
return sys.replace('riscv32gc-', 'riscv32-', 1)
|
||||
if sys.startswith('riscv64gc-'):
|
||||
return sys.replace('riscv64gc-', 'riscv64-', 1)
|
||||
return sys
|
||||
|
||||
# generates our target CPU value
|
||||
def llvm_cpu(d):
|
||||
cpu = d.getVar('PACKAGE_ARCH')
|
||||
@@ -334,7 +346,7 @@ def rust_gen_target(d, thing, wd, arch):
|
||||
|
||||
# build tspec
|
||||
tspec = {}
|
||||
tspec['llvm-target'] = rustsys
|
||||
tspec['llvm-target'] = rust_sys_to_llvm_target(rustsys)
|
||||
tspec['data-layout'] = d.getVarFlag('DATA_LAYOUT', arch_abi)
|
||||
if tspec['data-layout'] is None:
|
||||
bb.fatal("No rust target defined for %s" % arch_abi)
|
||||
|
||||
@@ -298,7 +298,7 @@ do_uboot_generate_rsa_keys() {
|
||||
"${UBOOT_FIT_SIGN_NUMBITS}"
|
||||
|
||||
echo "Generating certificate for signing U-Boot fitImage"
|
||||
openssl req ${FIT_KEY_REQ_ARGS} "${UBOOT_FIT_KEY_SIGN_PKCS}" \
|
||||
openssl req ${UBOOT_FIT_KEY_REQ_ARGS} "${UBOOT_FIT_KEY_SIGN_PKCS}" \
|
||||
-key "${SPL_SIGN_KEYDIR}/${SPL_SIGN_KEYNAME}".key \
|
||||
-out "${SPL_SIGN_KEYDIR}/${SPL_SIGN_KEYNAME}".crt
|
||||
fi
|
||||
|
||||
@@ -21,7 +21,6 @@ SPDX_TOOL_VERSION ??= "1.0"
|
||||
SPDXRUNTIMEDEPLOY = "${SPDXDIR}/runtime-deploy"
|
||||
|
||||
SPDX_INCLUDE_SOURCES ??= "0"
|
||||
SPDX_INCLUDE_PACKAGED ??= "0"
|
||||
SPDX_ARCHIVE_SOURCES ??= "0"
|
||||
SPDX_ARCHIVE_PACKAGED ??= "0"
|
||||
|
||||
@@ -431,7 +430,6 @@ python do_create_spdx() {
|
||||
|
||||
deploy_dir_spdx = Path(d.getVar("DEPLOY_DIR_SPDX"))
|
||||
spdx_workdir = Path(d.getVar("SPDXWORK"))
|
||||
include_packaged = d.getVar("SPDX_INCLUDE_PACKAGED") == "1"
|
||||
include_sources = d.getVar("SPDX_INCLUDE_SOURCES") == "1"
|
||||
archive_sources = d.getVar("SPDX_ARCHIVE_SOURCES") == "1"
|
||||
archive_packaged = d.getVar("SPDX_ARCHIVE_PACKAGED") == "1"
|
||||
@@ -459,6 +457,7 @@ python do_create_spdx() {
|
||||
|
||||
for s in d.getVar('SRC_URI').split():
|
||||
if not s.startswith("file://"):
|
||||
s = s.split(';')[0]
|
||||
recipe.downloadLocation = s
|
||||
break
|
||||
else:
|
||||
|
||||
@@ -61,7 +61,7 @@ python () {
|
||||
if externalsrcbuild:
|
||||
d.setVar('B', externalsrcbuild)
|
||||
else:
|
||||
d.setVar('B', '${WORKDIR}/${BPN}-${PV}/')
|
||||
d.setVar('B', '${WORKDIR}/${BPN}-${PV}')
|
||||
|
||||
local_srcuri = []
|
||||
fetch = bb.fetch2.Fetch((d.getVar('SRC_URI') or '').split(), d)
|
||||
@@ -212,8 +212,8 @@ def srctree_hash_files(d, srcdir=None):
|
||||
try:
|
||||
git_dir = os.path.join(s_dir,
|
||||
subprocess.check_output(['git', '-C', s_dir, 'rev-parse', '--git-dir'], stderr=subprocess.DEVNULL).decode("utf-8").rstrip())
|
||||
top_git_dir = os.path.join(s_dir, subprocess.check_output(['git', '-C', d.getVar("TOPDIR"), 'rev-parse', '--git-dir'],
|
||||
stderr=subprocess.DEVNULL).decode("utf-8").rstrip())
|
||||
top_git_dir = os.path.join(d.getVar("TOPDIR"),
|
||||
subprocess.check_output(['git', '-C', d.getVar("TOPDIR"), 'rev-parse', '--git-dir'], stderr=subprocess.DEVNULL).decode("utf-8").rstrip())
|
||||
if git_dir == top_git_dir:
|
||||
git_dir = None
|
||||
except subprocess.CalledProcessError:
|
||||
|
||||
@@ -64,7 +64,7 @@ TEMPLATECONF={} . {}/oe-init-build-env build-try-{}"""
|
||||
oecore = None
|
||||
|
||||
for l in layers:
|
||||
if l[0] == os.path.abspath(args.layerpath):
|
||||
if os.path.abspath(l[0]) == os.path.abspath(args.layerpath):
|
||||
targetlayer = l[0]
|
||||
if l[1] == 'meta':
|
||||
oecore = os.path.dirname(l[0])
|
||||
|
||||
@@ -40,7 +40,11 @@ def unitFileList(d):
|
||||
bb.fatal("Missing required mount point for OVERLAYFS_MOUNT_POINT[%s] in your MACHINE configuration" % mountPoint)
|
||||
|
||||
for mountPoint in overlayMountPoints:
|
||||
for path in d.getVarFlag('OVERLAYFS_WRITABLE_PATHS', mountPoint).split():
|
||||
mountPointList = d.getVarFlag('OVERLAYFS_WRITABLE_PATHS', mountPoint)
|
||||
if not mountPointList:
|
||||
bb.debug(1, "No mount points defined for %s flag, don't add to file list", mountPoint)
|
||||
continue
|
||||
for path in mountPointList.split():
|
||||
fileList.append(mountUnitName(path))
|
||||
fileList.append(helperUnitName(path))
|
||||
|
||||
|
||||
@@ -8,4 +8,6 @@
|
||||
def arch_to_rust_arch(arch):
|
||||
if arch == "ppc64le":
|
||||
return "powerpc64le"
|
||||
if arch in ('riscv32', 'riscv64'):
|
||||
return arch + 'gc'
|
||||
return arch
|
||||
|
||||
@@ -50,8 +50,8 @@ COMPATIBLE_HOST = "${GRUB_COMPATIBLE_HOST}"
|
||||
# Grub doesn't support hard float toolchain and won't be able to forcefully
|
||||
# disable it on some of the target CPUs. See 'configure.ac' for
|
||||
# supported/unsupported CPUs in hardfp.
|
||||
COMPATIBLE_HOST:armv7a = "${@'null' if d.getVar('TUNE_CCARGS_MFLOAT') == 'hardfp' else d.getVar('GRUB_COMPATIBLE_HOST')}"
|
||||
COMPATIBLE_HOST:armv7ve = "${@'null' if d.getVar('TUNE_CCARGS_MFLOAT') == 'hardfp' else d.getVar('GRUB_COMPATIBLE_HOST')}"
|
||||
COMPATIBLE_HOST:armv7a = "${@'null' if bb.utils.contains('TUNE_CCARGS_MFLOAT', 'hard', True, False, d) else d.getVar('GRUB_COMPATIBLE_HOST')}"
|
||||
COMPATIBLE_HOST:armv7ve = "${@'null' if bb.utils.contains('TUNE_CCARGS_MFLOAT', 'hard', True, False, d) else d.getVar('GRUB_COMPATIBLE_HOST')}"
|
||||
|
||||
# configure.ac has code to set this automagically from the target tuple
|
||||
# but the OE freeform one (core2-foo-bar-linux) don't work with that.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
export OPENSSL_CONF="$OECORE_NATIVE_SYSROOT/usr/lib/ssl/openssl.cnf"
|
||||
export SSL_CERT_DIR="$OECORE_NATIVE_SYSROOT/usr/lib/ssl/certs"
|
||||
export SSL_CERT_FILE="$OECORE_NATIVE_SYSROOT/usr/lib/ssl/cert.pem"
|
||||
export SSL_CERT_FILE="$OECORE_NATIVE_SYSROOT/usr/lib/ssl/certs/ca-certificates.crt"
|
||||
export OPENSSL_MODULES="$OECORE_NATIVE_SYSROOT/usr/lib/ossl-modules/"
|
||||
export OPENSSL_ENGINES="$OECORE_NATIVE_SYSROOT/usr/lib/engines-3"
|
||||
|
||||
@@ -18,7 +18,7 @@ SRC_URI:append:class-nativesdk = " \
|
||||
file://environment.d-openssl.sh \
|
||||
"
|
||||
|
||||
SRC_URI[sha256sum] = "aa7d8d9bef71ad6525c55ba11e5f4397889ce49c2c9349dcea6d3e4f0b024a7a"
|
||||
SRC_URI[sha256sum] = "83049d042a260e696f62406ac5c08bf706fd84383f945cf21bd61e9ed95c396e"
|
||||
|
||||
inherit lib_package multilib_header multilib_script ptest perlnative
|
||||
MULTILIB_SCRIPTS = "${PN}-bin:${bindir}/c_rehash"
|
||||
@@ -16,7 +16,7 @@ SRC_URI = "git://salsa.debian.org/debian/ifupdown.git;protocol=https;branch=mast
|
||||
file://0001-ifupdown-skip-wrong-test-case.patch \
|
||||
${@bb.utils.contains('DISTRO_FEATURES', 'ptest', 'file://tweak-ptest-script.patch', '', d)} \
|
||||
"
|
||||
SRCREV = "2b4138f36ce3ba37186aa01b502273e0c39ab518"
|
||||
SRCREV = "be91dd267b4a8db502a6bbf5758563f7048b8078"
|
||||
|
||||
S = "${WORKDIR}/git"
|
||||
|
||||
@@ -24,8 +24,8 @@ IMAGE_FSTYPES = "wic.vmdk wic.vhd wic.vhdx"
|
||||
|
||||
inherit core-image setuptools3
|
||||
|
||||
SRCREV ?= "4f942c272d4417b5b719df25b80a6a6b54669a73"
|
||||
SRC_URI = "git://git.yoctoproject.org/poky;branch=master \
|
||||
SRCREV ?= "80d22fc07f6284094f84d5001b8129b90c28df2c"
|
||||
SRC_URI = "git://git.yoctoproject.org/poky;branch=langdale \
|
||||
file://Yocto_Build_Appliance.vmx \
|
||||
file://Yocto_Build_Appliance.vmxf \
|
||||
file://README_VirtualBox_Guest_Additions.txt \
|
||||
|
||||
@@ -72,6 +72,8 @@ create_sdk_files:append () {
|
||||
if [ -e "${SDK_OUTPUT}${SDKPATHNATIVE}${sysconfdir}/ssl/certs/ca-certificates.crt" ]; then
|
||||
echo 'export GIT_SSL_CAINFO="${SDKPATHNATIVE}${sysconfdir}/ssl/certs/ca-certificates.crt"' >>$script
|
||||
echo 'export SSL_CERT_FILE="${SDKPATHNATIVE}${sysconfdir}/ssl/certs/ca-certificates.crt"' >>$script
|
||||
echo 'export REQUESTS_CA_BUNDLE="${SDKPATHNATIVE}${sysconfdir}/ssl/certs/ca-certificates.crt"' >>$script
|
||||
echo 'export CURL_CA_BUNDLE="${SDKPATHNATIVE}${sysconfdir}/ssl/certs/ca-certificates.crt"' >>$script
|
||||
fi
|
||||
|
||||
toolchain_create_sdk_version ${SDK_OUTPUT}/${SDKPATH}/version-${SDK_SYS}
|
||||
|
||||
@@ -518,6 +518,8 @@ FILES:${PN}-extra-utils = "\
|
||||
${bindir}/systemd-path \
|
||||
${bindir}/systemd-run \
|
||||
${bindir}/systemd-cat \
|
||||
${bindir}/systemd-creds \
|
||||
${bindir}/systemd-cryptenroll \
|
||||
${bindir}/systemd-delta \
|
||||
${bindir}/systemd-cgls \
|
||||
${bindir}/systemd-cgtop \
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
From ec3df00224d4b396e2ac6586ab5d25f673caa4c2 Mon Sep 17 00:00:00 2001
|
||||
From: Mark Adler <madler@alumni.caltech.edu>
|
||||
Date: Wed, 30 Mar 2022 11:14:53 -0700
|
||||
Subject: [PATCH] Correct incorrect inputs provided to the CRC functions.
|
||||
|
||||
The previous releases of zlib were not sensitive to incorrect CRC
|
||||
inputs with bits set above the low 32. This commit restores that
|
||||
behavior, so that applications with such bugs will continue to
|
||||
operate as before.
|
||||
|
||||
Upstream-Status: Backport [https://github.com/madler/zlib/commit/ec3df00224d4b396e2ac6586ab5d25f673caa4c2]
|
||||
Signed-off-by: Jacob Kroon <jacob.kroon@gmail.com>
|
||||
---
|
||||
crc32.c | 8 ++++----
|
||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/crc32.c b/crc32.c
|
||||
index a1bdce5..451887b 100644
|
||||
--- a/crc32.c
|
||||
+++ b/crc32.c
|
||||
@@ -630,7 +630,7 @@ unsigned long ZEXPORT crc32_z(crc, buf, len)
|
||||
#endif /* DYNAMIC_CRC_TABLE */
|
||||
|
||||
/* Pre-condition the CRC */
|
||||
- crc ^= 0xffffffff;
|
||||
+ crc = (~crc) & 0xffffffff;
|
||||
|
||||
/* Compute the CRC up to a word boundary. */
|
||||
while (len && ((z_size_t)buf & 7) != 0) {
|
||||
@@ -749,7 +749,7 @@ unsigned long ZEXPORT crc32_z(crc, buf, len)
|
||||
#endif /* DYNAMIC_CRC_TABLE */
|
||||
|
||||
/* Pre-condition the CRC */
|
||||
- crc ^= 0xffffffff;
|
||||
+ crc = (~crc) & 0xffffffff;
|
||||
|
||||
#ifdef W
|
||||
|
||||
@@ -1077,7 +1077,7 @@ uLong ZEXPORT crc32_combine64(crc1, crc2, len2)
|
||||
#ifdef DYNAMIC_CRC_TABLE
|
||||
once(&made, make_crc_table);
|
||||
#endif /* DYNAMIC_CRC_TABLE */
|
||||
- return multmodp(x2nmodp(len2, 3), crc1) ^ crc2;
|
||||
+ return multmodp(x2nmodp(len2, 3), crc1) ^ (crc2 & 0xffffffff);
|
||||
}
|
||||
|
||||
/* ========================================================================= */
|
||||
@@ -1112,5 +1112,5 @@ uLong crc32_combine_op(crc1, crc2, op)
|
||||
uLong crc2;
|
||||
uLong op;
|
||||
{
|
||||
- return multmodp(op, crc1) ^ crc2;
|
||||
+ return multmodp(op, crc1) ^ (crc2 & 0xffffffff);
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
From eff308af425b67093bab25f80f1ae950166bece1 Mon Sep 17 00:00:00 2001
|
||||
From: Mark Adler <fork@madler.net>
|
||||
Date: Sat, 30 Jul 2022 15:51:11 -0700
|
||||
Subject: [PATCH] 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.
|
||||
|
||||
CVE: CVE-2022-37434
|
||||
Upstream-Status: Backport [https://github.com/madler/zlib/commit/eff308af425b67093bab25f80f1ae950166be]
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
inflate.c | 5 +++--
|
||||
1 file changed, 3 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/inflate.c b/inflate.c
|
||||
index 7be8c63..7a72897 100644
|
||||
--- a/inflate.c
|
||||
+++ b/inflate.c
|
||||
@@ -763,9 +763,10 @@ int flush;
|
||||
copy = state->length;
|
||||
if (copy > have) copy = have;
|
||||
if (copy) {
|
||||
+ len = state->head->extra_len - state->length;
|
||||
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_max) {
|
||||
zmemcpy(state->head->extra + len, next,
|
||||
len + copy > state->head->extra_max ?
|
||||
state->head->extra_max - len : copy);
|
||||
--
|
||||
2.37.2
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
From 1eb7682f845ac9e9bf9ae35bbfb3bad5dacbd91d Mon Sep 17 00:00:00 2001
|
||||
From: Mark Adler <fork@madler.net>
|
||||
Date: Mon, 8 Aug 2022 10:50:09 -0700
|
||||
Subject: [PATCH] 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.
|
||||
|
||||
CVE: CVE-2022-37434
|
||||
Upstream-Status: Backport [https://github.com/madler/zlib/commit/1eb7682f845ac9e9bf9ae35bbfb3bad5dacbd91d]
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
inflate.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/inflate.c b/inflate.c
|
||||
index 7a72897..2a3c4fe 100644
|
||||
--- a/inflate.c
|
||||
+++ b/inflate.c
|
||||
@@ -763,10 +763,10 @@ int flush;
|
||||
copy = state->length;
|
||||
if (copy > have) copy = have;
|
||||
if (copy) {
|
||||
- len = state->head->extra_len - state->length;
|
||||
if (state->head != Z_NULL &&
|
||||
state->head->extra != Z_NULL &&
|
||||
- len < state->head->extra_max) {
|
||||
+ (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.37.2
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
Upstream-Status: Backport
|
||||
Signed-off-by: Ross Burton <ross.burton@arm.com>
|
||||
|
||||
From 05796d3d8d5546cf1b4dfe2cd72ab746afae505d Mon Sep 17 00:00:00 2001
|
||||
From: Mark Adler <madler@alumni.caltech.edu>
|
||||
Date: Mon, 28 Mar 2022 18:34:10 -0700
|
||||
Subject: [PATCH] Fix configure issue that discarded provided CC definition.
|
||||
|
||||
---
|
||||
configure | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/configure b/configure
|
||||
index 52ff4a04e..3fa3e8618 100755
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -174,7 +174,10 @@ if test -z "$CC"; then
|
||||
else
|
||||
cc=${CROSS_PREFIX}cc
|
||||
fi
|
||||
+else
|
||||
+ cc=${CC}
|
||||
fi
|
||||
+
|
||||
cflags=${CFLAGS-"-O3"}
|
||||
# to force the asm version use: CFLAGS="-O3 -DASMV" ./configure
|
||||
case "$cc" in
|
||||
@@ -1,45 +0,0 @@
|
||||
Obey LDFLAGS for tests
|
||||
|
||||
Upstream-Status: Submitted [https://github.com/madler/zlib/pull/409]
|
||||
Signed-off-by: Ross Burton <ross.burton@intel.com>
|
||||
|
||||
--- zlib-1.2.8.orig/Makefile.in
|
||||
+++ zlib-1.2.8/Makefile.in
|
||||
@@ -26,7 +26,7 @@ CFLAGS=-O
|
||||
|
||||
SFLAGS=-O
|
||||
LDFLAGS=
|
||||
-TEST_LDFLAGS=-L. libz.a
|
||||
+TEST_LDFLAGS=-L. $(LDFLAGS)
|
||||
LDSHARED=$(CC)
|
||||
CPP=$(CC) -E
|
||||
|
||||
@@ -176,22 +176,22 @@ placebo $(SHAREDLIBV): $(PIC_OBJS) libz.
|
||||
-@rmdir objs
|
||||
|
||||
example$(EXE): example.o $(STATICLIB)
|
||||
- $(CC) $(CFLAGS) -o $@ example.o $(TEST_LDFLAGS)
|
||||
+ $(CC) $(CFLAGS) -o $@ example.o $(TEST_LDFLAGS) $(STATICLIB)
|
||||
|
||||
minigzip$(EXE): minigzip.o $(STATICLIB)
|
||||
- $(CC) $(CFLAGS) -o $@ minigzip.o $(TEST_LDFLAGS)
|
||||
+ $(CC) $(CFLAGS) -o $@ minigzip.o $(TEST_LDFLAGS) $(STATICLIB)
|
||||
|
||||
examplesh$(EXE): example.o $(SHAREDLIBV)
|
||||
- $(CC) $(CFLAGS) -o $@ example.o -L. $(SHAREDLIBV)
|
||||
+ $(CC) $(CFLAGS) -o $@ example.o $(TEST_LDFLAGS) $(SHAREDLIBV)
|
||||
|
||||
minigzipsh$(EXE): minigzip.o $(SHAREDLIBV)
|
||||
- $(CC) $(CFLAGS) -o $@ minigzip.o -L. $(SHAREDLIBV)
|
||||
+ $(CC) $(CFLAGS) -o $@ minigzip.o $(TEST_LDFLAGS) $(SHAREDLIBV)
|
||||
|
||||
example64$(EXE): example64.o $(STATICLIB)
|
||||
- $(CC) $(CFLAGS) -o $@ example64.o $(TEST_LDFLAGS)
|
||||
+ $(CC) $(CFLAGS) -o $@ example64.o $(TEST_LDFLAGS) $(STATICLIB)
|
||||
|
||||
minigzip64$(EXE): minigzip64.o $(STATICLIB)
|
||||
- $(CC) $(CFLAGS) -o $@ minigzip64.o $(TEST_LDFLAGS)
|
||||
+ $(CC) $(CFLAGS) -o $@ minigzip64.o $(TEST_LDFLAGS) $(STATICLIB)
|
||||
|
||||
install-libs: $(LIBS)
|
||||
-@if [ ! -d $(DESTDIR)$(exec_prefix) ]; then mkdir -p $(DESTDIR)$(exec_prefix); fi
|
||||
@@ -8,17 +8,12 @@ LIC_FILES_CHKSUM = "file://zlib.h;beginline=6;endline=23;md5=5377232268e952e9ef6
|
||||
|
||||
# The source tarball needs to be .gz as only the .gz ends up in fossils/
|
||||
SRC_URI = "https://zlib.net/${BP}.tar.gz \
|
||||
file://cc.patch \
|
||||
file://ldflags-tests.patch \
|
||||
file://0001-configure-Pass-LDFLAGS-to-link-tests.patch \
|
||||
file://run-ptest \
|
||||
file://0001-Correct-incorrect-inputs-provided-to-the-CRC-functio.patch \
|
||||
file://0001-Fix-a-bug-when-getting-a-gzip-header-extra-field-wit.patch \
|
||||
file://0001-Fix-extra-field-processing-bug-that-dereferences-NUL.patch \
|
||||
"
|
||||
UPSTREAM_CHECK_URI = "http://zlib.net/"
|
||||
|
||||
SRC_URI[sha256sum] = "91844808532e5ce316b3c010929493c0244f3d37593afd6de04f71821d5136d9"
|
||||
SRC_URI[sha256sum] = "b3a24de97a8fdbc835b9833169501030b8977031bcb54b3b3ac13740f846ab30"
|
||||
|
||||
# When a new release is made the previous release is moved to fossils/, so add this
|
||||
# to PREMIRRORS so it is also searched automatically.
|
||||
@@ -30,9 +25,12 @@ RDEPENDS:${PN}-ptest += "make"
|
||||
|
||||
inherit ptest
|
||||
|
||||
B = "${WORKDIR}/build"
|
||||
|
||||
do_configure() {
|
||||
LDCONFIG=true ./configure --prefix=${prefix} --shared --libdir=${libdir} --uname=GNU
|
||||
LDCONFIG=true ${S}/configure --prefix=${prefix} --shared --libdir=${libdir} --uname=GNU
|
||||
}
|
||||
do_configure[cleandirs] += "${B}"
|
||||
|
||||
do_compile() {
|
||||
oe_runmake shared
|
||||
@@ -32,6 +32,7 @@ CMAKE_EXTRACONF = "\
|
||||
-DCMAKE_USE_SYSTEM_LIBRARY_EXPAT=0 \
|
||||
-DENABLE_ACL=0 -DHAVE_ACL_LIBACL_H=0 \
|
||||
-DHAVE_SYS_ACL_H=0 \
|
||||
-DCURL_LIBRARIES=-lcurl \
|
||||
"
|
||||
|
||||
do_configure () {
|
||||
|
||||
@@ -5,7 +5,7 @@ if [ -z "$OECORE_NATIVE_SYSROOT" ]; then
|
||||
fi
|
||||
|
||||
if [ -z "$SSL_CERT_DIR" ]; then
|
||||
export SSL_CERT_DIR="${OECORE_NATIVE_SYSROOT}/etc/ssl/certs/"
|
||||
export SSL_CERT_DIR="$OECORE_NATIVE_SYSROOT/etc/ssl/certs/"
|
||||
fi
|
||||
|
||||
# If these are set to a cross-compile path, meson will get confused and try to
|
||||
@@ -13,7 +13,20 @@ fi
|
||||
# config is already in meson.cross.
|
||||
unset CC CXX CPP LD AR NM STRIP
|
||||
|
||||
for arg in "$@"; do
|
||||
case "$arg" in
|
||||
-*) continue ;;
|
||||
*) SUBCMD="$arg"; break ;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ "$SUBCMD" = "setup" ] || [ -d "$SUBCMD" ]; then
|
||||
MESON_SUB_OPTS=" \
|
||||
--cross-file="$OECORE_NATIVE_SYSROOT/usr/share/meson/${TARGET_PREFIX}meson.cross" \
|
||||
--native-file="$OECORE_NATIVE_SYSROOT/usr/share/meson/meson.native" \
|
||||
"
|
||||
fi
|
||||
|
||||
exec "$OECORE_NATIVE_SYSROOT/usr/bin/meson.real" \
|
||||
--cross-file "${OECORE_NATIVE_SYSROOT}/usr/share/meson/${TARGET_PREFIX}meson.cross" \
|
||||
--native-file "${OECORE_NATIVE_SYSROOT}/usr/share/meson/meson.native" \
|
||||
"$@"
|
||||
"$@" \
|
||||
$MESON_SUB_OPTS
|
||||
|
||||
@@ -18,7 +18,7 @@ SRC_URI = "${GITHUB_BASE_URI}/download/${PV}/meson-${PV}.tar.gz \
|
||||
file://0001-is_debianlike-always-return-False.patch \
|
||||
file://0001-Check-for-clang-before-guessing-gcc-or-lcc.patch \
|
||||
"
|
||||
SRC_URI[sha256sum] = "16222f17ef76be0542c91c07994f9676ae879f46fc21c0c786a21ef2cb518bbf"
|
||||
SRC_URI[sha256sum] = "519c0932e1a8b208741f0fdce90aa5c0b528dd297cf337009bf63539846ac056"
|
||||
|
||||
inherit python_setuptools_build_meta github-releases
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 3a05dc2c0acff1713dd44cef5e9f328f0706eb3e Mon Sep 17 00:00:00 2001
|
||||
From c496cad7b7a84e599f521f289648373df9fad80f Mon Sep 17 00:00:00 2001
|
||||
From: Ed Bartosh <ed.bartosh@linux.intel.com>
|
||||
Date: Tue, 13 Jun 2017 14:55:52 +0300
|
||||
Subject: [PATCH] Disabled reading host configs.
|
||||
@@ -12,10 +12,10 @@ Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
|
||||
1 file changed, 8 deletions(-)
|
||||
|
||||
diff --git a/config.c b/config.c
|
||||
index 630f99d..07dbf53 100644
|
||||
index 8c5fa83..346048b 100644
|
||||
--- a/config.c
|
||||
+++ b/config.c
|
||||
@@ -834,14 +834,6 @@ void read_config(void)
|
||||
@@ -843,14 +843,6 @@ void read_config(void)
|
||||
memcpy(devices, const_devices,
|
||||
nr_const_devices*sizeof(struct device));
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ RRECOMMENDS:${PN}:libc-glibc = "\
|
||||
glibc-gconv-ibm866 \
|
||||
glibc-gconv-ibm869 \
|
||||
"
|
||||
SRC_URI[sha256sum] = "a22fca42354011dd2293a7f51f228b46ebbd802e7740b0975912afecb79d5df4"
|
||||
SRC_URI[sha256sum] = "2542152264fb3eff7ed70662abf4f4eef8133bc37d0b7a686c240df2b5f80a13"
|
||||
|
||||
SRC_URI = "${GNU_MIRROR}/mtools/mtools-${PV}.tar.bz2 \
|
||||
file://mtools-makeinfo.patch \
|
||||
@@ -29,6 +29,7 @@ SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \
|
||||
file://0010-hw-pvrdma-Protect-against-buggy-or-malicious-guest-d.patch \
|
||||
file://0001-net-tulip-Restrict-DMA-engine-to-memories.patch \
|
||||
file://arm-cpreg-fix.patch \
|
||||
file://CVE-2022-3165.patch \
|
||||
"
|
||||
UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar"
|
||||
|
||||
@@ -198,6 +199,7 @@ PACKAGECONFIG[rdma] = "--enable-rdma,--disable-rdma"
|
||||
PACKAGECONFIG[vde] = "--enable-vde,--disable-vde"
|
||||
PACKAGECONFIG[slirp] = "--enable-slirp=internal,--disable-slirp"
|
||||
PACKAGECONFIG[brlapi] = "--enable-brlapi,--disable-brlapi"
|
||||
PACKAGECONFIG[jack] = "--enable-jack,--disable-jack,jack,"
|
||||
|
||||
INSANE_SKIP:${PN} = "arch"
|
||||
|
||||
|
||||
59
meta/recipes-devtools/qemu/qemu/CVE-2022-3165.patch
Normal file
59
meta/recipes-devtools/qemu/qemu/CVE-2022-3165.patch
Normal file
@@ -0,0 +1,59 @@
|
||||
CVE: CVE-2022-3165
|
||||
Upstream-Status: Backport
|
||||
Signed-off-by: Ross Burton <ross.burton@arm.com>
|
||||
|
||||
From d307040b18bfcb1393b910f1bae753d5c12a4dc7 Mon Sep 17 00:00:00 2001
|
||||
From: Mauro Matteo Cascella <mcascell@redhat.com>
|
||||
Date: Sun, 25 Sep 2022 22:45:11 +0200
|
||||
Subject: [PATCH] ui/vnc-clipboard: fix integer underflow in
|
||||
vnc_client_cut_text_ext
|
||||
|
||||
Extended ClientCutText messages start with a 4-byte header. If len < 4,
|
||||
an integer underflow occurs in vnc_client_cut_text_ext. The result is
|
||||
used to decompress data in a while loop in inflate_buffer, leading to
|
||||
CPU consumption and denial of service. Prevent this by checking dlen in
|
||||
protocol_client_msg.
|
||||
|
||||
Fixes: CVE-2022-3165
|
||||
Fixes: 0bf41cab93e5 ("ui/vnc: clipboard support")
|
||||
Reported-by: TangPeng <tangpeng@qianxin.com>
|
||||
Signed-off-by: Mauro Matteo Cascella <mcascell@redhat.com>
|
||||
Message-Id: <20220925204511.1103214-1-mcascell@redhat.com>
|
||||
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
|
||||
---
|
||||
ui/vnc.c | 11 ++++++++---
|
||||
1 file changed, 8 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/ui/vnc.c b/ui/vnc.c
|
||||
index 6a05d06147..acb3629cd8 100644
|
||||
--- a/ui/vnc.c
|
||||
+++ b/ui/vnc.c
|
||||
@@ -2442,8 +2442,8 @@ static int protocol_client_msg(VncState *vs, uint8_t *data, size_t len)
|
||||
if (len == 1) {
|
||||
return 8;
|
||||
}
|
||||
+ uint32_t dlen = abs(read_s32(data, 4));
|
||||
if (len == 8) {
|
||||
- uint32_t dlen = abs(read_s32(data, 4));
|
||||
if (dlen > (1 << 20)) {
|
||||
error_report("vnc: client_cut_text msg payload has %u bytes"
|
||||
" which exceeds our limit of 1MB.", dlen);
|
||||
@@ -2456,8 +2456,13 @@ static int protocol_client_msg(VncState *vs, uint8_t *data, size_t len)
|
||||
}
|
||||
|
||||
if (read_s32(data, 4) < 0) {
|
||||
- vnc_client_cut_text_ext(vs, abs(read_s32(data, 4)),
|
||||
- read_u32(data, 8), data + 12);
|
||||
+ if (dlen < 4) {
|
||||
+ error_report("vnc: malformed payload (header less than 4 bytes)"
|
||||
+ " in extended clipboard pseudo-encoding.");
|
||||
+ vnc_client_error(vs);
|
||||
+ break;
|
||||
+ }
|
||||
+ vnc_client_cut_text_ext(vs, dlen, read_u32(data, 8), data + 12);
|
||||
break;
|
||||
}
|
||||
vnc_client_cut_text(vs, read_u32(data, 4), data + 8);
|
||||
--
|
||||
GitLab
|
||||
|
||||
@@ -12,6 +12,7 @@ SRC_URI = "${SAVANNAH_GNU_MIRROR}/quilt/quilt-${PV}.tar.gz \
|
||||
file://Makefile \
|
||||
file://test.sh \
|
||||
file://0001-tests-Allow-different-output-from-mv.patch \
|
||||
file://fix-grep-3.8.patch \
|
||||
"
|
||||
|
||||
SRC_URI:append:class-target = " file://gnu_patch_test_fix_target.patch"
|
||||
|
||||
144
meta/recipes-devtools/quilt/quilt/fix-grep-3.8.patch
Normal file
144
meta/recipes-devtools/quilt/quilt/fix-grep-3.8.patch
Normal file
@@ -0,0 +1,144 @@
|
||||
From f73f8d7f71de2878d3f92881a5fcb8eafd78cb5f Mon Sep 17 00:00:00 2001
|
||||
From: Jean Delvare <jdelvare@suse.de>
|
||||
Date: Fri, 9 Sep 2022 10:10:37 +0200
|
||||
Subject: Avoid warnings with grep 3.8
|
||||
|
||||
GNU grep version 3.8 became more strict about needless quoting in
|
||||
patterns. We have one occurrence of that in quilt, where "/"
|
||||
characters are being quoted by default. There are cases where they
|
||||
indeed need to be quoted (typically when used in a sed s/// command)
|
||||
but most of the time they do not, and this results in the following
|
||||
warning:
|
||||
|
||||
grep: warning: stray \ before /
|
||||
|
||||
So rename quote_bre() to quote_sed_re(), and introduce
|
||||
quote_grep_re() which does not quote "/".
|
||||
|
||||
Signed-off-by: Jean Delvare <jdelvare@suse.de>
|
||||
Upstream-Status: Backport [https://git.savannah.nongnu.org/cgit/quilt.git/commit/?id=f73f8d7f71de2878d3f92881a5fcb8eafd78cb5f]
|
||||
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
|
||||
---
|
||||
quilt/diff.in | 2 +-
|
||||
quilt/patches.in | 2 +-
|
||||
quilt/scripts/patchfns.in | 20 +++++++++++++-------
|
||||
quilt/upgrade.in | 4 ++--
|
||||
4 files changed, 17 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/quilt/diff.in b/quilt/diff.in
|
||||
index e90dc33..07788ff 100644
|
||||
--- a/quilt/diff.in
|
||||
+++ b/quilt/diff.in
|
||||
@@ -255,7 +255,7 @@ then
|
||||
# Add all files in the snapshot into the file list (they may all
|
||||
# have changed).
|
||||
files=( $(find $QUILT_PC/$snap_subdir -type f \
|
||||
- | sed -e "s/^$(quote_bre $QUILT_PC/$snap_subdir/)//" \
|
||||
+ | sed -e "s/^$(quote_sed_re $QUILT_PC/$snap_subdir/)//" \
|
||||
| sort) )
|
||||
printf "%s\n" "${files[@]}" >&4
|
||||
unset files
|
||||
diff --git a/quilt/patches.in b/quilt/patches.in
|
||||
index bb17a46..eac45a9 100644
|
||||
--- a/quilt/patches.in
|
||||
+++ b/quilt/patches.in
|
||||
@@ -60,7 +60,7 @@ scan_unapplied()
|
||||
# Quote each file name only once
|
||||
for file in "${opt_files[@]}"
|
||||
do
|
||||
- files_bre[${#files_bre[@]}]=$(quote_bre "$file")
|
||||
+ files_bre[${#files_bre[@]}]=$(quote_grep_re "$file")
|
||||
done
|
||||
|
||||
# "Or" all files in a single pattern
|
||||
diff --git a/quilt/scripts/patchfns.in b/quilt/scripts/patchfns.in
|
||||
index c2d5f9d..1bd7233 100644
|
||||
--- a/quilt/scripts/patchfns.in
|
||||
+++ b/quilt/scripts/patchfns.in
|
||||
@@ -78,8 +78,14 @@ array_join()
|
||||
done
|
||||
}
|
||||
|
||||
-# Quote a string for use in a basic regular expression.
|
||||
-quote_bre()
|
||||
+# Quote a string for use in a regular expression for a grep pattern.
|
||||
+quote_grep_re()
|
||||
+{
|
||||
+ echo "$1" | sed -e 's:\([][^$.*\\]\):\\\1:g'
|
||||
+}
|
||||
+
|
||||
+# Quote a string for use in a regular expression for a sed s/// command.
|
||||
+quote_sed_re()
|
||||
{
|
||||
echo "$1" | sed -e 's:\([][^$/.*\\]\):\\\1:g'
|
||||
}
|
||||
@@ -215,7 +221,7 @@ patch_in_series()
|
||||
|
||||
if [ -e "$SERIES" ]
|
||||
then
|
||||
- grep -q "^$(quote_bre $patch)\([ \t]\|$\)" "$SERIES"
|
||||
+ grep -q "^$(quote_grep_re $patch)\([ \t]\|$\)" "$SERIES"
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
@@ -365,7 +371,7 @@ is_applied()
|
||||
{
|
||||
local patch=$1
|
||||
[ -e $DB ] || return 1
|
||||
- grep -q "^$(quote_bre $patch)\$" $DB
|
||||
+ grep -q "^$(quote_grep_re $patch)\$" $DB
|
||||
}
|
||||
|
||||
applied_patches()
|
||||
@@ -465,7 +471,7 @@ remove_from_db()
|
||||
local tmpfile
|
||||
if tmpfile=$(gen_tempfile)
|
||||
then
|
||||
- grep -v "^$(quote_bre $patch)\$" $DB > $tmpfile
|
||||
+ grep -v "^$(quote_grep_re $patch)\$" $DB > $tmpfile
|
||||
cat $tmpfile > $DB
|
||||
rm -f $tmpfile
|
||||
[ -s $DB ] || rm -f $DB
|
||||
@@ -520,7 +526,7 @@ find_patch()
|
||||
fi
|
||||
|
||||
local patch=${1#$SUBDIR_DOWN$QUILT_PATCHES/}
|
||||
- local bre=$(quote_bre "$patch")
|
||||
+ local bre=$(quote_sed_re "$patch")
|
||||
set -- $(sed -e "/^$bre\(\|\.patch\|\.diff\?\)\(\|\.gz\|\.bz2\|\.xz\|\.lzma\|\.lz\)\([ "$'\t'"]\|$\)/!d" \
|
||||
-e 's/[ '$'\t''].*//' "$SERIES")
|
||||
if [ $# -eq 1 ]
|
||||
@@ -631,7 +637,7 @@ files_in_patch()
|
||||
then
|
||||
find "$path" -type f \
|
||||
-a ! -path "$(quote_glob "$path")/.timestamp" |
|
||||
- sed -e "s/$(quote_bre "$path")\///"
|
||||
+ sed -e "s/$(quote_sed_re "$path")\///"
|
||||
fi
|
||||
}
|
||||
|
||||
diff --git a/quilt/upgrade.in b/quilt/upgrade.in
|
||||
index dbf7d05..866aa33 100644
|
||||
--- a/quilt/upgrade.in
|
||||
+++ b/quilt/upgrade.in
|
||||
@@ -74,7 +74,7 @@ printf $"Converting meta-data to version %s\n" "$DB_VERSION"
|
||||
|
||||
for patch in $(applied_patches)
|
||||
do
|
||||
- proper_name="$(grep "^$(quote_bre $patch)"'\(\|\.patch\|\.diff?\)\(\|\.gz\|\.bz2\)\([ \t]\|$\)' $SERIES)"
|
||||
+ proper_name="$(grep "^$(quote_grep_re $patch)"'\(\|\.patch\|\.diff?\)\(\|\.gz\|\.bz2\)\([ \t]\|$\)' $SERIES)"
|
||||
proper_name=${proper_name#$QUILT_PATCHES/}
|
||||
proper_name=${proper_name%% *}
|
||||
if [ -z "$proper_name" ]
|
||||
@@ -84,7 +84,7 @@ do
|
||||
fi
|
||||
|
||||
if [ "$patch" != "$proper_name" -a -d $QUILT_PC/$patch ] \
|
||||
- && grep -q "^$(quote_bre $patch)\$" \
|
||||
+ && grep -q "^$(quote_grep_re $patch)\$" \
|
||||
$QUILT_PC/applied-patches
|
||||
then
|
||||
mv $QUILT_PC/$patch $QUILT_PC/$proper_name \
|
||||
--
|
||||
cgit v1.1
|
||||
|
||||
@@ -57,7 +57,6 @@ rust_do_install:class-nativesdk() {
|
||||
}
|
||||
|
||||
EXTRA_TOOLS ?= "cargo-clippy clippy-driver rustfmt"
|
||||
EXTRA_TOOLS:remove:riscv32 = "rustfmt"
|
||||
rust_do_install:class-target() {
|
||||
export PSEUDO_UNLOAD=1
|
||||
rust_runx install
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
CVE: CVE-2022-41556
|
||||
Upstream-Status: Backport
|
||||
Signed-off-by: Ross Burton <ross.burton@arm.com>
|
||||
|
||||
From b18de6f9264f914f7bf493abd3b6059343548e50 Mon Sep 17 00:00:00 2001
|
||||
From: Glenn Strauss <gstrauss@gluelogic.com>
|
||||
Date: Sun, 11 Sep 2022 22:31:34 -0400
|
||||
Subject: [PATCH] [core] handle RDHUP when collecting chunked body
|
||||
|
||||
handle RDHUP as soon as RDHUP detected when collecting HTTP/1.1 chunked
|
||||
request body (and when not streaming request body to backend)
|
||||
|
||||
x-ref:
|
||||
https://github.com/lighttpd/lighttpd1.4/pull/115
|
||||
---
|
||||
src/gw_backend.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/gw_backend.c b/src/gw_backend.c
|
||||
index df9d8217..5db56287 100644
|
||||
--- a/src/gw_backend.c
|
||||
+++ b/src/gw_backend.c
|
||||
@@ -2228,7 +2228,7 @@ handler_t gw_handle_subrequest(request_st * const r, void *p_d) {
|
||||
* and module is flagged to stream request body to backend) */
|
||||
return (r->conf.stream_request_body & FDEVENT_STREAM_REQUEST)
|
||||
? http_response_reqbody_read_error(r, 411)
|
||||
- : HANDLER_WAIT_FOR_EVENT;
|
||||
+ : (rc == HANDLER_GO_ON) ? HANDLER_WAIT_FOR_EVENT : rc;
|
||||
}
|
||||
|
||||
if (hctx->wb_reqlen < -1 && r->reqbody_length >= 0) {
|
||||
@@ -14,13 +14,12 @@ RRECOMMENDS:${PN} = "lighttpd-module-access \
|
||||
lighttpd-module-accesslog"
|
||||
|
||||
SRC_URI = "http://download.lighttpd.net/lighttpd/releases-1.4.x/lighttpd-${PV}.tar.xz \
|
||||
file://CVE-2022-41556.patch \
|
||||
file://index.html.lighttpd \
|
||||
file://lighttpd.conf \
|
||||
file://lighttpd \
|
||||
"
|
||||
|
||||
SRC_URI[sha256sum] = "47ac6e60271aa0196e65472d02d019556dc7c6d09df3b65df2c1ab6866348e3b"
|
||||
SRC_URI[sha256sum] = "7e04d767f51a8d824b32e2483ef2950982920d427d1272ef4667f49d6f89f358"
|
||||
|
||||
DEPENDS = "virtual/crypt"
|
||||
|
||||
@@ -30,7 +30,7 @@ SRC_URI:append:class-native = " \
|
||||
SRC_URI:append:class-nativesdk = " \
|
||||
file://0001-Disable-use-of-syslog-for-sysroot.patch \
|
||||
"
|
||||
SRC_URI[sha256sum] = "9fdb73b5d2b44e8ba9fcee1b4493ac75dd5040bda35b9ac8b06570cd192e7ee3"
|
||||
SRC_URI[sha256sum] = "f525154adc5605e4ebf03d3e7ee8be4d7f3c7cf9df2c2244043406b6eefca2da"
|
||||
|
||||
|
||||
# Additional Policy files for PAM
|
||||
|
||||
54
meta/recipes-extended/sudo/files/CVE-2022-43995.patch
Normal file
54
meta/recipes-extended/sudo/files/CVE-2022-43995.patch
Normal file
@@ -0,0 +1,54 @@
|
||||
CVE: CVE-2022-43995
|
||||
Upstream-Status: Backport
|
||||
Signed-off-by: Ross Burton <ross.burton@arm.com>
|
||||
|
||||
From bd209b9f16fcd1270c13db27ae3329c677d48050 Mon Sep 17 00:00:00 2001
|
||||
From: "Todd C. Miller" <Todd.Miller@sudo.ws>
|
||||
Date: Fri, 28 Oct 2022 07:29:55 -0600
|
||||
Subject: [PATCH] Fix CVE-2022-43995, potential heap overflow for passwords < 8
|
||||
characters. Starting with sudo 1.8.0 the plaintext password buffer is
|
||||
dynamically sized so it is not safe to assume that it is at least 9 bytes in
|
||||
size. Found by Hugo Lefeuvre (University of Manchester) with ConfFuzz.
|
||||
|
||||
---
|
||||
plugins/sudoers/auth/passwd.c | 11 +++++------
|
||||
1 file changed, 5 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/plugins/sudoers/auth/passwd.c b/plugins/sudoers/auth/passwd.c
|
||||
index b2046eca2..0416861e9 100644
|
||||
--- a/plugins/sudoers/auth/passwd.c
|
||||
+++ b/plugins/sudoers/auth/passwd.c
|
||||
@@ -63,7 +63,7 @@ sudo_passwd_init(struct passwd *pw, sudo_auth *auth)
|
||||
int
|
||||
sudo_passwd_verify(struct passwd *pw, char *pass, sudo_auth *auth, struct sudo_conv_callback *callback)
|
||||
{
|
||||
- char sav, *epass;
|
||||
+ char des_pass[9], *epass;
|
||||
char *pw_epasswd = auth->data;
|
||||
size_t pw_len;
|
||||
int matched = 0;
|
||||
@@ -75,12 +75,12 @@ sudo_passwd_verify(struct passwd *pw, char *pass, sudo_auth *auth, struct sudo_c
|
||||
|
||||
/*
|
||||
* Truncate to 8 chars if standard DES since not all crypt()'s do this.
|
||||
- * If this turns out not to be safe we will have to use OS #ifdef's (sigh).
|
||||
*/
|
||||
- sav = pass[8];
|
||||
pw_len = strlen(pw_epasswd);
|
||||
- if (pw_len == DESLEN || HAS_AGEINFO(pw_epasswd, pw_len))
|
||||
- pass[8] = '\0';
|
||||
+ if (pw_len == DESLEN || HAS_AGEINFO(pw_epasswd, pw_len)) {
|
||||
+ strlcpy(des_pass, pass, sizeof(des_pass));
|
||||
+ pass = des_pass;
|
||||
+ }
|
||||
|
||||
/*
|
||||
* Normal UN*X password check.
|
||||
@@ -88,7 +88,6 @@ sudo_passwd_verify(struct passwd *pw, char *pass, sudo_auth *auth, struct sudo_c
|
||||
* only compare the first DESLEN characters in that case.
|
||||
*/
|
||||
epass = (char *) crypt(pass, pw_epasswd);
|
||||
- pass[8] = sav;
|
||||
if (epass != NULL) {
|
||||
if (HAS_AGEINFO(pw_epasswd, pw_len) && strlen(epass) == DESLEN)
|
||||
matched = !strncmp(pw_epasswd, epass, DESLEN);
|
||||
@@ -4,6 +4,7 @@ SRC_URI = "https://www.sudo.ws/dist/sudo-${PV}.tar.gz \
|
||||
${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)} \
|
||||
file://0001-sudo.conf.in-fix-conflict-with-multilib.patch \
|
||||
file://0001-lib-util-mksigname.c-correctly-include-header-for-ou.patch \
|
||||
file://CVE-2022-43995.patch \
|
||||
"
|
||||
|
||||
PAM_SRC_URI = "file://sudo.pam"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 0234c546d86174fafe9ab280cf5f44de50b73676 Mon Sep 17 00:00:00 2001
|
||||
From 77093de6a12c24a60fc447698900d18d0a3943af Mon Sep 17 00:00:00 2001
|
||||
From: Carlos Rafael Giani <crg7475@mailbox.org>
|
||||
Date: Fri, 18 Mar 2022 12:06:23 +0100
|
||||
Subject: [PATCH] Disable libunwind in native OE builds by not looking for
|
||||
@@ -22,10 +22,10 @@ Upstream-Status: Inappropriate [OE specific]
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 644715a..bbf2e28 100644
|
||||
index 7617205..d9b1522 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -869,7 +869,7 @@ if(SDL_LIBC)
|
||||
@@ -952,7 +952,7 @@ if(SDL_LIBC)
|
||||
check_include_file(sys/types.h HAVE_SYS_TYPES_H)
|
||||
foreach(_HEADER
|
||||
stdio.h stdlib.h stddef.h stdarg.h malloc.h memory.h string.h limits.h float.h
|
||||
|
||||
@@ -27,7 +27,7 @@ SRC_URI:append:class-native = " file://0001-Disable-libunwind-in-native-OE-build
|
||||
|
||||
S = "${WORKDIR}/SDL2-${PV}"
|
||||
|
||||
SRC_URI[sha256sum] = "91e4c34b1768f92d399b078e171448c6af18cafda743987ed2064a28954d6d97"
|
||||
SRC_URI[sha256sum] = "bc121588b1105065598ce38078026a414c28ea95e66ed2adab4c44d80b309e1b"
|
||||
|
||||
inherit cmake lib_package binconfig-disabled pkgconfig upstream-version-is-even
|
||||
|
||||
@@ -19,10 +19,12 @@ SRC_URI = "https://mesa.freedesktop.org/archive/mesa-${PV}.tar.xz \
|
||||
file://0001-meson-misdetects-64bit-atomics-on-mips-clang.patch \
|
||||
file://0001-futex.h-Define-__NR_futex-if-it-does-not-exist.patch \
|
||||
file://0001-util-format-Check-for-NEON-before-using-it.patch \
|
||||
file://0001-nir-nir_opt_move-fix-ALWAYS_INLINE-compiler-error.patch \
|
||||
"
|
||||
|
||||
SRC_URI[sha256sum] = "b1f9c8fd08f2cae3adf83355bef4d2398e8025f44947332880f2d0066bdafa8c"
|
||||
# required by mesa-native on Ubuntu 18.04 with gcc 7.5 when DEBUG_BUILD enabled
|
||||
SRC_URI:append:class-native = " file://0001-nir-nir_opt_move-fix-ALWAYS_INLINE-compiler-error.patch"
|
||||
|
||||
SRC_URI[sha256sum] = "2de11fb74fc5cc671b818e49fe203cea0cd1d8b69756e97cdb06a2f4e78948f9"
|
||||
|
||||
UPSTREAM_CHECK_GITTAGREGEX = "mesa-(?P<pver>\d+(\.\d+)+)"
|
||||
|
||||
@@ -179,6 +181,8 @@ PACKAGECONFIG[vulkan-beta] = "-Dvulkan-beta=true,-Dvulkan-beta=false"
|
||||
|
||||
PACKAGECONFIG[osmesa] = "-Dosmesa=true,-Dosmesa=false"
|
||||
|
||||
PACKAGECONFIG[perfetto] = "-Dperfetto=true,-Dperfetto=false,libperfetto"
|
||||
|
||||
PACKAGECONFIG[unwind] = "-Dlibunwind=enabled,-Dlibunwind=disabled,libunwind"
|
||||
|
||||
PACKAGECONFIG[lmsensors] = "-Dlmsensors=enabled,-Dlmsensors=disabled,lmsensors"
|
||||
|
||||
@@ -24,7 +24,7 @@ SRC_URI += "file://run-ptest \
|
||||
file://0001-Skip-running-test-layout-test.patch \
|
||||
"
|
||||
|
||||
SRC_URI[archive.sha256sum] = "1b636aabf905130d806372136f5e137b6a27f26d47defd9240bf444f6a4fe610"
|
||||
SRC_URI[archive.sha256sum] = "7e5d2f1e40854d24a9a2c4d093bafe75dcdbeccdf1de43e4437332eabed64966"
|
||||
|
||||
DEPENDS = "glib-2.0 glib-2.0-native fontconfig freetype virtual/libiconv cairo harfbuzz fribidi"
|
||||
|
||||
@@ -5,7 +5,7 @@ LICENSE = "Apache-2.0"
|
||||
|
||||
LIC_FILES_CHKSUM = "file://LICENSE;md5=48aa35cefb768436223a6e7f18dc2a2a"
|
||||
|
||||
SRC_URI = "gitsm://github.com/KhronosGroup/Vulkan-Samples.git;branch=master;protocol=https \
|
||||
SRC_URI = "gitsm://github.com/KhronosGroup/Vulkan-Samples.git;branch=master;protocol=https;lfs=0 \
|
||||
file://0001-CMakeLists.txt-do-not-hardcode-lib-as-installation-t.patch \
|
||||
file://debugfix.patch \
|
||||
file://0001-Qualify-move-as-std-move.patch;patchdir=third_party/spirv-cross \
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
CVE: CVE-2022-3554
|
||||
Upstream-Status: Backport
|
||||
Signed-off-by: Ross Burton <ross.burton@arm.com>
|
||||
|
||||
From 1d11822601fd24a396b354fa616b04ed3df8b4ef Mon Sep 17 00:00:00 2001
|
||||
From: "Thomas E. Dickey" <dickey@invisible-island.net>
|
||||
Date: Tue, 4 Oct 2022 18:26:17 -0400
|
||||
Subject: [PATCH] fix a memory leak in XRegisterIMInstantiateCallback
|
||||
|
||||
Analysis:
|
||||
|
||||
_XimRegisterIMInstantiateCallback() opens an XIM and closes it using
|
||||
the internal function pointers, but the internal close function does
|
||||
not free the pointer to the XIM (this would be done in XCloseIM()).
|
||||
|
||||
Report/patch:
|
||||
|
||||
Date: Mon, 03 Oct 2022 18:47:32 +0800
|
||||
From: Po Lu <luangruo@yahoo.com>
|
||||
To: xorg-devel@lists.x.org
|
||||
Subject: Re: Yet another leak in Xlib
|
||||
|
||||
For reference, here's how I'm calling XRegisterIMInstantiateCallback:
|
||||
|
||||
XSetLocaleModifiers ("");
|
||||
XRegisterIMInstantiateCallback (compositor.display,
|
||||
XrmGetDatabase (compositor.display),
|
||||
(char *) compositor.resource_name,
|
||||
(char *) compositor.app_name,
|
||||
IMInstantiateCallback, NULL);
|
||||
|
||||
and XMODIFIERS is:
|
||||
|
||||
@im=ibus
|
||||
|
||||
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
|
||||
---
|
||||
modules/im/ximcp/imInsClbk.c | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/modules/im/ximcp/imInsClbk.c b/modules/im/ximcp/imInsClbk.c
|
||||
index 95b379cb..c10e347f 100644
|
||||
--- a/modules/im/ximcp/imInsClbk.c
|
||||
+++ b/modules/im/ximcp/imInsClbk.c
|
||||
@@ -212,6 +212,9 @@ _XimRegisterIMInstantiateCallback(
|
||||
if( xim ) {
|
||||
lock = True;
|
||||
xim->methods->close( (XIM)xim );
|
||||
+ /* XIMs must be freed manually after being opened; close just
|
||||
+ does the protocol to deinitialize the IM. */
|
||||
+ XFree( xim );
|
||||
lock = False;
|
||||
icb->call = True;
|
||||
callback( display, client_data, NULL );
|
||||
--
|
||||
2.34.1
|
||||
|
||||
@@ -15,6 +15,7 @@ PE = "1"
|
||||
SRC_URI = "${XORG_MIRROR}/individual/lib/${XORG_PN}-${PV}.tar.xz"
|
||||
|
||||
SRC_URI += "file://disable_tests.patch \
|
||||
file://0001-fix-a-memory-leak-in-XRegisterIMInstantiateCallback.patch \
|
||||
"
|
||||
SRC_URI[sha256sum] = "1bc41aa1bbe01401f330d76dfa19f386b79c51881c7bbfee9eb4e27f22f2d9f7"
|
||||
|
||||
|
||||
33
meta/recipes-graphics/xorg-lib/pixman/CVE-2022-44638.patch
Normal file
33
meta/recipes-graphics/xorg-lib/pixman/CVE-2022-44638.patch
Normal file
@@ -0,0 +1,33 @@
|
||||
CVE: CVE-2022-44638
|
||||
Upstream-Status: Backport
|
||||
Signed-off-by: Ross Burton <ross.burton@arm.com>
|
||||
|
||||
From a1f88e842e0216a5b4df1ab023caebe33c101395 Mon Sep 17 00:00:00 2001
|
||||
From: Matt Turner <mattst88@gmail.com>
|
||||
Date: Wed, 2 Nov 2022 12:07:32 -0400
|
||||
Subject: [PATCH] Avoid integer overflow leading to out-of-bounds write
|
||||
|
||||
Thanks to Maddie Stone and Google's Project Zero for discovering this
|
||||
issue, providing a proof-of-concept, and a great analysis.
|
||||
|
||||
Closes: https://gitlab.freedesktop.org/pixman/pixman/-/issues/63
|
||||
---
|
||||
pixman/pixman-trap.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/pixman/pixman-trap.c b/pixman/pixman-trap.c
|
||||
index 91766fd..7560405 100644
|
||||
--- a/pixman/pixman-trap.c
|
||||
+++ b/pixman/pixman-trap.c
|
||||
@@ -74,7 +74,7 @@ pixman_sample_floor_y (pixman_fixed_t y,
|
||||
|
||||
if (f < Y_FRAC_FIRST (n))
|
||||
{
|
||||
- if (pixman_fixed_to_int (i) == 0x8000)
|
||||
+ if (pixman_fixed_to_int (i) == 0xffff8000)
|
||||
{
|
||||
f = 0; /* saturate */
|
||||
}
|
||||
--
|
||||
GitLab
|
||||
|
||||
@@ -9,6 +9,7 @@ DEPENDS = "zlib"
|
||||
|
||||
SRC_URI = "https://www.cairographics.org/releases/${BP}.tar.gz \
|
||||
file://0001-ARM-qemu-related-workarounds-in-cpu-features-detecti.patch \
|
||||
file://CVE-2022-44638.patch \
|
||||
"
|
||||
SRC_URI[md5sum] = "73858c0862dd9896fb5f62ae267084a4"
|
||||
SRC_URI[sha256sum] = "6d200dec3740d9ec4ec8d1180e25779c00bc749f94278c8b9021f5534db223fc"
|
||||
|
||||
@@ -28,6 +28,8 @@ CVE_CHECK_IGNORE += "CVE-2011-4613"
|
||||
# impossible or difficult to exploit. There is currently no upstream patch
|
||||
# available for this flaw.
|
||||
CVE_CHECK_IGNORE += "CVE-2020-25697"
|
||||
# This is specific to XQuartz, which is the macOS X server port
|
||||
CVE_CHECK_IGNORE += "CVE-2022-3553"
|
||||
|
||||
S = "${WORKDIR}/${XORG_PN}-${PV}"
|
||||
|
||||
@@ -80,9 +82,9 @@ PACKAGES =+ "${PN}-sdl \
|
||||
SUMMARY:xf86-video-modesetting = "X.Org X server -- modesetting display driver"
|
||||
INSANE_SKIP:${MLPREFIX}xf86-video-modesetting = "xorg-driver-abi"
|
||||
|
||||
XSERVER_RRECOMMENDS = "xkeyboard-config rgb xserver-xf86-config xkbcomp xf86-input-libinput"
|
||||
RRECOMMENDS:${PN} += "${XSERVER_RRECOMMENDS}"
|
||||
RRECOMMENDS:${PN}-xwayland += "${XSERVER_RRECOMMENDS}"
|
||||
XSERVER_RDEPENDS = "xkeyboard-config rgb xserver-xf86-config xkbcomp xf86-input-libinput"
|
||||
RDEPENDS:${PN} += "${XSERVER_RDEPENDS}"
|
||||
RDEPENDS:${PN}-xwayland += "${XSERVER_RDEPENDS}"
|
||||
RDEPENDS:${PN}-xvfb += "xkeyboard-config"
|
||||
RDEPENDS:${PN}-module-exa = "${PN} (= ${EXTENDPKGV})"
|
||||
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
CVE: CVE-2022-3551
|
||||
Upstream-Status: Backport
|
||||
Signed-off-by: Ross Burton <ross.burton@arm.com>
|
||||
|
||||
From 18f91b950e22c2a342a4fbc55e9ddf7534a707d2 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Hutterer <peter.hutterer@who-t.net>
|
||||
Date: Wed, 13 Jul 2022 11:23:09 +1000
|
||||
Subject: [PATCH] xkb: fix some possible memleaks in XkbGetKbdByName
|
||||
|
||||
GetComponentByName returns an allocated string, so let's free that if we
|
||||
fail somewhere.
|
||||
|
||||
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
||||
---
|
||||
xkb/xkb.c | 26 ++++++++++++++++++++------
|
||||
1 file changed, 20 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/xkb/xkb.c b/xkb/xkb.c
|
||||
index 4692895db..b79a269e3 100644
|
||||
--- a/xkb/xkb.c
|
||||
+++ b/xkb/xkb.c
|
||||
@@ -5935,18 +5935,32 @@ ProcXkbGetKbdByName(ClientPtr client)
|
||||
xkb = dev->key->xkbInfo->desc;
|
||||
status = Success;
|
||||
str = (unsigned char *) &stuff[1];
|
||||
- if (GetComponentSpec(&str, TRUE, &status)) /* keymap, unsupported */
|
||||
- return BadMatch;
|
||||
+ {
|
||||
+ char *keymap = GetComponentSpec(&str, TRUE, &status); /* keymap, unsupported */
|
||||
+ if (keymap) {
|
||||
+ free(keymap);
|
||||
+ return BadMatch;
|
||||
+ }
|
||||
+ }
|
||||
names.keycodes = GetComponentSpec(&str, TRUE, &status);
|
||||
names.types = GetComponentSpec(&str, TRUE, &status);
|
||||
names.compat = GetComponentSpec(&str, TRUE, &status);
|
||||
names.symbols = GetComponentSpec(&str, TRUE, &status);
|
||||
names.geometry = GetComponentSpec(&str, TRUE, &status);
|
||||
- if (status != Success)
|
||||
+ if (status == Success) {
|
||||
+ len = str - ((unsigned char *) stuff);
|
||||
+ if ((XkbPaddedSize(len) / 4) != stuff->length)
|
||||
+ status = BadLength;
|
||||
+ }
|
||||
+
|
||||
+ if (status != Success) {
|
||||
+ free(names.keycodes);
|
||||
+ free(names.types);
|
||||
+ free(names.compat);
|
||||
+ free(names.symbols);
|
||||
+ free(names.geometry);
|
||||
return status;
|
||||
- len = str - ((unsigned char *) stuff);
|
||||
- if ((XkbPaddedSize(len) / 4) != stuff->length)
|
||||
- return BadLength;
|
||||
+ }
|
||||
|
||||
CHK_MASK_LEGAL(0x01, stuff->want, XkbGBN_AllComponentsMask);
|
||||
CHK_MASK_LEGAL(0x02, stuff->need, XkbGBN_AllComponentsMask);
|
||||
--
|
||||
2.34.1
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
CVE: CVE-2022-3550
|
||||
Upstream-Status: Backport
|
||||
Signed-off-by: Ross Burton <ross.burton@arm.com>
|
||||
|
||||
From 11beef0b7f1ed290348e45618e5fa0d2bffcb72e Mon Sep 17 00:00:00 2001
|
||||
From: Peter Hutterer <peter.hutterer@who-t.net>
|
||||
Date: Tue, 5 Jul 2022 12:06:20 +1000
|
||||
Subject: [PATCH] xkb: proof GetCountedString against request length attacks
|
||||
|
||||
GetCountedString did a check for the whole string to be within the
|
||||
request buffer but not for the initial 2 bytes that contain the length
|
||||
field. A swapped client could send a malformed request to trigger a
|
||||
swaps() on those bytes, writing into random memory.
|
||||
|
||||
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
||||
---
|
||||
xkb/xkb.c | 5 +++++
|
||||
1 file changed, 5 insertions(+)
|
||||
|
||||
diff --git a/xkb/xkb.c b/xkb/xkb.c
|
||||
index f42f59ef3..1841cff26 100644
|
||||
--- a/xkb/xkb.c
|
||||
+++ b/xkb/xkb.c
|
||||
@@ -5137,6 +5137,11 @@ _GetCountedString(char **wire_inout, ClientPtr client, char **str)
|
||||
CARD16 len;
|
||||
|
||||
wire = *wire_inout;
|
||||
+
|
||||
+ if (client->req_len <
|
||||
+ bytes_to_int32(wire + 2 - (char *) client->requestBuffer))
|
||||
+ return BadValue;
|
||||
+
|
||||
len = *(CARD16 *) wire;
|
||||
if (client->swapped) {
|
||||
swaps(&len);
|
||||
--
|
||||
2.34.1
|
||||
|
||||
@@ -2,6 +2,8 @@ require xserver-xorg.inc
|
||||
|
||||
SRC_URI += "file://0001-xf86pciBus.c-use-Intel-ddx-only-for-pre-gen4-hardwar.patch \
|
||||
file://0001-Avoid-duplicate-definitions-of-IOPortBase.patch \
|
||||
file://0001-xkb-fix-some-possible-memleaks-in-XkbGetKbdByName.patch \
|
||||
file://0001-xkb-proof-GetCountedString-against-request-length-at.patch \
|
||||
"
|
||||
SRC_URI[sha256sum] = "5cc4be8ee47edb58d4a90e603a59d56b40291ad38371b0bd2471fc3cbee1c587"
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ LIC_FILES_CHKSUM = "\
|
||||
|
||||
DEPENDS = "git-native"
|
||||
|
||||
SRCREV = "ba600ef61a85966596126a6e8d936971905e8749"
|
||||
SRCREV = "6a4752ebbe7d242c02b3c74a5772926edd243626"
|
||||
PV = "0.3+git${SRCPV}"
|
||||
|
||||
inherit native
|
||||
|
||||
@@ -228,6 +228,7 @@ do_install() {
|
||||
PACKAGES =+ "${PN}-ralink-license ${PN}-ralink \
|
||||
${PN}-mt7601u-license ${PN}-mt7601u \
|
||||
${PN}-radeon-license ${PN}-radeon \
|
||||
${PN}-amdgpu-license ${PN}-amdgpu \
|
||||
${PN}-marvell-license ${PN}-pcie8897 ${PN}-pcie8997 \
|
||||
${PN}-sd8686 ${PN}-sd8688 ${PN}-sd8787 ${PN}-sd8797 ${PN}-sd8801 \
|
||||
${PN}-sd8887 ${PN}-sd8897 ${PN}-sd8997 ${PN}-usb8997 \
|
||||
@@ -235,6 +236,7 @@ PACKAGES =+ "${PN}-ralink-license ${PN}-ralink \
|
||||
${PN}-vt6656-license ${PN}-vt6656 \
|
||||
${PN}-rs9113 ${PN}-rs9116 \
|
||||
${PN}-rtl-license ${PN}-rtl8188 ${PN}-rtl8192cu ${PN}-rtl8192ce ${PN}-rtl8192su ${PN}-rtl8723 ${PN}-rtl8821 \
|
||||
${PN}-rtl8761 \
|
||||
${PN}-rtl8168 \
|
||||
${PN}-cypress-license \
|
||||
${PN}-broadcom-license \
|
||||
@@ -428,6 +430,17 @@ FILES:${PN}-radeon = " \
|
||||
|
||||
RDEPENDS:${PN}-radeon += "${PN}-radeon-license"
|
||||
|
||||
# For amdgpu
|
||||
LICENSE:${PN}-amdgpu = "Firmware-amdgpu"
|
||||
LICENSE:${PN}-amdgpu-license = "Firmware-amdgpu"
|
||||
|
||||
FILES:${PN}-amdgpu-license = "${nonarch_base_libdir}/firmware/LICENSE.amdgpu"
|
||||
FILES:${PN}-amdgpu = " \
|
||||
${nonarch_base_libdir}/firmware/amdgpu \
|
||||
"
|
||||
|
||||
RDEPENDS:${PN}-amdgpu += "${PN}-amdgpu-license"
|
||||
|
||||
# For lontium
|
||||
LICENSE:${PN}-lt9611uxc = "Firmware-Lontium"
|
||||
|
||||
@@ -563,6 +576,7 @@ LICENSE:${PN}-rtl8192cu = "Firmware-rtlwifi_firmware"
|
||||
LICENSE:${PN}-rtl8192ce = "Firmware-rtlwifi_firmware"
|
||||
LICENSE:${PN}-rtl8192su = "Firmware-rtlwifi_firmware"
|
||||
LICENSE:${PN}-rtl8723 = "Firmware-rtlwifi_firmware"
|
||||
LICENSE:${PN}-rtl8761 = "Firmware-rtlwifi_firmware"
|
||||
LICENSE:${PN}-rtl8821 = "Firmware-rtlwifi_firmware"
|
||||
LICENSE:${PN}-rtl-license = "Firmware-rtlwifi_firmware"
|
||||
LICENSE:${PN}-rtl8168 = "WHENCE"
|
||||
@@ -588,6 +602,9 @@ FILES:${PN}-rtl8723 = " \
|
||||
FILES:${PN}-rtl8821 = " \
|
||||
${nonarch_base_libdir}/firmware/rtlwifi/rtl8821*.bin \
|
||||
"
|
||||
FILES:${PN}-rtl8761 = " \
|
||||
${nonarch_base_libdir}/firmware/rtl_bt/rtl8761*.bin \
|
||||
"
|
||||
FILES:${PN}-rtl8168 = " \
|
||||
${nonarch_base_libdir}/firmware/rtl_nic/rtl8168*.fw \
|
||||
"
|
||||
@@ -598,6 +615,7 @@ RDEPENDS:${PN}-rtl8192cu += "${PN}-rtl-license"
|
||||
RDEPENDS:${PN}-rtl8192su = "${PN}-rtl-license"
|
||||
RDEPENDS:${PN}-rtl8723 += "${PN}-rtl-license"
|
||||
RDEPENDS:${PN}-rtl8821 += "${PN}-rtl-license"
|
||||
RDEPENDS:${PN}-rtl8761 += "${PN}-rtl-license"
|
||||
RDEPENDS:${PN}-rtl8168 += "${PN}-whence-license"
|
||||
|
||||
# For ti-connectivity
|
||||
|
||||
@@ -11,13 +11,13 @@ python () {
|
||||
raise bb.parse.SkipRecipe("Set PREFERRED_PROVIDER_virtual/kernel to linux-yocto-rt to enable it")
|
||||
}
|
||||
|
||||
SRCREV_machine ?= "dba1b7d90813231782bdeda1bd169c93b35c94e0"
|
||||
SRCREV_meta ?= "1128d7bcdcde490d4f35cc00c97f5410bb240d99"
|
||||
SRCREV_machine ?= "47b86b149db08838964584baec1b913c5d67c060"
|
||||
SRCREV_meta ?= "c6aba7f07aae15d63bccf5b072a6e70602c2bcef"
|
||||
|
||||
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.15;destsuffix=${KMETA}"
|
||||
|
||||
LINUX_VERSION ?= "5.15.68"
|
||||
LINUX_VERSION ?= "5.15.72"
|
||||
|
||||
LIC_FILES_CHKSUM = "file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46"
|
||||
|
||||
|
||||
@@ -11,13 +11,13 @@ python () {
|
||||
raise bb.parse.SkipRecipe("Set PREFERRED_PROVIDER_virtual/kernel to linux-yocto-rt to enable it")
|
||||
}
|
||||
|
||||
SRCREV_machine ?= "bc8af638c00f28a46e77e34056079087638f6e65"
|
||||
SRCREV_meta ?= "350b544d077955b599b54ab364f6227d96a90455"
|
||||
SRCREV_machine ?= "92f22179274bd656239b8aa70eb655473abf68f5"
|
||||
SRCREV_meta ?= "1cd6a86d7aa5d42ce72097d011c907bd4ea354ec"
|
||||
|
||||
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.19;destsuffix=${KMETA}"
|
||||
|
||||
LINUX_VERSION ?= "5.19.9"
|
||||
LINUX_VERSION ?= "5.19.14"
|
||||
|
||||
LIC_FILES_CHKSUM = "file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46"
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ KCONFIG_MODE = "--allnoconfig"
|
||||
|
||||
require recipes-kernel/linux/linux-yocto.inc
|
||||
|
||||
LINUX_VERSION ?= "5.15.68"
|
||||
LINUX_VERSION ?= "5.15.72"
|
||||
LIC_FILES_CHKSUM = "file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46"
|
||||
|
||||
DEPENDS += "${@bb.utils.contains('ARCH', 'x86', 'elfutils-native', '', d)}"
|
||||
@@ -14,8 +14,8 @@ DEPENDS += "openssl-native util-linux-native"
|
||||
KMETA = "kernel-meta"
|
||||
KCONF_BSP_AUDIT_LEVEL = "2"
|
||||
|
||||
SRCREV_machine ?= "33e7eea5c4545a973cf01a849c2b45fa0cd1fa13"
|
||||
SRCREV_meta ?= "1128d7bcdcde490d4f35cc00c97f5410bb240d99"
|
||||
SRCREV_machine ?= "34404e5be3791dac897da77afa6c7fa00c993f78"
|
||||
SRCREV_meta ?= "c6aba7f07aae15d63bccf5b072a6e70602c2bcef"
|
||||
|
||||
PV = "${LINUX_VERSION}+git${SRCPV}"
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ KCONFIG_MODE = "--allnoconfig"
|
||||
|
||||
require recipes-kernel/linux/linux-yocto.inc
|
||||
|
||||
LINUX_VERSION ?= "5.19.9"
|
||||
LINUX_VERSION ?= "5.19.14"
|
||||
LIC_FILES_CHKSUM = "file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46"
|
||||
|
||||
DEPENDS += "${@bb.utils.contains('ARCH', 'x86', 'elfutils-native', '', d)}"
|
||||
@@ -14,8 +14,8 @@ DEPENDS += "openssl-native util-linux-native"
|
||||
KMETA = "kernel-meta"
|
||||
KCONF_BSP_AUDIT_LEVEL = "2"
|
||||
|
||||
SRCREV_machine ?= "65a9a22786a6710fc7b4edb7cfae80dd83f591f1"
|
||||
SRCREV_meta ?= "350b544d077955b599b54ab364f6227d96a90455"
|
||||
SRCREV_machine ?= "23ee2ef634b3fb51be429623fa1927b1d5c3e95c"
|
||||
SRCREV_meta ?= "1cd6a86d7aa5d42ce72097d011c907bd4ea354ec"
|
||||
|
||||
PV = "${LINUX_VERSION}+git${SRCPV}"
|
||||
|
||||
|
||||
@@ -13,24 +13,24 @@ KBRANCH:qemux86 ?= "v5.15/standard/base"
|
||||
KBRANCH:qemux86-64 ?= "v5.15/standard/base"
|
||||
KBRANCH:qemumips64 ?= "v5.15/standard/mti-malta64"
|
||||
|
||||
SRCREV_machine:qemuarm ?= "efe28b4b16d4a1a19f59b4650a0bfb23ffc8c40e"
|
||||
SRCREV_machine:qemuarm64 ?= "66986670c45f63d2ed2078e07aa817ede88025ad"
|
||||
SRCREV_machine:qemumips ?= "aeeb80fd7f684aca830adb7daf32cfd80637cf3a"
|
||||
SRCREV_machine:qemuppc ?= "5c6387a562af89ec92546c1374a120ac240f14e6"
|
||||
SRCREV_machine:qemuriscv64 ?= "0e51e571701842db33ad96f6ddc8cc6b23230627"
|
||||
SRCREV_machine:qemuriscv32 ?= "0e51e571701842db33ad96f6ddc8cc6b23230627"
|
||||
SRCREV_machine:qemux86 ?= "0e51e571701842db33ad96f6ddc8cc6b23230627"
|
||||
SRCREV_machine:qemux86-64 ?= "0e51e571701842db33ad96f6ddc8cc6b23230627"
|
||||
SRCREV_machine:qemumips64 ?= "20ec37851f4ee9965120937dcf2567f15e72e07a"
|
||||
SRCREV_machine ?= "0e51e571701842db33ad96f6ddc8cc6b23230627"
|
||||
SRCREV_meta ?= "1128d7bcdcde490d4f35cc00c97f5410bb240d99"
|
||||
SRCREV_machine:qemuarm ?= "84a35b23cf4c520894d0d1b91628eb019dc7901a"
|
||||
SRCREV_machine:qemuarm64 ?= "e939c4ebc789805c00a36eaf4a190df6f8f51470"
|
||||
SRCREV_machine:qemumips ?= "1adf4e5b574a5d23b4724766890ea74101d04abd"
|
||||
SRCREV_machine:qemuppc ?= "7220def162c7b2d3b4f1c6c86de0ecc19ade7d5f"
|
||||
SRCREV_machine:qemuriscv64 ?= "0b628306d1f9ea28c0e86369ce9bb87a47893c9c"
|
||||
SRCREV_machine:qemuriscv32 ?= "0b628306d1f9ea28c0e86369ce9bb87a47893c9c"
|
||||
SRCREV_machine:qemux86 ?= "0b628306d1f9ea28c0e86369ce9bb87a47893c9c"
|
||||
SRCREV_machine:qemux86-64 ?= "0b628306d1f9ea28c0e86369ce9bb87a47893c9c"
|
||||
SRCREV_machine:qemumips64 ?= "3840e1613b7fe9cc68e9cdfcaf7afa5e14fa8344"
|
||||
SRCREV_machine ?= "0b628306d1f9ea28c0e86369ce9bb87a47893c9c"
|
||||
SRCREV_meta ?= "c6aba7f07aae15d63bccf5b072a6e70602c2bcef"
|
||||
|
||||
# set your preferred provider of linux-yocto to 'linux-yocto-upstream', and you'll
|
||||
# get the <version>/base branch, which is pure upstream -stable, and the same
|
||||
# meta SRCREV as the linux-yocto-standard builds. Select your version using the
|
||||
# normal PREFERRED_VERSION settings.
|
||||
BBCLASSEXTEND = "devupstream:target"
|
||||
SRCREV_machine:class-devupstream ?= "dd20085f2a88b6cdb12bdcdbd2d7a761c86b184a"
|
||||
SRCREV_machine:class-devupstream ?= "c68173b2012b8eba332cf9832f0ad23427d795b5"
|
||||
PN:class-devupstream = "linux-yocto-upstream"
|
||||
KBRANCH:class-devupstream = "v5.15/base"
|
||||
|
||||
@@ -38,7 +38,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.15;destsuffix=${KMETA}"
|
||||
|
||||
LIC_FILES_CHKSUM = "file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46"
|
||||
LINUX_VERSION ?= "5.15.68"
|
||||
LINUX_VERSION ?= "5.15.72"
|
||||
|
||||
DEPENDS += "${@bb.utils.contains('ARCH', 'x86', 'elfutils-native', '', d)}"
|
||||
DEPENDS += "openssl-native util-linux-native"
|
||||
|
||||
@@ -13,24 +13,24 @@ KBRANCH:qemux86 ?= "v5.19/standard/base"
|
||||
KBRANCH:qemux86-64 ?= "v5.19/standard/base"
|
||||
KBRANCH:qemumips64 ?= "v5.19/standard/mti-malta64"
|
||||
|
||||
SRCREV_machine:qemuarm ?= "446661f6a3b07535304497c1a51d9cab95f48f0b"
|
||||
SRCREV_machine:qemuarm64 ?= "65a9a22786a6710fc7b4edb7cfae80dd83f591f1"
|
||||
SRCREV_machine:qemumips ?= "98da147618fca3da29cf1c6ab9c53f24de2c587c"
|
||||
SRCREV_machine:qemuppc ?= "65a9a22786a6710fc7b4edb7cfae80dd83f591f1"
|
||||
SRCREV_machine:qemuriscv64 ?= "65a9a22786a6710fc7b4edb7cfae80dd83f591f1"
|
||||
SRCREV_machine:qemuriscv32 ?= "65a9a22786a6710fc7b4edb7cfae80dd83f591f1"
|
||||
SRCREV_machine:qemux86 ?= "65a9a22786a6710fc7b4edb7cfae80dd83f591f1"
|
||||
SRCREV_machine:qemux86-64 ?= "65a9a22786a6710fc7b4edb7cfae80dd83f591f1"
|
||||
SRCREV_machine:qemumips64 ?= "53842054198d851b5deb5810afaf126156efbb54"
|
||||
SRCREV_machine ?= "65a9a22786a6710fc7b4edb7cfae80dd83f591f1"
|
||||
SRCREV_meta ?= "350b544d077955b599b54ab364f6227d96a90455"
|
||||
SRCREV_machine:qemuarm ?= "8150698489c801b7aa4a641d4feec1de1b2ea07c"
|
||||
SRCREV_machine:qemuarm64 ?= "23ee2ef634b3fb51be429623fa1927b1d5c3e95c"
|
||||
SRCREV_machine:qemumips ?= "8d7dc30e65155e4a6a217b054cf54252ace8c724"
|
||||
SRCREV_machine:qemuppc ?= "23ee2ef634b3fb51be429623fa1927b1d5c3e95c"
|
||||
SRCREV_machine:qemuriscv64 ?= "23ee2ef634b3fb51be429623fa1927b1d5c3e95c"
|
||||
SRCREV_machine:qemuriscv32 ?= "23ee2ef634b3fb51be429623fa1927b1d5c3e95c"
|
||||
SRCREV_machine:qemux86 ?= "23ee2ef634b3fb51be429623fa1927b1d5c3e95c"
|
||||
SRCREV_machine:qemux86-64 ?= "23ee2ef634b3fb51be429623fa1927b1d5c3e95c"
|
||||
SRCREV_machine:qemumips64 ?= "930822733328e39e8698bfac5a4e4e8d6a25b4d5"
|
||||
SRCREV_machine ?= "23ee2ef634b3fb51be429623fa1927b1d5c3e95c"
|
||||
SRCREV_meta ?= "1cd6a86d7aa5d42ce72097d011c907bd4ea354ec"
|
||||
|
||||
# set your preferred provider of linux-yocto to 'linux-yocto-upstream', and you'll
|
||||
# get the <version>/base branch, which is pure upstream -stable, and the same
|
||||
# meta SRCREV as the linux-yocto-standard builds. Select your version using the
|
||||
# normal PREFERRED_VERSION settings.
|
||||
BBCLASSEXTEND = "devupstream:target"
|
||||
SRCREV_machine:class-devupstream ?= "d1105a680e66b0482bd18048534c58ecabb5c284"
|
||||
SRCREV_machine:class-devupstream ?= "30c780ac0f9fc09160790cf58f07ef3b92097ceb"
|
||||
PN:class-devupstream = "linux-yocto-upstream"
|
||||
KBRANCH:class-devupstream = "v5.19/base"
|
||||
|
||||
@@ -38,7 +38,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.19;destsuffix=${KMETA}"
|
||||
|
||||
LIC_FILES_CHKSUM = "file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46"
|
||||
LINUX_VERSION ?= "5.19.9"
|
||||
LINUX_VERSION ?= "5.19.14"
|
||||
|
||||
DEPENDS += "${@bb.utils.contains('ARCH', 'x86', 'elfutils-native', '', d)}"
|
||||
DEPENDS += "openssl-native util-linux-native"
|
||||
|
||||
@@ -1,68 +0,0 @@
|
||||
From 8e42c4821fb5f5cb816b6ddf73d9a13ba3298a63 Mon Sep 17 00:00:00 2001
|
||||
From: Michael Jeanson <mjeanson@efficios.com>
|
||||
Date: Wed, 10 Aug 2022 11:07:14 -0400
|
||||
Subject: [PATCH] fix: tie compaction probe build to CONFIG_COMPACTION
|
||||
|
||||
The definition of 'struct compact_control' in 'mm/internal.h' depends on
|
||||
CONFIG_COMPACTION being defined. Only build the compaction probe when
|
||||
this configuration option is enabled.
|
||||
|
||||
Thanks to Bruce Ashfield <bruce.ashfield@gmail.com> for reporting this
|
||||
issue.
|
||||
|
||||
Upstream-Status: Backport [https://review.lttng.org/c/lttng-modules/+/8660]
|
||||
|
||||
Change-Id: I81e77aa9c1bf10452c152d432fe5224df0db42c9
|
||||
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
|
||||
---
|
||||
src/probes/Kbuild | 34 ++++++++++++++++++----------------
|
||||
1 file changed, 18 insertions(+), 16 deletions(-)
|
||||
|
||||
diff --git a/src/probes/Kbuild b/src/probes/Kbuild
|
||||
index 2908cf75..3e556b8e 100644
|
||||
--- a/src/probes/Kbuild
|
||||
+++ b/src/probes/Kbuild
|
||||
@@ -167,22 +167,24 @@ ifneq ($(CONFIG_BTRFS_FS),)
|
||||
endif # $(wildcard $(btrfs_dep))
|
||||
endif # CONFIG_BTRFS_FS
|
||||
|
||||
-# A dependency on internal header 'mm/internal.h' was introduced in v5.18
|
||||
-compaction_dep = $(srctree)/mm/internal.h
|
||||
-compaction_dep_wildcard = $(wildcard $(compaction_dep))
|
||||
-compaction_dep_check = $(shell \
|
||||
-if [ \( $(VERSION) -ge 6 \
|
||||
- -o \( $(VERSION) -eq 5 -a $(PATCHLEVEL) -ge 18 \) \) -a \
|
||||
- -z "$(compaction_dep_wildcard)" ] ; then \
|
||||
- echo "warn" ; \
|
||||
-else \
|
||||
- echo "ok" ; \
|
||||
-fi ;)
|
||||
-ifeq ($(compaction_dep_check),ok)
|
||||
- obj-$(CONFIG_LTTNG) += lttng-probe-compaction.o
|
||||
-else
|
||||
- $(warning Files $(compaction_dep) not found. Probe "compaction" is disabled. Use full kernel source tree to enable it.)
|
||||
-endif # $(wildcard $(compaction_dep))
|
||||
+ifneq ($(CONFIG_COMPACTION),)
|
||||
+ # A dependency on internal header 'mm/internal.h' was introduced in v5.18
|
||||
+ compaction_dep = $(srctree)/mm/internal.h
|
||||
+ compaction_dep_wildcard = $(wildcard $(compaction_dep))
|
||||
+ compaction_dep_check = $(shell \
|
||||
+ if [ \( $(VERSION) -ge 6 \
|
||||
+ -o \( $(VERSION) -eq 5 -a $(PATCHLEVEL) -ge 18 \) \) -a \
|
||||
+ -z "$(compaction_dep_wildcard)" ] ; then \
|
||||
+ echo "warn" ; \
|
||||
+ else \
|
||||
+ echo "ok" ; \
|
||||
+ fi ;)
|
||||
+ ifeq ($(compaction_dep_check),ok)
|
||||
+ obj-$(CONFIG_LTTNG) += lttng-probe-compaction.o
|
||||
+ else
|
||||
+ $(warning Files $(compaction_dep) not found. Probe "compaction" is disabled. Use full kernel source tree to enable it.)
|
||||
+ endif # $(wildcard $(compaction_dep))
|
||||
+endif # CONFIG_COMPACTION
|
||||
|
||||
ifneq ($(CONFIG_EXT4_FS),)
|
||||
ext4_dep = $(srctree)/fs/ext4/*.h
|
||||
--
|
||||
2.34.1
|
||||
|
||||
@@ -1,106 +0,0 @@
|
||||
From 8d5da4d2a3d7d9173208f4e8dc7a709f0bfc9820 Mon Sep 17 00:00:00 2001
|
||||
From: Michael Jeanson <mjeanson@efficios.com>
|
||||
Date: Wed, 8 Jun 2022 12:56:36 -0400
|
||||
Subject: [PATCH 1/3] fix: mm/page_alloc: fix tracepoint
|
||||
mm_page_alloc_zone_locked() (v5.19)
|
||||
|
||||
See upstream commit :
|
||||
|
||||
commit 10e0f7530205799e7e971aba699a7cb3a47456de
|
||||
Author: Wonhyuk Yang <vvghjk1234@gmail.com>
|
||||
Date: Thu May 19 14:08:54 2022 -0700
|
||||
|
||||
mm/page_alloc: fix tracepoint mm_page_alloc_zone_locked()
|
||||
|
||||
Currently, trace point mm_page_alloc_zone_locked() doesn't show correct
|
||||
information.
|
||||
|
||||
First, when alloc_flag has ALLOC_HARDER/ALLOC_CMA, page can be allocated
|
||||
from MIGRATE_HIGHATOMIC/MIGRATE_CMA. Nevertheless, tracepoint use
|
||||
requested migration type not MIGRATE_HIGHATOMIC and MIGRATE_CMA.
|
||||
|
||||
Second, after commit 44042b4498728 ("mm/page_alloc: allow high-order pages
|
||||
to be stored on the per-cpu lists") percpu-list can store high order
|
||||
pages. But trace point determine whether it is a refiil of percpu-list by
|
||||
comparing requested order and 0.
|
||||
|
||||
To handle these problems, make mm_page_alloc_zone_locked() only be called
|
||||
by __rmqueue_smallest with correct migration type. With a new argument
|
||||
called percpu_refill, it can show roughly whether it is a refill of
|
||||
percpu-list.
|
||||
|
||||
Upstream-Status: Backport
|
||||
|
||||
Change-Id: I2e4a57393757f12b9c5a4566c4d1102ee2474a09
|
||||
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
|
||||
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
|
||||
---
|
||||
include/instrumentation/events/kmem.h | 45 +++++++++++++++++++++++++++
|
||||
1 file changed, 45 insertions(+)
|
||||
|
||||
diff --git a/include/instrumentation/events/kmem.h b/include/instrumentation/events/kmem.h
|
||||
index 29c0fb7f..8c19e962 100644
|
||||
--- a/include/instrumentation/events/kmem.h
|
||||
+++ b/include/instrumentation/events/kmem.h
|
||||
@@ -218,6 +218,50 @@ LTTNG_TRACEPOINT_EVENT_MAP(mm_page_alloc, kmem_mm_page_alloc,
|
||||
)
|
||||
)
|
||||
|
||||
+#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,19,0))
|
||||
+LTTNG_TRACEPOINT_EVENT_CLASS(kmem_mm_page,
|
||||
+
|
||||
+ TP_PROTO(struct page *page, unsigned int order, int migratetype,
|
||||
+ int percpu_refill),
|
||||
+
|
||||
+ TP_ARGS(page, order, migratetype, percpu_refill),
|
||||
+
|
||||
+ TP_FIELDS(
|
||||
+ ctf_integer_hex(struct page *, page, page)
|
||||
+ ctf_integer(unsigned long, pfn,
|
||||
+ page ? page_to_pfn(page) : -1UL)
|
||||
+ ctf_integer(unsigned int, order, order)
|
||||
+ ctf_integer(int, migratetype, migratetype)
|
||||
+ ctf_integer(int, percpu_refill, percpu_refill)
|
||||
+ )
|
||||
+)
|
||||
+
|
||||
+LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(kmem_mm_page, mm_page_alloc_zone_locked,
|
||||
+
|
||||
+ kmem_mm_page_alloc_zone_locked,
|
||||
+
|
||||
+ TP_PROTO(struct page *page, unsigned int order, int migratetype,
|
||||
+ int percpu_refill),
|
||||
+
|
||||
+ TP_ARGS(page, order, migratetype, percpu_refill)
|
||||
+)
|
||||
+
|
||||
+LTTNG_TRACEPOINT_EVENT_MAP(mm_page_pcpu_drain,
|
||||
+
|
||||
+ kmem_mm_page_pcpu_drain,
|
||||
+
|
||||
+ TP_PROTO(struct page *page, unsigned int order, int migratetype),
|
||||
+
|
||||
+ TP_ARGS(page, order, migratetype),
|
||||
+
|
||||
+ TP_FIELDS(
|
||||
+ ctf_integer(unsigned long, pfn,
|
||||
+ page ? page_to_pfn(page) : -1UL)
|
||||
+ ctf_integer(unsigned int, order, order)
|
||||
+ ctf_integer(int, migratetype, migratetype)
|
||||
+ )
|
||||
+)
|
||||
+#else
|
||||
LTTNG_TRACEPOINT_EVENT_CLASS(kmem_mm_page,
|
||||
|
||||
TP_PROTO(struct page *page, unsigned int order, int migratetype),
|
||||
@@ -250,6 +294,7 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(kmem_mm_page, mm_page_pcpu_drain,
|
||||
|
||||
TP_ARGS(page, order, migratetype)
|
||||
)
|
||||
+#endif
|
||||
|
||||
#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,19,2) \
|
||||
|| LTTNG_KERNEL_RANGE(3,14,36, 3,15,0) \
|
||||
--
|
||||
2.19.1
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
From d8254360c7f2ff9b3f945e9668d89c0b56b9bd91 Mon Sep 17 00:00:00 2001
|
||||
From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
|
||||
Date: Fri, 29 Jul 2022 15:37:43 -0400
|
||||
Subject: [PATCH] fix: net: skb: introduce kfree_skb_reason() (v5.15.58..v5.16)
|
||||
|
||||
See upstream commit :
|
||||
|
||||
commit c504e5c2f9648a1e5c2be01e8c3f59d394192bd3
|
||||
Author: Menglong Dong <imagedong@tencent.com>
|
||||
Date: Sun Jan 9 14:36:26 2022 +0800
|
||||
|
||||
net: skb: introduce kfree_skb_reason()
|
||||
|
||||
Introduce the interface kfree_skb_reason(), which is able to pass
|
||||
the reason why the skb is dropped to 'kfree_skb' tracepoint.
|
||||
|
||||
Add the 'reason' field to 'trace_kfree_skb', therefor user can get
|
||||
more detail information about abnormal skb with 'drop_monitor' or
|
||||
eBPF.
|
||||
|
||||
All drop reasons are defined in the enum 'skb_drop_reason', and
|
||||
they will be print as string in 'kfree_skb' tracepoint in format
|
||||
of 'reason: XXX'.
|
||||
|
||||
( Maybe the reasons should be defined in a uapi header file, so that
|
||||
user space can use them? )
|
||||
|
||||
Upstream-Status: Backport
|
||||
|
||||
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
|
||||
Change-Id: Ib3c039207739dad10f097cf76474e0822e351273
|
||||
---
|
||||
include/instrumentation/events/skb.h | 4 +++-
|
||||
1 file changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/include/instrumentation/events/skb.h b/include/instrumentation/events/skb.h
|
||||
index 237e54ad..186732ea 100644
|
||||
--- a/include/instrumentation/events/skb.h
|
||||
+++ b/include/instrumentation/events/skb.h
|
||||
@@ -13,7 +13,9 @@
|
||||
/*
|
||||
* Tracepoint for free an sk_buff:
|
||||
*/
|
||||
-#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,17,0))
|
||||
+#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,17,0) \
|
||||
+ || LTTNG_KERNEL_RANGE(5,15,58, 5,16,0))
|
||||
+
|
||||
LTTNG_TRACEPOINT_ENUM(skb_drop_reason,
|
||||
TP_ENUM_VALUES(
|
||||
ctf_enum_value("NOT_SPECIFIED", SKB_DROP_REASON_NOT_SPECIFIED)
|
||||
--
|
||||
2.17.1
|
||||
|
||||
@@ -1,76 +0,0 @@
|
||||
From b5d1c38665cd69d7d1c94231fe0609da5c8afbc3 Mon Sep 17 00:00:00 2001
|
||||
From: Michael Jeanson <mjeanson@efficios.com>
|
||||
Date: Wed, 8 Jun 2022 13:07:59 -0400
|
||||
Subject: [PATCH 2/3] fix: fs: Remove flags parameter from aops->write_begin
|
||||
(v5.19)
|
||||
|
||||
See upstream commit :
|
||||
|
||||
commit 9d6b0cd7579844761ed68926eb3073bab1dca87b
|
||||
Author: Matthew Wilcox (Oracle) <willy@infradead.org>
|
||||
Date: Tue Feb 22 14:31:43 2022 -0500
|
||||
|
||||
fs: Remove flags parameter from aops->write_begin
|
||||
|
||||
There are no more aop flags left, so remove the parameter.
|
||||
|
||||
Upstream-Status: Backport
|
||||
|
||||
Change-Id: I82725b93e13d749f52a631b2ac60df81a5e839f8
|
||||
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
|
||||
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
|
||||
---
|
||||
include/instrumentation/events/ext4.h | 30 +++++++++++++++++++++++++++
|
||||
1 file changed, 30 insertions(+)
|
||||
|
||||
diff --git a/include/instrumentation/events/ext4.h b/include/instrumentation/events/ext4.h
|
||||
index 513762c0..222416ec 100644
|
||||
--- a/include/instrumentation/events/ext4.h
|
||||
+++ b/include/instrumentation/events/ext4.h
|
||||
@@ -122,6 +122,35 @@ LTTNG_TRACEPOINT_EVENT(ext4_begin_ordered_truncate,
|
||||
)
|
||||
)
|
||||
|
||||
+#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,19,0))
|
||||
+LTTNG_TRACEPOINT_EVENT_CLASS(ext4__write_begin,
|
||||
+
|
||||
+ TP_PROTO(struct inode *inode, loff_t pos, unsigned int len),
|
||||
+
|
||||
+ TP_ARGS(inode, pos, len),
|
||||
+
|
||||
+ TP_FIELDS(
|
||||
+ ctf_integer(dev_t, dev, inode->i_sb->s_dev)
|
||||
+ ctf_integer(ino_t, ino, inode->i_ino)
|
||||
+ ctf_integer(loff_t, pos, pos)
|
||||
+ ctf_integer(unsigned int, len, len)
|
||||
+ )
|
||||
+)
|
||||
+
|
||||
+LTTNG_TRACEPOINT_EVENT_INSTANCE(ext4__write_begin, ext4_write_begin,
|
||||
+
|
||||
+ TP_PROTO(struct inode *inode, loff_t pos, unsigned int len),
|
||||
+
|
||||
+ TP_ARGS(inode, pos, len)
|
||||
+)
|
||||
+
|
||||
+LTTNG_TRACEPOINT_EVENT_INSTANCE(ext4__write_begin, ext4_da_write_begin,
|
||||
+
|
||||
+ TP_PROTO(struct inode *inode, loff_t pos, unsigned int len),
|
||||
+
|
||||
+ TP_ARGS(inode, pos, len)
|
||||
+)
|
||||
+#else
|
||||
LTTNG_TRACEPOINT_EVENT_CLASS(ext4__write_begin,
|
||||
|
||||
TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
|
||||
@@ -153,6 +182,7 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(ext4__write_begin, ext4_da_write_begin,
|
||||
|
||||
TP_ARGS(inode, pos, len, flags)
|
||||
)
|
||||
+#endif
|
||||
|
||||
LTTNG_TRACEPOINT_EVENT_CLASS(ext4__write_end,
|
||||
TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
|
||||
--
|
||||
2.19.1
|
||||
|
||||
@@ -1,124 +0,0 @@
|
||||
From 526f13c844cd29f89bd3e924867d9ddfe3c40ade Mon Sep 17 00:00:00 2001
|
||||
From: Michael Jeanson <mjeanson@efficios.com>
|
||||
Date: Wed, 15 Jun 2022 12:07:16 -0400
|
||||
Subject: [PATCH 3/3] fix: workqueue: Fix type of cpu in trace event (v5.19)
|
||||
|
||||
See upstream commit :
|
||||
|
||||
commit 873a400938b31a1e443c4d94b560b78300787540
|
||||
Author: Wonhyuk Yang <vvghjk1234@gmail.com>
|
||||
Date: Wed May 4 11:32:03 2022 +0900
|
||||
|
||||
workqueue: Fix type of cpu in trace event
|
||||
|
||||
The trace event "workqueue_queue_work" use unsigned int type for
|
||||
req_cpu, cpu. This casue confusing cpu number like below log.
|
||||
|
||||
$ cat /sys/kernel/debug/tracing/trace
|
||||
cat-317 [001] ...: workqueue_queue_work: ... req_cpu=8192 cpu=4294967295
|
||||
|
||||
So, change unsigned type to signed type in the trace event. After
|
||||
applying this patch, cpu number will be printed as -1 instead of
|
||||
4294967295 as folllows.
|
||||
|
||||
$ cat /sys/kernel/debug/tracing/trace
|
||||
cat-1338 [002] ...: workqueue_queue_work: ... req_cpu=8192 cpu=-1
|
||||
|
||||
Upstream-Status: Backport
|
||||
|
||||
Change-Id: I478083c350b6ec314d87e9159dc5b342b96daed7
|
||||
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
|
||||
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
|
||||
---
|
||||
include/instrumentation/events/workqueue.h | 49 ++++++++++++++++++++--
|
||||
1 file changed, 46 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/include/instrumentation/events/workqueue.h b/include/instrumentation/events/workqueue.h
|
||||
index 023b65a8..5693cf89 100644
|
||||
--- a/include/instrumentation/events/workqueue.h
|
||||
+++ b/include/instrumentation/events/workqueue.h
|
||||
@@ -28,10 +28,35 @@ LTTNG_TRACEPOINT_EVENT_CLASS(workqueue_work,
|
||||
)
|
||||
)
|
||||
|
||||
+#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,19,0))
|
||||
/**
|
||||
* workqueue_queue_work - called when a work gets queued
|
||||
* @req_cpu: the requested cpu
|
||||
- * @cwq: pointer to struct cpu_workqueue_struct
|
||||
+ * @pwq: pointer to struct pool_workqueue
|
||||
+ * @work: pointer to struct work_struct
|
||||
+ *
|
||||
+ * This event occurs when a work is queued immediately or once a
|
||||
+ * delayed work is actually queued on a workqueue (ie: once the delay
|
||||
+ * has been reached).
|
||||
+ */
|
||||
+LTTNG_TRACEPOINT_EVENT(workqueue_queue_work,
|
||||
+
|
||||
+ TP_PROTO(int req_cpu, struct pool_workqueue *pwq,
|
||||
+ struct work_struct *work),
|
||||
+
|
||||
+ TP_ARGS(req_cpu, pwq, work),
|
||||
+
|
||||
+ TP_FIELDS(
|
||||
+ ctf_integer_hex(void *, work, work)
|
||||
+ ctf_integer_hex(void *, function, work->func)
|
||||
+ ctf_integer(int, req_cpu, req_cpu)
|
||||
+ )
|
||||
+)
|
||||
+#elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,9,0))
|
||||
+/**
|
||||
+ * workqueue_queue_work - called when a work gets queued
|
||||
+ * @req_cpu: the requested cpu
|
||||
+ * @pwq: pointer to struct pool_workqueue
|
||||
* @work: pointer to struct work_struct
|
||||
*
|
||||
* This event occurs when a work is queued immediately or once a
|
||||
@@ -40,17 +65,34 @@ LTTNG_TRACEPOINT_EVENT_CLASS(workqueue_work,
|
||||
*/
|
||||
LTTNG_TRACEPOINT_EVENT(workqueue_queue_work,
|
||||
|
||||
-#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,9,0))
|
||||
TP_PROTO(unsigned int req_cpu, struct pool_workqueue *pwq,
|
||||
struct work_struct *work),
|
||||
|
||||
TP_ARGS(req_cpu, pwq, work),
|
||||
+
|
||||
+ TP_FIELDS(
|
||||
+ ctf_integer_hex(void *, work, work)
|
||||
+ ctf_integer_hex(void *, function, work->func)
|
||||
+ ctf_integer(unsigned int, req_cpu, req_cpu)
|
||||
+ )
|
||||
+)
|
||||
#else
|
||||
+/**
|
||||
+ * workqueue_queue_work - called when a work gets queued
|
||||
+ * @req_cpu: the requested cpu
|
||||
+ * @cwq: pointer to struct cpu_workqueue_struct
|
||||
+ * @work: pointer to struct work_struct
|
||||
+ *
|
||||
+ * This event occurs when a work is queued immediately or once a
|
||||
+ * delayed work is actually queued on a workqueue (ie: once the delay
|
||||
+ * has been reached).
|
||||
+ */
|
||||
+LTTNG_TRACEPOINT_EVENT(workqueue_queue_work,
|
||||
+
|
||||
TP_PROTO(unsigned int req_cpu, struct cpu_workqueue_struct *cwq,
|
||||
struct work_struct *work),
|
||||
|
||||
TP_ARGS(req_cpu, cwq, work),
|
||||
-#endif
|
||||
|
||||
TP_FIELDS(
|
||||
ctf_integer_hex(void *, work, work)
|
||||
@@ -58,6 +100,7 @@ LTTNG_TRACEPOINT_EVENT(workqueue_queue_work,
|
||||
ctf_integer(unsigned int, req_cpu, req_cpu)
|
||||
)
|
||||
)
|
||||
+#endif
|
||||
|
||||
/**
|
||||
* workqueue_activate_work - called when a work gets activated
|
||||
--
|
||||
2.19.1
|
||||
|
||||
@@ -11,17 +11,12 @@ include lttng-platforms.inc
|
||||
|
||||
SRC_URI = "https://lttng.org/files/${BPN}/${BPN}-${PV}.tar.bz2 \
|
||||
file://0009-Rename-genhd-wrapper-to-blkdev.patch \
|
||||
file://0001-fix-mm-page_alloc-fix-tracepoint-mm_page_alloc_zone_.patch \
|
||||
file://0002-fix-fs-Remove-flags-parameter-from-aops-write_begin-.patch \
|
||||
file://0003-fix-workqueue-Fix-type-of-cpu-in-trace-event-v5.19.patch \
|
||||
file://0001-fix-net-skb-introduce-kfree_skb_reason-v5.15.58.v5.1.patch \
|
||||
file://0001-fix-compaction.patch \
|
||||
"
|
||||
|
||||
# Use :append here so that the patch is applied also when using devupstream
|
||||
SRC_URI:append = " file://0001-src-Kbuild-change-missing-CONFIG_TRACEPOINTS-to-warn.patch"
|
||||
|
||||
SRC_URI[sha256sum] = "6159d00e4e1d59546eec8d4a67e1aa39c1084ceb5e5afeb666eab4b8a5b5a9ee"
|
||||
SRC_URI[sha256sum] = "eceb3428d80e85a9f008425beb9526195c9f7f02b302f28add56df53aef3e708"
|
||||
|
||||
export INSTALL_MOD_DIR="kernel/lttng-modules"
|
||||
|
||||
@@ -34,7 +34,7 @@ SRC_URI = "https://lttng.org/files/lttng-ust/lttng-ust-${PV}.tar.bz2 \
|
||||
file://0001-Makefile.am-update-rpath-link.patch \
|
||||
"
|
||||
|
||||
SRC_URI[sha256sum] = "698f82ec5dc56e981c0bb08c46ebabaf31c60e877c2e365b9fd6d3a9fff8b398"
|
||||
SRC_URI[sha256sum] = "f1d7bb4984a3dc5dacd3b7bcb4c10c04b041b0eecd7cba1fef3d8f86aff02bd6"
|
||||
|
||||
CVE_PRODUCT = "ust"
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
From 78a97c1ec35ada76d83fc67d0549ba56c74d8875 Mon Sep 17 00:00:00 2001
|
||||
From: Seungha Yang <seungha@centricular.com>
|
||||
Date: Thu, 7 Jul 2022 22:16:30 +0900
|
||||
Subject: [PATCH] libav: Fix for APNG encoder property registration
|
||||
|
||||
The AVClass name of Animated PNG in FFmpeg 5.x is "(A)PNG"
|
||||
and it will be converted to "-a-png" through
|
||||
g_ascii_strdown() and g_strcanon(). But GLib disallow leading '-'
|
||||
character for a GType name. Strip leading '-' to workaround it.
|
||||
|
||||
Upstream-Status: Backport [https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2724]
|
||||
|
||||
Seungha Yangs patch was imported without modifications.
|
||||
|
||||
Signed-off-by: Claus Stovgaard <claus.stovgaard@gmail.com>
|
||||
---
|
||||
ext/libav/gstavcfg.c | 29 +++++++++++++++++++++++------
|
||||
1 file changed, 23 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/ext/libav/gstavcfg.c b/ext/libav/gstavcfg.c
|
||||
index c736920..a8635a7 100644
|
||||
--- a/ext/libav/gstavcfg.c
|
||||
+++ b/ext/libav/gstavcfg.c
|
||||
@@ -91,10 +91,19 @@ register_enum (const AVClass ** obj, const AVOption * top_opt)
|
||||
gchar *lower_obj_name = g_ascii_strdown ((*obj)->class_name, -1);
|
||||
gchar *enum_name = g_strdup_printf ("%s-%s", lower_obj_name, top_opt->unit);
|
||||
gboolean none_default = TRUE;
|
||||
+ const gchar *enum_name_strip;
|
||||
|
||||
g_strcanon (enum_name, G_CSET_a_2_z G_CSET_DIGITS, '-');
|
||||
|
||||
- if ((res = g_type_from_name (enum_name)))
|
||||
+ /* strip leading '-'s */
|
||||
+ enum_name_strip = enum_name;
|
||||
+ while (enum_name_strip[0] == '-')
|
||||
+ enum_name_strip++;
|
||||
+
|
||||
+ if (enum_name_strip[0] == '\0')
|
||||
+ goto done;
|
||||
+
|
||||
+ if ((res = g_type_from_name (enum_name_strip)))
|
||||
goto done;
|
||||
|
||||
while ((opt = av_opt_next (obj, opt))) {
|
||||
@@ -150,9 +159,8 @@ register_enum (const AVClass ** obj, const AVOption * top_opt)
|
||||
}
|
||||
}
|
||||
|
||||
- res =
|
||||
- g_enum_register_static (enum_name, &g_array_index (values, GEnumValue,
|
||||
- 0));
|
||||
+ res = g_enum_register_static (enum_name_strip,
|
||||
+ &g_array_index (values, GEnumValue, 0));
|
||||
|
||||
gst_type_mark_as_plugin_api (res, 0);
|
||||
}
|
||||
@@ -177,10 +185,19 @@ register_flags (const AVClass ** obj, const AVOption * top_opt)
|
||||
GArray *values = g_array_new (TRUE, TRUE, sizeof (GEnumValue));
|
||||
gchar *lower_obj_name = g_ascii_strdown ((*obj)->class_name, -1);
|
||||
gchar *flags_name = g_strdup_printf ("%s-%s", lower_obj_name, top_opt->unit);
|
||||
+ const gchar *flags_name_strip;
|
||||
|
||||
g_strcanon (flags_name, G_CSET_a_2_z G_CSET_DIGITS, '-');
|
||||
|
||||
- if ((res = g_type_from_name (flags_name)))
|
||||
+ /* strip leading '-'s */
|
||||
+ flags_name_strip = flags_name;
|
||||
+ while (flags_name_strip[0] == '-')
|
||||
+ flags_name_strip++;
|
||||
+
|
||||
+ if (flags_name_strip[0] == '\0')
|
||||
+ goto done;
|
||||
+
|
||||
+ if ((res = g_type_from_name (flags_name_strip)))
|
||||
goto done;
|
||||
|
||||
while ((opt = av_opt_next (obj, opt))) {
|
||||
@@ -211,7 +228,7 @@ register_flags (const AVClass ** obj, const AVOption * top_opt)
|
||||
g_array_sort (values, (GCompareFunc) cmp_flags_value);
|
||||
|
||||
res =
|
||||
- g_flags_register_static (flags_name, &g_array_index (values,
|
||||
+ g_flags_register_static (flags_name_strip, &g_array_index (values,
|
||||
GFlagsValue, 0));
|
||||
|
||||
gst_type_mark_as_plugin_api (res, 0);
|
||||
@@ -11,7 +11,9 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=69333daa044cb77e486cc36129f7a770 \
|
||||
file://ext/libav/gstav.h;beginline=1;endline=18;md5=a752c35267d8276fd9ca3db6994fca9c \
|
||||
"
|
||||
|
||||
SRC_URI = "https://gstreamer.freedesktop.org/src/gst-libav/gst-libav-${PV}.tar.xz"
|
||||
SRC_URI = "https://gstreamer.freedesktop.org/src/gst-libav/gst-libav-${PV}.tar.xz \
|
||||
file://0001-libav-Fix-for-APNG-encoder-property-registration.patch \
|
||||
"
|
||||
SRC_URI[sha256sum] = "3fedd10560fcdfaa1b6462cbf79a38c4e7b57d7f390359393fc0cef6dbf27dfe"
|
||||
|
||||
S = "${WORKDIR}/gst-libav-${PV}"
|
||||
|
||||
@@ -0,0 +1,266 @@
|
||||
CVE: CVE-2022-3599
|
||||
Upstream-Status: Backport
|
||||
Signed-off-by: Ross Burton <ross.burton@arm.com>
|
||||
|
||||
From f00484b9519df933723deb38fff943dc291a793d Mon Sep 17 00:00:00 2001
|
||||
From: Su_Laus <sulau@freenet.de>
|
||||
Date: Tue, 30 Aug 2022 16:56:48 +0200
|
||||
Subject: [PATCH] Revised handling of TIFFTAG_INKNAMES and related
|
||||
TIFFTAG_NUMBEROFINKS value
|
||||
|
||||
In order to solve the buffer overflow issues related to TIFFTAG_INKNAMES and related TIFFTAG_NUMBEROFINKS value, a revised handling of those tags within LibTiff is proposed:
|
||||
|
||||
Behaviour for writing:
|
||||
`NumberOfInks` MUST fit to the number of inks in the `InkNames` string.
|
||||
`NumberOfInks` is automatically set when `InkNames` is set.
|
||||
If `NumberOfInks` is different to the number of inks within `InkNames` string, that will be corrected and a warning is issued.
|
||||
If `NumberOfInks` is not equal to samplesperpixel only a warning will be issued.
|
||||
|
||||
Behaviour for reading:
|
||||
When reading `InkNames` from a TIFF file, the `NumberOfInks` will be set automatically to the number of inks in `InkNames` string.
|
||||
If `NumberOfInks` is different to the number of inks within `InkNames` string, that will be corrected and a warning is issued.
|
||||
If `NumberOfInks` is not equal to samplesperpixel only a warning will be issued.
|
||||
|
||||
This allows the safe use of the NumberOfInks value to read out the InkNames without buffer overflow
|
||||
|
||||
This MR will close the following issues: #149, #150, #152, #168 (to be checked), #250, #269, #398 and #456.
|
||||
|
||||
It also fixes the old bug at http://bugzilla.maptools.org/show_bug.cgi?id=2599, for which the limitation of `NumberOfInks = SPP` was introduced, which is in my opinion not necessary and does not solve the general issue.
|
||||
---
|
||||
libtiff/tif_dir.c | 119 ++++++++++++++++++++++++-----------------
|
||||
libtiff/tif_dir.h | 2 +
|
||||
libtiff/tif_dirinfo.c | 2 +-
|
||||
libtiff/tif_dirwrite.c | 5 ++
|
||||
libtiff/tif_print.c | 4 ++
|
||||
5 files changed, 82 insertions(+), 50 deletions(-)
|
||||
|
||||
diff --git a/libtiff/tif_dir.c b/libtiff/tif_dir.c
|
||||
index 793e8a79..816f7756 100644
|
||||
--- a/libtiff/tif_dir.c
|
||||
+++ b/libtiff/tif_dir.c
|
||||
@@ -136,32 +136,30 @@ setExtraSamples(TIFF* tif, va_list ap, uint32_t* v)
|
||||
}
|
||||
|
||||
/*
|
||||
- * Confirm we have "samplesperpixel" ink names separated by \0. Returns
|
||||
+ * Count ink names separated by \0. Returns
|
||||
* zero if the ink names are not as expected.
|
||||
*/
|
||||
-static uint32_t
|
||||
-checkInkNamesString(TIFF* tif, uint32_t slen, const char* s)
|
||||
+static uint16_t
|
||||
+countInkNamesString(TIFF *tif, uint32_t slen, const char *s)
|
||||
{
|
||||
- TIFFDirectory* td = &tif->tif_dir;
|
||||
- uint16_t i = td->td_samplesperpixel;
|
||||
+ uint16_t i = 0;
|
||||
+ const char *ep = s + slen;
|
||||
+ const char *cp = s;
|
||||
|
||||
if (slen > 0) {
|
||||
- const char* ep = s+slen;
|
||||
- const char* cp = s;
|
||||
- for (; i > 0; i--) {
|
||||
+ do {
|
||||
for (; cp < ep && *cp != '\0'; cp++) {}
|
||||
if (cp >= ep)
|
||||
goto bad;
|
||||
cp++; /* skip \0 */
|
||||
- }
|
||||
- return ((uint32_t)(cp - s));
|
||||
+ i++;
|
||||
+ } while (cp < ep);
|
||||
+ return (i);
|
||||
}
|
||||
bad:
|
||||
TIFFErrorExt(tif->tif_clientdata, "TIFFSetField",
|
||||
- "%s: Invalid InkNames value; expecting %"PRIu16" names, found %"PRIu16,
|
||||
- tif->tif_name,
|
||||
- td->td_samplesperpixel,
|
||||
- (uint16_t)(td->td_samplesperpixel-i));
|
||||
+ "%s: Invalid InkNames value; no NUL at given buffer end location %"PRIu32", after %"PRIu16" ink",
|
||||
+ tif->tif_name, slen, i);
|
||||
return (0);
|
||||
}
|
||||
|
||||
@@ -478,13 +476,61 @@ _TIFFVSetField(TIFF* tif, uint32_t tag, va_list ap)
|
||||
_TIFFsetFloatArray(&td->td_refblackwhite, va_arg(ap, float*), 6);
|
||||
break;
|
||||
case TIFFTAG_INKNAMES:
|
||||
- v = (uint16_t) va_arg(ap, uint16_vap);
|
||||
- s = va_arg(ap, char*);
|
||||
- v = checkInkNamesString(tif, v, s);
|
||||
- status = v > 0;
|
||||
- if( v > 0 ) {
|
||||
- _TIFFsetNString(&td->td_inknames, s, v);
|
||||
- td->td_inknameslen = v;
|
||||
+ {
|
||||
+ v = (uint16_t) va_arg(ap, uint16_vap);
|
||||
+ s = va_arg(ap, char*);
|
||||
+ uint16_t ninksinstring;
|
||||
+ ninksinstring = countInkNamesString(tif, v, s);
|
||||
+ status = ninksinstring > 0;
|
||||
+ if(ninksinstring > 0 ) {
|
||||
+ _TIFFsetNString(&td->td_inknames, s, v);
|
||||
+ td->td_inknameslen = v;
|
||||
+ /* Set NumberOfInks to the value ninksinstring */
|
||||
+ if (TIFFFieldSet(tif, FIELD_NUMBEROFINKS))
|
||||
+ {
|
||||
+ if (td->td_numberofinks != ninksinstring) {
|
||||
+ TIFFErrorExt(tif->tif_clientdata, module,
|
||||
+ "Warning %s; Tag %s:\n Value %"PRIu16" of NumberOfInks is different from the number of inks %"PRIu16".\n -> NumberOfInks value adapted to %"PRIu16"",
|
||||
+ tif->tif_name, fip->field_name, td->td_numberofinks, ninksinstring, ninksinstring);
|
||||
+ td->td_numberofinks = ninksinstring;
|
||||
+ }
|
||||
+ } else {
|
||||
+ td->td_numberofinks = ninksinstring;
|
||||
+ TIFFSetFieldBit(tif, FIELD_NUMBEROFINKS);
|
||||
+ }
|
||||
+ if (TIFFFieldSet(tif, FIELD_SAMPLESPERPIXEL))
|
||||
+ {
|
||||
+ if (td->td_numberofinks != td->td_samplesperpixel) {
|
||||
+ TIFFErrorExt(tif->tif_clientdata, module,
|
||||
+ "Warning %s; Tag %s:\n Value %"PRIu16" of NumberOfInks is different from the SamplesPerPixel value %"PRIu16"",
|
||||
+ tif->tif_name, fip->field_name, td->td_numberofinks, td->td_samplesperpixel);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ break;
|
||||
+ case TIFFTAG_NUMBEROFINKS:
|
||||
+ v = (uint16_t)va_arg(ap, uint16_vap);
|
||||
+ /* If InkNames already set also NumberOfInks is set accordingly and should be equal */
|
||||
+ if (TIFFFieldSet(tif, FIELD_INKNAMES))
|
||||
+ {
|
||||
+ if (v != td->td_numberofinks) {
|
||||
+ TIFFErrorExt(tif->tif_clientdata, module,
|
||||
+ "Error %s; Tag %s:\n It is not possible to set the value %"PRIu32" for NumberOfInks\n which is different from the number of inks in the InkNames tag (%"PRIu16")",
|
||||
+ tif->tif_name, fip->field_name, v, td->td_numberofinks);
|
||||
+ /* Do not set / overwrite number of inks already set by InkNames case accordingly. */
|
||||
+ status = 0;
|
||||
+ }
|
||||
+ } else {
|
||||
+ td->td_numberofinks = (uint16_t)v;
|
||||
+ if (TIFFFieldSet(tif, FIELD_SAMPLESPERPIXEL))
|
||||
+ {
|
||||
+ if (td->td_numberofinks != td->td_samplesperpixel) {
|
||||
+ TIFFErrorExt(tif->tif_clientdata, module,
|
||||
+ "Warning %s; Tag %s:\n Value %"PRIu32" of NumberOfInks is different from the SamplesPerPixel value %"PRIu16"",
|
||||
+ tif->tif_name, fip->field_name, v, td->td_samplesperpixel);
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
break;
|
||||
case TIFFTAG_PERSAMPLE:
|
||||
@@ -986,34 +1032,6 @@ _TIFFVGetField(TIFF* tif, uint32_t tag, va_list ap)
|
||||
if (fip->field_bit == FIELD_CUSTOM) {
|
||||
standard_tag = 0;
|
||||
}
|
||||
-
|
||||
- if( standard_tag == TIFFTAG_NUMBEROFINKS )
|
||||
- {
|
||||
- int i;
|
||||
- for (i = 0; i < td->td_customValueCount; i++) {
|
||||
- uint16_t val;
|
||||
- TIFFTagValue *tv = td->td_customValues + i;
|
||||
- if (tv->info->field_tag != standard_tag)
|
||||
- continue;
|
||||
- if( tv->value == NULL )
|
||||
- return 0;
|
||||
- val = *(uint16_t *)tv->value;
|
||||
- /* Truncate to SamplesPerPixel, since the */
|
||||
- /* setting code for INKNAMES assume that there are SamplesPerPixel */
|
||||
- /* inknames. */
|
||||
- /* Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2599 */
|
||||
- if( val > td->td_samplesperpixel )
|
||||
- {
|
||||
- TIFFWarningExt(tif->tif_clientdata,"_TIFFVGetField",
|
||||
- "Truncating NumberOfInks from %u to %"PRIu16,
|
||||
- val, td->td_samplesperpixel);
|
||||
- val = td->td_samplesperpixel;
|
||||
- }
|
||||
- *va_arg(ap, uint16_t*) = val;
|
||||
- return 1;
|
||||
- }
|
||||
- return 0;
|
||||
- }
|
||||
|
||||
switch (standard_tag) {
|
||||
case TIFFTAG_SUBFILETYPE:
|
||||
@@ -1195,6 +1213,9 @@ _TIFFVGetField(TIFF* tif, uint32_t tag, va_list ap)
|
||||
case TIFFTAG_INKNAMES:
|
||||
*va_arg(ap, const char**) = td->td_inknames;
|
||||
break;
|
||||
+ case TIFFTAG_NUMBEROFINKS:
|
||||
+ *va_arg(ap, uint16_t *) = td->td_numberofinks;
|
||||
+ break;
|
||||
default:
|
||||
{
|
||||
int i;
|
||||
diff --git a/libtiff/tif_dir.h b/libtiff/tif_dir.h
|
||||
index 09065648..0c251c9e 100644
|
||||
--- a/libtiff/tif_dir.h
|
||||
+++ b/libtiff/tif_dir.h
|
||||
@@ -117,6 +117,7 @@ typedef struct {
|
||||
/* CMYK parameters */
|
||||
int td_inknameslen;
|
||||
char* td_inknames;
|
||||
+ uint16_t td_numberofinks; /* number of inks in InkNames string */
|
||||
|
||||
int td_customValueCount;
|
||||
TIFFTagValue *td_customValues;
|
||||
@@ -174,6 +175,7 @@ typedef struct {
|
||||
#define FIELD_TRANSFERFUNCTION 44
|
||||
#define FIELD_INKNAMES 46
|
||||
#define FIELD_SUBIFD 49
|
||||
+#define FIELD_NUMBEROFINKS 50
|
||||
/* FIELD_CUSTOM (see tiffio.h) 65 */
|
||||
/* end of support for well-known tags; codec-private tags follow */
|
||||
#define FIELD_CODEC 66 /* base of codec-private tags */
|
||||
diff --git a/libtiff/tif_dirinfo.c b/libtiff/tif_dirinfo.c
|
||||
index 3371cb5c..3b4bcd33 100644
|
||||
--- a/libtiff/tif_dirinfo.c
|
||||
+++ b/libtiff/tif_dirinfo.c
|
||||
@@ -114,7 +114,7 @@ tiffFields[] = {
|
||||
{ TIFFTAG_SUBIFD, -1, -1, TIFF_IFD8, 0, TIFF_SETGET_C16_IFD8, TIFF_SETGET_UNDEFINED, FIELD_SUBIFD, 1, 1, "SubIFD", (TIFFFieldArray*) &tiffFieldArray },
|
||||
{ TIFFTAG_INKSET, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 0, "InkSet", NULL },
|
||||
{ TIFFTAG_INKNAMES, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_C16_ASCII, TIFF_SETGET_UNDEFINED, FIELD_INKNAMES, 1, 1, "InkNames", NULL },
|
||||
- { TIFFTAG_NUMBEROFINKS, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "NumberOfInks", NULL },
|
||||
+ { TIFFTAG_NUMBEROFINKS, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_NUMBEROFINKS, 1, 0, "NumberOfInks", NULL },
|
||||
{ TIFFTAG_DOTRANGE, 2, 2, TIFF_SHORT, 0, TIFF_SETGET_UINT16_PAIR, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 0, "DotRange", NULL },
|
||||
{ TIFFTAG_TARGETPRINTER, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "TargetPrinter", NULL },
|
||||
{ TIFFTAG_EXTRASAMPLES, -1, -1, TIFF_SHORT, 0, TIFF_SETGET_C16_UINT16, TIFF_SETGET_UNDEFINED, FIELD_EXTRASAMPLES, 0, 1, "ExtraSamples", NULL },
|
||||
diff --git a/libtiff/tif_dirwrite.c b/libtiff/tif_dirwrite.c
|
||||
index 6c86fdca..062e4610 100644
|
||||
--- a/libtiff/tif_dirwrite.c
|
||||
+++ b/libtiff/tif_dirwrite.c
|
||||
@@ -626,6 +626,11 @@ TIFFWriteDirectorySec(TIFF* tif, int isimage, int imagedone, uint64_t* pdiroff)
|
||||
if (!TIFFWriteDirectoryTagAscii(tif,&ndir,dir,TIFFTAG_INKNAMES,tif->tif_dir.td_inknameslen,tif->tif_dir.td_inknames))
|
||||
goto bad;
|
||||
}
|
||||
+ if (TIFFFieldSet(tif, FIELD_NUMBEROFINKS))
|
||||
+ {
|
||||
+ if (!TIFFWriteDirectoryTagShort(tif, &ndir, dir, TIFFTAG_NUMBEROFINKS, tif->tif_dir.td_numberofinks))
|
||||
+ goto bad;
|
||||
+ }
|
||||
if (TIFFFieldSet(tif,FIELD_SUBIFD))
|
||||
{
|
||||
if (!TIFFWriteDirectoryTagSubifd(tif,&ndir,dir))
|
||||
diff --git a/libtiff/tif_print.c b/libtiff/tif_print.c
|
||||
index 16ce5780..a91b9e7b 100644
|
||||
--- a/libtiff/tif_print.c
|
||||
+++ b/libtiff/tif_print.c
|
||||
@@ -397,6 +397,10 @@ TIFFPrintDirectory(TIFF* tif, FILE* fd, long flags)
|
||||
}
|
||||
fputs("\n", fd);
|
||||
}
|
||||
+ if (TIFFFieldSet(tif, FIELD_NUMBEROFINKS)) {
|
||||
+ fprintf(fd, " NumberOfInks: %d\n",
|
||||
+ td->td_numberofinks);
|
||||
+ }
|
||||
if (TIFFFieldSet(tif,FIELD_THRESHHOLDING)) {
|
||||
fprintf(fd, " Thresholding: ");
|
||||
switch (td->td_threshholding) {
|
||||
--
|
||||
2.34.1
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
Upstream-Status: Backport
|
||||
Signed-off-by: Ross Burton <ross.burton@arm.com>
|
||||
|
||||
From bad48e90b410df32172006c7876da449ba62cdba Mon Sep 17 00:00:00 2001
|
||||
From: Su_Laus <sulau@freenet.de>
|
||||
Date: Sat, 20 Aug 2022 23:35:26 +0200
|
||||
Subject: [PATCH] tiffcrop -S option: Make decision simpler.
|
||||
|
||||
---
|
||||
tools/tiffcrop.c | 10 +++++-----
|
||||
1 file changed, 5 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/tools/tiffcrop.c b/tools/tiffcrop.c
|
||||
index c3b758ec..8fd856dc 100644
|
||||
--- a/tools/tiffcrop.c
|
||||
+++ b/tools/tiffcrop.c
|
||||
@@ -2133,11 +2133,11 @@ void process_command_opts (int argc, char *argv[], char *mp, char *mode, uint32
|
||||
}
|
||||
/*-- Check for not allowed combinations (e.g. -X, -Y and -Z, -z and -S are mutually exclusive) --*/
|
||||
char XY, Z, R, S;
|
||||
- XY = ((crop_data->crop_mode & CROP_WIDTH) || (crop_data->crop_mode & CROP_LENGTH));
|
||||
- Z = (crop_data->crop_mode & CROP_ZONES);
|
||||
- R = (crop_data->crop_mode & CROP_REGIONS);
|
||||
- S = (page->mode & PAGE_MODE_ROWSCOLS);
|
||||
- if ((XY && Z) || (XY && R) || (XY && S) || (Z && R) || (Z && S) || (R && S)) {
|
||||
+ XY = ((crop_data->crop_mode & CROP_WIDTH) || (crop_data->crop_mode & CROP_LENGTH)) ? 1 : 0;
|
||||
+ Z = (crop_data->crop_mode & CROP_ZONES) ? 1 : 0;
|
||||
+ R = (crop_data->crop_mode & CROP_REGIONS) ? 1 : 0;
|
||||
+ S = (page->mode & PAGE_MODE_ROWSCOLS) ? 1 : 0;
|
||||
+ if (XY + Z + R + S > 1) {
|
||||
TIFFError("tiffcrop input error", "The crop options(-X|-Y), -Z, -z and -S are mutually exclusive.->Exit");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
--
|
||||
2.34.1
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
CVE: CVE-2022-3597 CVE-2022-3626 CVE-2022-3627
|
||||
Upstream-Status: Backport
|
||||
Signed-off-by: Ross Burton <ross.burton@arm.com>
|
||||
|
||||
From 4746f16253b784287bc8a5003990c1c3b9a03a62 Mon Sep 17 00:00:00 2001
|
||||
From: Su_Laus <sulau@freenet.de>
|
||||
Date: Thu, 25 Aug 2022 16:11:41 +0200
|
||||
Subject: [PATCH] tiffcrop: disable incompatibility of -Z, -X, -Y, -z options
|
||||
with any PAGE_MODE_x option (fixes #411 and #413)
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
tiffcrop does not support –Z, -z, -X and –Y options together with any other PAGE_MODE_x options like -H, -V, -P, -J, -K or –S.
|
||||
|
||||
Code analysis:
|
||||
|
||||
With the options –Z, -z, the crop.selections are set to a value > 0. Within main(), this triggers the call of processCropSelections(), which copies the sections from the read_buff into seg_buffs[].
|
||||
In the following code in main(), the only supported step, where that seg_buffs are further handled are within an if-clause with if (page.mode == PAGE_MODE_NONE) .
|
||||
|
||||
Execution of the else-clause often leads to buffer-overflows.
|
||||
|
||||
Therefore, the above option combination is not supported and will be disabled to prevent those buffer-overflows.
|
||||
|
||||
The MR solves issues #411 and #413.
|
||||
---
|
||||
doc/tools/tiffcrop.rst | 8 ++++++++
|
||||
tools/tiffcrop.c | 32 +++++++++++++++++++++++++-------
|
||||
2 files changed, 33 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/tools/tiffcrop.c b/tools/tiffcrop.c
|
||||
index 8fd856dc..41a2ea36 100644
|
||||
--- a/tools/tiffcrop.c
|
||||
+++ b/tools/tiffcrop.c
|
||||
@@ -2138,9 +2143,20 @@ void process_command_opts (int argc, char *argv[], char *mp, char *mode, uint32
|
||||
R = (crop_data->crop_mode & CROP_REGIONS) ? 1 : 0;
|
||||
S = (page->mode & PAGE_MODE_ROWSCOLS) ? 1 : 0;
|
||||
if (XY + Z + R + S > 1) {
|
||||
- TIFFError("tiffcrop input error", "The crop options(-X|-Y), -Z, -z and -S are mutually exclusive.->Exit");
|
||||
+ TIFFError("tiffcrop input error", "The crop options(-X|-Y), -Z, -z and -S are mutually exclusive.->exit");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
+
|
||||
+ /* Check for not allowed combination:
|
||||
+ * Any of the -X, -Y, -Z and -z options together with other PAGE_MODE_x options
|
||||
+ * such as -H, -V, -P, -J or -K are not supported and may cause buffer overflows.
|
||||
+. */
|
||||
+ if ((XY + Z + R > 0) && page->mode != PAGE_MODE_NONE) {
|
||||
+ TIFFError("tiffcrop input error",
|
||||
+ "Any of the crop options -X, -Y, -Z and -z together with other PAGE_MODE_x options such as - H, -V, -P, -J or -K is not supported and may cause buffer overflows..->exit");
|
||||
+ exit(EXIT_FAILURE);
|
||||
+ }
|
||||
+
|
||||
} /* end process_command_opts */
|
||||
|
||||
/* Start a new output file if one has not been previously opened or
|
||||
--
|
||||
2.34.1
|
||||
|
||||
@@ -0,0 +1,653 @@
|
||||
CVE: CVE-2022-3570 CVE-2022-3598
|
||||
Upstream-Status: Backport
|
||||
Signed-off-by: Ross Burton <ross.burton@arm.com>
|
||||
|
||||
From afd7086090dafd3949afd172822cbcec4ed17d56 Mon Sep 17 00:00:00 2001
|
||||
From: Su Laus <sulau@freenet.de>
|
||||
Date: Thu, 13 Oct 2022 14:33:27 +0000
|
||||
Subject: [PATCH] tiffcrop subroutines require a larger buffer (fixes #271,
|
||||
#381, #386, #388, #389, #435)
|
||||
|
||||
---
|
||||
tools/tiffcrop.c | 209 ++++++++++++++++++++++++++---------------------
|
||||
1 file changed, 118 insertions(+), 91 deletions(-)
|
||||
|
||||
diff --git a/tools/tiffcrop.c b/tools/tiffcrop.c
|
||||
index 41a2ea36..deab5feb 100644
|
||||
--- a/tools/tiffcrop.c
|
||||
+++ b/tools/tiffcrop.c
|
||||
@@ -212,6 +212,10 @@ static char tiffcrop_rev_date[] = "26-08-2022";
|
||||
|
||||
#define TIFF_DIR_MAX 65534
|
||||
|
||||
+/* Some conversion subroutines require image buffers, which are at least 3 bytes
|
||||
+ * larger than the necessary size for the image itself. */
|
||||
+#define NUM_BUFF_OVERSIZE_BYTES 3
|
||||
+
|
||||
/* Offsets into buffer for margins and fixed width and length segments */
|
||||
struct offset {
|
||||
uint32_t tmargin;
|
||||
@@ -233,7 +237,7 @@ struct offset {
|
||||
*/
|
||||
|
||||
struct buffinfo {
|
||||
- uint32_t size; /* size of this buffer */
|
||||
+ size_t size; /* size of this buffer */
|
||||
unsigned char *buffer; /* address of the allocated buffer */
|
||||
};
|
||||
|
||||
@@ -810,8 +814,8 @@ static int readContigTilesIntoBuffer (TIFF* in, uint8_t* buf,
|
||||
uint32_t dst_rowsize, shift_width;
|
||||
uint32_t bytes_per_sample, bytes_per_pixel;
|
||||
uint32_t trailing_bits, prev_trailing_bits;
|
||||
- uint32_t tile_rowsize = TIFFTileRowSize(in);
|
||||
- uint32_t src_offset, dst_offset;
|
||||
+ tmsize_t tile_rowsize = TIFFTileRowSize(in);
|
||||
+ tmsize_t src_offset, dst_offset;
|
||||
uint32_t row_offset, col_offset;
|
||||
uint8_t *bufp = (uint8_t*) buf;
|
||||
unsigned char *src = NULL;
|
||||
@@ -861,7 +865,7 @@ static int readContigTilesIntoBuffer (TIFF* in, uint8_t* buf,
|
||||
TIFFError("readContigTilesIntoBuffer", "Integer overflow when calculating buffer size.");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
- tilebuf = limitMalloc(tile_buffsize + 3);
|
||||
+ tilebuf = limitMalloc(tile_buffsize + NUM_BUFF_OVERSIZE_BYTES);
|
||||
if (tilebuf == 0)
|
||||
return 0;
|
||||
tilebuf[tile_buffsize] = 0;
|
||||
@@ -1024,7 +1028,7 @@ static int readSeparateTilesIntoBuffer (TIFF* in, uint8_t *obuf,
|
||||
for (sample = 0; (sample < spp) && (sample < MAX_SAMPLES); sample++)
|
||||
{
|
||||
srcbuffs[sample] = NULL;
|
||||
- tbuff = (unsigned char *)limitMalloc(tilesize + 8);
|
||||
+ tbuff = (unsigned char *)limitMalloc(tilesize + NUM_BUFF_OVERSIZE_BYTES);
|
||||
if (!tbuff)
|
||||
{
|
||||
TIFFError ("readSeparateTilesIntoBuffer",
|
||||
@@ -1217,7 +1221,8 @@ writeBufferToSeparateStrips (TIFF* out, uint8_t* buf,
|
||||
}
|
||||
rowstripsize = rowsperstrip * bytes_per_sample * (width + 1);
|
||||
|
||||
- obuf = limitMalloc (rowstripsize);
|
||||
+ /* Add 3 padding bytes for extractContigSamples32bits */
|
||||
+ obuf = limitMalloc (rowstripsize + NUM_BUFF_OVERSIZE_BYTES);
|
||||
if (obuf == NULL)
|
||||
return 1;
|
||||
|
||||
@@ -1229,7 +1234,7 @@ writeBufferToSeparateStrips (TIFF* out, uint8_t* buf,
|
||||
|
||||
stripsize = TIFFVStripSize(out, nrows);
|
||||
src = buf + (row * rowsize);
|
||||
- memset (obuf, '\0', rowstripsize);
|
||||
+ memset (obuf, '\0',rowstripsize + NUM_BUFF_OVERSIZE_BYTES);
|
||||
if (extractContigSamplesToBuffer(obuf, src, nrows, width, s, spp, bps, dump))
|
||||
{
|
||||
_TIFFfree(obuf);
|
||||
@@ -1237,10 +1242,15 @@ writeBufferToSeparateStrips (TIFF* out, uint8_t* buf,
|
||||
}
|
||||
if ((dump->outfile != NULL) && (dump->level == 1))
|
||||
{
|
||||
- dump_info(dump->outfile, dump->format,"",
|
||||
+ if (scanlinesize > 0x0ffffffffULL) {
|
||||
+ dump_info(dump->infile, dump->format, "loadImage",
|
||||
+ "Attention: scanlinesize %"PRIu64" is larger than UINT32_MAX.\nFollowing dump might be wrong.",
|
||||
+ scanlinesize);
|
||||
+ }
|
||||
+ dump_info(dump->outfile, dump->format,"",
|
||||
"Sample %2d, Strip: %2d, bytes: %4d, Row %4d, bytes: %4d, Input offset: %6d",
|
||||
- s + 1, strip + 1, stripsize, row + 1, scanlinesize, src - buf);
|
||||
- dump_buffer(dump->outfile, dump->format, nrows, scanlinesize, row, obuf);
|
||||
+ s + 1, strip + 1, stripsize, row + 1, (uint32_t)scanlinesize, src - buf);
|
||||
+ dump_buffer(dump->outfile, dump->format, nrows, (uint32_t)scanlinesize, row, obuf);
|
||||
}
|
||||
|
||||
if (TIFFWriteEncodedStrip(out, strip++, obuf, stripsize) < 0)
|
||||
@@ -1267,7 +1277,7 @@ static int writeBufferToContigTiles (TIFF* out, uint8_t* buf, uint32_t imageleng
|
||||
uint32_t tl, tw;
|
||||
uint32_t row, col, nrow, ncol;
|
||||
uint32_t src_rowsize, col_offset;
|
||||
- uint32_t tile_rowsize = TIFFTileRowSize(out);
|
||||
+ tmsize_t tile_rowsize = TIFFTileRowSize(out);
|
||||
uint8_t* bufp = (uint8_t*) buf;
|
||||
tsize_t tile_buffsize = 0;
|
||||
tsize_t tilesize = TIFFTileSize(out);
|
||||
@@ -1310,9 +1320,11 @@ static int writeBufferToContigTiles (TIFF* out, uint8_t* buf, uint32_t imageleng
|
||||
}
|
||||
src_rowsize = ((imagewidth * spp * bps) + 7U) / 8;
|
||||
|
||||
- tilebuf = limitMalloc(tile_buffsize);
|
||||
+ /* Add 3 padding bytes for extractContigSamples32bits */
|
||||
+ tilebuf = limitMalloc(tile_buffsize + NUM_BUFF_OVERSIZE_BYTES);
|
||||
if (tilebuf == 0)
|
||||
return 1;
|
||||
+ memset(tilebuf, 0, tile_buffsize + NUM_BUFF_OVERSIZE_BYTES);
|
||||
for (row = 0; row < imagelength; row += tl)
|
||||
{
|
||||
nrow = (row + tl > imagelength) ? imagelength - row : tl;
|
||||
@@ -1358,7 +1370,8 @@ static int writeBufferToSeparateTiles (TIFF* out, uint8_t* buf, uint32_t imagele
|
||||
uint32_t imagewidth, tsample_t spp,
|
||||
struct dump_opts * dump)
|
||||
{
|
||||
- tdata_t obuf = limitMalloc(TIFFTileSize(out));
|
||||
+ /* Add 3 padding bytes for extractContigSamples32bits */
|
||||
+ tdata_t obuf = limitMalloc(TIFFTileSize(out) + NUM_BUFF_OVERSIZE_BYTES);
|
||||
uint32_t tl, tw;
|
||||
uint32_t row, col, nrow, ncol;
|
||||
uint32_t src_rowsize, col_offset;
|
||||
@@ -1368,6 +1381,7 @@ static int writeBufferToSeparateTiles (TIFF* out, uint8_t* buf, uint32_t imagele
|
||||
|
||||
if (obuf == NULL)
|
||||
return 1;
|
||||
+ memset(obuf, 0, TIFFTileSize(out) + NUM_BUFF_OVERSIZE_BYTES);
|
||||
|
||||
if( !TIFFGetField(out, TIFFTAG_TILELENGTH, &tl) ||
|
||||
!TIFFGetField(out, TIFFTAG_TILEWIDTH, &tw) ||
|
||||
@@ -1793,14 +1807,14 @@ void process_command_opts (int argc, char *argv[], char *mp, char *mode, uint32
|
||||
|
||||
*opt_offset = '\0';
|
||||
/* convert option to lowercase */
|
||||
- end = strlen (opt_ptr);
|
||||
+ end = (unsigned int)strlen (opt_ptr);
|
||||
for (i = 0; i < end; i++)
|
||||
*(opt_ptr + i) = tolower((int) *(opt_ptr + i));
|
||||
/* Look for dump format specification */
|
||||
if (strncmp(opt_ptr, "for", 3) == 0)
|
||||
{
|
||||
/* convert value to lowercase */
|
||||
- end = strlen (opt_offset + 1);
|
||||
+ end = (unsigned int)strlen (opt_offset + 1);
|
||||
for (i = 1; i <= end; i++)
|
||||
*(opt_offset + i) = tolower((int) *(opt_offset + i));
|
||||
/* check dump format value */
|
||||
@@ -2273,6 +2287,8 @@ main(int argc, char* argv[])
|
||||
size_t length;
|
||||
char temp_filename[PATH_MAX + 16]; /* Extra space keeps the compiler from complaining */
|
||||
|
||||
+ assert(NUM_BUFF_OVERSIZE_BYTES >= 3);
|
||||
+
|
||||
little_endian = *((unsigned char *)&little_endian) & '1';
|
||||
|
||||
initImageData(&image);
|
||||
@@ -3227,13 +3243,13 @@ extractContigSamples32bits (uint8_t *in, uint8_t *out, uint32_t cols,
|
||||
/* If we have a full buffer's worth, write it out */
|
||||
if (ready_bits >= 32)
|
||||
{
|
||||
- bytebuff1 = (buff2 >> 56);
|
||||
+ bytebuff1 = (uint8_t)(buff2 >> 56);
|
||||
*dst++ = bytebuff1;
|
||||
- bytebuff2 = (buff2 >> 48);
|
||||
+ bytebuff2 = (uint8_t)(buff2 >> 48);
|
||||
*dst++ = bytebuff2;
|
||||
- bytebuff3 = (buff2 >> 40);
|
||||
+ bytebuff3 = (uint8_t)(buff2 >> 40);
|
||||
*dst++ = bytebuff3;
|
||||
- bytebuff4 = (buff2 >> 32);
|
||||
+ bytebuff4 = (uint8_t)(buff2 >> 32);
|
||||
*dst++ = bytebuff4;
|
||||
ready_bits -= 32;
|
||||
|
||||
@@ -3642,13 +3658,13 @@ extractContigSamplesShifted32bits (uint8_t *in, uint8_t *out, uint32_t cols,
|
||||
}
|
||||
else /* If we have a full buffer's worth, write it out */
|
||||
{
|
||||
- bytebuff1 = (buff2 >> 56);
|
||||
+ bytebuff1 = (uint8_t)(buff2 >> 56);
|
||||
*dst++ = bytebuff1;
|
||||
- bytebuff2 = (buff2 >> 48);
|
||||
+ bytebuff2 = (uint8_t)(buff2 >> 48);
|
||||
*dst++ = bytebuff2;
|
||||
- bytebuff3 = (buff2 >> 40);
|
||||
+ bytebuff3 = (uint8_t)(buff2 >> 40);
|
||||
*dst++ = bytebuff3;
|
||||
- bytebuff4 = (buff2 >> 32);
|
||||
+ bytebuff4 = (uint8_t)(buff2 >> 32);
|
||||
*dst++ = bytebuff4;
|
||||
ready_bits -= 32;
|
||||
|
||||
@@ -3825,10 +3841,10 @@ extractContigSamplesToTileBuffer(uint8_t *out, uint8_t *in, uint32_t rows, uint3
|
||||
static int readContigStripsIntoBuffer (TIFF* in, uint8_t* buf)
|
||||
{
|
||||
uint8_t* bufp = buf;
|
||||
- int32_t bytes_read = 0;
|
||||
+ tmsize_t bytes_read = 0;
|
||||
uint32_t strip, nstrips = TIFFNumberOfStrips(in);
|
||||
- uint32_t stripsize = TIFFStripSize(in);
|
||||
- uint32_t rows = 0;
|
||||
+ tmsize_t stripsize = TIFFStripSize(in);
|
||||
+ tmsize_t rows = 0;
|
||||
uint32_t rps = TIFFGetFieldDefaulted(in, TIFFTAG_ROWSPERSTRIP, &rps);
|
||||
tsize_t scanline_size = TIFFScanlineSize(in);
|
||||
|
||||
@@ -3841,11 +3857,11 @@ static int readContigStripsIntoBuffer (TIFF* in, uint8_t* buf)
|
||||
bytes_read = TIFFReadEncodedStrip (in, strip, bufp, -1);
|
||||
rows = bytes_read / scanline_size;
|
||||
if ((strip < (nstrips - 1)) && (bytes_read != (int32_t)stripsize))
|
||||
- TIFFError("", "Strip %"PRIu32": read %"PRId32" bytes, strip size %"PRIu32,
|
||||
+ TIFFError("", "Strip %"PRIu32": read %"PRId64" bytes, strip size %"PRIu64,
|
||||
strip + 1, bytes_read, stripsize);
|
||||
|
||||
if (bytes_read < 0 && !ignore) {
|
||||
- TIFFError("", "Error reading strip %"PRIu32" after %"PRIu32" rows",
|
||||
+ TIFFError("", "Error reading strip %"PRIu32" after %"PRIu64" rows",
|
||||
strip, rows);
|
||||
return 0;
|
||||
}
|
||||
@@ -4310,13 +4326,13 @@ combineSeparateSamples32bits (uint8_t *in[], uint8_t *out, uint32_t cols,
|
||||
/* If we have a full buffer's worth, write it out */
|
||||
if (ready_bits >= 32)
|
||||
{
|
||||
- bytebuff1 = (buff2 >> 56);
|
||||
+ bytebuff1 = (uint8_t)(buff2 >> 56);
|
||||
*dst++ = bytebuff1;
|
||||
- bytebuff2 = (buff2 >> 48);
|
||||
+ bytebuff2 = (uint8_t)(buff2 >> 48);
|
||||
*dst++ = bytebuff2;
|
||||
- bytebuff3 = (buff2 >> 40);
|
||||
+ bytebuff3 = (uint8_t)(buff2 >> 40);
|
||||
*dst++ = bytebuff3;
|
||||
- bytebuff4 = (buff2 >> 32);
|
||||
+ bytebuff4 = (uint8_t)(buff2 >> 32);
|
||||
*dst++ = bytebuff4;
|
||||
ready_bits -= 32;
|
||||
|
||||
@@ -4359,10 +4375,10 @@ combineSeparateSamples32bits (uint8_t *in[], uint8_t *out, uint32_t cols,
|
||||
"Row %3d, Col %3d, Src byte offset %3d bit offset %2d Dst offset %3d",
|
||||
row + 1, col + 1, src_byte, src_bit, dst - out);
|
||||
|
||||
- dump_long (dumpfile, format, "Match bits ", matchbits);
|
||||
+ dump_wide (dumpfile, format, "Match bits ", matchbits);
|
||||
dump_data (dumpfile, format, "Src bits ", src, 4);
|
||||
- dump_long (dumpfile, format, "Buff1 bits ", buff1);
|
||||
- dump_long (dumpfile, format, "Buff2 bits ", buff2);
|
||||
+ dump_wide (dumpfile, format, "Buff1 bits ", buff1);
|
||||
+ dump_wide (dumpfile, format, "Buff2 bits ", buff2);
|
||||
dump_byte (dumpfile, format, "Write bits1", bytebuff1);
|
||||
dump_byte (dumpfile, format, "Write bits2", bytebuff2);
|
||||
dump_info (dumpfile, format, "", "Ready bits: %2d", ready_bits);
|
||||
@@ -4835,13 +4851,13 @@ combineSeparateTileSamples32bits (uint8_t *in[], uint8_t *out, uint32_t cols,
|
||||
/* If we have a full buffer's worth, write it out */
|
||||
if (ready_bits >= 32)
|
||||
{
|
||||
- bytebuff1 = (buff2 >> 56);
|
||||
+ bytebuff1 = (uint8_t)(buff2 >> 56);
|
||||
*dst++ = bytebuff1;
|
||||
- bytebuff2 = (buff2 >> 48);
|
||||
+ bytebuff2 = (uint8_t)(buff2 >> 48);
|
||||
*dst++ = bytebuff2;
|
||||
- bytebuff3 = (buff2 >> 40);
|
||||
+ bytebuff3 = (uint8_t)(buff2 >> 40);
|
||||
*dst++ = bytebuff3;
|
||||
- bytebuff4 = (buff2 >> 32);
|
||||
+ bytebuff4 = (uint8_t)(buff2 >> 32);
|
||||
*dst++ = bytebuff4;
|
||||
ready_bits -= 32;
|
||||
|
||||
@@ -4884,10 +4900,10 @@ combineSeparateTileSamples32bits (uint8_t *in[], uint8_t *out, uint32_t cols,
|
||||
"Row %3d, Col %3d, Src byte offset %3d bit offset %2d Dst offset %3d",
|
||||
row + 1, col + 1, src_byte, src_bit, dst - out);
|
||||
|
||||
- dump_long (dumpfile, format, "Match bits ", matchbits);
|
||||
+ dump_wide (dumpfile, format, "Match bits ", matchbits);
|
||||
dump_data (dumpfile, format, "Src bits ", src, 4);
|
||||
- dump_long (dumpfile, format, "Buff1 bits ", buff1);
|
||||
- dump_long (dumpfile, format, "Buff2 bits ", buff2);
|
||||
+ dump_wide (dumpfile, format, "Buff1 bits ", buff1);
|
||||
+ dump_wide (dumpfile, format, "Buff2 bits ", buff2);
|
||||
dump_byte (dumpfile, format, "Write bits1", bytebuff1);
|
||||
dump_byte (dumpfile, format, "Write bits2", bytebuff2);
|
||||
dump_info (dumpfile, format, "", "Ready bits: %2d", ready_bits);
|
||||
@@ -4910,7 +4926,7 @@ static int readSeparateStripsIntoBuffer (TIFF *in, uint8_t *obuf, uint32_t lengt
|
||||
{
|
||||
int i, bytes_per_sample, bytes_per_pixel, shift_width, result = 1;
|
||||
uint32_t j;
|
||||
- int32_t bytes_read = 0;
|
||||
+ tmsize_t bytes_read = 0;
|
||||
uint16_t bps = 0, planar;
|
||||
uint32_t nstrips;
|
||||
uint32_t strips_per_sample;
|
||||
@@ -4976,7 +4992,7 @@ static int readSeparateStripsIntoBuffer (TIFF *in, uint8_t *obuf, uint32_t lengt
|
||||
for (s = 0; (s < spp) && (s < MAX_SAMPLES); s++)
|
||||
{
|
||||
srcbuffs[s] = NULL;
|
||||
- buff = limitMalloc(stripsize + 3);
|
||||
+ buff = limitMalloc(stripsize + NUM_BUFF_OVERSIZE_BYTES);
|
||||
if (!buff)
|
||||
{
|
||||
TIFFError ("readSeparateStripsIntoBuffer",
|
||||
@@ -4999,7 +5015,7 @@ static int readSeparateStripsIntoBuffer (TIFF *in, uint8_t *obuf, uint32_t lengt
|
||||
buff = srcbuffs[s];
|
||||
strip = (s * strips_per_sample) + j;
|
||||
bytes_read = TIFFReadEncodedStrip (in, strip, buff, stripsize);
|
||||
- rows_this_strip = bytes_read / src_rowsize;
|
||||
+ rows_this_strip = (uint32_t)(bytes_read / src_rowsize);
|
||||
if (bytes_read < 0 && !ignore)
|
||||
{
|
||||
TIFFError(TIFFFileName(in),
|
||||
@@ -6062,13 +6078,14 @@ loadImage(TIFF* in, struct image_data *image, struct dump_opts *dump, unsigned c
|
||||
uint16_t input_compression = 0, input_photometric = 0;
|
||||
uint16_t subsampling_horiz, subsampling_vert;
|
||||
uint32_t width = 0, length = 0;
|
||||
- uint32_t stsize = 0, tlsize = 0, buffsize = 0, scanlinesize = 0;
|
||||
+ tmsize_t stsize = 0, tlsize = 0, buffsize = 0;
|
||||
+ tmsize_t scanlinesize = 0;
|
||||
uint32_t tw = 0, tl = 0; /* Tile width and length */
|
||||
- uint32_t tile_rowsize = 0;
|
||||
+ tmsize_t tile_rowsize = 0;
|
||||
unsigned char *read_buff = NULL;
|
||||
unsigned char *new_buff = NULL;
|
||||
int readunit = 0;
|
||||
- static uint32_t prev_readsize = 0;
|
||||
+ static tmsize_t prev_readsize = 0;
|
||||
|
||||
TIFFGetFieldDefaulted(in, TIFFTAG_BITSPERSAMPLE, &bps);
|
||||
TIFFGetFieldDefaulted(in, TIFFTAG_SAMPLESPERPIXEL, &spp);
|
||||
@@ -6325,6 +6342,8 @@ loadImage(TIFF* in, struct image_data *image, struct dump_opts *dump, unsigned c
|
||||
/* The buffsize_check and the possible adaptation of buffsize
|
||||
* has to account also for padding of each line to a byte boundary.
|
||||
* This is assumed by mirrorImage() and rotateImage().
|
||||
+ * Furthermore, functions like extractContigSamplesShifted32bits()
|
||||
+ * need a buffer, which is at least 3 bytes larger than the actual image.
|
||||
* Otherwise buffer-overflow might occur there.
|
||||
*/
|
||||
buffsize_check = length * (uint32_t)(((width * spp * bps) + 7) / 8);
|
||||
@@ -6376,7 +6395,7 @@ loadImage(TIFF* in, struct image_data *image, struct dump_opts *dump, unsigned c
|
||||
TIFFError("loadImage", "Unable to allocate/reallocate read buffer");
|
||||
return (-1);
|
||||
}
|
||||
- read_buff = (unsigned char *)limitMalloc(buffsize+3);
|
||||
+ read_buff = (unsigned char *)limitMalloc(buffsize + NUM_BUFF_OVERSIZE_BYTES);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -6387,11 +6406,11 @@ loadImage(TIFF* in, struct image_data *image, struct dump_opts *dump, unsigned c
|
||||
TIFFError("loadImage", "Unable to allocate/reallocate read buffer");
|
||||
return (-1);
|
||||
}
|
||||
- new_buff = _TIFFrealloc(read_buff, buffsize+3);
|
||||
+ new_buff = _TIFFrealloc(read_buff, buffsize + NUM_BUFF_OVERSIZE_BYTES);
|
||||
if (!new_buff)
|
||||
{
|
||||
free (read_buff);
|
||||
- read_buff = (unsigned char *)limitMalloc(buffsize+3);
|
||||
+ read_buff = (unsigned char *)limitMalloc(buffsize + NUM_BUFF_OVERSIZE_BYTES);
|
||||
}
|
||||
else
|
||||
read_buff = new_buff;
|
||||
@@ -6464,8 +6483,13 @@ loadImage(TIFF* in, struct image_data *image, struct dump_opts *dump, unsigned c
|
||||
dump_info (dump->infile, dump->format, "",
|
||||
"Bits per sample %"PRIu16", Samples per pixel %"PRIu16, bps, spp);
|
||||
|
||||
+ if (scanlinesize > 0x0ffffffffULL) {
|
||||
+ dump_info(dump->infile, dump->format, "loadImage",
|
||||
+ "Attention: scanlinesize %"PRIu64" is larger than UINT32_MAX.\nFollowing dump might be wrong.",
|
||||
+ scanlinesize);
|
||||
+ }
|
||||
for (i = 0; i < length; i++)
|
||||
- dump_buffer(dump->infile, dump->format, 1, scanlinesize,
|
||||
+ dump_buffer(dump->infile, dump->format, 1, (uint32_t)scanlinesize,
|
||||
i, read_buff + (i * scanlinesize));
|
||||
}
|
||||
return (0);
|
||||
@@ -7485,13 +7509,13 @@ writeSingleSection(TIFF *in, TIFF *out, struct image_data *image,
|
||||
if (TIFFGetField(in, TIFFTAG_NUMBEROFINKS, &ninks)) {
|
||||
TIFFSetField(out, TIFFTAG_NUMBEROFINKS, ninks);
|
||||
if (TIFFGetField(in, TIFFTAG_INKNAMES, &inknames)) {
|
||||
- int inknameslen = strlen(inknames) + 1;
|
||||
+ int inknameslen = (int)strlen(inknames) + 1;
|
||||
const char* cp = inknames;
|
||||
while (ninks > 1) {
|
||||
cp = strchr(cp, '\0');
|
||||
if (cp) {
|
||||
cp++;
|
||||
- inknameslen += (strlen(cp) + 1);
|
||||
+ inknameslen += ((int)strlen(cp) + 1);
|
||||
}
|
||||
ninks--;
|
||||
}
|
||||
@@ -7554,23 +7578,23 @@ createImageSection(uint32_t sectsize, unsigned char **sect_buff_ptr)
|
||||
|
||||
if (!sect_buff)
|
||||
{
|
||||
- sect_buff = (unsigned char *)limitMalloc(sectsize);
|
||||
+ sect_buff = (unsigned char *)limitMalloc(sectsize + NUM_BUFF_OVERSIZE_BYTES);
|
||||
if (!sect_buff)
|
||||
{
|
||||
TIFFError("createImageSection", "Unable to allocate/reallocate section buffer");
|
||||
return (-1);
|
||||
}
|
||||
- _TIFFmemset(sect_buff, 0, sectsize);
|
||||
+ _TIFFmemset(sect_buff, 0, sectsize + NUM_BUFF_OVERSIZE_BYTES);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (prev_sectsize < sectsize)
|
||||
{
|
||||
- new_buff = _TIFFrealloc(sect_buff, sectsize);
|
||||
+ new_buff = _TIFFrealloc(sect_buff, sectsize + NUM_BUFF_OVERSIZE_BYTES);
|
||||
if (!new_buff)
|
||||
{
|
||||
_TIFFfree (sect_buff);
|
||||
- sect_buff = (unsigned char *)limitMalloc(sectsize);
|
||||
+ sect_buff = (unsigned char *)limitMalloc(sectsize + NUM_BUFF_OVERSIZE_BYTES);
|
||||
}
|
||||
else
|
||||
sect_buff = new_buff;
|
||||
@@ -7580,7 +7604,7 @@ createImageSection(uint32_t sectsize, unsigned char **sect_buff_ptr)
|
||||
TIFFError("createImageSection", "Unable to allocate/reallocate section buffer");
|
||||
return (-1);
|
||||
}
|
||||
- _TIFFmemset(sect_buff, 0, sectsize);
|
||||
+ _TIFFmemset(sect_buff, 0, sectsize + NUM_BUFF_OVERSIZE_BYTES);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7611,17 +7635,17 @@ processCropSelections(struct image_data *image, struct crop_mask *crop,
|
||||
cropsize = crop->bufftotal;
|
||||
crop_buff = seg_buffs[0].buffer;
|
||||
if (!crop_buff)
|
||||
- crop_buff = (unsigned char *)limitMalloc(cropsize);
|
||||
+ crop_buff = (unsigned char *)limitMalloc(cropsize + NUM_BUFF_OVERSIZE_BYTES);
|
||||
else
|
||||
{
|
||||
prev_cropsize = seg_buffs[0].size;
|
||||
if (prev_cropsize < cropsize)
|
||||
{
|
||||
- next_buff = _TIFFrealloc(crop_buff, cropsize);
|
||||
+ next_buff = _TIFFrealloc(crop_buff, cropsize + NUM_BUFF_OVERSIZE_BYTES);
|
||||
if (! next_buff)
|
||||
{
|
||||
_TIFFfree (crop_buff);
|
||||
- crop_buff = (unsigned char *)limitMalloc(cropsize);
|
||||
+ crop_buff = (unsigned char *)limitMalloc(cropsize + NUM_BUFF_OVERSIZE_BYTES);
|
||||
}
|
||||
else
|
||||
crop_buff = next_buff;
|
||||
@@ -7634,7 +7658,7 @@ processCropSelections(struct image_data *image, struct crop_mask *crop,
|
||||
return (-1);
|
||||
}
|
||||
|
||||
- _TIFFmemset(crop_buff, 0, cropsize);
|
||||
+ _TIFFmemset(crop_buff, 0, cropsize + NUM_BUFF_OVERSIZE_BYTES);
|
||||
seg_buffs[0].buffer = crop_buff;
|
||||
seg_buffs[0].size = cropsize;
|
||||
|
||||
@@ -7714,17 +7738,17 @@ processCropSelections(struct image_data *image, struct crop_mask *crop,
|
||||
cropsize = crop->bufftotal;
|
||||
crop_buff = seg_buffs[i].buffer;
|
||||
if (!crop_buff)
|
||||
- crop_buff = (unsigned char *)limitMalloc(cropsize);
|
||||
+ crop_buff = (unsigned char *)limitMalloc(cropsize + NUM_BUFF_OVERSIZE_BYTES);
|
||||
else
|
||||
{
|
||||
prev_cropsize = seg_buffs[0].size;
|
||||
if (prev_cropsize < cropsize)
|
||||
{
|
||||
- next_buff = _TIFFrealloc(crop_buff, cropsize);
|
||||
+ next_buff = _TIFFrealloc(crop_buff, cropsize + NUM_BUFF_OVERSIZE_BYTES);
|
||||
if (! next_buff)
|
||||
{
|
||||
_TIFFfree (crop_buff);
|
||||
- crop_buff = (unsigned char *)limitMalloc(cropsize);
|
||||
+ crop_buff = (unsigned char *)limitMalloc(cropsize + NUM_BUFF_OVERSIZE_BYTES);
|
||||
}
|
||||
else
|
||||
crop_buff = next_buff;
|
||||
@@ -7737,7 +7761,7 @@ processCropSelections(struct image_data *image, struct crop_mask *crop,
|
||||
return (-1);
|
||||
}
|
||||
|
||||
- _TIFFmemset(crop_buff, 0, cropsize);
|
||||
+ _TIFFmemset(crop_buff, 0, cropsize + NUM_BUFF_OVERSIZE_BYTES);
|
||||
seg_buffs[i].buffer = crop_buff;
|
||||
seg_buffs[i].size = cropsize;
|
||||
|
||||
@@ -7853,24 +7877,24 @@ createCroppedImage(struct image_data *image, struct crop_mask *crop,
|
||||
crop_buff = *crop_buff_ptr;
|
||||
if (!crop_buff)
|
||||
{
|
||||
- crop_buff = (unsigned char *)limitMalloc(cropsize);
|
||||
+ crop_buff = (unsigned char *)limitMalloc(cropsize + NUM_BUFF_OVERSIZE_BYTES);
|
||||
if (!crop_buff)
|
||||
{
|
||||
TIFFError("createCroppedImage", "Unable to allocate/reallocate crop buffer");
|
||||
return (-1);
|
||||
}
|
||||
- _TIFFmemset(crop_buff, 0, cropsize);
|
||||
+ _TIFFmemset(crop_buff, 0, cropsize + NUM_BUFF_OVERSIZE_BYTES);
|
||||
prev_cropsize = cropsize;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (prev_cropsize < cropsize)
|
||||
{
|
||||
- new_buff = _TIFFrealloc(crop_buff, cropsize);
|
||||
+ new_buff = _TIFFrealloc(crop_buff, cropsize + NUM_BUFF_OVERSIZE_BYTES);
|
||||
if (!new_buff)
|
||||
{
|
||||
free (crop_buff);
|
||||
- crop_buff = (unsigned char *)limitMalloc(cropsize);
|
||||
+ crop_buff = (unsigned char *)limitMalloc(cropsize + NUM_BUFF_OVERSIZE_BYTES);
|
||||
}
|
||||
else
|
||||
crop_buff = new_buff;
|
||||
@@ -7879,7 +7903,7 @@ createCroppedImage(struct image_data *image, struct crop_mask *crop,
|
||||
TIFFError("createCroppedImage", "Unable to allocate/reallocate crop buffer");
|
||||
return (-1);
|
||||
}
|
||||
- _TIFFmemset(crop_buff, 0, cropsize);
|
||||
+ _TIFFmemset(crop_buff, 0, cropsize + NUM_BUFF_OVERSIZE_BYTES);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8177,13 +8201,13 @@ writeCroppedImage(TIFF *in, TIFF *out, struct image_data *image,
|
||||
if (TIFFGetField(in, TIFFTAG_NUMBEROFINKS, &ninks)) {
|
||||
TIFFSetField(out, TIFFTAG_NUMBEROFINKS, ninks);
|
||||
if (TIFFGetField(in, TIFFTAG_INKNAMES, &inknames)) {
|
||||
- int inknameslen = strlen(inknames) + 1;
|
||||
+ int inknameslen = (int)strlen(inknames) + 1;
|
||||
const char* cp = inknames;
|
||||
while (ninks > 1) {
|
||||
cp = strchr(cp, '\0');
|
||||
if (cp) {
|
||||
cp++;
|
||||
- inknameslen += (strlen(cp) + 1);
|
||||
+ inknameslen += ((int)strlen(cp) + 1);
|
||||
}
|
||||
ninks--;
|
||||
}
|
||||
@@ -8568,13 +8592,13 @@ rotateContigSamples32bits(uint16_t rotation, uint16_t spp, uint16_t bps, uint32_
|
||||
}
|
||||
else /* If we have a full buffer's worth, write it out */
|
||||
{
|
||||
- bytebuff1 = (buff2 >> 56);
|
||||
+ bytebuff1 = (uint8_t)(buff2 >> 56);
|
||||
*dst++ = bytebuff1;
|
||||
- bytebuff2 = (buff2 >> 48);
|
||||
+ bytebuff2 = (uint8_t)(buff2 >> 48);
|
||||
*dst++ = bytebuff2;
|
||||
- bytebuff3 = (buff2 >> 40);
|
||||
+ bytebuff3 = (uint8_t)(buff2 >> 40);
|
||||
*dst++ = bytebuff3;
|
||||
- bytebuff4 = (buff2 >> 32);
|
||||
+ bytebuff4 = (uint8_t)(buff2 >> 32);
|
||||
*dst++ = bytebuff4;
|
||||
ready_bits -= 32;
|
||||
|
||||
@@ -8643,12 +8667,13 @@ rotateImage(uint16_t rotation, struct image_data *image, uint32_t *img_width,
|
||||
return (-1);
|
||||
}
|
||||
|
||||
- if (!(rbuff = (unsigned char *)limitMalloc(buffsize)))
|
||||
+ /* Add 3 padding bytes for extractContigSamplesShifted32bits */
|
||||
+ if (!(rbuff = (unsigned char *)limitMalloc(buffsize + NUM_BUFF_OVERSIZE_BYTES)))
|
||||
{
|
||||
- TIFFError("rotateImage", "Unable to allocate rotation buffer of %1u bytes", buffsize);
|
||||
+ TIFFError("rotateImage", "Unable to allocate rotation buffer of %1u bytes", buffsize + NUM_BUFF_OVERSIZE_BYTES);
|
||||
return (-1);
|
||||
}
|
||||
- _TIFFmemset(rbuff, '\0', buffsize);
|
||||
+ _TIFFmemset(rbuff, '\0', buffsize + NUM_BUFF_OVERSIZE_BYTES);
|
||||
|
||||
ibuff = *ibuff_ptr;
|
||||
switch (rotation)
|
||||
@@ -9176,13 +9201,13 @@ reverseSamples32bits (uint16_t spp, uint16_t bps, uint32_t width,
|
||||
}
|
||||
else /* If we have a full buffer's worth, write it out */
|
||||
{
|
||||
- bytebuff1 = (buff2 >> 56);
|
||||
+ bytebuff1 = (uint8_t)(buff2 >> 56);
|
||||
*dst++ = bytebuff1;
|
||||
- bytebuff2 = (buff2 >> 48);
|
||||
+ bytebuff2 = (uint8_t)(buff2 >> 48);
|
||||
*dst++ = bytebuff2;
|
||||
- bytebuff3 = (buff2 >> 40);
|
||||
+ bytebuff3 = (uint8_t)(buff2 >> 40);
|
||||
*dst++ = bytebuff3;
|
||||
- bytebuff4 = (buff2 >> 32);
|
||||
+ bytebuff4 = (uint8_t)(buff2 >> 32);
|
||||
*dst++ = bytebuff4;
|
||||
ready_bits -= 32;
|
||||
|
||||
@@ -9273,12 +9298,13 @@ mirrorImage(uint16_t spp, uint16_t bps, uint16_t mirror, uint32_t width, uint32_
|
||||
{
|
||||
case MIRROR_BOTH:
|
||||
case MIRROR_VERT:
|
||||
- line_buff = (unsigned char *)limitMalloc(rowsize);
|
||||
+ line_buff = (unsigned char *)limitMalloc(rowsize + NUM_BUFF_OVERSIZE_BYTES);
|
||||
if (line_buff == NULL)
|
||||
{
|
||||
- TIFFError ("mirrorImage", "Unable to allocate mirror line buffer of %1u bytes", rowsize);
|
||||
+ TIFFError ("mirrorImage", "Unable to allocate mirror line buffer of %1u bytes", rowsize + NUM_BUFF_OVERSIZE_BYTES);
|
||||
return (-1);
|
||||
}
|
||||
+ _TIFFmemset(line_buff, '\0', rowsize + NUM_BUFF_OVERSIZE_BYTES);
|
||||
|
||||
dst = ibuff + (rowsize * (length - 1));
|
||||
for (row = 0; row < length / 2; row++)
|
||||
@@ -9310,11 +9336,12 @@ mirrorImage(uint16_t spp, uint16_t bps, uint16_t mirror, uint32_t width, uint32_
|
||||
}
|
||||
else
|
||||
{ /* non 8 bit per sample data */
|
||||
- if (!(line_buff = (unsigned char *)limitMalloc(rowsize + 1)))
|
||||
+ if (!(line_buff = (unsigned char *)limitMalloc(rowsize + NUM_BUFF_OVERSIZE_BYTES)))
|
||||
{
|
||||
TIFFError("mirrorImage", "Unable to allocate mirror line buffer");
|
||||
return (-1);
|
||||
}
|
||||
+ _TIFFmemset(line_buff, '\0', rowsize + NUM_BUFF_OVERSIZE_BYTES);
|
||||
bytes_per_sample = (bps + 7) / 8;
|
||||
bytes_per_pixel = ((bps * spp) + 7) / 8;
|
||||
if (bytes_per_pixel < (bytes_per_sample + 1))
|
||||
@@ -9326,7 +9353,7 @@ mirrorImage(uint16_t spp, uint16_t bps, uint16_t mirror, uint32_t width, uint32_
|
||||
{
|
||||
row_offset = row * rowsize;
|
||||
src = ibuff + row_offset;
|
||||
- _TIFFmemset (line_buff, '\0', rowsize);
|
||||
+ _TIFFmemset (line_buff, '\0', rowsize + NUM_BUFF_OVERSIZE_BYTES);
|
||||
switch (shift_width)
|
||||
{
|
||||
case 1: if (reverseSamples16bits(spp, bps, width, src, line_buff))
|
||||
--
|
||||
2.34.1
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
CVE: CVE-2022-2053
|
||||
CVE: CVE-2022-2953
|
||||
Upstream-Status: Backport
|
||||
Signed-off-by: Ross Burton <ross.burton@arm.com>
|
||||
|
||||
|
||||
@@ -12,6 +12,10 @@ SRC_URI = "http://download.osgeo.org/libtiff/tiff-${PV}.tar.gz \
|
||||
file://0001-fix-the-FPE-in-tiffcrop-415-427-and-428.patch \
|
||||
file://CVE-2022-34526.patch \
|
||||
file://CVE-2022-2953.patch \
|
||||
file://0001-Revised-handling-of-TIFFTAG_INKNAMES-and-related-TIF.patch \
|
||||
file://0001-tiffcrop-S-option-Make-decision-simpler.patch \
|
||||
file://0001-tiffcrop-disable-incompatibility-of-Z-X-Y-z-options-.patch \
|
||||
file://0001-tiffcrop-subroutines-require-a-larger-buffer-fixes-2.patch \
|
||||
"
|
||||
|
||||
SRC_URI[sha256sum] = "917223b37538959aca3b790d2d73aa6e626b688e02dcda272aec24c2f498abed"
|
||||
@@ -25,7 +29,6 @@ CVE_CHECK_IGNORE += "CVE-2015-7313"
|
||||
# These issues only affect libtiff post-4.3.0 but before 4.4.0,
|
||||
# caused by 3079627e and fixed by b4e79bfa.
|
||||
CVE_CHECK_IGNORE += "CVE-2022-1622 CVE-2022-1623"
|
||||
|
||||
# Issue is in jbig which we don't enable
|
||||
CVE_CHECK_IGNORE += "CVE-2022-1210"
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ inherit meson features_check pkgconfig
|
||||
REQUIRED_DISTRO_FEATURES = "opengl"
|
||||
|
||||
SRC_URI = "https://wpewebkit.org/releases/${BPN}-${PV}.tar.xz"
|
||||
SRC_URI[sha256sum] = "45aa833c44ec292f31fa943b01b8cc75e54eb623ad7ba6a66fc2f118fe69e629"
|
||||
SRC_URI[sha256sum] = "e75b0cb2c7145448416e8696013d8883f675c66c11ed750e06865efec5809155"
|
||||
|
||||
# Especially helps compiling with clang which enable this as error when
|
||||
# using c++11
|
||||
27
meta/recipes-support/curl/curl/CVE-2022-32221.patch
Normal file
27
meta/recipes-support/curl/curl/CVE-2022-32221.patch
Normal file
@@ -0,0 +1,27 @@
|
||||
From dd31455d46dcf9e3a1b8bd37e671af1a6af52807 Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Stenberg <daniel@haxx.se>
|
||||
Date: Thu, 15 Sep 2022 09:22:45 +0200
|
||||
Subject: [PATCH] setopt: when POST is set, reset the 'upload' field
|
||||
|
||||
Reported-by: RobBotic1 on github
|
||||
Fixes #9507
|
||||
Closes #9511
|
||||
|
||||
Upstream-Status: Backport [https://github.com/curl/curl/commit/a64e3e59938abd7d6]
|
||||
Signed-off-by: Robert Joslyn <robert.joslyn@redrectangle.org>
|
||||
---
|
||||
lib/setopt.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/lib/setopt.c b/lib/setopt.c
|
||||
index d5e3b50..b8793b4 100644
|
||||
--- a/lib/setopt.c
|
||||
+++ b/lib/setopt.c
|
||||
@@ -696,6 +696,7 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param)
|
||||
}
|
||||
else
|
||||
data->set.method = HTTPREQ_GET;
|
||||
+ data->set.upload = FALSE;
|
||||
break;
|
||||
|
||||
case CURLOPT_HTTPPOST:
|
||||
73
meta/recipes-support/curl/curl/CVE-2022-35260.patch
Normal file
73
meta/recipes-support/curl/curl/CVE-2022-35260.patch
Normal file
@@ -0,0 +1,73 @@
|
||||
From 9169e54444bdca7b5e7b44034c463fe5fc801e88 Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Stenberg <daniel@haxx.se>
|
||||
Date: Tue, 4 Oct 2022 14:37:24 +0200
|
||||
Subject: [PATCH] netrc: replace fgets with Curl_get_line
|
||||
|
||||
Make the parser only accept complete lines and avoid problems with
|
||||
overly long lines.
|
||||
|
||||
Reported-by: Hiroki Kurosawa
|
||||
|
||||
Closes #9789
|
||||
|
||||
Upstream-Status: Backport [https://github.com/curl/curl/commit/c97ec984fb2bc919a3aa86]
|
||||
Signed-off-by: Robert Joslyn <robert.joslyn@redrectangle.org>
|
||||
---
|
||||
lib/curl_get_line.c | 6 +++---
|
||||
lib/netrc.c | 5 +++--
|
||||
2 files changed, 6 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/lib/curl_get_line.c b/lib/curl_get_line.c
|
||||
index 6a26bb2..22e3705 100644
|
||||
--- a/lib/curl_get_line.c
|
||||
+++ b/lib/curl_get_line.c
|
||||
@@ -25,7 +25,7 @@
|
||||
#include "curl_setup.h"
|
||||
|
||||
#if !defined(CURL_DISABLE_COOKIES) || !defined(CURL_DISABLE_ALTSVC) || \
|
||||
- !defined(CURL_DISABLE_HSTS)
|
||||
+ !defined(CURL_DISABLE_HSTS) || !defined(CURL_DISABLE_NETRC)
|
||||
|
||||
#include "curl_get_line.h"
|
||||
#include "curl_memory.h"
|
||||
@@ -33,8 +33,8 @@
|
||||
#include "memdebug.h"
|
||||
|
||||
/*
|
||||
- * get_line() makes sure to only return complete whole lines that fit in 'len'
|
||||
- * bytes and end with a newline.
|
||||
+ * Curl_get_line() makes sure to only return complete whole lines that fit in
|
||||
+ * 'len' bytes and end with a newline.
|
||||
*/
|
||||
char *Curl_get_line(char *buf, int len, FILE *input)
|
||||
{
|
||||
diff --git a/lib/netrc.c b/lib/netrc.c
|
||||
index 62a6a10..5d17482 100644
|
||||
--- a/lib/netrc.c
|
||||
+++ b/lib/netrc.c
|
||||
@@ -33,6 +33,7 @@
|
||||
#include "netrc.h"
|
||||
#include "strtok.h"
|
||||
#include "strcase.h"
|
||||
+#include "curl_get_line.h"
|
||||
|
||||
/* The last 3 #include files should be in this order */
|
||||
#include "curl_printf.h"
|
||||
@@ -84,7 +85,7 @@ static int parsenetrc(const char *host,
|
||||
char netrcbuffer[4096];
|
||||
int netrcbuffsize = (int)sizeof(netrcbuffer);
|
||||
|
||||
- while(!done && fgets(netrcbuffer, netrcbuffsize, file)) {
|
||||
+ while(!done && Curl_get_line(netrcbuffer, netrcbuffsize, file)) {
|
||||
char *tok;
|
||||
char *tok_end;
|
||||
bool quoted;
|
||||
@@ -243,7 +244,7 @@ static int parsenetrc(const char *host,
|
||||
} /* switch (state) */
|
||||
tok = ++tok_end;
|
||||
}
|
||||
- } /* while fgets() */
|
||||
+ } /* while Curl_get_line() */
|
||||
|
||||
out:
|
||||
if(!retcode) {
|
||||
53
meta/recipes-support/curl/curl/CVE-2022-42915.patch
Normal file
53
meta/recipes-support/curl/curl/CVE-2022-42915.patch
Normal file
@@ -0,0 +1,53 @@
|
||||
From 3ede0e72aaad6447d2a5ab07dac43e1b9d7e617b Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Stenberg <daniel@haxx.se>
|
||||
Date: Thu, 6 Oct 2022 14:13:36 +0200
|
||||
Subject: [PATCH] http_proxy: restore the protocol pointer on error
|
||||
|
||||
Reported-by: Trail of Bits
|
||||
|
||||
Closes #9790
|
||||
|
||||
Upstream-Status: Backport [https://github.com/curl/curl/commit/55e1875729f9d9fc7315ce]
|
||||
Signed-off-by: Robert Joslyn <robert.joslyn@redrectangle.org>
|
||||
---
|
||||
lib/http_proxy.c | 6 ++----
|
||||
lib/url.c | 9 ---------
|
||||
2 files changed, 2 insertions(+), 13 deletions(-)
|
||||
|
||||
diff --git a/lib/http_proxy.c b/lib/http_proxy.c
|
||||
index 1f87f6c..cc20b3a 100644
|
||||
--- a/lib/http_proxy.c
|
||||
+++ b/lib/http_proxy.c
|
||||
@@ -212,10 +212,8 @@ void Curl_connect_done(struct Curl_easy *data)
|
||||
Curl_dyn_free(&s->rcvbuf);
|
||||
Curl_dyn_free(&s->req);
|
||||
|
||||
- /* restore the protocol pointer, if not already done */
|
||||
- if(s->prot_save)
|
||||
- data->req.p.http = s->prot_save;
|
||||
- s->prot_save = NULL;
|
||||
+ /* restore the protocol pointer */
|
||||
+ data->req.p.http = s->prot_save;
|
||||
data->info.httpcode = 0; /* clear it as it might've been used for the
|
||||
proxy */
|
||||
data->req.ignorebody = FALSE;
|
||||
diff --git a/lib/url.c b/lib/url.c
|
||||
index bfc784f..61c99d2 100644
|
||||
--- a/lib/url.c
|
||||
+++ b/lib/url.c
|
||||
@@ -746,15 +746,6 @@ static void conn_shutdown(struct Curl_easy *data, struct connectdata *conn)
|
||||
DEBUGASSERT(data);
|
||||
infof(data, "Closing connection %ld", conn->connection_id);
|
||||
|
||||
-#ifndef USE_HYPER
|
||||
- if(conn->connect_state && conn->connect_state->prot_save) {
|
||||
- /* If this was closed with a CONNECT in progress, cleanup this temporary
|
||||
- struct arrangement */
|
||||
- data->req.p.http = NULL;
|
||||
- Curl_safefree(conn->connect_state->prot_save);
|
||||
- }
|
||||
-#endif
|
||||
-
|
||||
/* possible left-overs from the async name resolvers */
|
||||
Curl_resolver_cancel(data);
|
||||
|
||||
134
meta/recipes-support/curl/curl/CVE-2022-42916.patch
Normal file
134
meta/recipes-support/curl/curl/CVE-2022-42916.patch
Normal file
@@ -0,0 +1,134 @@
|
||||
From 401455229a5006bed0346fedc99791ccb53e146c Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Stenberg <daniel@haxx.se>
|
||||
Date: Wed, 12 Oct 2022 10:47:59 +0200
|
||||
Subject: [PATCH] url: use IDN decoded names for HSTS checks
|
||||
|
||||
Reported-by: Hiroki Kurosawa
|
||||
|
||||
Closes #9791
|
||||
|
||||
Upstream-Status: Backport [https://github.com/curl/curl/commit/53bcf55b4538067e6]
|
||||
Signed-off-by: Robert Joslyn <robert.joslyn@redrectangle.org>
|
||||
---
|
||||
lib/url.c | 91 ++++++++++++++++++++++++++++---------------------------
|
||||
1 file changed, 47 insertions(+), 44 deletions(-)
|
||||
|
||||
diff --git a/lib/url.c b/lib/url.c
|
||||
index 61c99d2..6426fa7 100644
|
||||
--- a/lib/url.c
|
||||
+++ b/lib/url.c
|
||||
@@ -2024,10 +2024,56 @@ static CURLcode parseurlandfillconn(struct Curl_easy *data,
|
||||
failf(data, "Too long host name (maximum is %d)", MAX_URL_LEN);
|
||||
return CURLE_URL_MALFORMAT;
|
||||
}
|
||||
+ hostname = data->state.up.hostname;
|
||||
+
|
||||
+ if(hostname && hostname[0] == '[') {
|
||||
+ /* This looks like an IPv6 address literal. See if there is an address
|
||||
+ scope. */
|
||||
+ size_t hlen;
|
||||
+ conn->bits.ipv6_ip = TRUE;
|
||||
+ /* cut off the brackets! */
|
||||
+ hostname++;
|
||||
+ hlen = strlen(hostname);
|
||||
+ hostname[hlen - 1] = 0;
|
||||
+
|
||||
+ zonefrom_url(uh, data, conn);
|
||||
+ }
|
||||
+
|
||||
+ /* make sure the connect struct gets its own copy of the host name */
|
||||
+ conn->host.rawalloc = strdup(hostname ? hostname : "");
|
||||
+ if(!conn->host.rawalloc)
|
||||
+ return CURLE_OUT_OF_MEMORY;
|
||||
+ conn->host.name = conn->host.rawalloc;
|
||||
+
|
||||
+ /*************************************************************
|
||||
+ * IDN-convert the hostnames
|
||||
+ *************************************************************/
|
||||
+ result = Curl_idnconvert_hostname(data, &conn->host);
|
||||
+ if(result)
|
||||
+ return result;
|
||||
+ if(conn->bits.conn_to_host) {
|
||||
+ result = Curl_idnconvert_hostname(data, &conn->conn_to_host);
|
||||
+ if(result)
|
||||
+ return result;
|
||||
+ }
|
||||
+#ifndef CURL_DISABLE_PROXY
|
||||
+ if(conn->bits.httpproxy) {
|
||||
+ result = Curl_idnconvert_hostname(data, &conn->http_proxy.host);
|
||||
+ if(result)
|
||||
+ return result;
|
||||
+ }
|
||||
+ if(conn->bits.socksproxy) {
|
||||
+ result = Curl_idnconvert_hostname(data, &conn->socks_proxy.host);
|
||||
+ if(result)
|
||||
+ return result;
|
||||
+ }
|
||||
+#endif
|
||||
|
||||
#ifndef CURL_DISABLE_HSTS
|
||||
+ /* HSTS upgrade */
|
||||
if(data->hsts && strcasecompare("http", data->state.up.scheme)) {
|
||||
- if(Curl_hsts(data->hsts, data->state.up.hostname, TRUE)) {
|
||||
+ /* This MUST use the IDN decoded name */
|
||||
+ if(Curl_hsts(data->hsts, conn->host.name, TRUE)) {
|
||||
char *url;
|
||||
Curl_safefree(data->state.up.scheme);
|
||||
uc = curl_url_set(uh, CURLUPART_SCHEME, "https", 0);
|
||||
@@ -2133,26 +2179,6 @@ static CURLcode parseurlandfillconn(struct Curl_easy *data,
|
||||
|
||||
(void)curl_url_get(uh, CURLUPART_QUERY, &data->state.up.query, 0);
|
||||
|
||||
- hostname = data->state.up.hostname;
|
||||
- if(hostname && hostname[0] == '[') {
|
||||
- /* This looks like an IPv6 address literal. See if there is an address
|
||||
- scope. */
|
||||
- size_t hlen;
|
||||
- conn->bits.ipv6_ip = TRUE;
|
||||
- /* cut off the brackets! */
|
||||
- hostname++;
|
||||
- hlen = strlen(hostname);
|
||||
- hostname[hlen - 1] = 0;
|
||||
-
|
||||
- zonefrom_url(uh, data, conn);
|
||||
- }
|
||||
-
|
||||
- /* make sure the connect struct gets its own copy of the host name */
|
||||
- conn->host.rawalloc = strdup(hostname ? hostname : "");
|
||||
- if(!conn->host.rawalloc)
|
||||
- return CURLE_OUT_OF_MEMORY;
|
||||
- conn->host.name = conn->host.rawalloc;
|
||||
-
|
||||
#ifdef ENABLE_IPV6
|
||||
if(data->set.scope_id)
|
||||
/* Override any scope that was set above. */
|
||||
@@ -3781,29 +3807,6 @@ static CURLcode create_conn(struct Curl_easy *data,
|
||||
if(result)
|
||||
goto out;
|
||||
|
||||
- /*************************************************************
|
||||
- * IDN-convert the hostnames
|
||||
- *************************************************************/
|
||||
- result = Curl_idnconvert_hostname(data, &conn->host);
|
||||
- if(result)
|
||||
- goto out;
|
||||
- if(conn->bits.conn_to_host) {
|
||||
- result = Curl_idnconvert_hostname(data, &conn->conn_to_host);
|
||||
- if(result)
|
||||
- goto out;
|
||||
- }
|
||||
-#ifndef CURL_DISABLE_PROXY
|
||||
- if(conn->bits.httpproxy) {
|
||||
- result = Curl_idnconvert_hostname(data, &conn->http_proxy.host);
|
||||
- if(result)
|
||||
- goto out;
|
||||
- }
|
||||
- if(conn->bits.socksproxy) {
|
||||
- result = Curl_idnconvert_hostname(data, &conn->socks_proxy.host);
|
||||
- if(result)
|
||||
- goto out;
|
||||
- }
|
||||
-#endif
|
||||
|
||||
/*************************************************************
|
||||
* Check whether the host and the "connect to host" are equal.
|
||||
@@ -13,6 +13,10 @@ SRC_URI = " \
|
||||
https://curl.se/download/${BP}.tar.xz \
|
||||
file://run-ptest \
|
||||
file://disable-tests \
|
||||
file://CVE-2022-32221.patch \
|
||||
file://CVE-2022-35260.patch \
|
||||
file://CVE-2022-42915.patch \
|
||||
file://CVE-2022-42916.patch \
|
||||
"
|
||||
SRC_URI[sha256sum] = "88b54a6d4b9a48cb4d873c7056dcba997ddd5b7be5a2d537a4acb55c20b04be6"
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ SRC_URI = "https://www.gnupg.org/ftp/gcrypt/gnutls/v${SHRT_VER}/gnutls-${PV}.tar
|
||||
file://0001-Creating-.hmac-file-should-be-excuted-in-target-envi.patch \
|
||||
"
|
||||
|
||||
SRC_URI[sha256sum] = "be9143d0d58eab64dba9b77114aaafac529b6c0d7e81de6bdf1c9b59027d2106"
|
||||
SRC_URI[sha256sum] = "c58ad39af0670efe6a8aee5e3a8b2331a1200418b64b7c51977fb396d4617114"
|
||||
|
||||
inherit autotools texinfo pkgconfig gettext lib_package gtk-doc
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 1c234bc39446eb9b23896e85dd67b02976d46c3d Mon Sep 17 00:00:00 2001
|
||||
From a3196f3a06e7bbfde30d143c92a4325be323b3d0 Mon Sep 17 00:00:00 2001
|
||||
From: Hongxu Jia <hongxu.jia@windriver.com>
|
||||
Date: Thu, 14 Oct 2021 15:57:36 +0800
|
||||
Subject: [PATCH] nativesdk-libcap: Raise the size of arrays containing dl
|
||||
|
||||
@@ -20,7 +20,7 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/libs/security/linux-privs/${BPN}2/${BPN}-${
|
||||
SRC_URI:append:class-nativesdk = " \
|
||||
file://0001-nativesdk-libcap-Raise-the-size-of-arrays-containing.patch \
|
||||
"
|
||||
SRC_URI[sha256sum] = "73e350020cc31fe15360879d19384ffa3395a825f065fcf6bda3a5cdf965bebd"
|
||||
SRC_URI[sha256sum] = "15c40ededb3003d70a283fe587a36b7d19c8b3b554e33f86129c059a4bb466b2"
|
||||
|
||||
UPSTREAM_CHECK_URI = "https://www.kernel.org/pub/linux/libs/security/linux-privs/${BPN}2/"
|
||||
|
||||
@@ -15,7 +15,7 @@ SECTION = "libs"
|
||||
SRC_URI = "${GITHUB_BASE_URI}/download/v${PV}/${BP}.tar.gz \
|
||||
file://0001-cmake-Do-not-export-CC-into-gir-compiler.patch \
|
||||
"
|
||||
SRC_URI[sha256sum] = "4284b780356f1dc6a01f16083e7b836e63d3815e27ed0eaaad684712357ccc8f"
|
||||
SRC_URI[sha256sum] = "019085ba99936f25546d86cb3e34852e5fe2b5a7d5f1cb4423a0cc42e399f629"
|
||||
|
||||
inherit cmake pkgconfig gobject-introspection vala github-releases
|
||||
|
||||
@@ -24,7 +24,7 @@ UPSTREAM_CHECK_URI = "https://gnupg.org/download/index.html"
|
||||
SRC_URI = "${GNUPG_MIRROR}/${BPN}/${BPN}-${PV}.tar.bz2 \
|
||||
file://ksba-add-pkgconfig-support.patch"
|
||||
|
||||
SRC_URI[sha256sum] = "dad683e6f2d915d880aa4bed5cea9a115690b8935b78a1bbe01669189307a48b"
|
||||
SRC_URI[sha256sum] = "fce01ccac59812bddadffacff017dac2e4762bdb6ebc6ffe06f6ed4f6192c971"
|
||||
|
||||
do_configure:prepend () {
|
||||
# Else these could be used in preference to those in aclocal-copy
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user