mirror of
https://git.yoctoproject.org/poky
synced 2026-02-20 08:29:42 +01:00
Compare commits
177 Commits
kirkstone-
...
kirkstone-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
755632c2fc | ||
|
|
387d01b0a4 | ||
|
|
4761cbe1ee | ||
|
|
8a09f8472f | ||
|
|
82802901c6 | ||
|
|
f22a96e5cc | ||
|
|
3562768af7 | ||
|
|
6f84c60edf | ||
|
|
eadd5efcb3 | ||
|
|
e01044d629 | ||
|
|
079e50aba0 | ||
|
|
26ffdb7a30 | ||
|
|
1110f16718 | ||
|
|
8b75148d87 | ||
|
|
75b08b43a4 | ||
|
|
c4f28d9643 | ||
|
|
30be4f67cc | ||
|
|
75cd31f6d3 | ||
|
|
f5c3c374e8 | ||
|
|
93d2e547d1 | ||
|
|
31507dd07a | ||
|
|
82e76d21dc | ||
|
|
006b4b976c | ||
|
|
d6385a54cb | ||
|
|
acd993f24c | ||
|
|
98223b776a | ||
|
|
7057b7bb2b | ||
|
|
a76bc698c4 | ||
|
|
3e73216a32 | ||
|
|
239bf770b6 | ||
|
|
d1b9e2acaa | ||
|
|
51a2c26e29 | ||
|
|
f46bb8ad10 | ||
|
|
f007ad78dd | ||
|
|
24121f9699 | ||
|
|
f8a7dbd8fb | ||
|
|
8dc22248a8 | ||
|
|
b159ad2464 | ||
|
|
a2d67684cc | ||
|
|
fdd88b549f | ||
|
|
95795dff9b | ||
|
|
6c9f29507f | ||
|
|
942c66a9fb | ||
|
|
12643571ec | ||
|
|
9536f32528 | ||
|
|
e826f80436 | ||
|
|
f19d7f427e | ||
|
|
c8fa08b01c | ||
|
|
ecba5ff495 | ||
|
|
a7657ca5ff | ||
|
|
c771630e99 | ||
|
|
39aa7af59b | ||
|
|
2629c5fe89 | ||
|
|
517e513209 | ||
|
|
973020ce12 | ||
|
|
f2c0b5cef2 | ||
|
|
1867c0de35 | ||
|
|
24646e55b2 | ||
|
|
f9527fb2ac | ||
|
|
e447b4139f | ||
|
|
f60fb52055 | ||
|
|
2e3c89e255 | ||
|
|
9200c6b310 | ||
|
|
ae28221a40 | ||
|
|
4e227eaf1c | ||
|
|
9f0a8901d1 | ||
|
|
f9a95adda5 | ||
|
|
a171408008 | ||
|
|
8d57eddc82 | ||
|
|
2fc0a78176 | ||
|
|
0207478c7b | ||
|
|
d8d6d921fa | ||
|
|
73e3b5481b | ||
|
|
df56d7c525 | ||
|
|
5f21fa7de9 | ||
|
|
b971ffa75e | ||
|
|
f966e16c3b | ||
|
|
83d53dc031 | ||
|
|
f948c66f75 | ||
|
|
b1ddd4178d | ||
|
|
95b430be16 | ||
|
|
e46e74cd90 | ||
|
|
f35f1aaf22 | ||
|
|
715fc203c2 | ||
|
|
e9a7427077 | ||
|
|
6f022adb5c | ||
|
|
59077aa77b | ||
|
|
bdea205855 | ||
|
|
bf5e50a353 | ||
|
|
3fd3ed3b11 | ||
|
|
b5b18d155e | ||
|
|
c3032cebe7 | ||
|
|
955796ad7e | ||
|
|
650980791e | ||
|
|
0f23056836 | ||
|
|
6fd2902f05 | ||
|
|
720324bd18 | ||
|
|
6a3b428c7c | ||
|
|
c969a2456c | ||
|
|
734069e81b | ||
|
|
aaf748b95f | ||
|
|
811cf0320c | ||
|
|
a6f551f516 | ||
|
|
fb38c59633 | ||
|
|
386672ff8c | ||
|
|
e06868eff3 | ||
|
|
024fa046fc | ||
|
|
7725c28871 | ||
|
|
b1c1d6d048 | ||
|
|
70f4bd1b3c | ||
|
|
72ddfbc89a | ||
|
|
36a2a0129a | ||
|
|
6da1e21e9a | ||
|
|
24e9fed15a | ||
|
|
f550a63161 | ||
|
|
8391218990 | ||
|
|
bdcc4c9909 | ||
|
|
4b721dc5c8 | ||
|
|
455b08d0a9 | ||
|
|
4537f28311 | ||
|
|
47d212a57f | ||
|
|
a721e0f85b | ||
|
|
fbf88236e3 | ||
|
|
7b43af7ad4 | ||
|
|
f989613808 | ||
|
|
3f174130d3 | ||
|
|
43e36aec34 | ||
|
|
c0b54da555 | ||
|
|
cc936073a4 | ||
|
|
36e8271ca0 | ||
|
|
49ebeb4b0d | ||
|
|
73d81d2908 | ||
|
|
9d5d4218ec | ||
|
|
e77b551dbf | ||
|
|
600b508c37 | ||
|
|
2a2ea5ac75 | ||
|
|
de59761cbb | ||
|
|
3a3afebf41 | ||
|
|
222be3e3b9 | ||
|
|
ef5214f584 | ||
|
|
bf72cdd748 | ||
|
|
fbbe0f86ba | ||
|
|
f06b171bee | ||
|
|
96d8a62454 | ||
|
|
6b0501fef3 | ||
|
|
6191449343 | ||
|
|
7ffedb40a1 | ||
|
|
1c8f2d8cad | ||
|
|
fcb2375417 | ||
|
|
91c3fc996e | ||
|
|
c58c63d48f | ||
|
|
3ba8fdef70 | ||
|
|
ee2bf45810 | ||
|
|
c156968a90 | ||
|
|
ad12417f38 | ||
|
|
7eefa6dfb6 | ||
|
|
0b624c308c | ||
|
|
22caf0ce33 | ||
|
|
74b22a5e91 | ||
|
|
25073f9c0e | ||
|
|
0e4966eb77 | ||
|
|
6b6a161273 | ||
|
|
eea8e56bed | ||
|
|
eae16020a2 | ||
|
|
81cad46d69 | ||
|
|
8b4655300d | ||
|
|
425ed15bde | ||
|
|
6cbbd132d3 | ||
|
|
e67e90c557 | ||
|
|
a54b91946c | ||
|
|
a1b812eefa | ||
|
|
7435f15930 | ||
|
|
fe7e47368e | ||
|
|
200596b5ad | ||
|
|
226bc34085 | ||
|
|
df7a37d54f | ||
|
|
dc1a3be255 |
24
SECURITY.md
Normal file
24
SECURITY.md
Normal file
@@ -0,0 +1,24 @@
|
||||
How to Report a Potential Vulnerability?
|
||||
========================================
|
||||
|
||||
If you would like to report a public issue (for example, one with a released
|
||||
CVE number), please report it using the
|
||||
[https://bugzilla.yoctoproject.org/enter_bug.cgi?product=Security Security Bugzilla].
|
||||
If you have a patch ready, submit it following the same procedure as any other
|
||||
patch as described in README.md.
|
||||
|
||||
If you are dealing with a not-yet released or urgent issue, please send a
|
||||
message to security AT yoctoproject DOT org, including as many details as
|
||||
possible: the layer or software module affected, the recipe and its version,
|
||||
and any example code, if available.
|
||||
|
||||
Branches maintained with security fixes
|
||||
---------------------------------------
|
||||
|
||||
See [https://wiki.yoctoproject.org/wiki/Stable_Release_and_LTS Stable release and LTS]
|
||||
for detailed info regarding the policies and maintenance of Stable branches.
|
||||
|
||||
The [https://wiki.yoctoproject.org/wiki/Releases Release page] contains a list of all
|
||||
releases of the Yocto Project. Versions in grey are no longer actively maintained with
|
||||
security patches, but well-tested patches may still be accepted for them for
|
||||
significant issues.
|
||||
24
bitbake/SECURITY.md
Normal file
24
bitbake/SECURITY.md
Normal file
@@ -0,0 +1,24 @@
|
||||
How to Report a Potential Vulnerability?
|
||||
========================================
|
||||
|
||||
If you would like to report a public issue (for example, one with a released
|
||||
CVE number), please report it using the
|
||||
[https://bugzilla.yoctoproject.org/enter_bug.cgi?product=Security Security Bugzilla].
|
||||
If you have a patch ready, submit it following the same procedure as any other
|
||||
patch as described in README.md.
|
||||
|
||||
If you are dealing with a not-yet released or urgent issue, please send a
|
||||
message to security AT yoctoproject DOT org, including as many details as
|
||||
possible: the layer or software module affected, the recipe and its version,
|
||||
and any example code, if available.
|
||||
|
||||
Branches maintained with security fixes
|
||||
---------------------------------------
|
||||
|
||||
See [https://wiki.yoctoproject.org/wiki/Stable_Release_and_LTS Stable release and LTS]
|
||||
for detailed info regarding the policies and maintenance of Stable branches.
|
||||
|
||||
The [https://wiki.yoctoproject.org/wiki/Releases Release page] contains a list of all
|
||||
releases of the Yocto Project. Versions in grey are no longer actively maintained with
|
||||
security patches, but well-tested patches may still be accepted for them for
|
||||
significant issues.
|
||||
@@ -25,6 +25,7 @@ if __name__ == "__main__":
|
||||
parser.add_argument('-u', '--unexpand', help='Do not expand the value (with --value)', action="store_true")
|
||||
parser.add_argument('-f', '--flag', help='Specify a variable flag to query (with --value)', default=None)
|
||||
parser.add_argument('--value', help='Only report the value, no history and no variable name', action="store_true")
|
||||
parser.add_argument('-q', '--quiet', help='Silence bitbake server logging', action="store_true")
|
||||
args = parser.parse_args()
|
||||
|
||||
if args.unexpand and not args.value:
|
||||
@@ -35,9 +36,10 @@ if __name__ == "__main__":
|
||||
print("--flag only makes sense with --value")
|
||||
sys.exit(1)
|
||||
|
||||
with bb.tinfoil.Tinfoil(tracking=True) as tinfoil:
|
||||
quiet = args.quiet
|
||||
with bb.tinfoil.Tinfoil(tracking=True, setup_logging=not quiet) as tinfoil:
|
||||
if args.recipe:
|
||||
tinfoil.prepare(quiet=2)
|
||||
tinfoil.prepare(quiet=3 if quiet else 2)
|
||||
d = tinfoil.parse_recipe(args.recipe)
|
||||
else:
|
||||
tinfoil.prepare(quiet=2, config_only=True)
|
||||
|
||||
@@ -91,19 +91,19 @@ def worker_fire_prepickled(event):
|
||||
worker_thread_exit = False
|
||||
|
||||
def worker_flush(worker_queue):
|
||||
worker_queue_int = b""
|
||||
worker_queue_int = bytearray()
|
||||
global worker_pipe, worker_thread_exit
|
||||
|
||||
while True:
|
||||
try:
|
||||
worker_queue_int = worker_queue_int + worker_queue.get(True, 1)
|
||||
worker_queue_int.extend(worker_queue.get(True, 1))
|
||||
except queue.Empty:
|
||||
pass
|
||||
while (worker_queue_int or not worker_queue.empty()):
|
||||
try:
|
||||
(_, ready, _) = select.select([], [worker_pipe], [], 1)
|
||||
if not worker_queue.empty():
|
||||
worker_queue_int = worker_queue_int + worker_queue.get()
|
||||
worker_queue_int.extend(worker_queue.get())
|
||||
written = os.write(worker_pipe, worker_queue_int)
|
||||
worker_queue_int = worker_queue_int[written:]
|
||||
except (IOError, OSError) as e:
|
||||
@@ -338,12 +338,12 @@ class runQueueWorkerPipe():
|
||||
if pipeout:
|
||||
pipeout.close()
|
||||
bb.utils.nonblockingfd(self.input)
|
||||
self.queue = b""
|
||||
self.queue = bytearray()
|
||||
|
||||
def read(self):
|
||||
start = len(self.queue)
|
||||
try:
|
||||
self.queue = self.queue + (self.input.read(102400) or b"")
|
||||
self.queue.extend(self.input.read(102400) or b"")
|
||||
except (OSError, IOError) as e:
|
||||
if e.errno != errno.EAGAIN:
|
||||
raise
|
||||
@@ -371,7 +371,7 @@ class BitbakeWorker(object):
|
||||
def __init__(self, din):
|
||||
self.input = din
|
||||
bb.utils.nonblockingfd(self.input)
|
||||
self.queue = b""
|
||||
self.queue = bytearray()
|
||||
self.cookercfg = None
|
||||
self.databuilder = None
|
||||
self.data = None
|
||||
@@ -405,7 +405,7 @@ class BitbakeWorker(object):
|
||||
if len(r) == 0:
|
||||
# EOF on pipe, server must have terminated
|
||||
self.sigterm_exception(signal.SIGTERM, None)
|
||||
self.queue = self.queue + r
|
||||
self.queue.extend(r)
|
||||
except (OSError, IOError):
|
||||
pass
|
||||
if len(self.queue):
|
||||
|
||||
@@ -234,9 +234,10 @@ class diskMonitor:
|
||||
freeInode = st.f_favail
|
||||
|
||||
if minInode and freeInode < minInode:
|
||||
# Some filesystems use dynamic inodes so can't run out
|
||||
# (e.g. btrfs). This is reported by the inode count being 0.
|
||||
if st.f_files == 0:
|
||||
# Some filesystems use dynamic inodes so can't run out.
|
||||
# This is reported by the inode count being 0 (btrfs) or the free
|
||||
# inode count being -1 (cephfs).
|
||||
if st.f_files == 0 or st.f_favail == -1:
|
||||
self.devDict[k][2] = None
|
||||
continue
|
||||
# Always show warning, the self.checked would always be False if the action is WARN
|
||||
|
||||
@@ -198,15 +198,27 @@ class RunQueueScheduler(object):
|
||||
curr_cpu_pressure = cpu_pressure_fds.readline().split()[4].split("=")[1]
|
||||
curr_io_pressure = io_pressure_fds.readline().split()[4].split("=")[1]
|
||||
curr_memory_pressure = memory_pressure_fds.readline().split()[4].split("=")[1]
|
||||
exceeds_cpu_pressure = self.rq.max_cpu_pressure and (float(curr_cpu_pressure) - float(self.prev_cpu_pressure)) > self.rq.max_cpu_pressure
|
||||
exceeds_io_pressure = self.rq.max_io_pressure and (float(curr_io_pressure) - float(self.prev_io_pressure)) > self.rq.max_io_pressure
|
||||
exceeds_memory_pressure = self.rq.max_memory_pressure and (float(curr_memory_pressure) - float(self.prev_memory_pressure)) > self.rq.max_memory_pressure
|
||||
now = time.time()
|
||||
if now - self.prev_pressure_time > 1.0:
|
||||
tdiff = now - self.prev_pressure_time
|
||||
psi_accumulation_interval = 1.0
|
||||
cpu_pressure = (float(curr_cpu_pressure) - float(self.prev_cpu_pressure)) / tdiff
|
||||
io_pressure = (float(curr_io_pressure) - float(self.prev_io_pressure)) / tdiff
|
||||
memory_pressure = (float(curr_memory_pressure) - float(self.prev_memory_pressure)) / tdiff
|
||||
exceeds_cpu_pressure = self.rq.max_cpu_pressure and cpu_pressure > self.rq.max_cpu_pressure
|
||||
exceeds_io_pressure = self.rq.max_io_pressure and io_pressure > self.rq.max_io_pressure
|
||||
exceeds_memory_pressure = self.rq.max_memory_pressure and memory_pressure > self.rq.max_memory_pressure
|
||||
|
||||
if tdiff > psi_accumulation_interval:
|
||||
self.prev_cpu_pressure = curr_cpu_pressure
|
||||
self.prev_io_pressure = curr_io_pressure
|
||||
self.prev_memory_pressure = curr_memory_pressure
|
||||
self.prev_pressure_time = now
|
||||
|
||||
pressure_state = (exceeds_cpu_pressure, exceeds_io_pressure, exceeds_memory_pressure)
|
||||
pressure_values = (round(cpu_pressure,1), self.rq.max_cpu_pressure, round(io_pressure,1), self.rq.max_io_pressure, round(memory_pressure,1), self.rq.max_memory_pressure)
|
||||
if hasattr(self, "pressure_state") and pressure_state != self.pressure_state:
|
||||
bb.note("Pressure status changed to CPU: %s, IO: %s, Mem: %s (CPU: %s/%s, IO: %s/%s, Mem: %s/%s) - using %s/%s bitbake threads" % (pressure_state + pressure_values + (len(self.rq.runq_running.difference(self.rq.runq_complete)), self.rq.number_tasks)))
|
||||
self.pressure_state = pressure_state
|
||||
return (exceeds_cpu_pressure or exceeds_io_pressure or exceeds_memory_pressure)
|
||||
return False
|
||||
|
||||
@@ -1980,12 +1992,12 @@ class RunQueueExecute:
|
||||
# Allow the next deferred task to run. Any other deferred tasks should be deferred after that task.
|
||||
# We shouldn't allow all to run at once as it is prone to races.
|
||||
if not found:
|
||||
bb.note("Deferred task %s now buildable" % t)
|
||||
bb.debug(1, "Deferred task %s now buildable" % t)
|
||||
del self.sq_deferred[t]
|
||||
update_scenequeue_data([t], self.sqdata, self.rqdata, self.rq, self.cooker, self.stampcache, self, summary=False)
|
||||
found = t
|
||||
else:
|
||||
bb.note("Deferring %s after %s" % (t, found))
|
||||
bb.debug(1, "Deferring %s after %s" % (t, found))
|
||||
self.sq_deferred[t] = found
|
||||
|
||||
def task_complete(self, task):
|
||||
@@ -2892,7 +2904,7 @@ def build_scenequeue_data(sqdata, rqdata, rq, cooker, stampcache, sqrq):
|
||||
sqdata.hashes[h] = tid
|
||||
else:
|
||||
sqrq.sq_deferred[tid] = sqdata.hashes[h]
|
||||
bb.note("Deferring %s after %s" % (tid, sqdata.hashes[h]))
|
||||
bb.debug(1, "Deferring %s after %s" % (tid, sqdata.hashes[h]))
|
||||
|
||||
update_scenequeue_data(sqdata.sq_revdeps, sqdata, rqdata, rq, cooker, stampcache, sqrq, summary=True)
|
||||
|
||||
@@ -3101,7 +3113,7 @@ class runQueuePipe():
|
||||
if pipeout:
|
||||
pipeout.close()
|
||||
bb.utils.nonblockingfd(self.input)
|
||||
self.queue = b""
|
||||
self.queue = bytearray()
|
||||
self.d = d
|
||||
self.rq = rq
|
||||
self.rqexec = rqexec
|
||||
@@ -3120,7 +3132,7 @@ class runQueuePipe():
|
||||
|
||||
start = len(self.queue)
|
||||
try:
|
||||
self.queue = self.queue + (self.input.read(102400) or b"")
|
||||
self.queue.extend(self.input.read(102400) or b"")
|
||||
except (OSError, IOError) as e:
|
||||
if e.errno != errno.EAGAIN:
|
||||
raise
|
||||
|
||||
@@ -324,11 +324,11 @@ class Tinfoil:
|
||||
self.recipes_parsed = False
|
||||
self.quiet = 0
|
||||
self.oldhandlers = self.logger.handlers[:]
|
||||
self.localhandlers = []
|
||||
if setup_logging:
|
||||
# This is the *client-side* logger, nothing to do with
|
||||
# logging messages from the server
|
||||
bb.msg.logger_create('BitBake', output)
|
||||
self.localhandlers = []
|
||||
for handler in self.logger.handlers:
|
||||
if handler not in self.oldhandlers:
|
||||
self.localhandlers.append(handler)
|
||||
|
||||
@@ -257,7 +257,7 @@ an entire Linux distribution, including the toolchain, from source.
|
||||
BB_SIGNATURE_HANDLER = "OEEquivHash"
|
||||
BB_HASHSERVE = "auto"
|
||||
BB_HASHSERVE_UPSTREAM = "hashserv.yocto.io:8687"
|
||||
SSTATE_MIRRORS ?= "file://.* https://sstate.yoctoproject.org/all/PATH;downloadfilename=PATH"
|
||||
SSTATE_MIRRORS ?= "file://.* http://cdn.jsdelivr.net/yocto/sstate/all/PATH;downloadfilename=PATH"
|
||||
|
||||
#. **Start the Build:** Continue with the following command to build an OS
|
||||
image for the target, which is ``core-image-sato`` in this example:
|
||||
|
||||
@@ -774,20 +774,6 @@ workflow.
|
||||
|
||||
- Two general IA platforms (``genericx86`` and ``genericx86-64``)
|
||||
|
||||
- There are three core Intel BSPs in the Yocto Project
|
||||
release, in the ``meta-intel`` layer:
|
||||
|
||||
- ``intel-core2-32``, which is a BSP optimized for the Core2
|
||||
family of CPUs as well as all CPUs prior to the Silvermont
|
||||
core.
|
||||
|
||||
- ``intel-corei7-64``, which is a BSP optimized for Nehalem
|
||||
and later Core and Xeon CPUs as well as Silvermont and later
|
||||
Atom CPUs, such as the Baytrail SoCs.
|
||||
|
||||
- ``intel-quark``, which is a BSP optimized for the Intel
|
||||
Galileo gen1 & gen2 development boards.
|
||||
|
||||
When you set up a layer for a new BSP, you should follow a standard
|
||||
layout. This layout is described in the ":ref:`bsp-guide/bsp:example filesystem layout`"
|
||||
section. In the standard layout, notice
|
||||
@@ -893,8 +879,8 @@ Yocto Project:
|
||||
``recipes-*`` subdirectories specific to the recipe's function, or
|
||||
within a subdirectory containing a set of closely-related recipes.
|
||||
The recipes themselves should follow the general guidelines for
|
||||
recipes used in the Yocto Project found in the ":oe_wiki:`OpenEmbedded
|
||||
Style Guide </Styleguide>`".
|
||||
recipes found in the ":doc:`../contributor-guide/recipe-style-guide`"
|
||||
in the Yocto Project and OpenEmbedded Contributor Guide.
|
||||
|
||||
- *License File:* You must include a license file in the
|
||||
``meta-bsp_root_name`` directory. This license covers the BSP
|
||||
@@ -1194,7 +1180,7 @@ Use these steps to create a BSP layer:
|
||||
|
||||
- *Create a Kernel Recipe:* Create a kernel recipe in
|
||||
``recipes-kernel/linux`` by either using a kernel append file or a
|
||||
new custom kernel recipe file (e.g. ``yocto-linux_4.12.bb``). The BSP
|
||||
new custom kernel recipe file (e.g. ``linux-yocto_4.12.bb``). The BSP
|
||||
layers mentioned in the previous step also contain different kernel
|
||||
examples. See the ":ref:`kernel-dev/common:modifying an existing recipe`"
|
||||
section in the Yocto Project Linux Kernel Development Manual for
|
||||
@@ -1449,39 +1435,39 @@ The kernel recipe used to build the kernel image for the BeagleBone
|
||||
device was established in the machine configuration::
|
||||
|
||||
PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto"
|
||||
PREFERRED_VERSION_linux-yocto ?= "5.0%"
|
||||
PREFERRED_VERSION_linux-yocto ?= "5.15%"
|
||||
|
||||
The ``meta-yocto-bsp/recipes-kernel/linux`` directory in the layer contains
|
||||
metadata used to build the kernel. In this case, a kernel append file
|
||||
(i.e. ``linux-yocto_5.0.bbappend``) is used to override an established
|
||||
kernel recipe (i.e. ``linux-yocto_5.0.bb``), which is located in
|
||||
:yocto_git:`/poky/tree/meta/recipes-kernel/linux`.
|
||||
(i.e. ``linux-yocto_5.15.bbappend``) is used to override an established
|
||||
kernel recipe (i.e. ``linux-yocto_5.15.bb``), which is located in
|
||||
:yocto_git:`/poky/tree/meta-yocto-bsp/recipes-kernel/linux`.
|
||||
|
||||
Following is the contents of the append file::
|
||||
|
||||
KBRANCH:genericx86 = "v5.0/standard/base"
|
||||
KBRANCH:genericx86-64 = "v5.0/standard/base"
|
||||
KBRANCH:edgerouter = "v5.0/standard/edgerouter"
|
||||
KBRANCH:beaglebone-yocto = "v5.0/standard/beaglebone"
|
||||
KBRANCH:genericx86 = "v5.15/standard/base"
|
||||
KBRANCH:genericx86-64 = "v5.15/standard/base"
|
||||
KBRANCH:edgerouter = "v5.15/standard/edgerouter"
|
||||
KBRANCH:beaglebone-yocto = "v5.15/standard/beaglebone"
|
||||
|
||||
KMACHINE:genericx86 ?= "common-pc"
|
||||
KMACHINE:genericx86-64 ?= "common-pc-64"
|
||||
KMACHINE:beaglebone-yocto ?= "beaglebone"
|
||||
|
||||
SRCREV_machine:genericx86 ?= "3df4aae6074e94e794e27fe7f17451d9353cdf3d"
|
||||
SRCREV_machine:genericx86-64 ?= "3df4aae6074e94e794e27fe7f17451d9353cdf3d"
|
||||
SRCREV_machine:edgerouter ?= "3df4aae6074e94e794e27fe7f17451d9353cdf3d"
|
||||
SRCREV_machine:beaglebone-yocto ?= "3df4aae6074e94e794e27fe7f17451d9353cdf3d"
|
||||
SRCREV_machine:genericx86 ?= "0b628306d1f9ea28c0e86369ce9bb87a47893c9c"
|
||||
SRCREV_machine:genericx86-64 ?= "0b628306d1f9ea28c0e86369ce9bb87a47893c9c"
|
||||
SRCREV_machine:edgerouter ?= "90f1ee6589264545f548d731c2480b08a007230f"
|
||||
SRCREV_machine:beaglebone-yocto ?= "9aabbaa89fcb21af7028e814c1f5b61171314d5a"
|
||||
|
||||
COMPATIBLE_MACHINE:genericx86 = "genericx86"
|
||||
COMPATIBLE_MACHINE:genericx86-64 = "genericx86-64"
|
||||
COMPATIBLE_MACHINE:edgerouter = "edgerouter"
|
||||
COMPATIBLE_MACHINE:beaglebone-yocto = "beaglebone-yocto"
|
||||
|
||||
LINUX_VERSION:genericx86 = "5.0.3"
|
||||
LINUX_VERSION:genericx86-64 = "5.0.3"
|
||||
LINUX_VERSION:edgerouter = "5.0.3"
|
||||
LINUX_VERSION:beaglebone-yocto = "5.0.3"
|
||||
LINUX_VERSION:genericx86 = "5.15.72"
|
||||
LINUX_VERSION:genericx86-64 = "5.15.72"
|
||||
LINUX_VERSION:edgerouter = "5.15.54"
|
||||
LINUX_VERSION:beaglebone-yocto = "5.15.54"
|
||||
|
||||
This particular append file works for all the machines that are
|
||||
part of the ``meta-yocto-bsp`` layer. The relevant statements are
|
||||
|
||||
@@ -7,17 +7,18 @@ Recipe Naming Conventions
|
||||
=========================
|
||||
|
||||
In general, most recipes should follow the naming convention
|
||||
``recipes-category/package/packagename_version.bb``. Recipes for related
|
||||
projects may share the same package directory. ``packagename``, ``category``,
|
||||
and ``package`` may contain hyphens, but hyphens are not allowed in ``version``.
|
||||
``recipes-category/recipename/recipename_version.bb``. Recipes for related
|
||||
projects may share the same recipe directory. ``recipename`` and ``category``
|
||||
may contain hyphens, but hyphens are not allowed in ``version``.
|
||||
|
||||
If the recipe is tracking a Git revision that does not correspond to a released
|
||||
version of the software, ``version`` may be ``git`` (e.g. ``packagename_git.bb``)
|
||||
version of the software, ``version`` may be ``git`` (e.g. ``recipename_git.bb``)
|
||||
and the recipe would set :term:`PV`.
|
||||
|
||||
Version Policy
|
||||
==============
|
||||
|
||||
Our versions follow the form ``<package epoch>:<package version>-<package revision>``
|
||||
Our versions follow the form ``<epoch>:<version>-<revision>``
|
||||
or in BitBake variable terms ${:term:`PE`}:${:term:`PV`}-${:term:`PR`}. We
|
||||
generally follow the `Debian <https://www.debian.org/doc/debian-policy/ch-controlfields.html#version>`__
|
||||
version policy which defines these terms.
|
||||
@@ -26,7 +27,7 @@ In most cases the version :term:`PV` will be set automatically from the recipe
|
||||
file name. It is recommended to use released versions of software as these are
|
||||
revisions that upstream are expecting people to use.
|
||||
|
||||
Package versions should always compare and sort correctly so that upgrades work
|
||||
Recipe versions should always compare and sort correctly so that upgrades work
|
||||
as expected. With conventional versions such as ``1.4`` upgrading ``to 1.5``
|
||||
this happens naturally, but some versions don't sort. For example,
|
||||
``1.5 Release Candidate 2`` could be written as ``1.5rc2`` but this sorts after
|
||||
@@ -62,7 +63,7 @@ Version Number Changes
|
||||
|
||||
The :term:`PR` variable is used to indicate different revisions of a recipe
|
||||
that reference the same upstream source version. It can be used to force a
|
||||
new version of a package to be installed onto a device from a package feed.
|
||||
new version of a recipe to be installed onto a device from a package feed.
|
||||
These once had to be set manually but in most cases these can now be set and
|
||||
incremented automatically by a PR Server connected with a package feed.
|
||||
|
||||
@@ -256,6 +257,20 @@ Tips and Guidelines for Writing Recipes
|
||||
and ``-nativesdk`` ones, whenever possible. This avoids having to maintain multiple
|
||||
recipe files at the same time.
|
||||
|
||||
- Recipes should have tasks which are idempotent, i.e. that executing a given task
|
||||
multiple times shouldn't change the end result. The build environment is built upon
|
||||
this assumption and breaking it can cause obscure build failures.
|
||||
|
||||
- For idempotence when modifying files in tasks, it is usually best to:
|
||||
|
||||
- copy a file ``X`` to ``X.orig`` (only if it doesn't exist already)
|
||||
- then, copy ``X.orig`` back to ``X``,
|
||||
- and, finally, modify ``X``.
|
||||
|
||||
This ensures if rerun the task always has the same end result and the
|
||||
original file can be preserved to reuse. It also guards against an
|
||||
interrupted build corrupting the file.
|
||||
|
||||
Patch Upstream Status
|
||||
=====================
|
||||
|
||||
@@ -271,19 +286,23 @@ Then, you should also add an ``Upstream-Status:`` tag containing one of the
|
||||
following status strings:
|
||||
|
||||
``Pending``
|
||||
No determination has been made yet or not yet submitted to upstream.
|
||||
No determination has been made yet, or patch has not yet been submitted to
|
||||
upstream.
|
||||
|
||||
Keep in mind that every patch submitted upstream reduces the maintainance
|
||||
burden in OpenEmbedded and Yocto Project in the long run, so this patch
|
||||
status should only be used in exceptional cases if there are genuine
|
||||
obstacles to submitting a patch upstream; the reason for that should be
|
||||
included in the patch.
|
||||
|
||||
``Submitted [where]``
|
||||
Submitted to upstream, waiting for approval. Optionally include where
|
||||
it was submitted, such as the author, mailing list, etc.
|
||||
|
||||
``Accepted``
|
||||
Accepted in upstream, expect it to be removed at next update, include
|
||||
expected version info.
|
||||
|
||||
``Backport``
|
||||
Backported from new upstream version, because we are at a fixed version,
|
||||
include upstream version info.
|
||||
``Backport [version]``
|
||||
Accepted upstream and included in the next release, or backported from newer
|
||||
upstream version, because we are at a fixed version.
|
||||
Include upstream version info (e.g. commit ID or next expected version).
|
||||
|
||||
``Denied``
|
||||
Not accepted by upstream, include reason in patch.
|
||||
@@ -299,29 +318,30 @@ following status strings:
|
||||
|
||||
``Inappropriate [reason]``
|
||||
The patch is not appropriate for upstream, include a brief reason on the
|
||||
same line enclosed with ``[]``. The reason can be:
|
||||
same line enclosed with ``[]``. In the past, there were several different
|
||||
reasons not to submit patches upstream, but we have to consider that every
|
||||
non-upstreamed patch means a maintainance burden for recipe maintainers.
|
||||
Currently, the only reasons to mark patches as inappropriate for upstream
|
||||
submission are:
|
||||
|
||||
- ``not author`` (you are not the author and do not intend to upstream this,
|
||||
the source must be listed in the comments)
|
||||
- ``native``
|
||||
- ``licensing``
|
||||
- ``configuration``
|
||||
- ``enable feature``
|
||||
- ``disable feature``
|
||||
- ``bugfix`` (add bug URL here)
|
||||
- ``embedded specific``
|
||||
- ``other`` (give details in comments)
|
||||
|
||||
The various ``Inappropriate [reason]`` status items are meant to indicate that
|
||||
the person responsible for adding this patch to the system does not intend to
|
||||
upstream the patch for a specific reason.
|
||||
- ``oe specific``: the issue is specific to how OpenEmbedded performs builds
|
||||
or sets things up at runtime, and can be resolved only with a patch that
|
||||
is not however relevant or appropriate for general upstream submission.
|
||||
- ``upstream ticket <link>``: the issue is not specific to Open-Embedded
|
||||
and should be fixed upstream, but the patch in its current form is not
|
||||
suitable for merging upstream, and the author lacks sufficient expertise
|
||||
to develop a proper patch. Instead the issue is handled via a bug report
|
||||
(include link).
|
||||
|
||||
Of course, if another person later takes care of submitting this patch upstream,
|
||||
the status should be changed to ``Submitted [where]``, and an additional
|
||||
``Signed-off-by:`` line should be added to the patch by the person claiming
|
||||
responsibility for upstreaming.
|
||||
|
||||
For example, if the patch has been submitted upstream::
|
||||
Examples
|
||||
--------
|
||||
|
||||
Here's an example of a patch that has been submitted upstream::
|
||||
|
||||
rpm: Adjusted the foo setting in bar
|
||||
|
||||
@@ -334,5 +354,46 @@ For example, if the patch has been submitted upstream::
|
||||
|
||||
Signed-off-by: Joe Developer <joe.developer@example.com>
|
||||
|
||||
A future update can change the value to ``Accepted`` or ``Denied`` as
|
||||
A future update can change the value to ``Backport`` or ``Denied`` as
|
||||
appropriate.
|
||||
|
||||
Another example of a patch that is specific to OpenEmbedded::
|
||||
|
||||
Do not treat warnings as errors
|
||||
|
||||
There are additional warnings found with musl which are
|
||||
treated as errors and fails the build, we have more combinations
|
||||
than upstream supports to handle.
|
||||
|
||||
Upstream-Status: Inappropriate [oe specific]
|
||||
|
||||
Here's a patch that has been backported from an upstream commit::
|
||||
|
||||
include missing sys/file.h for LOCK_EX
|
||||
|
||||
Upstream-Status: Backport [https://github.com/systemd/systemd/commit/ac8db36cbc26694ee94beecc8dca208ec4b5fd45]
|
||||
|
||||
CVE patches
|
||||
===========
|
||||
|
||||
In order to have a better control of vulnerabilities, patches that fix CVEs must
|
||||
contain a ``CVE:`` tag. This tag list all CVEs fixed by the patch. If more than
|
||||
one CVE is fixed, separate them using spaces.
|
||||
|
||||
CVE Examples
|
||||
------------
|
||||
|
||||
This should be the header of patch that fixes :cve:`2015-8370` in GRUB2::
|
||||
|
||||
grub2: Fix CVE-2015-8370
|
||||
|
||||
[No upstream tracking] -- https://bugzilla.redhat.com/show_bug.cgi?id=1286966
|
||||
|
||||
Back to 28; Grub2 Authentication
|
||||
|
||||
Two functions suffer from integer underflow fault; the grub_username_get() and grub_password_get()located in
|
||||
grub-core/normal/auth.c and lib/crypto.c respectively. This can be exploited to obtain a Grub rescue shell.
|
||||
|
||||
Upstream-Status: Backport [http://git.savannah.gnu.org/cgit/grub.git/commit/?id=451d80e52d851432e109771bb8febafca7a5f1f2]
|
||||
CVE: CVE-2015-8370
|
||||
Signed-off-by: Joe Developer <joe.developer@example.com>
|
||||
|
||||
@@ -42,6 +42,7 @@ Yocto Project Development Tasks Manual
|
||||
runtime-testing
|
||||
debugging
|
||||
licenses
|
||||
security-subjects
|
||||
vulnerabilities
|
||||
sbom
|
||||
error-reporting-tool
|
||||
|
||||
@@ -128,6 +128,20 @@ Follow these general steps to create your layer without using tools:
|
||||
variable is a good way to indicate if your particular layer is
|
||||
current.
|
||||
|
||||
|
||||
.. note::
|
||||
|
||||
A layer does not have to contain only recipes ``.bb`` or append files
|
||||
``.bbappend``. Generally, developers create layers using
|
||||
``bitbake-layers create-layer``.
|
||||
See ":ref:`dev-manual/layers:creating a general layer using the \`\`bitbake-layers\`\` script`",
|
||||
explaining how the ``layer.conf`` file is created from a template located in
|
||||
``meta/lib/bblayers/templates/layer.conf``.
|
||||
In fact, none of the variables set in ``layer.conf`` are mandatory,
|
||||
except when :term:`BBFILE_COLLECTIONS` is present. In this case
|
||||
:term:`LAYERSERIES_COMPAT` and :term:`BBFILE_PATTERN` have to be
|
||||
defined too.
|
||||
|
||||
#. *Add Content:* Depending on the type of layer, add the content. If
|
||||
the layer adds support for a machine, add the machine configuration
|
||||
in a ``conf/machine/`` file within the layer. If the layer adds
|
||||
|
||||
@@ -409,8 +409,8 @@ Patching Code
|
||||
|
||||
Sometimes it is necessary to patch code after it has been fetched. Any
|
||||
files mentioned in :term:`SRC_URI` whose names end in ``.patch`` or
|
||||
``.diff`` or compressed versions of these suffixes (e.g. ``diff.gz`` are
|
||||
treated as patches. The
|
||||
``.diff`` or compressed versions of these suffixes (e.g. ``diff.gz``,
|
||||
``patch.bz2``, etc.) are treated as patches. The
|
||||
:ref:`ref-tasks-patch` task
|
||||
automatically applies these patches.
|
||||
|
||||
@@ -1396,9 +1396,9 @@ doing the following:
|
||||
Following Recipe Style Guidelines
|
||||
=================================
|
||||
|
||||
When writing recipes, it is good to conform to existing style
|
||||
guidelines. The :oe_wiki:`OpenEmbedded Styleguide </Styleguide>` wiki page
|
||||
provides rough guidelines for preferred recipe style.
|
||||
When writing recipes, it is good to conform to existing style guidelines.
|
||||
See the ":doc:`../contributor-guide/recipe-style-guide`" in the Yocto Project
|
||||
and OpenEmbedded Contributor Guide for reference.
|
||||
|
||||
It is common for existing recipes to deviate a bit from this style.
|
||||
However, aiming for at least a consistent style is a good idea. Some
|
||||
|
||||
@@ -229,7 +229,7 @@ The final thing you need to do when setting :term:`TEST_TARGET` to
|
||||
statements in your ``local.conf`` file::
|
||||
|
||||
IMAGE_FSTYPES += "tar.gz"
|
||||
INHERIT += "testimage"
|
||||
IMAGE_CLASSES += "testimage"
|
||||
TEST_TARGET = "SystemdbootTarget"
|
||||
TEST_TARGET_IP = "192.168.2.3"
|
||||
|
||||
@@ -332,10 +332,10 @@ You can start the tests automatically or manually:
|
||||
bitbake core-image-sato
|
||||
|
||||
- *Manually running tests:* To manually run the tests, first globally
|
||||
inherit the :ref:`ref-classes-testimage*` class by editing your
|
||||
inherit the :ref:`ref-classes-testimage` class by editing your
|
||||
``local.conf`` file::
|
||||
|
||||
INHERIT += "testimage"
|
||||
IMAGE_CLASSES += "testimage"
|
||||
|
||||
Next, use BitBake to run the tests::
|
||||
|
||||
|
||||
189
documentation/dev-manual/security-subjects.rst
Normal file
189
documentation/dev-manual/security-subjects.rst
Normal file
@@ -0,0 +1,189 @@
|
||||
.. SPDX-License-Identifier: CC-BY-SA-2.0-UK
|
||||
|
||||
Dealing with Vulnerability Reports
|
||||
**********************************
|
||||
|
||||
The Yocto Project and OpenEmbedded are open-source, community-based projects
|
||||
used in numerous products. They assemble multiple other open-source projects,
|
||||
and need to handle security issues and practices both internal (in the code
|
||||
maintained by both projects), and external (maintained by other projects and
|
||||
organizations).
|
||||
|
||||
This manual assembles security-related information concerning the whole
|
||||
ecosystem. It includes information on reporting a potential security issue,
|
||||
the operation of the YP Security team and how to contribute in the
|
||||
related code. It is written to be useful for both security researchers and
|
||||
YP developers.
|
||||
|
||||
How to report a potential security vulnerability?
|
||||
=================================================
|
||||
|
||||
If you would like to report a public issue (for example, one with a released
|
||||
CVE number), please report it using the
|
||||
:yocto_bugs:`Security Bugzilla </enter_bug.cgi?product=Security>`.
|
||||
|
||||
If you are dealing with a not-yet-released issue, or an urgent one, please send
|
||||
a message to security AT yoctoproject DOT org, including as many details as
|
||||
possible: the layer or software module affected, the recipe and its version,
|
||||
and any example code, if available. This mailing list is monitored by the
|
||||
Yocto Project Security team.
|
||||
|
||||
For each layer, you might also look for specific instructions (if any) for
|
||||
reporting potential security issues in the specific ``SECURITY.md`` file at the
|
||||
root of the repository. Instructions on how and where submit a patch are
|
||||
usually available in ``README.md``. If this is your first patch to the
|
||||
Yocto Project/OpenEmbedded, you might want to have a look into the
|
||||
Contributor's Manual section
|
||||
":ref:`contributor-guide/submit-changes:preparing changes for submission`".
|
||||
|
||||
Branches maintained with security fixes
|
||||
---------------------------------------
|
||||
|
||||
See the
|
||||
:ref:`Release process <ref-manual/release-process:Stable Release Process>`
|
||||
documentation for details regarding the policies and maintenance of stable
|
||||
branches.
|
||||
|
||||
The :yocto_wiki:`Releases page </Releases>` contains a list
|
||||
of all releases of the Yocto Project. Versions in gray are no longer actively
|
||||
maintained with security patches, but well-tested patches may still be accepted
|
||||
for them for significant issues.
|
||||
|
||||
Security-related discussions at the Yocto Project
|
||||
-------------------------------------------------
|
||||
|
||||
We have set up two security-related mailing lists:
|
||||
|
||||
- Public List: yocto [dash] security [at] yoctoproject[dot] org
|
||||
|
||||
This is a public mailing list for anyone to subscribe to. This list is an
|
||||
open list to discuss public security issues/patches and security-related
|
||||
initiatives. For more information, including subscription information,
|
||||
please see the :yocto_lists:`yocto-security mailing list info page </g/yocto-security>`.
|
||||
|
||||
- Private List: security [at] yoctoproject [dot] org
|
||||
|
||||
This is a private mailing list for reporting non-published potential
|
||||
vulnerabilities. The list is monitored by the Yocto Project Security team.
|
||||
|
||||
|
||||
What you should do if you find a security vulnerability
|
||||
-------------------------------------------------------
|
||||
|
||||
If you find a security flaw: a crash, an information leakage, or anything that
|
||||
can have a security impact if exploited in any Open Source software built or
|
||||
used by the Yocto Project, please report this to the Yocto Project Security
|
||||
Team. If you prefer to contact the upstream project directly, please send a
|
||||
copy to the security team at the Yocto Project as well. If you believe this is
|
||||
highly sensitive information, please report the vulnerability in a secure way,
|
||||
i.e. encrypt the email and send it to the private list. This ensures that
|
||||
the exploit is not leaked and exploited before a response/fix has been generated.
|
||||
|
||||
Security team
|
||||
=============
|
||||
|
||||
The Yocto Project/OpenEmbedded security team coordinates the work on security
|
||||
subjects in the project. All general discussion takes place publicly. The
|
||||
Security Team only uses confidential communication tools to deal with private
|
||||
vulnerability reports before they are released.
|
||||
|
||||
Security team appointment
|
||||
-------------------------
|
||||
|
||||
The Yocto Project Security Team consists of at least three members. When new
|
||||
members are needed, the Yocto Project Technical Steering Committee (YP TSC)
|
||||
asks for nominations by public channels including a nomination deadline.
|
||||
Self-nominations are possible. When the limit time is
|
||||
reached, the YP TSC posts the list of candidates for the comments of project
|
||||
participants and developers. Comments may be sent publicly or privately to the
|
||||
YP and OE TSCs. The candidates are approved by both YP TSC and OpenEmbedded
|
||||
Technical Steering Committee (OE TSC) and the final list of the team members
|
||||
is announced publicly. The aim is to have people representing technical
|
||||
leadership, security knowledge and infrastructure present with enough people
|
||||
to provide backup/coverage but keep the notification list small enough to
|
||||
minimize information risk and maintain trust.
|
||||
|
||||
YP Security Team members may resign at any time.
|
||||
|
||||
Security Team Operations
|
||||
------------------------
|
||||
|
||||
The work of the Security Team might require high confidentiality. Team members
|
||||
are individuals selected by merit and do not represent the companies they work
|
||||
for. They do not share information about confidential issues outside of the team
|
||||
and do not hint about ongoing embargoes.
|
||||
|
||||
Team members can bring in domain experts as needed. Those people should be
|
||||
added to individual issues only and adhere to the same standards as the YP
|
||||
Security Team.
|
||||
|
||||
The YP security team organizes its meetings and communication as needed.
|
||||
|
||||
When the YP Security team receives a report about a potential security
|
||||
vulnerability, they quickly analyze and notify the reporter of the result.
|
||||
They might also request more information.
|
||||
|
||||
If the issue is confirmed and affects the code maintained by the YP, they
|
||||
confidentially notify maintainers of that code and work with them to prepare
|
||||
a fix.
|
||||
|
||||
If the issue is confirmed and affects an upstream project, the YP security team
|
||||
notifies the project. Usually, the upstream project analyzes the problem again.
|
||||
If they deem it a real security problem in their software, they develop and
|
||||
release a fix following their security policy. They may want to include the
|
||||
original reporter in the loop. There is also sometimes some coordination for
|
||||
handling patches, backporting patches etc, or just understanding the problem
|
||||
or what caused it.
|
||||
|
||||
When the fix is publicly available, the YP security team member or the
|
||||
package maintainer sends patches against the YP code base, following usual
|
||||
procedures, including public code review.
|
||||
|
||||
What Yocto Security Team does when it receives a security vulnerability
|
||||
-----------------------------------------------------------------------
|
||||
|
||||
The YP Security Team team performs a quick analysis and would usually report
|
||||
the flaw to the upstream project. Normally the upstream project analyzes the
|
||||
problem. If they deem it a real security problem in their software, they
|
||||
develop and release a fix following their own security policy. They may want
|
||||
to include the original reporter in the loop. There is also sometimes some
|
||||
coordination for handling patches, backporting patches etc, or just
|
||||
understanding the problem or what caused it.
|
||||
|
||||
The security policy of the upstream project might include a notification to
|
||||
Linux distributions or other important downstream projects in advance to
|
||||
discuss coordinated disclosure. These mailing lists are normally non-public.
|
||||
|
||||
When the upstream project releases a version with the fix, they are responsible
|
||||
for contacting `Mitre <https://www.cve.org/>`__ to get a CVE number assigned and
|
||||
the CVE record published.
|
||||
|
||||
If an upstream project does not respond quickly
|
||||
-----------------------------------------------
|
||||
|
||||
If an upstream project does not fix the problem in a reasonable time,
|
||||
the Yocto's Security Team will contact other interested parties (usually
|
||||
other distributions) in the community and together try to solve the
|
||||
vulnerability as quickly as possible.
|
||||
|
||||
The Yocto Project Security team adheres to the 90 days disclosure policy
|
||||
by default. An increase of the embargo time is possible when necessary.
|
||||
|
||||
Current Security Team members
|
||||
-----------------------------
|
||||
|
||||
For secure communications, please send your messages encrypted using the GPG
|
||||
keys. Remember, message headers are not encrypted so do not include sensitive
|
||||
information in the subject line.
|
||||
|
||||
- Ross Burton: <ross@burtonini.com> `Public key <https://keys.openpgp.org/search?q=ross%40burtonini.com>`__
|
||||
|
||||
- Michael Halstead: <mhalstead [at] linuxfoundation [dot] org>
|
||||
`Public key <https://pgp.mit.edu/pks/lookup?op=vindex&search=0x3373170601861969>`__
|
||||
or `Public key <https://keyserver.ubuntu.com/pks/lookup?op=get&search=0xd1f2407285e571ed12a407a73373170601861969>`__
|
||||
|
||||
- Richard Purdie: <richard.purdie@linuxfoundation.org> `Public key <https://keys.openpgp.org/search?q=richard.purdie%40linuxfoundation.org>`__
|
||||
|
||||
- Marta Rybczynska: <marta DOT rybczynska [at] syslinbit [dot] com> `Public key <https://keys.openpgp.org/search?q=marta.rybczynska@syslinbit.com>`__
|
||||
|
||||
- Steve Sakoman: <steve [at] sakoman [dot] com> `Public key <https://keys.openpgp.org/search?q=steve%40sakoman.com>`__
|
||||
@@ -88,27 +88,15 @@ particular working environment and set of practices.
|
||||
For information about BitBake, see the
|
||||
:doc:`bitbake:index`.
|
||||
|
||||
It is relatively easy to set up Git services and create
|
||||
infrastructure like :yocto_git:`/`, which is based on
|
||||
server software called ``gitolite`` with ``cgit`` being used to
|
||||
generate the web interface that lets you view the repositories. The
|
||||
``gitolite`` software identifies users using SSH keys and allows
|
||||
It is relatively easy to set up Git services and create infrastructure like
|
||||
:yocto_git:`/`, which is based on server software called
|
||||
`Gitolite <https://gitolite.com>`__
|
||||
with `cgit <https://git.zx2c4.com/cgit/about/>`__ being used to
|
||||
generate the web interface that lets you view the repositories.
|
||||
``gitolite`` identifies users using SSH keys and allows
|
||||
branch-based access controls to repositories that you can control as
|
||||
little or as much as necessary.
|
||||
|
||||
.. note::
|
||||
|
||||
The setup of these services is beyond the scope of this manual.
|
||||
However, here are sites describing how to perform setup:
|
||||
|
||||
- `Gitolite <https://gitolite.com>`__: Information for
|
||||
``gitolite``.
|
||||
|
||||
- `Interfaces, frontends, and
|
||||
tools <https://git.wiki.kernel.org/index.php/Interfaces,_frontends,_and_tools>`__:
|
||||
Documentation on how to create interfaces and frontends for
|
||||
Git.
|
||||
|
||||
5. *Set up the Application Development Machines:* As mentioned earlier,
|
||||
application developers are creating applications on top of existing
|
||||
software stacks. Following are some best practices for setting up
|
||||
|
||||
@@ -113,11 +113,11 @@ The following steps describe how to set up the AUH utility:
|
||||
``upgrade-helper/work/recipe/buildhistory-diff.txt`` file found in
|
||||
your :term:`Build Directory`.
|
||||
|
||||
- If you want to enable testing through the :ref:`ref-classes-testimage*`
|
||||
- If you want to enable testing through the :ref:`ref-classes-testimage`
|
||||
class, which is optional, you need to have the following set in
|
||||
your ``conf/local.conf`` file::
|
||||
|
||||
INHERIT += "testimage"
|
||||
IMAGE_CLASSES += "testimage"
|
||||
|
||||
.. note::
|
||||
|
||||
|
||||
@@ -142,17 +142,18 @@ command to return the available Wic images as follows::
|
||||
genericx86 Create an EFI disk image for genericx86*
|
||||
edgerouter Create SD card image for Edgerouter
|
||||
beaglebone-yocto Create SD card image for Beaglebone
|
||||
qemux86-directdisk Create a qemu machine 'pcbios' direct disk image
|
||||
systemd-bootdisk Create an EFI disk image with systemd-boot
|
||||
mkhybridiso Create a hybrid ISO image
|
||||
qemuriscv Create qcow2 image for RISC-V QEMU machines
|
||||
mkefidisk Create an EFI disk image
|
||||
sdimage-bootpart Create SD card image with a boot partition
|
||||
directdisk-multi-rootfs Create multi rootfs image using rootfs plugin
|
||||
directdisk Create a 'pcbios' direct disk image
|
||||
directdisk-bootloader-config Create a 'pcbios' direct disk image with custom bootloader config
|
||||
qemuriscv Create qcow2 image for RISC-V QEMU machines
|
||||
efi-bootdisk
|
||||
mkhybridiso Create a hybrid ISO image
|
||||
directdisk-gpt Create a 'pcbios' direct disk image
|
||||
efi-bootdisk
|
||||
systemd-bootdisk Create an EFI disk image with systemd-boot
|
||||
sdimage-bootpart Create SD card image with a boot partition
|
||||
qemux86-directdisk Create a qemu machine 'pcbios' direct disk image
|
||||
directdisk-bootloader-config Create a 'pcbios' direct disk image with custom bootloader config
|
||||
|
||||
|
||||
Once you know the list of available
|
||||
Wic images, you can use ``help`` with the command to get help on a
|
||||
@@ -283,16 +284,18 @@ Use the following command to list the available kickstart files::
|
||||
|
||||
$ wic list images
|
||||
genericx86 Create an EFI disk image for genericx86*
|
||||
beaglebone-yocto Create SD card image for Beaglebone
|
||||
edgerouter Create SD card image for Edgerouter
|
||||
qemux86-directdisk Create a QEMU machine 'pcbios' direct disk image
|
||||
directdisk-gpt Create a 'pcbios' direct disk image
|
||||
beaglebone-yocto Create SD card image for Beaglebone
|
||||
qemuriscv Create qcow2 image for RISC-V QEMU machines
|
||||
mkefidisk Create an EFI disk image
|
||||
directdisk Create a 'pcbios' direct disk image
|
||||
systemd-bootdisk Create an EFI disk image with systemd-boot
|
||||
mkhybridiso Create a hybrid ISO image
|
||||
sdimage-bootpart Create SD card image with a boot partition
|
||||
directdisk-multi-rootfs Create multi rootfs image using rootfs plugin
|
||||
directdisk Create a 'pcbios' direct disk image
|
||||
efi-bootdisk
|
||||
mkhybridiso Create a hybrid ISO image
|
||||
directdisk-gpt Create a 'pcbios' direct disk image
|
||||
systemd-bootdisk Create an EFI disk image with systemd-boot
|
||||
sdimage-bootpart Create SD card image with a boot partition
|
||||
qemux86-directdisk Create a qemu machine 'pcbios' direct disk image
|
||||
directdisk-bootloader-config Create a 'pcbios' direct disk image with custom bootloader config
|
||||
|
||||
When you use an existing file, you
|
||||
|
||||
@@ -69,8 +69,7 @@ to indicate the branch.
|
||||
You can use the :term:`KBRANCH` value to define an alternate branch typically
|
||||
with a machine override as shown here from the ``meta-yocto-bsp`` layer::
|
||||
|
||||
KBRANCH:edgerouter = "standard/edgerouter"
|
||||
|
||||
KBRANCH:beaglebone-yocto = "standard/beaglebone"
|
||||
|
||||
The linux-yocto style recipes can optionally define the following
|
||||
variables:
|
||||
|
||||
@@ -455,13 +455,13 @@ Creating the Append File
|
||||
|
||||
You create this file in your custom layer. You also name it accordingly
|
||||
based on the linux-yocto recipe you are using. For example, if you are
|
||||
modifying the ``meta/recipes-kernel/linux/linux-yocto_4.12.bb`` recipe,
|
||||
modifying the ``meta/recipes-kernel/linux/linux-yocto_5.15.bb`` recipe,
|
||||
the append file will typically be located as follows within your custom
|
||||
layer:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
your-layer/recipes-kernel/linux/linux-yocto_4.12.bbappend
|
||||
your-layer/recipes-kernel/linux/linux-yocto_5.15.bbappend
|
||||
|
||||
The append file should initially extend the
|
||||
:term:`FILESPATH` search path by
|
||||
@@ -489,36 +489,36 @@ As an example, consider the following append file used by the BSPs in
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
meta-yocto-bsp/recipes-kernel/linux/linux-yocto_4.12.bbappend
|
||||
meta-yocto-bsp/recipes-kernel/linux/linux-yocto_5.15.bbappend
|
||||
|
||||
Here are the contents of this file. Be aware that the actual commit ID
|
||||
strings in this example listing might be different than the actual
|
||||
strings in the file from the ``meta-yocto-bsp`` layer upstream.
|
||||
::
|
||||
|
||||
KBRANCH:genericx86 = "standard/base"
|
||||
KBRANCH:genericx86-64 = "standard/base"
|
||||
KBRANCH:genericx86 = "v5.15/standard/base"
|
||||
KBRANCH:genericx86-64 = "v5.15/standard/base"
|
||||
KBRANCH:edgerouter = "v5.15/standard/edgerouter"
|
||||
KBRANCH:beaglebone-yocto = "v5.15/standard/beaglebone"
|
||||
|
||||
KMACHINE:genericx86 ?= "common-pc"
|
||||
KMACHINE:genericx86-64 ?= "common-pc-64"
|
||||
KBRANCH:edgerouter = "standard/edgerouter"
|
||||
KBRANCH:beaglebone = "standard/beaglebone"
|
||||
|
||||
SRCREV_machine:genericx86 ?= "d09f2ce584d60ecb7890550c22a80c48b83c2e19"
|
||||
SRCREV_machine:genericx86-64 ?= "d09f2ce584d60ecb7890550c22a80c48b83c2e19"
|
||||
SRCREV_machine:edgerouter ?= "b5c8cfda2dfe296410d51e131289fb09c69e1e7d"
|
||||
SRCREV_machine:beaglebone ?= "b5c8cfda2dfe296410d51e131289fb09c69e1e7d"
|
||||
KMACHINE:beaglebone-yocto ?= "beaglebone"
|
||||
|
||||
SRCREV_machine:genericx86 ?= "0b628306d1f9ea28c0e86369ce9bb87a47893c9c"
|
||||
SRCREV_machine:genericx86-64 ?= "0b628306d1f9ea28c0e86369ce9bb87a47893c9c"
|
||||
SRCREV_machine:edgerouter ?= "90f1ee6589264545f548d731c2480b08a007230f"
|
||||
SRCREV_machine:beaglebone-yocto ?= "9aabbaa89fcb21af7028e814c1f5b61171314d5a"
|
||||
|
||||
COMPATIBLE_MACHINE:genericx86 = "genericx86"
|
||||
COMPATIBLE_MACHINE:genericx86-64 = "genericx86-64"
|
||||
COMPATIBLE_MACHINE:edgerouter = "edgerouter"
|
||||
COMPATIBLE_MACHINE:beaglebone = "beaglebone"
|
||||
COMPATIBLE_MACHINE:beaglebone-yocto = "beaglebone-yocto"
|
||||
|
||||
LINUX_VERSION:genericx86 = "4.12.7"
|
||||
LINUX_VERSION:genericx86-64 = "4.12.7"
|
||||
LINUX_VERSION:edgerouter = "4.12.10"
|
||||
LINUX_VERSION:beaglebone = "4.12.10"
|
||||
LINUX_VERSION:genericx86 = "5.15.72"
|
||||
LINUX_VERSION:genericx86-64 = "5.15.72"
|
||||
LINUX_VERSION:edgerouter = "5.15.54"
|
||||
LINUX_VERSION:beaglebone-yocto = "5.15.54"
|
||||
|
||||
This append file
|
||||
contains statements used to support several BSPs that ship with the
|
||||
@@ -1081,7 +1081,7 @@ Section.
|
||||
the following sequence of commands::
|
||||
|
||||
$ cd poky/build
|
||||
$ bitbake -c cleanall yocto-linux
|
||||
$ bitbake -c cleanall linux-yocto
|
||||
$ bitbake core-image-minimal -c cleanall
|
||||
$ bitbake core-image-minimal
|
||||
$ runqemu qemux86
|
||||
|
||||
@@ -240,7 +240,7 @@ Automated Image Testing
|
||||
-----------------------
|
||||
|
||||
A new automated image testing framework has been added through the
|
||||
:ref:`ref-classes-testimage*` classes. This
|
||||
:ref:`ref-classes-testimage` classes. This
|
||||
framework replaces the older ``imagetest-qemu`` framework.
|
||||
|
||||
You can learn more about performing automated image tests in the
|
||||
|
||||
@@ -319,7 +319,7 @@ This section provides information about automatic testing changes:
|
||||
practices now dictate that you use the
|
||||
:term:`IMAGE_CLASSES` variable rather than the
|
||||
:term:`INHERIT` variable when you inherit the
|
||||
:ref:`testimage <ref-classes-testimage*>` and
|
||||
:ref:`testimage <ref-classes-testimage>` and
|
||||
:ref:`testsdk <ref-classes-testsdk>` classes used for automatic
|
||||
testing.
|
||||
|
||||
|
||||
@@ -19,3 +19,5 @@ Release 4.0 (kirkstone)
|
||||
release-notes-4.0.10
|
||||
release-notes-4.0.11
|
||||
release-notes-4.0.12
|
||||
release-notes-4.0.13
|
||||
release-notes-4.0.14
|
||||
|
||||
271
documentation/migration-guides/release-notes-4.0.13.rst
Normal file
271
documentation/migration-guides/release-notes-4.0.13.rst
Normal file
File diff suppressed because one or more lines are too long
227
documentation/migration-guides/release-notes-4.0.14.rst
Normal file
227
documentation/migration-guides/release-notes-4.0.14.rst
Normal file
File diff suppressed because one or more lines are too long
@@ -1026,7 +1026,7 @@ processing includes creation of a manifest file and optimizations.
|
||||
The manifest file (``.manifest``) resides in the same directory as the
|
||||
root filesystem image. This file lists out, line-by-line, the installed
|
||||
packages. The manifest file is useful for the
|
||||
:ref:`testimage <ref-classes-testimage*>` class,
|
||||
:ref:`testimage <ref-classes-testimage>` class,
|
||||
for example, to determine whether or not to run specific tests. See the
|
||||
:term:`IMAGE_MANIFEST`
|
||||
variable for additional information.
|
||||
@@ -2004,6 +2004,15 @@ task output from the Shared State cache.
|
||||
the stability of the task's output hash. Therefore, the effectiveness
|
||||
of Hash Equivalence strongly depends on it.
|
||||
|
||||
Recipes that are not reproducible may have undesired behavior if hash
|
||||
equivalence is enabled, since the non-reproducible diverging output maybe be
|
||||
remapped to an older sstate object in the cache by the server. If a recipe
|
||||
is non-reproducible in trivial ways, such as different timestamps, this is
|
||||
likely not a problem. However recipes that have more dramatic changes (such
|
||||
as completely different file names) will likely outright fail since the
|
||||
downstream sstate objects are not actually equivalent to what was just
|
||||
built.
|
||||
|
||||
This applies to multiple scenarios:
|
||||
|
||||
- A "trivial" change to a recipe that doesn't impact its generated output,
|
||||
@@ -2221,3 +2230,173 @@ For more information, see the
|
||||
BitBake User Manual. You can also reference the "`Why Not
|
||||
Fakeroot? <https://github.com/wrpseudo/pseudo/wiki/WhyNotFakeroot>`__"
|
||||
article for background information on Fakeroot and Pseudo.
|
||||
|
||||
BitBake Tasks Map
|
||||
=================
|
||||
|
||||
To understand how BitBake operates in the build directory and environment
|
||||
we can consider the following recipes and diagram, to have full picture
|
||||
about the tasks that BitBake runs to generate the final package file
|
||||
for the recipe.
|
||||
|
||||
We will have two recipes as an example:
|
||||
|
||||
- ``libhello``: A recipe that provides a shared library
|
||||
- ``sayhello``: A recipe that uses ``libhello`` library to do its job
|
||||
|
||||
.. note::
|
||||
|
||||
``sayhello`` depends on ``libhello`` at compile time as it needs the shared
|
||||
library to do the dynamic linking process. It also depends on it at runtime
|
||||
as the shared library loader needs to find the library.
|
||||
For more details about dependencies check :ref:`ref-varlocality-recipe-dependencies`.
|
||||
|
||||
``libhello`` sources are as follows:
|
||||
|
||||
- ``LICENSE``: This is the license associated with this library
|
||||
- ``Makefile``: The file used by ``make`` to build the library
|
||||
- ``hellolib.c``: The implementation of the library
|
||||
- ``hellolib.h``: The C header of the library
|
||||
|
||||
``sayhello`` sources are as follows:
|
||||
|
||||
- ``LICENSE``: This is the license associated with this project
|
||||
- ``Makefile``: The file used by ``make`` to build the project
|
||||
- ``sayhello.c``: The source file of the project
|
||||
|
||||
Before presenting the contents of each file, here are the steps
|
||||
that we need to follow to accomplish what we want in the first place,
|
||||
which is integrating ``sayhello`` in our root file system:
|
||||
|
||||
#. Create a Git repository for each project with the corresponding files
|
||||
|
||||
#. Create a recipe for each project
|
||||
|
||||
#. Make sure that ``sayhello`` recipe :term:`DEPENDS` on ``libhello``
|
||||
|
||||
#. Make sure that ``sayhello`` recipe :term:`RDEPENDS` on ``libhello``
|
||||
|
||||
#. Add ``sayhello`` to :term:`IMAGE_INSTALL` to integrate it into
|
||||
the root file system
|
||||
|
||||
The following are the contents of ``libhello/Makefile``::
|
||||
|
||||
LIB=libhello.so
|
||||
|
||||
all: $(LIB)
|
||||
|
||||
$(LIB): hellolib.o
|
||||
$(CC) $< -Wl,-soname,$(LIB).1 -fPIC $(LDFLAGS) -shared -o $(LIB).1.0
|
||||
|
||||
%.o: %.c
|
||||
$(CC) -c $<
|
||||
|
||||
clean:
|
||||
rm -rf *.o *.so*
|
||||
|
||||
.. note::
|
||||
|
||||
When creating shared libraries, it is strongly recommended to follow the Linux
|
||||
conventions and guidelines (see `this article
|
||||
<https://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html>`__
|
||||
for some background).
|
||||
|
||||
.. note::
|
||||
|
||||
When creating ``Makefile`` files, it is strongly recommended to use ``CC``, ``LDFLAGS``
|
||||
and ``CFLAGS`` as BitBake will set them as environment variables according
|
||||
to your build configuration.
|
||||
|
||||
The following are the contents of ``libhello/hellolib.h``::
|
||||
|
||||
#ifndef HELLOLIB_H
|
||||
#define HELLOLIB_H
|
||||
|
||||
void Hello();
|
||||
|
||||
#endif
|
||||
|
||||
The following are the contents of ``libhello/hellolib.c``::
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
void Hello(){
|
||||
puts("Hello from a Yocto demo \n");
|
||||
}
|
||||
|
||||
The following are the contents of ``sayhello/Makefile``::
|
||||
|
||||
EXEC=sayhello
|
||||
LDFLAGS += -lhello
|
||||
|
||||
all: $(EXEC)
|
||||
|
||||
$(EXEC): sayhello.c
|
||||
$(CC) $< $(LDFLAGS) $(CFLAGS) -o $(EXEC)
|
||||
|
||||
clean:
|
||||
rm -rf $(EXEC) *.o
|
||||
|
||||
The following are the contents of ``sayhello/sayhello.c``::
|
||||
|
||||
#include <hellolib.h>
|
||||
|
||||
int main(){
|
||||
Hello();
|
||||
return 0;
|
||||
}
|
||||
|
||||
The following are the contents of ``libhello_0.1.bb``::
|
||||
|
||||
SUMMARY = "Hello demo library"
|
||||
DESCRIPTION = "Hello shared library used in Yocto demo"
|
||||
|
||||
# NOTE: Set the License according to the LICENSE file of your project
|
||||
# and then add LIC_FILES_CHKSUM accordingly
|
||||
LICENSE = "CLOSED"
|
||||
|
||||
# Assuming the branch is main
|
||||
# Change <username> accordingly
|
||||
SRC_URI = "git://github.com/<username>/libhello;branch=main;protocol=https"
|
||||
|
||||
S = "${WORKDIR}/git"
|
||||
|
||||
do_install(){
|
||||
install -d ${D}${includedir}
|
||||
install -d ${D}${libdir}
|
||||
|
||||
install hellolib.h ${D}${includedir}
|
||||
oe_soinstall ${PN}.so.${PV} ${D}${libdir}
|
||||
}
|
||||
|
||||
The following are the contents of ``sayhello_0.1.bb``::
|
||||
|
||||
SUMMARY = "SayHello demo"
|
||||
DESCRIPTION = "SayHello project used in Yocto demo"
|
||||
|
||||
# NOTE: Set the License according to the LICENSE file of your project
|
||||
# and then add LIC_FILES_CHKSUM accordingly
|
||||
LICENSE = "CLOSED"
|
||||
|
||||
# Assuming the branch is main
|
||||
# Change <username> accordingly
|
||||
SRC_URI = "git://github.com/<username>/sayhello;branch=main;protocol=https"
|
||||
|
||||
DEPENDS += "libhello"
|
||||
RDEPENDS:${PN} += "libhello"
|
||||
|
||||
S = "${WORKDIR}/git"
|
||||
|
||||
do_install(){
|
||||
install -d ${D}/usr/bin
|
||||
install -m 0700 sayhello ${D}/usr/bin
|
||||
}
|
||||
|
||||
After placing the recipes in a custom layer we can run ``bitbake sayhello``
|
||||
to build the recipe.
|
||||
|
||||
The following diagram shows the sequences of tasks that BitBake
|
||||
executes to accomplish that.
|
||||
|
||||
.. image:: svg/bitbake_tasks_map.*
|
||||
:width: 100%
|
||||
|
||||
4
documentation/overview-manual/svg/bitbake_tasks_map.svg
Normal file
4
documentation/overview-manual/svg/bitbake_tasks_map.svg
Normal file
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 197 KiB |
@@ -7,43 +7,45 @@ Yocto Project Profiling and Tracing Manual
|
||||
Introduction
|
||||
============
|
||||
|
||||
Yocto bundles a number of tracing and profiling tools - this 'HOWTO'
|
||||
Yocto Project bundles a number of tracing and profiling tools --- this manual
|
||||
describes their basic usage and shows by example how to make use of them
|
||||
to examine application and system behavior.
|
||||
to analyze application and system behavior.
|
||||
|
||||
The tools presented are for the most part completely open-ended and have
|
||||
The tools presented are, for the most part, completely open-ended and have
|
||||
quite good and/or extensive documentation of their own which can be used
|
||||
to solve just about any problem you might come across in Linux. Each
|
||||
section that describes a particular tool has links to that tool's
|
||||
documentation and website.
|
||||
|
||||
The purpose of this 'HOWTO' is to present a set of common and generally
|
||||
The purpose of this manual is to present a set of common and generally
|
||||
useful tracing and profiling idioms along with their application (as
|
||||
appropriate) to each tool, in the context of a general-purpose
|
||||
'drill-down' methodology that can be applied to solving a large number
|
||||
(90%?) of problems. For help with more advanced usages and problems,
|
||||
please see the documentation and/or websites listed for each tool.
|
||||
of problems. For help with more advanced usages and problems,
|
||||
refer to the documentation and/or websites provided for each tool.
|
||||
|
||||
The final section of this 'HOWTO' is a collection of real-world examples
|
||||
which we'll be continually adding to as we solve more problems using the
|
||||
tools - feel free to add your own examples to the list!
|
||||
The final section of this manual is a collection of real-world examples
|
||||
which we'll be continually updating as we solve more problems using the
|
||||
tools --- feel free to suggest additions to what you read here.
|
||||
|
||||
General Setup
|
||||
=============
|
||||
|
||||
Most of the tools are available only in 'sdk' images or in images built
|
||||
after adding 'tools-profile' to your local.conf. So, in order to be able
|
||||
to access all of the tools described here, please first build and boot
|
||||
an 'sdk' image e.g. ::
|
||||
Most of the tools are available only in ``sdk`` images or in images built
|
||||
after adding ``tools-profile`` to your ``local.conf`` file. So, in order to be able
|
||||
to access all of the tools described here, you can build and boot
|
||||
an ``sdk`` image, perhaps one of::
|
||||
|
||||
$ bitbake core-image-sato-sdk
|
||||
$ bitbake core-image-weston-sdk
|
||||
$ bitbake core-image-rt-sdk
|
||||
|
||||
or alternatively by adding 'tools-profile' to the EXTRA_IMAGE_FEATURES line in
|
||||
your local.conf::
|
||||
Alternatively, you can add ``tools-profile`` to the :term:`EXTRA_IMAGE_FEATURES` line in
|
||||
your ``local.conf`` file::
|
||||
|
||||
EXTRA_IMAGE_FEATURES = "debug-tweaks tools-profile"
|
||||
|
||||
If you use the 'tools-profile' method, you don't need to build an sdk image -
|
||||
If you use the ``tools-profile`` method, you don't need to build an sdk image ---
|
||||
the tracing and profiling tools will be included in non-sdk images as well e.g.::
|
||||
|
||||
$ bitbake core-image-sato
|
||||
@@ -64,12 +66,12 @@ the tracing and profiling tools will be included in non-sdk images as well e.g.:
|
||||
If you've already built a stripped image, you can generate debug
|
||||
packages (xxx-dbg) which you can manually install as needed.
|
||||
|
||||
To generate debug info for packages, you can add dbg-pkgs to
|
||||
EXTRA_IMAGE_FEATURES in local.conf. For example::
|
||||
To generate debug info for packages, you can add ``dbg-pkgs`` to
|
||||
:term:`EXTRA_IMAGE_FEATURES` in ``local.conf``. For example::
|
||||
|
||||
EXTRA_IMAGE_FEATURES = "debug-tweaks tools-profile dbg-pkgs"
|
||||
|
||||
Additionally, in order to generate the right type of debuginfo, we also need to
|
||||
Additionally, in order to generate the right type of debug info, we also need to
|
||||
set :term:`PACKAGE_DEBUG_SPLIT_STYLE` in the ``local.conf`` file::
|
||||
|
||||
PACKAGE_DEBUG_SPLIT_STYLE = 'debug-file-directory'
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -163,7 +163,7 @@ consists of the following pieces:
|
||||
an ARM target, did the build produce ARM binaries. If, for example,
|
||||
the build produced PPC binaries then there is a problem.
|
||||
|
||||
- :ref:`ref-classes-testimage*`: This class
|
||||
- :ref:`ref-classes-testimage`: This class
|
||||
performs runtime testing of images after they are built. The tests
|
||||
are usually used with :doc:`QEMU </dev-manual/qemu>`
|
||||
to boot the images and check the combined runtime result boot
|
||||
|
||||
@@ -718,7 +718,7 @@
|
||||
x="1373.233"
|
||||
y="-247.33261"
|
||||
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:13.3333px;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans Bold';text-align:center;text-anchor:middle;fill:#fffefe;fill-opacity:1;stroke:none"
|
||||
id="tspan10317-2-9-1-4-6-5">4.4</tspan></text>
|
||||
id="tspan10317-2-9-1-4-6-5">5.0</tspan></text>
|
||||
<rect
|
||||
style="fill:#333333;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2;stroke-opacity:1"
|
||||
id="rect917-0-0-4-4-9-9"
|
||||
|
||||
|
Before Width: | Height: | Size: 106 KiB After Width: | Height: | Size: 106 KiB |
@@ -1202,6 +1202,32 @@ system and gives an overview of their function and contents.
|
||||
speed since the build system skips parsing recipes not compatible
|
||||
with the current machine.
|
||||
|
||||
If one wants to have a recipe only available for some architectures
|
||||
(here ``aarch64`` and ``mips64``), the following can be used::
|
||||
|
||||
COMPATIBLE_MACHINE = "^$"
|
||||
COMPATIBLE_MACHINE:arch64 = "^(aarch64)$"
|
||||
COMPATIBLE_MACHINE:mips64 = "^(mips64)$"
|
||||
|
||||
The first line means "match all machines whose :term:`MACHINEOVERRIDES`
|
||||
contains the empty string", which will always be none.
|
||||
|
||||
The second is for matching all machines whose :term:`MACHINEOVERRIDES`
|
||||
contains one override which is exactly ``aarch64``.
|
||||
|
||||
The third is for matching all machines whose :term:`MACHINEOVERRIDES`
|
||||
contains one override which is exactly ``mips64``.
|
||||
|
||||
The same could be achieved with::
|
||||
|
||||
COMPATIBLE_MACHINE = "^(aarch64|mips64)$"
|
||||
|
||||
.. note::
|
||||
|
||||
When :term:`COMPATIBLE_MACHINE` is set in a recipe inherits from
|
||||
native, the recipe is always skipped. All native recipes must be
|
||||
entirely target independent and should not rely on :term:`MACHINE`.
|
||||
|
||||
:term:`COMPLEMENTARY_GLOB`
|
||||
Defines wildcards to match when installing a list of complementary
|
||||
packages for all the packages explicitly (or implicitly) installed in
|
||||
@@ -2075,6 +2101,18 @@ system and gives an overview of their function and contents.
|
||||
For information on policies and on how to use this variable, see the
|
||||
comments in the ``meta/classes/compress_doc.bbclass`` file.
|
||||
|
||||
:term:`DT_FILES_PATH`
|
||||
When compiling out-of-tree device tree sources using a recipe that
|
||||
inherits the :ref:`ref-classes-devicetree` class, this variable specifies
|
||||
the path to the directory containing dts files to build.
|
||||
|
||||
Defaults to the :term:`S` directory.
|
||||
|
||||
:term:`DT_PADDING_SIZE`
|
||||
When inheriting the :ref:`ref-classes-devicetree` class, this variable
|
||||
specifies the size of padding appended to the device tree blob, used as
|
||||
extra space typically for additional properties during boot.
|
||||
|
||||
:term:`EFI_PROVIDER`
|
||||
When building bootable images (i.e. where ``hddimg``, ``iso``, or
|
||||
``wic.vmdk`` is in :term:`IMAGE_FSTYPES`), the
|
||||
@@ -2834,6 +2872,73 @@ system and gives an overview of their function and contents.
|
||||
|
||||
GLIBC_GENERATE_LOCALES = "en_GB.UTF-8 en_US.UTF-8"
|
||||
|
||||
:term:`GO_IMPORT`
|
||||
When inheriting the :ref:`ref-classes-go` class, this mandatory variable
|
||||
sets the import path for the Go package that will be created for the code
|
||||
to build. If you have a ``go.mod`` file in the source directory, this
|
||||
typically matches the path in the ``module`` line in this file.
|
||||
|
||||
Other Go programs importing this package will use this path.
|
||||
|
||||
Here is an example setting from the
|
||||
:yocto_git:`go-helloworld_0.1.bb </poky/tree/meta/recipes-extended/go-examples/go-helloworld_0.1.bb>`
|
||||
recipe::
|
||||
|
||||
GO_IMPORT = "golang.org/x/example"
|
||||
|
||||
:term:`GO_INSTALL`
|
||||
When inheriting the :ref:`ref-classes-go` class, this optional variable
|
||||
specifies which packages in the sources should be compiled and
|
||||
installed in the Go build space by the
|
||||
`go install <https://go.dev/ref/mod#go-install>`__ command.
|
||||
|
||||
Here is an example setting from the
|
||||
:oe_git:`crucible </meta-openembedded/tree/meta-oe/recipes-support/crucible/>`
|
||||
recipe::
|
||||
|
||||
GO_INSTALL = "\
|
||||
${GO_IMPORT}/cmd/crucible \
|
||||
${GO_IMPORT}/cmd/habtool \
|
||||
"
|
||||
|
||||
By default, :term:`GO_INSTALL` is defined as::
|
||||
|
||||
GO_INSTALL ?= "${GO_IMPORT}/..."
|
||||
|
||||
The ``...`` wildcard means that it will catch all
|
||||
packages found in the sources.
|
||||
|
||||
See the :term:`GO_INSTALL_FILTEROUT` variable for
|
||||
filtering out unwanted packages from the ones
|
||||
found from the :term:`GO_INSTALL` value.
|
||||
|
||||
:term:`GO_INSTALL_FILTEROUT`
|
||||
When using the Go "vendor" mechanism to bring in dependencies for a Go
|
||||
package, the default :term:`GO_INSTALL` setting, which uses the ``...``
|
||||
wildcard, will include the vendored packages in the build, which produces
|
||||
incorrect results.
|
||||
|
||||
There are also some Go packages that are structured poorly, so that the
|
||||
``...`` wildcard results in building example or test code that should not
|
||||
be included in the build, or could fail to build.
|
||||
|
||||
This optional variable allows for filtering out a subset of the sources.
|
||||
It defaults to excluding everything under the ``vendor`` subdirectory
|
||||
under package's main directory. This is the normal location for vendored
|
||||
packages, but it can be overridden by a recipe to filter out other
|
||||
subdirectories if needed.
|
||||
|
||||
:term:`GO_WORKDIR`
|
||||
When using Go Modules, the current working directory must be the directory
|
||||
containing the ``go.mod`` file, or one of its subdirectories. When the
|
||||
``go`` tool is used, it will automatically look for the ``go.mod`` file
|
||||
in the Go working directory or in any parent directory, but not in
|
||||
subdirectories.
|
||||
|
||||
When using the :ref:`ref-classes-go-mod` class to use Go modules,
|
||||
the optional :term:`GO_WORKDIR` variable, defaulting to the value
|
||||
of :term:`GO_IMPORT`, allows to specify a different Go working directory.
|
||||
|
||||
:term:`GROUPADD_PARAM`
|
||||
When inheriting the :ref:`useradd <ref-classes-useradd>` class,
|
||||
this variable specifies for a package what parameters should be
|
||||
@@ -3102,17 +3207,23 @@ system and gives an overview of their function and contents.
|
||||
material for Wic is located in the
|
||||
":doc:`/ref-manual/kickstart`" chapter.
|
||||
|
||||
:term:`IMAGE_BUILDINFO_FILE`
|
||||
When using the :ref:`ref-classes-image-buildinfo` class,
|
||||
specifies the file in the image to write the build information into. The
|
||||
default value is "``${sysconfdir}/buildinfo``".
|
||||
|
||||
:term:`IMAGE_BUILDINFO_VARS`
|
||||
When using the :ref:`ref-classes-image-buildinfo` class,
|
||||
specifies the list of variables to include in the `Build Configuration`
|
||||
section of the output file (as a space-separated list). Defaults to
|
||||
":term:`DISTRO` :term:`DISTRO_VERSION`".
|
||||
|
||||
:term:`IMAGE_CLASSES`
|
||||
A list of classes that all images should inherit. You typically use
|
||||
this variable to specify the list of classes that register the
|
||||
different types of images the OpenEmbedded build system creates.
|
||||
A list of classes that all images should inherit. This is typically used
|
||||
to enable functionality across all image recipes.
|
||||
|
||||
The default value for :term:`IMAGE_CLASSES` is ``image_types``. You can
|
||||
set this variable in your ``local.conf`` or in a distribution
|
||||
configuration file.
|
||||
|
||||
For more information, see ``meta/classes/image_types.bbclass`` in the
|
||||
:term:`Source Directory`.
|
||||
Classes specified in :term:`IMAGE_CLASSES` must be located in the
|
||||
``classes-recipe/`` or ``classes/`` subdirectories.
|
||||
|
||||
:term:`IMAGE_CMD`
|
||||
Specifies the command to create the image file for a specific image
|
||||
@@ -3694,6 +3805,21 @@ system and gives an overview of their function and contents.
|
||||
even if the toolchain's binaries are strippable, there are other files
|
||||
needed for the build that are not strippable.
|
||||
|
||||
:term:`INIT_MANAGER`
|
||||
Specifies the system init manager to use. Available options are:
|
||||
|
||||
- ``sysvinit`` - System V init (default for poky)
|
||||
- ``systemd`` - systemd
|
||||
- ``mdev-busybox`` - mdev provided by busybox
|
||||
- ``none`` - no init manager
|
||||
|
||||
More concretely, this is used to include
|
||||
``conf/distro/include/init-manager-${INIT_MANAGER}.inc`` into the global
|
||||
configuration. You can have a look at the ``conf/distro/include/init-manager-*.inc``
|
||||
files for more information, and also the
|
||||
":ref:`dev-manual/init-manager:selecting an initialization manager`"
|
||||
section in the Yocto Project Development Tasks Manual.
|
||||
|
||||
:term:`INITRAMFS_DEPLOY_DIR_IMAGE`
|
||||
Indicates the deploy directory used by ``do_bundle_initramfs`` where the
|
||||
:term:`INITRAMFS_IMAGE` will be fetched from.
|
||||
@@ -3936,7 +4062,7 @@ system and gives an overview of their function and contents.
|
||||
|
||||
Values for this variable are set in the kernel's recipe file and the
|
||||
kernel's append file. For example, if you are using the
|
||||
``linux-yocto_4.12`` kernel, the kernel recipe file is the
|
||||
``linux-yocto_5.15`` kernel, the kernel recipe file is the
|
||||
``meta/recipes-kernel/linux/linux-yocto_4.12.bb`` file. :term:`KBRANCH`
|
||||
is set as follows in that kernel recipe file::
|
||||
|
||||
@@ -3949,13 +4075,13 @@ system and gives an overview of their function and contents.
|
||||
BSP layer for a given machine. For example, the append file for the
|
||||
Beaglebone, EdgeRouter, and generic versions of both 32 and 64-bit IA
|
||||
machines (``meta-yocto-bsp``) is named
|
||||
``meta-yocto-bsp/recipes-kernel/linux/linux-yocto_4.12.bbappend``.
|
||||
``meta-yocto-bsp/recipes-kernel/linux/linux-yocto_4.15.bbappend``.
|
||||
Here are the related statements from that append file::
|
||||
|
||||
KBRANCH:genericx86 = "standard/base"
|
||||
KBRANCH:genericx86-64 = "standard/base"
|
||||
KBRANCH:edgerouter = "standard/edgerouter"
|
||||
KBRANCH:beaglebone = "standard/beaglebone"
|
||||
KBRANCH:genericx86 = "v5.15/standard/base"
|
||||
KBRANCH:genericx86-64 = "v5.15/standard/base"
|
||||
KBRANCH:edgerouter = "v5.15/standard/edgerouter"
|
||||
KBRANCH:beaglebone-yocto = "v5.15/standard/beaglebone"
|
||||
|
||||
The :term:`KBRANCH` statements
|
||||
identify the kernel branch to use when building for each supported
|
||||
@@ -4074,9 +4200,18 @@ system and gives an overview of their function and contents.
|
||||
There is legacy support for specifying the full path to the device
|
||||
tree. However, providing just the ``.dtb`` file is preferred.
|
||||
|
||||
In order to use this variable, the
|
||||
:ref:`kernel-devicetree <ref-classes-kernel-devicetree>` class must
|
||||
be inherited.
|
||||
In order to use this variable, the :ref:`ref-classes-kernel-devicetree`
|
||||
class must be inherited.
|
||||
|
||||
:term:`KERNEL_DEVICETREE_BUNDLE`
|
||||
When set to "1", this variable allows to bundle the Linux kernel
|
||||
and the Device Tree Binary together in a single file.
|
||||
|
||||
This feature is currently only supported on the "arm" (32 bit)
|
||||
architecture.
|
||||
|
||||
This variable is set to "0" by default by the
|
||||
:ref:`ref-classes-kernel-devicetree` class.
|
||||
|
||||
:term:`KERNEL_DTB_LINK_NAME`
|
||||
The link name of the kernel device tree binary (DTB). This variable
|
||||
@@ -4101,10 +4236,25 @@ system and gives an overview of their function and contents.
|
||||
|
||||
KERNEL_DTB_NAME ?= "${KERNEL_ARTIFACT_NAME}"
|
||||
|
||||
The value of the :term:`KERNEL_ARTIFACT_NAME`
|
||||
variable, which is set in the same file, has the following value::
|
||||
See :term:`KERNEL_ARTIFACT_NAME` for additional information.
|
||||
|
||||
KERNEL_ARTIFACT_NAME ?= "${PKGE}-${PKGV}-${PKGR}-${MACHINE}${IMAGE_VERSION_SUFFIX}"
|
||||
|
||||
:term:`KERNEL_DTBDEST`
|
||||
This variable, used by the :ref:`ref-classes-kernel-devicetree`
|
||||
class, allows to change the installation directory of the DTB
|
||||
(Device Tree Binary) files.
|
||||
|
||||
It is set by default to "${KERNEL_IMAGEDEST}" by the
|
||||
:ref:`ref-classes-kernel` class.
|
||||
|
||||
:term:`KERNEL_DTBVENDORED`
|
||||
This variable, used by the :ref:`ref-classes-kernel-devicetree`,
|
||||
allows to ignore vendor subdirectories when installing DTB
|
||||
(Device Tree Binary) files, when it is set to "false".
|
||||
|
||||
To keep vendor subdirectories, set this variable to "true".
|
||||
|
||||
It is set by default to "false" by the :ref:`ref-classes-kernel` class.
|
||||
|
||||
:term:`KERNEL_DTC_FLAGS`
|
||||
Specifies the ``dtc`` flags that are passed to the Linux kernel build
|
||||
@@ -4219,9 +4369,12 @@ system and gives an overview of their function and contents.
|
||||
when building the kernel and is passed to ``make`` as the target to
|
||||
build.
|
||||
|
||||
If you want to build an alternate kernel image type in addition to that
|
||||
specified by :term:`KERNEL_IMAGETYPE`, use the :term:`KERNEL_ALT_IMAGETYPE`
|
||||
variable.
|
||||
To build additional kernel image types, use :term:`KERNEL_IMAGETYPES`.
|
||||
|
||||
:term:`KERNEL_IMAGETYPES`
|
||||
Lists additional types of kernel images to build for a device in addition
|
||||
to image type specified in :term:`KERNEL_IMAGETYPE`. Usually set by the
|
||||
machine configuration files.
|
||||
|
||||
:term:`KERNEL_MODULE_AUTOLOAD`
|
||||
Lists kernel modules that need to be auto-loaded during boot.
|
||||
@@ -4259,6 +4412,14 @@ system and gives an overview of their function and contents.
|
||||
provide those module configurations, see the
|
||||
:term:`module_conf_* <module_conf>` variable.
|
||||
|
||||
:term:`KERNEL_PACKAGE_NAME`
|
||||
Specifies the base name of the kernel packages, such as "kernel"
|
||||
in the kernel packages such as "kernel-modules", "kernel-image" and
|
||||
"kernel-dbg".
|
||||
|
||||
The default value for this variable is set to "kernel" by the
|
||||
:ref:`ref-classes-kernel` class.
|
||||
|
||||
:term:`KERNEL_PATH`
|
||||
The location of the kernel sources. This variable is set to the value
|
||||
of the :term:`STAGING_KERNEL_DIR` within
|
||||
@@ -5101,6 +5262,16 @@ system and gives an overview of their function and contents.
|
||||
:term:`Source Directory` for details on how this class
|
||||
applies these additional sed command arguments.
|
||||
|
||||
:term:`OECMAKE_GENERATOR`
|
||||
A variable for the :ref:`ref-classes-cmake` class, allowing to choose
|
||||
which back-end will be generated by CMake to build an application.
|
||||
|
||||
By default, this variable is set to ``Ninja``, which is faster than GNU
|
||||
make, but if building is broken with Ninja, a recipe can use this
|
||||
variable to use GNU make instead::
|
||||
|
||||
OECMAKE_GENERATOR = "Unix Makefiles"
|
||||
|
||||
:term:`OE_IMPORTS`
|
||||
An internal variable used to tell the OpenEmbedded build system what
|
||||
Python modules to import for every Python function run by the system.
|
||||
@@ -5144,6 +5315,20 @@ system and gives an overview of their function and contents.
|
||||
For additional information on how this variable is used, see the
|
||||
initialization script.
|
||||
|
||||
:term:`OEQA_REPRODUCIBLE_TEST_PACKAGE`
|
||||
Set the package manager(s) for build reproducibility testing.
|
||||
See :yocto_git:`reproducible.py </poky/tree/meta/lib/oeqa/selftest/cases/reproducible.py>`
|
||||
and :doc:`/test-manual/reproducible-builds`.
|
||||
|
||||
:term:`OEQA_REPRODUCIBLE_TEST_TARGET`
|
||||
Set build target for build reproducibility testing. By default
|
||||
all available recipes are compiled with "bitbake world", see also :term:`EXCLUDE_FROM_WORLD`
|
||||
and :doc:`/test-manual/reproducible-builds`.
|
||||
|
||||
:term:`OEQA_REPRODUCIBLE_TEST_SSTATE_TARGETS`
|
||||
Set build targets which can be rebuilt using :ref:`shared state <overview-manual/concepts:shared state cache>`
|
||||
when running build reproducibility tests. See :doc:`/test-manual/reproducible-builds`.
|
||||
|
||||
:term:`OLDEST_KERNEL`
|
||||
Declares the oldest version of the Linux kernel that the produced
|
||||
binaries must support. This variable is passed into the build of the
|
||||
@@ -5526,25 +5711,23 @@ system and gives an overview of their function and contents.
|
||||
omit any argument you like but must retain the separating commas. The
|
||||
order is important and specifies the following:
|
||||
|
||||
1. Extra arguments that should be added to the configure script
|
||||
argument list (:term:`EXTRA_OECONF` or
|
||||
:term:`PACKAGECONFIG_CONFARGS`) if
|
||||
the feature is enabled.
|
||||
#. Extra arguments that should be added to :term:`PACKAGECONFIG_CONFARGS`
|
||||
if the feature is enabled.
|
||||
|
||||
2. Extra arguments that should be added to :term:`EXTRA_OECONF` or
|
||||
:term:`PACKAGECONFIG_CONFARGS` if the feature is disabled.
|
||||
#. Extra arguments that should be added to :term:`PACKAGECONFIG_CONFARGS`
|
||||
if the feature is disabled.
|
||||
|
||||
3. Additional build dependencies (:term:`DEPENDS`)
|
||||
#. Additional build dependencies (:term:`DEPENDS`)
|
||||
that should be added if the feature is enabled.
|
||||
|
||||
4. Additional runtime dependencies (:term:`RDEPENDS`)
|
||||
#. Additional runtime dependencies (:term:`RDEPENDS`)
|
||||
that should be added if the feature is enabled.
|
||||
|
||||
5. Additional runtime recommendations
|
||||
#. Additional runtime recommendations
|
||||
(:term:`RRECOMMENDS`) that should be added if
|
||||
the feature is enabled.
|
||||
|
||||
6. Any conflicting (that is, mutually exclusive) :term:`PACKAGECONFIG`
|
||||
#. Any conflicting (that is, mutually exclusive) :term:`PACKAGECONFIG`
|
||||
settings for this feature.
|
||||
|
||||
Consider the following :term:`PACKAGECONFIG` block taken from the
|
||||
@@ -5591,6 +5774,38 @@ system and gives an overview of their function and contents.
|
||||
|
||||
PACKAGECONFIG:append:pn-recipename = " f4"
|
||||
|
||||
Consider the following example of a :ref:`ref-classes-cmake` recipe with a systemd service
|
||||
in which :term:`PACKAGECONFIG` is used to transform the systemd service
|
||||
into a feature that can be easily enabled or disabled via :term:`PACKAGECONFIG`::
|
||||
|
||||
example.c
|
||||
example.service
|
||||
CMakeLists.txt
|
||||
|
||||
The ``CMakeLists.txt`` file contains::
|
||||
|
||||
if(WITH_SYSTEMD)
|
||||
install(FILES ${PROJECT_SOURCE_DIR}/example.service DESTINATION /etc/systemd/systemd)
|
||||
endif(WITH_SYSTEMD)
|
||||
|
||||
In order to enable the installation of ``example.service`` we need to
|
||||
ensure that ``-DWITH_SYSTEMD=ON`` is passed to the ``cmake`` command
|
||||
execution. Recipes that have ``CMakeLists.txt`` generally inherit the
|
||||
:ref:`ref-classes-cmake` class, that runs ``cmake`` with
|
||||
:term:`EXTRA_OECMAKE`, which :term:`PACKAGECONFIG_CONFARGS` will be
|
||||
appended to. Now, knowing that :term:`PACKAGECONFIG_CONFARGS` is
|
||||
automatically filled with either the first or second element of
|
||||
:term:`PACKAGECONFIG` flag value, the recipe would be like::
|
||||
|
||||
inherit cmake
|
||||
PACKAGECONFIG = "systemd"
|
||||
PACKAGECONFIG[systemd] = "-DWITH_SYSTEMD=ON,-DWITH_SYSTEMD=OFF"
|
||||
|
||||
A side note to this recipe is to check if ``systemd`` is in fact the used :term:`INIT_MANAGER`
|
||||
or not::
|
||||
|
||||
PACKAGECONFIG = "${@'systemd' if d.getVar('INIT_MANAGER') == 'systemd' else ''}"
|
||||
|
||||
:term:`PACKAGECONFIG_CONFARGS`
|
||||
A space-separated list of configuration options generated from the
|
||||
:term:`PACKAGECONFIG` setting.
|
||||
@@ -6378,6 +6593,22 @@ system and gives an overview of their function and contents.
|
||||
BitBake User Manual for additional information on tasks and
|
||||
dependencies.
|
||||
|
||||
:term:`RECIPE_MAINTAINER`
|
||||
This variable defines the name and e-mail address of the maintainer of a
|
||||
recipe. Such information can be used by human users submitted changes,
|
||||
and by automated tools to send notifications, for example about
|
||||
vulnerabilities or source updates.
|
||||
|
||||
The variable can be defined in a global distribution :oe_git:`maintainers.inc
|
||||
</openembedded-core/tree/meta/conf/distro/include/maintainers.inc>` file::
|
||||
|
||||
meta/conf/distro/include/maintainers.inc:RECIPE_MAINTAINER:pn-sysvinit = "Ross Burton <ross.burton@arm.com>"
|
||||
|
||||
It can also be directly defined in a recipe,
|
||||
for example in the ``libgpiod`` one::
|
||||
|
||||
RECIPE_MAINTAINER = "Bartosz Golaszewski <brgl@bgdev.pl>"
|
||||
|
||||
:term:`RECIPE_NO_UPDATE_REASON`
|
||||
If a recipe should not be replaced by a more recent upstream version,
|
||||
putting the reason why in this variable in a recipe allows
|
||||
@@ -6385,6 +6616,39 @@ system and gives an overview of their function and contents.
|
||||
in the ":ref:`ref-manual/devtool-reference:checking on the upgrade status of a recipe`"
|
||||
section.
|
||||
|
||||
:term:`RECIPE_SYSROOT`
|
||||
This variable points to the directory that holds all files populated from
|
||||
recipes specified in :term:`DEPENDS`. As the name indicates,
|
||||
think of this variable as a custom root (``/``) for the recipe that will be
|
||||
used by the compiler in order to find headers and other files needed to complete
|
||||
its job.
|
||||
|
||||
This variable is related to :term:`STAGING_DIR_HOST` or :term:`STAGING_DIR_TARGET`
|
||||
according to the type of the recipe and the build target.
|
||||
|
||||
To better understand this variable, consider the following examples:
|
||||
|
||||
- For ``#include <header.h>``, ``header.h`` should be in ``"${RECIPE_SYSROOT}/usr/include"``
|
||||
|
||||
- For ``-lexample``, ``libexample.so`` should be in ``"${RECIPE_SYSROOT}/lib"``
|
||||
or other library sysroot directories.
|
||||
|
||||
The default value is ``"${WORKDIR}/recipe-sysroot"``.
|
||||
Do not modify it.
|
||||
|
||||
:term:`RECIPE_SYSROOT_NATIVE`
|
||||
This is similar to :term:`RECIPE_SYSROOT` but the populated files are from
|
||||
``-native`` recipes. This allows a recipe built for the target machine to
|
||||
use ``native`` tools.
|
||||
|
||||
This variable is related to :term:`STAGING_DIR_NATIVE`.
|
||||
|
||||
The default value is ``"${WORKDIR}/recipe-sysroot-native"``.
|
||||
Do not modify it.
|
||||
|
||||
:term:`REPODIR`
|
||||
See :term:`bitbake:REPODIR` in the BitBake manual.
|
||||
|
||||
:term:`REQUIRED_DISTRO_FEATURES`
|
||||
When inheriting the
|
||||
:ref:`features_check <ref-classes-features_check>`
|
||||
@@ -6746,13 +7010,16 @@ system and gives an overview of their function and contents.
|
||||
:term:`SDK_EXT_TYPE` is set to "full".
|
||||
|
||||
:term:`SDK_NAME`
|
||||
The base name for SDK output files. The name is derived from the
|
||||
:term:`DISTRO`, :term:`TCLIBC`,
|
||||
:term:`SDK_ARCH`,
|
||||
:term:`IMAGE_BASENAME`, and
|
||||
:term:`TUNE_PKGARCH` variables::
|
||||
The base name for SDK output files. The default value (as set in
|
||||
``meta-poky/conf/distro/poky.conf``) is derived from the
|
||||
:term:`DISTRO`,
|
||||
:term:`TCLIBC`,
|
||||
:term:`SDKMACHINE`,
|
||||
:term:`IMAGE_BASENAME`,
|
||||
:term:`TUNE_PKGARCH`, and
|
||||
:term:`MACHINE` variables::
|
||||
|
||||
SDK_NAME = "${DISTRO}-${TCLIBC}-${SDK_ARCH}-${IMAGE_BASENAME}-${TUNE_PKGARCH}"
|
||||
SDK_NAME = "${DISTRO}-${TCLIBC}-${SDKMACHINE}-${IMAGE_BASENAME}-${TUNE_PKGARCH}-${MACHINE}"
|
||||
|
||||
:term:`SDK_OS`
|
||||
Specifies the operating system for which the SDK will be built. The
|
||||
@@ -7283,6 +7550,38 @@ system and gives an overview of their function and contents.
|
||||
section in the Yocto Project Board Support Package Developer's Guide
|
||||
for additional information.
|
||||
|
||||
:term:`SPL_MKIMAGE_DTCOPTS`
|
||||
Options for the device tree compiler passed to ``mkimage -D`` feature
|
||||
while creating a FIT image with the :ref:`ref-classes-uboot-sign`
|
||||
class. If :term:`SPL_MKIMAGE_DTCOPTS` is not set then the
|
||||
:ref:`ref-classes-uboot-sign` class will not pass the ``-D`` option
|
||||
to ``mkimage``.
|
||||
|
||||
The default value is set to "" by the :ref:`ref-classes-uboot-config`
|
||||
class.
|
||||
|
||||
:term:`SPL_SIGN_ENABLE`
|
||||
Enable signing of the U-Boot FIT image. The default value is "0".
|
||||
This variable is used by the :ref:`ref-classes-uboot-sign` class.
|
||||
|
||||
:term:`SPL_SIGN_KEYDIR`
|
||||
Location of the directory containing the RSA key and certificate used for
|
||||
signing the U-Boot FIT image, used by the :ref:`ref-classes-uboot-sign`
|
||||
class.
|
||||
|
||||
:term:`SPL_SIGN_KEYNAME`
|
||||
The name of keys used by the :ref:`ref-classes-kernel-fitimage` class
|
||||
for signing U-Boot FIT image stored in the :term:`SPL_SIGN_KEYDIR`
|
||||
directory. If we have for example a ``dev.key`` key and a ``dev.crt``
|
||||
certificate stored in the :term:`SPL_SIGN_KEYDIR` directory, you will
|
||||
have to set :term:`SPL_SIGN_KEYNAME` to ``dev``.
|
||||
|
||||
:term:`SPLASH`
|
||||
This variable, used by the :ref:`ref-classes-image` class, allows
|
||||
to choose splashscreen applications. Set it to the names of packages
|
||||
for such applications to use. This variable is set by default to
|
||||
``psplash``.
|
||||
|
||||
:term:`SPLASH_IMAGES`
|
||||
This variable, used by the ``psplash`` recipe, allows to customize
|
||||
the default splashscreen image.
|
||||
@@ -7501,6 +7800,16 @@ system and gives an overview of their function and contents.
|
||||
file://.* https://someserver.tld/share/sstate/PATH;downloadfilename=PATH \
|
||||
file://.* file:///some-local-dir/sstate/PATH"
|
||||
|
||||
The Yocto Project actually shares the cache data objects built by its
|
||||
autobuilder::
|
||||
|
||||
SSTATE_MIRRORS ?= "file://.* http://cdn.jsdelivr.net/yocto/sstate/all/PATH;downloadfilename=PATH"
|
||||
|
||||
As such binary artifacts are built for the generic QEMU machines
|
||||
supported by the various Poky releases, they are less likely to be
|
||||
reusable in real projects building binaries optimized for a specific
|
||||
CPU family.
|
||||
|
||||
:term:`SSTATE_SCAN_FILES`
|
||||
Controls the list of files the OpenEmbedded build system scans for
|
||||
hardcoded installation paths. The variable uses a space-separated
|
||||
@@ -7619,10 +7928,15 @@ system and gives an overview of their function and contents.
|
||||
for ``-native`` recipes, as they make use of host headers and
|
||||
libraries.
|
||||
|
||||
Check :term:`RECIPE_SYSROOT` and :term:`RECIPE_SYSROOT_NATIVE`.
|
||||
|
||||
:term:`STAGING_DIR_NATIVE`
|
||||
Specifies the path to the sysroot directory used when building
|
||||
components that run on the build host itself.
|
||||
|
||||
The default value is ``"${RECIPE_SYSROOT_NATIVE}"``,
|
||||
check :term:`RECIPE_SYSROOT_NATIVE`.
|
||||
|
||||
:term:`STAGING_DIR_TARGET`
|
||||
Specifies the path to the sysroot used for the system for which the
|
||||
component generates code. For components that do not generate code,
|
||||
@@ -7804,6 +8118,35 @@ system and gives an overview of their function and contents.
|
||||
${libdir}/${BPN}/ptest \
|
||||
"
|
||||
|
||||
Consider the following example in which you need to manipulate this variable.
|
||||
Assume you have a recipe ``A`` that provides a shared library ``.so.*`` that is
|
||||
installed into a custom folder other than "``${libdir}``"
|
||||
or "``${base_libdir}``", let's say "``/opt/lib``".
|
||||
|
||||
.. note::
|
||||
|
||||
This is not a recommended way to deal with shared libraries, but this
|
||||
is just to show the usefulness of setting :term:`SYSROOT_DIRS`.
|
||||
|
||||
When a recipe ``B`` :term:`DEPENDS` on ``A``, it means what is in
|
||||
:term:`SYSROOT_DIRS` will be copied from :term:`D` of the recipe ``B``
|
||||
into ``B``'s :term:`SYSROOT_DESTDIR` that is "``${WORKDIR}/sysroot-destdir``".
|
||||
|
||||
Now, since ``/opt/lib`` is not in :term:`SYSROOT_DIRS`, it will never be copied to
|
||||
``A``'s :term:`RECIPE_SYSROOT`, which is "``${WORKDIR}/recipe-sysroot``". So,
|
||||
the linking process will fail.
|
||||
|
||||
To fix this, you need to add ``/opt/lib`` to :term:`SYSROOT_DIRS`::
|
||||
|
||||
SYSROOT_DIRS:append = " /opt/lib"
|
||||
|
||||
.. note::
|
||||
Even after setting ``/opt/lib`` to :term:`SYSROOT_DIRS`, the linking process will still fail
|
||||
because the linker does not know that location, since :term:`TARGET_LDFLAGS`
|
||||
doesn't contain it (if your recipe is for the target). Therefore, so you should add::
|
||||
|
||||
TARGET_LDFLAGS:append = " -L${RECIPE_SYSROOT}/opt/lib"
|
||||
|
||||
:term:`SYSROOT_DIRS_NATIVE`
|
||||
Extra directories staged into the sysroot by the
|
||||
:ref:`ref-tasks-populate_sysroot` task for
|
||||
@@ -8334,7 +8677,7 @@ system and gives an overview of their function and contents.
|
||||
on enabling, running, and writing these tests, see the
|
||||
":ref:`dev-manual/runtime-testing:performing automated runtime testing`"
|
||||
section in the Yocto Project Development Tasks Manual and the
|
||||
":ref:`ref-classes-testimage*`" section.
|
||||
":ref:`ref-classes-testimage`" section.
|
||||
|
||||
:term:`THISDIR`
|
||||
The directory in which the file BitBake is currently parsing is
|
||||
@@ -8399,6 +8742,16 @@ system and gives an overview of their function and contents.
|
||||
portion of an eSDK. This is similar to :term:`TOOLCHAIN_HOST_TASK`
|
||||
applying to SDKs.
|
||||
|
||||
:term:`TOOLCHAIN_OPTIONS`
|
||||
This variable holds extra options passed to the compiler and the linker
|
||||
for non ``-native`` recipes as they have to point to their custom
|
||||
``sysroot`` folder pointed to by :term:`RECIPE_SYSROOT`::
|
||||
|
||||
TOOLCHAIN_OPTIONS = " --sysroot=${RECIPE_SYSROOT}"
|
||||
|
||||
Native recipes don't need this variable to be set, as they are
|
||||
built for the host machine with the native compiler.
|
||||
|
||||
:term:`TOOLCHAIN_OUTPUTNAME`
|
||||
This variable defines the name used for the toolchain output. The
|
||||
:ref:`populate_sdk_base <ref-classes-populate-sdk-*>` class sets
|
||||
@@ -8608,6 +8961,64 @@ system and gives an overview of their function and contents.
|
||||
creation, the :term:`UBOOT_ENTRYPOINT` variable is passed as a
|
||||
command-line parameter to the ``uboot-mkimage`` utility.
|
||||
|
||||
:term:`UBOOT_FIT_DESC`
|
||||
Specifies the description string encoded into a U-Boot fitImage. The default
|
||||
value is set by the :ref:`ref-classes-uboot-sign` class as follows::
|
||||
|
||||
UBOOT_FIT_DESC ?= "U-Boot fitImage for ${DISTRO_NAME}/${PV}/${MACHINE}"
|
||||
|
||||
:term:`UBOOT_FIT_GENERATE_KEYS`
|
||||
Decides whether to generate the keys for signing the U-Boot fitImage if
|
||||
they don't already exist. The keys are created in :term:`SPL_SIGN_KEYDIR`.
|
||||
The default value is "0".
|
||||
|
||||
Enable this as follows::
|
||||
|
||||
UBOOT_FIT_GENERATE_KEYS = "1"
|
||||
|
||||
This variable is used in the :ref:`ref-classes-uboot-sign` class.
|
||||
|
||||
:term:`UBOOT_FIT_HASH_ALG`
|
||||
Specifies the hash algorithm used in creating the U-Boot FIT Image.
|
||||
It is set by default to ``sha256`` by the :ref:`ref-classes-uboot-sign`
|
||||
class.
|
||||
|
||||
:term:`UBOOT_FIT_KEY_GENRSA_ARGS`
|
||||
Arguments to ``openssl genrsa`` for generating a RSA private key for
|
||||
signing the U-Boot FIT image. The default value of this variable
|
||||
is set to "-F4" by the :ref:`ref-classes-uboot-sign` class.
|
||||
|
||||
:term:`UBOOT_FIT_KEY_REQ_ARGS`
|
||||
Arguments to ``openssl req`` for generating a certificate for signing
|
||||
the U-Boot FIT image. The default value is "-batch -new" by the
|
||||
:ref:`ref-classes-uboot-sign` class, "batch" for
|
||||
non interactive mode and "new" for generating new keys.
|
||||
|
||||
:term:`UBOOT_FIT_KEY_SIGN_PKCS`
|
||||
Format for the public key certificate used for signing the U-Boot FIT
|
||||
image. The default value is set to "x509" by the
|
||||
:ref:`ref-classes-uboot-sign` class.
|
||||
|
||||
:term:`UBOOT_FIT_SIGN_ALG`
|
||||
Specifies the signature algorithm used in creating the U-Boot FIT Image.
|
||||
This variable is set by default to "rsa2048" by the
|
||||
:ref:`ref-classes-uboot-sign` class.
|
||||
|
||||
:term:`UBOOT_FIT_SIGN_NUMBITS`
|
||||
Size of the private key used in signing the U-Boot FIT image, in number
|
||||
of bits. The default value for this variable is set to "2048"
|
||||
by the :ref:`ref-classes-uboot-sign` class.
|
||||
|
||||
:term:`UBOOT_FITIMAGE_ENABLE`
|
||||
This variable allows to generate a FIT image for U-Boot, which is one
|
||||
of the ways to implement a verified boot process.
|
||||
|
||||
Its default value is "0", so set it to "1" to enable this functionality::
|
||||
|
||||
UBOOT_FITIMAGE_ENABLE = "1"
|
||||
|
||||
See the :ref:`ref-classes-uboot-sign` class for details.
|
||||
|
||||
:term:`UBOOT_LOADADDRESS`
|
||||
Specifies the load address for the U-Boot image. During U-Boot image
|
||||
creation, the :term:`UBOOT_LOADADDRESS` variable is passed as a
|
||||
|
||||
@@ -25,27 +25,20 @@ Follow these steps to locate and hand-install the toolchain:
|
||||
download the installer appropriate for your build host, target
|
||||
hardware, and image type.
|
||||
|
||||
The installer files (``*.sh``) follow this naming convention::
|
||||
The installer files (``*.sh``) follow this naming convention:
|
||||
``poky-glibc-host_system-core-image-type-arch-toolchain[-ext]-release.sh``:
|
||||
|
||||
poky-glibc-host_system-core-image-type-arch-toolchain[-ext]-release.sh
|
||||
- ``host_system``: string representing your development system: ``i686`` or ``x86_64``
|
||||
|
||||
Where:
|
||||
host_system is a string representing your development system:
|
||||
"i686" or "x86_64"
|
||||
- ``type``: string representing the image: ``sato`` or ``minimal``
|
||||
|
||||
type is a string representing the image:
|
||||
"sato" or "minimal"
|
||||
- ``arch``: string representing the target architecture such as ``cortexa57-qemuarm64``
|
||||
|
||||
arch is a string representing the target architecture:
|
||||
"aarch64", "armv5e", "core2-64", "cortexa8hf-neon", "i586", "mips32r2",
|
||||
"mips64", or "ppc7400"
|
||||
|
||||
release is the version of Yocto Project.
|
||||
|
||||
NOTE:
|
||||
The standard SDK installer does not have the "-ext" string as
|
||||
part of the filename.
|
||||
- ``release``: version of the Yocto Project.
|
||||
|
||||
.. note::
|
||||
The standard SDK installer does not have the ``-ext`` string as
|
||||
part of the filename.
|
||||
|
||||
The toolchains provided by the Yocto
|
||||
Project are based off of the ``core-image-sato`` and
|
||||
@@ -53,16 +46,16 @@ Follow these steps to locate and hand-install the toolchain:
|
||||
developing against those images.
|
||||
|
||||
For example, if your build host is a 64-bit x86 system and you need
|
||||
an extended SDK for a 64-bit core2 target, go into the ``x86_64``
|
||||
an extended SDK for a 64-bit core2 QEMU target, go into the ``x86_64``
|
||||
folder and download the following installer::
|
||||
|
||||
poky-glibc-x86_64-core-image-sato-core2-64-toolchain-ext-&DISTRO;.sh
|
||||
poky-glibc-x86_64-core-image-sato-core2-64-qemux86-64-toolchain-&DISTRO;.sh
|
||||
|
||||
4. *Run the Installer:* Be sure you have execution privileges and run
|
||||
the installer. Following is an example from the ``Downloads``
|
||||
directory::
|
||||
|
||||
$ ~/Downloads/poky-glibc-x86_64-core-image-sato-core2-64-toolchain-ext-&DISTRO;.sh
|
||||
$ ~/Downloads/poky-glibc-x86_64-core-image-sato-core2-64-qemux86-64-toolchain-&DISTRO;.sh
|
||||
|
||||
During execution of the script, you choose the root location for the
|
||||
toolchain. See the
|
||||
@@ -206,21 +199,14 @@ Follow these steps to extract the root filesystem:
|
||||
also contain flattened root filesystem image files (``*.ext4``),
|
||||
which you can use with QEMU directly.
|
||||
|
||||
The pre-built root filesystem image files follow these naming
|
||||
conventions::
|
||||
The pre-built root filesystem image files follow the
|
||||
``core-image-profile-machine.tar.bz2`` naming convention:
|
||||
|
||||
core-image-profile-arch.tar.bz2
|
||||
- ``profile``: filesystem image's profile, such as ``minimal``,
|
||||
``minimal-dev`` or ``sato``. For information on these types of image
|
||||
profiles, see the "Images" chapter in the Yocto Project Reference Manual.
|
||||
|
||||
Where:
|
||||
profile is the filesystem image's profile:
|
||||
lsb, lsb-dev, lsb-sdk, minimal, minimal-dev, minimal-initramfs,
|
||||
sato, sato-dev, sato-sdk, sato-sdk-ptest. For information on
|
||||
these types of image profiles, see the "Images" chapter in
|
||||
the Yocto Project Reference Manual.
|
||||
|
||||
arch is a string representing the target architecture:
|
||||
beaglebone-yocto, beaglebone-yocto-lsb, edgerouter, edgerouter-lsb,
|
||||
genericx86, genericx86-64, genericx86-64-lsb, genericx86-lsb and qemu*.
|
||||
- ``machine``: same string as the name of the parent download directory.
|
||||
|
||||
The root filesystems
|
||||
provided by the Yocto Project are based off of the
|
||||
|
||||
@@ -41,44 +41,6 @@ functionality.
|
||||
Installing the Extensible SDK
|
||||
=============================
|
||||
|
||||
Two ways to install the Extensible SDK
|
||||
--------------------------------------
|
||||
|
||||
Extensible SDK can be installed in two different ways, and both have
|
||||
their own pros and cons:
|
||||
|
||||
#. *Setting up the Extensible SDK environment directly in a Yocto build*. This
|
||||
avoids having to produce, test, distribute and maintain separate SDK
|
||||
installer archives, which can get very large. There is only one environment
|
||||
for the regular Yocto build and the SDK and less code paths where things can
|
||||
go not according to plan. It's easier to update the SDK: it simply means
|
||||
updating the Yocto layers with git fetch or layer management tooling. The
|
||||
SDK extensibility is better than in the second option: just run ``bitbake``
|
||||
again to add more things to the sysroot, or add layers if even more things
|
||||
are required.
|
||||
|
||||
#. *Setting up the Extensible SDK from a standalone installer*. This has the
|
||||
benefit of having a single, self-contained archive that includes all the
|
||||
needed binary artifacts. So nothing needs to be rebuilt, and there is no
|
||||
need to provide a well-functioning binary artefact cache over the network
|
||||
for developers with underpowered laptops.
|
||||
|
||||
Setting up the Extensible SDK environment directly in a Yocto build
|
||||
-------------------------------------------------------------------
|
||||
|
||||
#. Set up all the needed layers and a Yocto :term:`Build Directory`, e.g. a regular Yocto
|
||||
build where ``bitbake`` can be executed.
|
||||
|
||||
#. Run::
|
||||
|
||||
$ bitbake meta-ide-support
|
||||
$ bitbake -c populate_sysroot gtk+3
|
||||
# or any other target or native item that the application developer would need
|
||||
$ bitbake build-sysroots
|
||||
|
||||
Setting up the Extensible SDK from a standalone installer
|
||||
---------------------------------------------------------
|
||||
|
||||
The first thing you need to do is install the SDK on your :term:`Build
|
||||
Host` by running the ``*.sh`` installation script.
|
||||
|
||||
@@ -172,12 +134,7 @@ Running the Extensible SDK Environment Setup Script
|
||||
===================================================
|
||||
|
||||
Once you have the SDK installed, you must run the SDK environment setup
|
||||
script before you can actually use the SDK.
|
||||
|
||||
When using a SDK directly in a Yocto build, you will find the script in
|
||||
``tmp/deploy/images/qemux86-64/`` in your :term:`Build Directory`.
|
||||
|
||||
When using a standalone SDK installer, this setup script resides in
|
||||
script before you can actually use the SDK. This setup script resides in
|
||||
the directory you chose when you installed the SDK, which is either the
|
||||
default ``poky_sdk`` directory or the directory you chose during
|
||||
installation.
|
||||
@@ -195,11 +152,6 @@ script is for an IA-based target machine using i586 tuning::
|
||||
SDK environment now set up; additionally you may now run devtool to perform development tasks.
|
||||
Run devtool --help for further details.
|
||||
|
||||
When using the environment script directly in a Yocto build, it can
|
||||
be run similarly::
|
||||
|
||||
$ source tmp/deploy/images/qemux86-64/environment-setup-core2-64-poky-linux
|
||||
|
||||
Running the setup script defines many environment variables needed in order to
|
||||
use the SDK (e.g. ``PATH``, :term:`CC`, :term:`LD`, and so forth). If you want
|
||||
to see all the environment variables the script exports, examine the
|
||||
@@ -1219,19 +1171,6 @@ You can use the following command to find out::
|
||||
Once you know the recipe
|
||||
(i.e. ``mesa`` in this example), you can install it.
|
||||
|
||||
When using the extensible SDK directly in a Yocto build
|
||||
-------------------------------------------------------
|
||||
|
||||
In this scenario, the Yocto build tooling, e.g. ``bitbake``
|
||||
is directly accessible to build additional items, and it
|
||||
can simply be executed directly::
|
||||
|
||||
$ bitbake mesa
|
||||
$ bitbake build-sysroots
|
||||
|
||||
When using a standalone installer for the Extensible SDK
|
||||
--------------------------------------------------------
|
||||
|
||||
::
|
||||
|
||||
$ devtool sdk-install mesa
|
||||
|
||||
@@ -131,7 +131,7 @@ the following types of tests:
|
||||
|
||||
$ bitbake image -c testimage
|
||||
|
||||
The tests utilize the :ref:`testimage* <ref-classes-testimage*>`
|
||||
The tests utilize the :ref:`testimage* <ref-classes-testimage>`
|
||||
classes and the :ref:`ref-tasks-testimage` task.
|
||||
|
||||
- *Layer Testing:* The Autobuilder has the possibility to test whether
|
||||
|
||||
@@ -68,17 +68,6 @@ things we do within the build system to ensure reproducibility include:
|
||||
- Filtering the tools available from the host's ``PATH`` to only a specific set
|
||||
of tools, set using the :term:`HOSTTOOLS` variable.
|
||||
|
||||
.. note::
|
||||
|
||||
Because of an open bug in GCC, using ``DISTRO_FEATURES:append = " lto"`` or
|
||||
adding ``-flto`` (Link Time Optimization) to ``CFLAGS`` makes the resulting
|
||||
binary non-reproducible, in that it depends on the full absolute build path
|
||||
to ``recipe-sysroot-native``, so installing the Yocto Project in a different
|
||||
directory results in a different binary.
|
||||
|
||||
This issue is addressed by
|
||||
:yocto_bugs:`bug 14481 - Programs built with -flto are not reproducible</show_bug.cgi?id=14481>`.
|
||||
|
||||
=========================================
|
||||
Can we prove the project is reproducible?
|
||||
=========================================
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
DISTRO = "poky"
|
||||
DISTRO_NAME = "Poky (Yocto Project Reference Distro)"
|
||||
#DISTRO_VERSION = "3.4+snapshot-${METADATA_REVISION}"
|
||||
DISTRO_VERSION = "4.0.13"
|
||||
DISTRO_VERSION = "4.0.15"
|
||||
DISTRO_CODENAME = "kirkstone"
|
||||
SDK_VENDOR = "-pokysdk"
|
||||
SDK_VERSION = "${@d.getVar('DISTRO_VERSION').replace('snapshot-${METADATA_REVISION}', 'snapshot')}"
|
||||
|
||||
@@ -12,7 +12,7 @@ inherit logging
|
||||
|
||||
OE_EXTRA_IMPORTS ?= ""
|
||||
|
||||
OE_IMPORTS += "os sys time oe.path oe.utils oe.types oe.package oe.packagegroup oe.sstatesig oe.lsb oe.cachedpath oe.license oe.qa oe.reproducible oe.rust ${OE_EXTRA_IMPORTS}"
|
||||
OE_IMPORTS += "os sys time oe.path oe.utils oe.types oe.package oe.packagegroup oe.sstatesig oe.lsb oe.cachedpath oe.license oe.qa oe.reproducible oe.rust oe.go ${OE_EXTRA_IMPORTS}"
|
||||
OE_IMPORTS[type] = "list"
|
||||
|
||||
PACKAGECONFIG_CONFARGS ??= ""
|
||||
|
||||
@@ -48,7 +48,7 @@ python do_menuconfig() {
|
||||
# ensure that environment variables are overwritten with this tasks 'd' values
|
||||
d.appendVar("OE_TERMINAL_EXPORTS", " PKG_CONFIG_DIR PKG_CONFIG_PATH PKG_CONFIG_LIBDIR PKG_CONFIG_SYSROOT_DIR")
|
||||
|
||||
oe_terminal("sh -c \"make %s; if [ \\$? -ne 0 ]; then echo 'Command failed.'; printf 'Press any key to continue... '; read r; fi\"" % d.getVar('KCONFIG_CONFIG_COMMAND'),
|
||||
oe_terminal("sh -c 'make %s; if [ \\$? -ne 0 ]; then echo \"Command failed.\"; printf \"Press any key to continue... \"; read r; fi'" % d.getVar('KCONFIG_CONFIG_COMMAND'),
|
||||
d.getVar('PN') + ' Configuration', d)
|
||||
|
||||
# FIXME this check can be removed when the minimum bitbake version has been bumped
|
||||
|
||||
@@ -98,6 +98,8 @@ def generate_json_report(d, out_path, link_path):
|
||||
cve_check_merge_jsons(summary, data)
|
||||
filename = f.readline()
|
||||
|
||||
summary["package"].sort(key=lambda d: d['name'])
|
||||
|
||||
with open(out_path, "w") as f:
|
||||
json.dump(summary, f, indent=2)
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ PACKAGE_WRITE_DEPS += "qemu-native"
|
||||
inherit qemu
|
||||
|
||||
FONT_PACKAGES ??= "${PN}"
|
||||
FONT_PACKAGES:class-native = ""
|
||||
FONT_EXTRA_RDEPENDS ?= "${MLPREFIX}fontconfig-utils"
|
||||
FONTCONFIG_CACHE_DIR ?= "${localstatedir}/cache/fontconfig"
|
||||
FONTCONFIG_CACHE_PARAMS ?= "-v"
|
||||
|
||||
@@ -61,31 +61,10 @@ SECURITY_NOPIE_CFLAGS ??= ""
|
||||
CCACHE_DISABLE ?= "1"
|
||||
|
||||
def go_map_arch(a, d):
|
||||
import re
|
||||
if re.match('i.86', a):
|
||||
return '386'
|
||||
elif a == 'x86_64':
|
||||
return 'amd64'
|
||||
elif re.match('arm.*', a):
|
||||
return 'arm'
|
||||
elif re.match('aarch64.*', a):
|
||||
return 'arm64'
|
||||
elif re.match('mips64el.*', a):
|
||||
return 'mips64le'
|
||||
elif re.match('mips64.*', a):
|
||||
return 'mips64'
|
||||
elif a == 'mips':
|
||||
return 'mips'
|
||||
elif a == 'mipsel':
|
||||
return 'mipsle'
|
||||
elif re.match('p(pc|owerpc)(64le)', a):
|
||||
return 'ppc64le'
|
||||
elif re.match('p(pc|owerpc)(64)', a):
|
||||
return 'ppc64'
|
||||
elif a == 'riscv64':
|
||||
return 'riscv64'
|
||||
else:
|
||||
arch = oe.go.map_arch(a)
|
||||
if not arch:
|
||||
raise bb.parse.SkipRecipe("Unsupported CPU architecture: %s" % a)
|
||||
return arch
|
||||
|
||||
def go_map_arm(a, d):
|
||||
if a.startswith("arm"):
|
||||
|
||||
@@ -442,8 +442,8 @@ kernel_do_install() {
|
||||
unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE
|
||||
if (grep -q -i -e '^CONFIG_MODULES=y$' .config); then
|
||||
oe_runmake DEPMOD=echo MODLIB=${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION} INSTALL_FW_PATH=${D}${nonarch_base_libdir}/firmware modules_install
|
||||
rm "${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}/build"
|
||||
rm "${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}/source"
|
||||
rm -f "${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}/build"
|
||||
rm -f "${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}/source"
|
||||
# Remove empty module directories to prevent QA issues
|
||||
find "${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}/kernel" -type d -empty -delete
|
||||
else
|
||||
|
||||
@@ -23,6 +23,8 @@ TARGET_CFLAGS = "${BUILD_CFLAGS}"
|
||||
TARGET_CXXFLAGS = "${BUILD_CXXFLAGS}"
|
||||
TARGET_LDFLAGS = "${BUILD_LDFLAGS}"
|
||||
TARGET_FPU = ""
|
||||
TUNE_FEATURES = ""
|
||||
ABIEXTENSION = ""
|
||||
|
||||
HOST_ARCH = "${BUILD_ARCH}"
|
||||
HOST_OS = "${BUILD_OS}"
|
||||
|
||||
@@ -4,6 +4,7 @@ IMAGE_PKGTYPE ?= "rpm"
|
||||
|
||||
RPM="rpm"
|
||||
RPMBUILD="rpmbuild"
|
||||
RPMBUILD_COMPMODE ?= "${@'w19T%d.zstdio' % int(d.getVar('ZSTD_THREADS'))}"
|
||||
|
||||
PKGWRITEDIRRPM = "${WORKDIR}/deploy-rpms"
|
||||
|
||||
@@ -652,6 +653,7 @@ python do_package_rpm () {
|
||||
|
||||
# Setup the rpmbuild arguments...
|
||||
rpmbuild = d.getVar('RPMBUILD')
|
||||
rpmbuild_compmode = d.getVar('RPMBUILD_COMPMODE')
|
||||
targetsys = d.getVar('TARGET_SYS')
|
||||
targetvendor = d.getVar('HOST_VENDOR')
|
||||
|
||||
@@ -678,8 +680,8 @@ python do_package_rpm () {
|
||||
cmd = cmd + " --define '_use_internal_dependency_generator 0'"
|
||||
cmd = cmd + " --define '_binaries_in_noarch_packages_terminate_build 0'"
|
||||
cmd = cmd + " --define '_build_id_links none'"
|
||||
cmd = cmd + " --define '_binary_payload w19T%d.zstdio'" % int(d.getVar("ZSTD_THREADS"))
|
||||
cmd = cmd + " --define '_source_payload w19T%d.zstdio'" % int(d.getVar("ZSTD_THREADS"))
|
||||
cmd = cmd + " --define '_source_payload %s'" % rpmbuild_compmode
|
||||
cmd = cmd + " --define '_binary_payload %s'" % rpmbuild_compmode
|
||||
cmd = cmd + " --define 'clamp_mtime_to_source_date_epoch 1'"
|
||||
cmd = cmd + " --define 'use_source_date_epoch_as_buildtime 1'"
|
||||
cmd = cmd + " --define '_buildhost reproducible'"
|
||||
|
||||
@@ -152,7 +152,7 @@ python do_create_extlinux_config() {
|
||||
bb.fatal('Unable to open %s' % (cfile))
|
||||
}
|
||||
UBOOT_EXTLINUX_VARS = "CONSOLE MENU_DESCRIPTION ROOT KERNEL_IMAGE FDTDIR FDT KERNEL_ARGS INITRD"
|
||||
do_create_extlinux_config[vardeps] += "${@' '.join(['UBOOT_EXTLINUX_%s_%s' % (v, l) for v in d.getVar('UBOOT_EXTLINUX_VARS').split() for l in d.getVar('UBOOT_EXTLINUX_LABELS').split()])}"
|
||||
do_create_extlinux_config[vardeps] += "${@' '.join(['UBOOT_EXTLINUX_%s:%s' % (v, l) for v in d.getVar('UBOOT_EXTLINUX_VARS').split() for l in d.getVar('UBOOT_EXTLINUX_LABELS').split()])}"
|
||||
do_create_extlinux_config[vardepsexclude] += "OVERRIDES"
|
||||
|
||||
addtask create_extlinux_config before do_install do_deploy after do_compile
|
||||
|
||||
@@ -89,11 +89,6 @@ def get_patched_cves(d):
|
||||
for url in oe.patch.src_patches(d):
|
||||
patch_file = bb.fetch.decodeurl(url)[2]
|
||||
|
||||
# Remote compressed patches may not be unpacked, so silently ignore them
|
||||
if not os.path.isfile(patch_file):
|
||||
bb.warn("%s does not exist, cannot extract CVE list" % patch_file)
|
||||
continue
|
||||
|
||||
# Check patch file name for CVE ID
|
||||
fname_match = cve_file_name_match.search(patch_file)
|
||||
if fname_match:
|
||||
@@ -101,6 +96,12 @@ def get_patched_cves(d):
|
||||
patched_cves.add(cve)
|
||||
bb.debug(2, "Found CVE %s from patch file name %s" % (cve, patch_file))
|
||||
|
||||
# Remote patches won't be present and compressed patches won't be
|
||||
# unpacked, so say we're not scanning them
|
||||
if not os.path.isfile(patch_file):
|
||||
bb.note("%s is remote or compressed, not scanning content" % patch_file)
|
||||
continue
|
||||
|
||||
with open(patch_file, "r", encoding="utf-8") as f:
|
||||
try:
|
||||
patch_text = f.read()
|
||||
@@ -159,7 +160,7 @@ def cve_check_merge_jsons(output, data):
|
||||
|
||||
for product in output["package"]:
|
||||
if product["name"] == data["package"][0]["name"]:
|
||||
bb.error("Error adding the same package twice")
|
||||
bb.error("Error adding the same package %s twice" % product["name"])
|
||||
return
|
||||
|
||||
output["package"].append(data["package"][0])
|
||||
|
||||
32
meta/lib/oe/go.py
Normal file
32
meta/lib/oe/go.py
Normal file
@@ -0,0 +1,32 @@
|
||||
#
|
||||
# Copyright OpenEmbedded Contributors
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
|
||||
import re
|
||||
|
||||
def map_arch(a):
|
||||
if re.match('i.86', a):
|
||||
return '386'
|
||||
elif a == 'x86_64':
|
||||
return 'amd64'
|
||||
elif re.match('arm.*', a):
|
||||
return 'arm'
|
||||
elif re.match('aarch64.*', a):
|
||||
return 'arm64'
|
||||
elif re.match('mips64el.*', a):
|
||||
return 'mips64le'
|
||||
elif re.match('mips64.*', a):
|
||||
return 'mips64'
|
||||
elif a == 'mips':
|
||||
return 'mips'
|
||||
elif a == 'mipsel':
|
||||
return 'mipsle'
|
||||
elif re.match('p(pc|owerpc)(64le)', a):
|
||||
return 'ppc64le'
|
||||
elif re.match('p(pc|owerpc)(64)', a):
|
||||
return 'ppc64'
|
||||
elif a == 'riscv64':
|
||||
return 'riscv64'
|
||||
return ''
|
||||
97
meta/recipes-bsp/grub/files/CVE-2023-4692.patch
Normal file
97
meta/recipes-bsp/grub/files/CVE-2023-4692.patch
Normal file
@@ -0,0 +1,97 @@
|
||||
From 43651027d24e62a7a463254165e1e46e42aecdea Mon Sep 17 00:00:00 2001
|
||||
From: Maxim Suhanov <dfirblog@gmail.com>
|
||||
Date: Thu, 16 Nov 2023 07:21:50 +0000
|
||||
Subject: [PATCH] fs/ntfs: Fix an OOB write when parsing the $ATTRIBUTE_LIST
|
||||
attribute for the $MFT file
|
||||
|
||||
When parsing an extremely fragmented $MFT file, i.e., the file described
|
||||
using the $ATTRIBUTE_LIST attribute, current NTFS code will reuse a buffer
|
||||
containing bytes read from the underlying drive to store sector numbers,
|
||||
which are consumed later to read data from these sectors into another buffer.
|
||||
|
||||
These sectors numbers, two 32-bit integers, are always stored at predefined
|
||||
offsets, 0x10 and 0x14, relative to first byte of the selected entry within
|
||||
the $ATTRIBUTE_LIST attribute. Usually, this won't cause any problem.
|
||||
|
||||
However, when parsing a specially-crafted file system image, this may cause
|
||||
the NTFS code to write these integers beyond the buffer boundary, likely
|
||||
causing the GRUB memory allocator to misbehave or fail. These integers contain
|
||||
values which are controlled by on-disk structures of the NTFS file system.
|
||||
|
||||
Such modification and resulting misbehavior may touch a memory range not
|
||||
assigned to the GRUB and owned by firmware or another EFI application/driver.
|
||||
|
||||
This fix introduces checks to ensure that these sector numbers are never
|
||||
written beyond the boundary.
|
||||
|
||||
Fixes: CVE-2023-4692
|
||||
|
||||
Reported-by: Maxim Suhanov <dfirblog@gmail.com>
|
||||
Signed-off-by: Maxim Suhanov <dfirblog@gmail.com>
|
||||
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
|
||||
|
||||
CVE: CVE-2023-4692
|
||||
Upstream-Status: Backport [https://git.savannah.gnu.org/cgit/grub.git/commit/?id=43651027d24e62a7a463254165e1e46e42aecdea]
|
||||
|
||||
Signed-off-by: Yogita Urade <yogita.urade@windriver.com>
|
||||
---
|
||||
grub-core/fs/ntfs.c | 18 +++++++++++++++++-
|
||||
1 file changed, 17 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/grub-core/fs/ntfs.c b/grub-core/fs/ntfs.c
|
||||
index 2f34f76..6009e49 100644
|
||||
--- a/grub-core/fs/ntfs.c
|
||||
+++ b/grub-core/fs/ntfs.c
|
||||
@@ -184,7 +184,7 @@ find_attr (struct grub_ntfs_attr *at, grub_uint8_t attr)
|
||||
}
|
||||
if (at->attr_end)
|
||||
{
|
||||
- grub_uint8_t *pa;
|
||||
+ grub_uint8_t *pa, *pa_end;
|
||||
|
||||
at->emft_buf = grub_malloc (at->mft->data->mft_size << GRUB_NTFS_BLK_SHR);
|
||||
if (at->emft_buf == NULL)
|
||||
@@ -209,11 +209,13 @@ find_attr (struct grub_ntfs_attr *at, grub_uint8_t attr)
|
||||
}
|
||||
at->attr_nxt = at->edat_buf;
|
||||
at->attr_end = at->edat_buf + u32at (pa, 0x30);
|
||||
+ pa_end = at->edat_buf + n;
|
||||
}
|
||||
else
|
||||
{
|
||||
at->attr_nxt = at->attr_end + u16at (pa, 0x14);
|
||||
at->attr_end = at->attr_end + u32at (pa, 4);
|
||||
+ pa_end = at->mft->buf + (at->mft->data->mft_size << GRUB_NTFS_BLK_SHR);
|
||||
}
|
||||
at->flags |= GRUB_NTFS_AF_ALST;
|
||||
while (at->attr_nxt < at->attr_end)
|
||||
@@ -230,6 +232,13 @@ find_attr (struct grub_ntfs_attr *at, grub_uint8_t attr)
|
||||
at->flags |= GRUB_NTFS_AF_GPOS;
|
||||
at->attr_cur = at->attr_nxt;
|
||||
pa = at->attr_cur;
|
||||
+
|
||||
+ if ((pa >= pa_end) || (pa_end - pa < 0x18))
|
||||
+ {
|
||||
+ grub_error (GRUB_ERR_BAD_FS, "can\'t parse attribute list");
|
||||
+ return NULL;
|
||||
+ }
|
||||
+
|
||||
grub_set_unaligned32 ((char *) pa + 0x10,
|
||||
grub_cpu_to_le32 (at->mft->data->mft_start));
|
||||
grub_set_unaligned32 ((char *) pa + 0x14,
|
||||
@@ -240,6 +249,13 @@ find_attr (struct grub_ntfs_attr *at, grub_uint8_t attr)
|
||||
{
|
||||
if (*pa != attr)
|
||||
break;
|
||||
+
|
||||
+ if ((pa >= pa_end) || (pa_end - pa < 0x18))
|
||||
+ {
|
||||
+ grub_error (GRUB_ERR_BAD_FS, "can\'t parse attribute list");
|
||||
+ return NULL;
|
||||
+ }
|
||||
+
|
||||
if (read_attr
|
||||
(at, pa + 0x10,
|
||||
u32at (pa, 0x10) * (at->mft->data->mft_size << GRUB_NTFS_BLK_SHR),
|
||||
--
|
||||
2.40.0
|
||||
62
meta/recipes-bsp/grub/files/CVE-2023-4693.patch
Normal file
62
meta/recipes-bsp/grub/files/CVE-2023-4693.patch
Normal file
@@ -0,0 +1,62 @@
|
||||
From 0ed2458cc4eff6d9a9199527e2a0b6d445802f94 Mon Sep 17 00:00:00 2001
|
||||
From: Maxim Suhanov <dfirblog@gmail.com>
|
||||
Date: Mon, 28 Aug 2023 16:32:33 +0300
|
||||
Subject: [PATCH] fs/ntfs: Fix an OOB read when reading data from the resident
|
||||
$DATA attribute
|
||||
|
||||
When reading a file containing resident data, i.e., the file data is stored in
|
||||
the $DATA attribute within the NTFS file record, not in external clusters,
|
||||
there are no checks that this resident data actually fits the corresponding
|
||||
file record segment.
|
||||
|
||||
When parsing a specially-crafted file system image, the current NTFS code will
|
||||
read the file data from an arbitrary, attacker-chosen memory offset and of
|
||||
arbitrary, attacker-chosen length.
|
||||
|
||||
This allows an attacker to display arbitrary chunks of memory, which could
|
||||
contain sensitive information like password hashes or even plain-text,
|
||||
obfuscated passwords from BS EFI variables.
|
||||
|
||||
This fix implements a check to ensure that resident data is read from the
|
||||
corresponding file record segment only.
|
||||
|
||||
Fixes: CVE-2023-4693
|
||||
|
||||
Reported-by: Maxim Suhanov <dfirblog@gmail.com>
|
||||
Signed-off-by: Maxim Suhanov <dfirblog@gmail.com>
|
||||
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
|
||||
|
||||
Upstream-Status: Backport [https://git.savannah.gnu.org/gitweb/?p=grub.git;a=commit;h=0ed2458cc4eff6d9a9199527e2a0b6d445802f94]
|
||||
CVE: CVE-2023-4693
|
||||
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
---
|
||||
grub-core/fs/ntfs.c | 13 ++++++++++++-
|
||||
1 file changed, 12 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/grub-core/fs/ntfs.c b/grub-core/fs/ntfs.c
|
||||
index 7e43fd6..8f63c83 100644
|
||||
--- a/grub-core/fs/ntfs.c
|
||||
+++ b/grub-core/fs/ntfs.c
|
||||
@@ -401,7 +401,18 @@ read_data (struct grub_ntfs_attr *at, grub_uint8_t *pa, grub_uint8_t *dest,
|
||||
{
|
||||
if (ofs + len > u32at (pa, 0x10))
|
||||
return grub_error (GRUB_ERR_BAD_FS, "read out of range");
|
||||
- grub_memcpy (dest, pa + u32at (pa, 0x14) + ofs, len);
|
||||
+
|
||||
+ if (u32at (pa, 0x10) > (at->mft->data->mft_size << GRUB_NTFS_BLK_SHR))
|
||||
+ return grub_error (GRUB_ERR_BAD_FS, "resident attribute too large");
|
||||
+
|
||||
+ if (pa >= at->mft->buf + (at->mft->data->mft_size << GRUB_NTFS_BLK_SHR))
|
||||
+ return grub_error (GRUB_ERR_BAD_FS, "resident attribute out of range");
|
||||
+
|
||||
+ if (u16at (pa, 0x14) + u32at (pa, 0x10) >
|
||||
+ (grub_addr_t) at->mft->buf + (at->mft->data->mft_size << GRUB_NTFS_BLK_SHR) - (grub_addr_t) pa)
|
||||
+ return grub_error (GRUB_ERR_BAD_FS, "resident attribute out of range");
|
||||
+
|
||||
+ grub_memcpy (dest, pa + u16at (pa, 0x14) + ofs, len);
|
||||
return 0;
|
||||
}
|
||||
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@@ -38,6 +38,8 @@ SRC_URI = "${GNU_MIRROR}/grub/grub-${PV}.tar.gz \
|
||||
file://loader-efi-chainloader-Simplify-the-loader-state.patch \
|
||||
file://commands-boot-Add-API-to-pass-context-to-loader.patch \
|
||||
file://CVE-2022-28736-loader-efi-chainloader-Use-grub_loader_set_ex.patch \
|
||||
file://CVE-2023-4692.patch \
|
||||
file://CVE-2023-4693.patch \
|
||||
"
|
||||
|
||||
SRC_URI[sha256sum] = "23b64b4c741569f9426ed2e3d0e6780796fca081bee4c99f62aa3f53ae803f5f"
|
||||
|
||||
@@ -26,6 +26,15 @@ SRC_URI = "https://github.com/lathiat/avahi/releases/download/v${PV}/avahi-${PV}
|
||||
file://0001-Fix-opening-etc-resolv.conf-error.patch \
|
||||
file://handle-hup.patch \
|
||||
file://local-ping.patch \
|
||||
file://CVE-2023-1981.patch \
|
||||
file://CVE-2023-38469-1.patch \
|
||||
file://CVE-2023-38469-2.patch \
|
||||
file://CVE-2023-38470-1.patch \
|
||||
file://CVE-2023-38470-2.patch \
|
||||
file://CVE-2023-38471-1.patch \
|
||||
file://CVE-2023-38471-2.patch \
|
||||
file://CVE-2023-38472.patch \
|
||||
file://CVE-2023-38473.patch \
|
||||
"
|
||||
|
||||
UPSTREAM_CHECK_URI = "https://github.com/lathiat/avahi/releases/"
|
||||
|
||||
58
meta/recipes-connectivity/avahi/files/CVE-2023-1981.patch
Normal file
58
meta/recipes-connectivity/avahi/files/CVE-2023-1981.patch
Normal file
@@ -0,0 +1,58 @@
|
||||
From a2696da2f2c50ac43b6c4903f72290d5c3fa9f6f Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= <pemensik@redhat.com>
|
||||
Date: Thu, 17 Nov 2022 01:51:53 +0100
|
||||
Subject: [PATCH] Emit error if requested service is not found
|
||||
|
||||
It currently just crashes instead of replying with error. Check return
|
||||
value and emit error instead of passing NULL pointer to reply.
|
||||
|
||||
Fixes #375
|
||||
|
||||
Upstream-Status: Backport [import from ubuntu https://git.launchpad.net/ubuntu/+source/avahi/tree/debian/patches/CVE-2023-1981.patch?h=ubuntu/jammy-security
|
||||
Upstream commit https://github.com/lathiat/avahi/commit/a2696da2f2c50ac43b6c4903f72290d5c3fa9f6f]
|
||||
CVE: CVE-2023-1981
|
||||
Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
|
||||
---
|
||||
avahi-daemon/dbus-protocol.c | 20 ++++++++++++++------
|
||||
1 file changed, 14 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/avahi-daemon/dbus-protocol.c b/avahi-daemon/dbus-protocol.c
|
||||
index 70d7687bc..406d0b441 100644
|
||||
--- a/avahi-daemon/dbus-protocol.c
|
||||
+++ b/avahi-daemon/dbus-protocol.c
|
||||
@@ -375,10 +375,14 @@ static DBusHandlerResult dbus_get_alternative_host_name(DBusConnection *c, DBusM
|
||||
}
|
||||
|
||||
t = avahi_alternative_host_name(n);
|
||||
- avahi_dbus_respond_string(c, m, t);
|
||||
- avahi_free(t);
|
||||
+ if (t) {
|
||||
+ avahi_dbus_respond_string(c, m, t);
|
||||
+ avahi_free(t);
|
||||
|
||||
- return DBUS_HANDLER_RESULT_HANDLED;
|
||||
+ return DBUS_HANDLER_RESULT_HANDLED;
|
||||
+ } else {
|
||||
+ return avahi_dbus_respond_error(c, m, AVAHI_ERR_NOT_FOUND, "Hostname not found");
|
||||
+ }
|
||||
}
|
||||
|
||||
static DBusHandlerResult dbus_get_alternative_service_name(DBusConnection *c, DBusMessage *m, DBusError *error) {
|
||||
@@ -389,10 +393,14 @@ static DBusHandlerResult dbus_get_alternative_service_name(DBusConnection *c, DB
|
||||
}
|
||||
|
||||
t = avahi_alternative_service_name(n);
|
||||
- avahi_dbus_respond_string(c, m, t);
|
||||
- avahi_free(t);
|
||||
+ if (t) {
|
||||
+ avahi_dbus_respond_string(c, m, t);
|
||||
+ avahi_free(t);
|
||||
|
||||
- return DBUS_HANDLER_RESULT_HANDLED;
|
||||
+ return DBUS_HANDLER_RESULT_HANDLED;
|
||||
+ } else {
|
||||
+ return avahi_dbus_respond_error(c, m, AVAHI_ERR_NOT_FOUND, "Service not found");
|
||||
+ }
|
||||
}
|
||||
|
||||
static DBusHandlerResult dbus_create_new_entry_group(DBusConnection *c, DBusMessage *m, DBusError *error) {
|
||||
47
meta/recipes-connectivity/avahi/files/CVE-2023-38469-1.patch
Normal file
47
meta/recipes-connectivity/avahi/files/CVE-2023-38469-1.patch
Normal file
@@ -0,0 +1,47 @@
|
||||
From a337a1ba7d15853fb56deef1f464529af6e3a1cf Mon Sep 17 00:00:00 2001
|
||||
From: Evgeny Vereshchagin <evvers@ya.ru>
|
||||
Date: Mon, 23 Oct 2023 20:29:31 +0000
|
||||
Subject: [PATCH]core: reject overly long TXT resource records
|
||||
Closes https://github.com/lathiat/avahi/issues/455
|
||||
|
||||
Upstream-Status: Backport [https://github.com/lathiat/avahi/pull/500/commits/a337a1ba7d15853fb56deef1f464529af6e3a1cf]
|
||||
CVE: CVE-2023-38469
|
||||
|
||||
Signed-off-by: Meenali Gupta <meenali.gupta@windriver.com>
|
||||
---
|
||||
avahi-core/rr.c | 9 ++++++++-
|
||||
1 file changed, 8 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/avahi-core/rr.c b/avahi-core/rr.c
|
||||
index 7fa0bee..b03a24c 100644
|
||||
--- a/avahi-core/rr.c
|
||||
+++ b/avahi-core/rr.c
|
||||
@@ -32,6 +32,7 @@
|
||||
#include <avahi-common/malloc.h>
|
||||
#include <avahi-common/defs.h>
|
||||
|
||||
+#include "dns.h"
|
||||
#include "rr.h"
|
||||
#include "log.h"
|
||||
#include "util.h"
|
||||
@@ -688,11 +689,17 @@ int avahi_record_is_valid(AvahiRecord *r) {
|
||||
case AVAHI_DNS_TYPE_TXT: {
|
||||
|
||||
AvahiStringList *strlst;
|
||||
+ size_t used = 0;
|
||||
|
||||
- for (strlst = r->data.txt.string_list; strlst; strlst = strlst->next)
|
||||
+ for (strlst = r->data.txt.string_list; strlst; strlst = strlst->next) {
|
||||
if (strlst->size > 255 || strlst->size <= 0)
|
||||
return 0;
|
||||
|
||||
+ used += 1+strlst->size;
|
||||
+ if (used > AVAHI_DNS_RDATA_MAX)
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
--
|
||||
2.40.0
|
||||
65
meta/recipes-connectivity/avahi/files/CVE-2023-38469-2.patch
Normal file
65
meta/recipes-connectivity/avahi/files/CVE-2023-38469-2.patch
Normal file
@@ -0,0 +1,65 @@
|
||||
From c6cab87df290448a63323c8ca759baa516166237 Mon Sep 17 00:00:00 2001
|
||||
From: Evgeny Vereshchagin <evvers@ya.ru>
|
||||
Date: Wed, 25 Oct 2023 18:15:42 +0000
|
||||
Subject: [PATCH] tests: pass overly long TXT resource records
|
||||
|
||||
to make sure they don't crash avahi any more.
|
||||
It reproduces https://github.com/lathiat/avahi/issues/455
|
||||
|
||||
Canonical notes:
|
||||
nickgalanis> removed first hunk since there is no .github dir in this release
|
||||
|
||||
Upstream-Status: Backport [import from ubuntu https://git.launchpad.net/ubuntu/+source/avahi/tree/debian/patches/CVE-2023-38469-2.patch?h=ubuntu/jammy-security
|
||||
Upstream commit https://github.com/lathiat/avahi/commit/c6cab87df290448a63323c8ca759baa516166237]
|
||||
CVE: CVE-2023-38469
|
||||
Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
|
||||
---
|
||||
avahi-client/client-test.c | 14 ++++++++++++++
|
||||
1 files changed, 14 insertions(+)
|
||||
|
||||
Index: avahi-0.8/avahi-client/client-test.c
|
||||
===================================================================
|
||||
--- avahi-0.8.orig/avahi-client/client-test.c
|
||||
+++ avahi-0.8/avahi-client/client-test.c
|
||||
@@ -22,6 +22,7 @@
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
+#include <string.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include <avahi-client/client.h>
|
||||
@@ -33,6 +34,8 @@
|
||||
#include <avahi-common/malloc.h>
|
||||
#include <avahi-common/timeval.h>
|
||||
|
||||
+#include <avahi-core/dns.h>
|
||||
+
|
||||
static const AvahiPoll *poll_api = NULL;
|
||||
static AvahiSimplePoll *simple_poll = NULL;
|
||||
|
||||
@@ -222,6 +225,9 @@ int main (AVAHI_GCC_UNUSED int argc, AVA
|
||||
uint32_t cookie;
|
||||
struct timeval tv;
|
||||
AvahiAddress a;
|
||||
+ uint8_t rdata[AVAHI_DNS_RDATA_MAX+1];
|
||||
+ AvahiStringList *txt = NULL;
|
||||
+ int r;
|
||||
|
||||
simple_poll = avahi_simple_poll_new();
|
||||
poll_api = avahi_simple_poll_get(simple_poll);
|
||||
@@ -258,6 +264,14 @@ int main (AVAHI_GCC_UNUSED int argc, AVA
|
||||
printf("%s\n", avahi_strerror(avahi_entry_group_add_service (group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, 0, "Lathiat's Site", "_http._tcp", NULL, NULL, 80, "foo=bar", NULL)));
|
||||
printf("add_record: %d\n", avahi_entry_group_add_record (group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, 0, "TestX", 0x01, 0x10, 120, "\5booya", 6));
|
||||
|
||||
+ memset(rdata, 1, sizeof(rdata));
|
||||
+ r = avahi_string_list_parse(rdata, sizeof(rdata), &txt);
|
||||
+ assert(r >= 0);
|
||||
+ assert(avahi_string_list_serialize(txt, NULL, 0) == sizeof(rdata));
|
||||
+ error = avahi_entry_group_add_service_strlst(group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, 0, "TestX", "_qotd._tcp", NULL, NULL, 123, txt);
|
||||
+ assert(error == AVAHI_ERR_INVALID_RECORD);
|
||||
+ avahi_string_list_free(txt);
|
||||
+
|
||||
avahi_entry_group_commit (group);
|
||||
|
||||
domain = avahi_domain_browser_new (avahi, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, NULL, AVAHI_DOMAIN_BROWSER_BROWSE, 0, avahi_domain_browser_callback, (char*) "omghai3u");
|
||||
59
meta/recipes-connectivity/avahi/files/CVE-2023-38470-1.patch
Normal file
59
meta/recipes-connectivity/avahi/files/CVE-2023-38470-1.patch
Normal file
@@ -0,0 +1,59 @@
|
||||
From 26806dbde54c5b40a2bf108d334ba59ec9d242d6 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= <pemensik@redhat.com>
|
||||
Date: Tue, 11 Apr 2023 15:29:59 +0200
|
||||
Subject: [PATCH]Ensure each label is at least one byte long
|
||||
|
||||
The only allowed exception is single dot, where it should return empty
|
||||
string.
|
||||
|
||||
Fixes #454.
|
||||
|
||||
Upstream-Status: Backport [https://github.com/lathiat/avahi/commit/94cb6489114636940ac683515417990b55b5d66c]
|
||||
CVE: CVE-2023-38470
|
||||
|
||||
Signed-off-by: Meenali Gupta <meenali.gupta@windriver.com>
|
||||
---
|
||||
avahi-common/domain-test.c | 14 ++++++++++++++
|
||||
avahi-common/domain.c | 2 +-
|
||||
2 files changed, 15 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/avahi-common/domain-test.c b/avahi-common/domain-test.c
|
||||
index cf763ec..3acc1c1 100644
|
||||
--- a/avahi-common/domain-test.c
|
||||
+++ b/avahi-common/domain-test.c
|
||||
@@ -45,6 +45,20 @@ int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) {
|
||||
printf("%s\n", s = avahi_normalize_name_strdup("fo\\\\o\\..f oo."));
|
||||
avahi_free(s);
|
||||
|
||||
+ printf("%s\n", s = avahi_normalize_name_strdup("."));
|
||||
+ avahi_free(s);
|
||||
+
|
||||
+ s = avahi_normalize_name_strdup(",.=.}.=.?-.}.=.?.?.}.}.?.?.?.z.?.?.}.}."
|
||||
+ "}.?.?.?.r.=.=.}.=.?.}}.}.?.?.?.zM.=.=.?.?.}.}.?.?.}.}.}"
|
||||
+ ".?.?.?.r.=.=.}.=.?.}}.}.?.?.?.zM.=.=.?.?.}.}.?.?.?.zM.?`"
|
||||
+ "?.}.}.}.?.?.?.r.=.?.}.=.?.?.}.?.?.?.}.=.?.?.}??.}.}.?.?."
|
||||
+ "?.z.?.?.}.}.}.?.?.?.r.=.=.}.=.?.}}.}.?.?.?.zM.?`?.}.}.}."
|
||||
+ "??.?.zM.?`?.}.}.}.?.?.?.r.=.?.}.=.?.?.}.?.?.?.}.=.?.?.}?"
|
||||
+ "?.}.}.?.?.?.z.?.?.}.}.}.?.?.?.r.=.=.}.=.?.}}.}.?.?.?.zM."
|
||||
+ "?`?.}.}.}.?.?.?.r.=.=.?.?`.?.?}.}.}.?.?.?.r.=.?.}.=.?.?."
|
||||
+ "}.?.?.?.}.=.?.?.}");
|
||||
+ assert(s == NULL);
|
||||
+
|
||||
printf("%i\n", avahi_domain_equal("\\065aa bbb\\.\\046cc.cc\\\\.dee.fff.", "Aaa BBB\\.\\.cc.cc\\\\.dee.fff"));
|
||||
printf("%i\n", avahi_domain_equal("A", "a"));
|
||||
|
||||
diff --git a/avahi-common/domain.c b/avahi-common/domain.c
|
||||
index 3b1ab68..e66d241 100644
|
||||
--- a/avahi-common/domain.c
|
||||
+++ b/avahi-common/domain.c
|
||||
@@ -201,7 +201,7 @@ char *avahi_normalize_name(const char *s, char *ret_s, size_t size) {
|
||||
}
|
||||
|
||||
if (!empty) {
|
||||
- if (size < 1)
|
||||
+ if (size < 2)
|
||||
return NULL;
|
||||
|
||||
*(r++) = '.';
|
||||
--
|
||||
2.40.0
|
||||
52
meta/recipes-connectivity/avahi/files/CVE-2023-38470-2.patch
Normal file
52
meta/recipes-connectivity/avahi/files/CVE-2023-38470-2.patch
Normal file
@@ -0,0 +1,52 @@
|
||||
From 20dec84b2480821704258bc908e7b2bd2e883b24 Mon Sep 17 00:00:00 2001
|
||||
From: Evgeny Vereshchagin <evvers@ya.ru>
|
||||
Date: Tue, 19 Sep 2023 03:21:25 +0000
|
||||
Subject: [PATCH] [common] bail out when escaped labels can't fit into ret
|
||||
|
||||
Fixes:
|
||||
```
|
||||
==93410==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7f9e76f14c16 at pc 0x00000047208d bp 0x7ffee90a6a00 sp 0x7ffee90a61c8
|
||||
READ of size 1110 at 0x7f9e76f14c16 thread T0
|
||||
#0 0x47208c in __interceptor_strlen (out/fuzz-domain+0x47208c) (BuildId: 731b20c1eef22c2104e75a6496a399b10cfc7cba)
|
||||
#1 0x534eb0 in avahi_strdup avahi/avahi-common/malloc.c:167:12
|
||||
#2 0x53862c in avahi_normalize_name_strdup avahi/avahi-common/domain.c:226:12
|
||||
```
|
||||
and
|
||||
```
|
||||
fuzz-domain: fuzz/fuzz-domain.c:38: int LLVMFuzzerTestOneInput(const uint8_t *, size_t): Assertion `avahi_domain_equal(s, t)' failed.
|
||||
==101571== ERROR: libFuzzer: deadly signal
|
||||
#0 0x501175 in __sanitizer_print_stack_trace (/home/vagrant/avahi/out/fuzz-domain+0x501175) (BuildId: 682bf6400aff9d41b64b6e2cc3ef5ad600216ea8)
|
||||
#1 0x45ad2c in fuzzer::PrintStackTrace() (/home/vagrant/avahi/out/fuzz-domain+0x45ad2c) (BuildId: 682bf6400aff9d41b64b6e2cc3ef5ad600216ea8)
|
||||
#2 0x43fc07 in fuzzer::Fuzzer::CrashCallback() (/home/vagrant/avahi/out/fuzz-domain+0x43fc07) (BuildId: 682bf6400aff9d41b64b6e2cc3ef5ad600216ea8)
|
||||
#3 0x7f1581d7ebaf (/lib64/libc.so.6+0x3dbaf) (BuildId: c9f62793b9e886eb1b95077d4f26fe2b4aa1ac25)
|
||||
#4 0x7f1581dcf883 in __pthread_kill_implementation (/lib64/libc.so.6+0x8e883) (BuildId: c9f62793b9e886eb1b95077d4f26fe2b4aa1ac25)
|
||||
#5 0x7f1581d7eafd in gsignal (/lib64/libc.so.6+0x3dafd) (BuildId: c9f62793b9e886eb1b95077d4f26fe2b4aa1ac25)
|
||||
#6 0x7f1581d6787e in abort (/lib64/libc.so.6+0x2687e) (BuildId: c9f62793b9e886eb1b95077d4f26fe2b4aa1ac25)
|
||||
#7 0x7f1581d6779a in __assert_fail_base.cold (/lib64/libc.so.6+0x2679a) (BuildId: c9f62793b9e886eb1b95077d4f26fe2b4aa1ac25)
|
||||
#8 0x7f1581d77186 in __assert_fail (/lib64/libc.so.6+0x36186) (BuildId: c9f62793b9e886eb1b95077d4f26fe2b4aa1ac25)
|
||||
#9 0x5344a4 in LLVMFuzzerTestOneInput /home/vagrant/avahi/fuzz/fuzz-domain.c:38:9
|
||||
```
|
||||
|
||||
It's a follow-up to 94cb6489114636940ac683515417990b55b5d66c
|
||||
|
||||
Upstream-Status: Backport [import from ubuntu https://git.launchpad.net/ubuntu/+source/avahi/tree/debian/patches/CVE-2023-38470-2.patch?h=ubuntu/jammy-security
|
||||
CVE: CVE-2023-38470 #Follow-up patch
|
||||
Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
|
||||
---
|
||||
avahi-common/domain.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
Index: avahi-0.8/avahi-common/domain.c
|
||||
===================================================================
|
||||
--- avahi-0.8.orig/avahi-common/domain.c
|
||||
+++ avahi-0.8/avahi-common/domain.c
|
||||
@@ -210,7 +210,8 @@ char *avahi_normalize_name(const char *s
|
||||
} else
|
||||
empty = 0;
|
||||
|
||||
- avahi_escape_label(label, strlen(label), &r, &size);
|
||||
+ if (!(avahi_escape_label(label, strlen(label), &r, &size)))
|
||||
+ return NULL;
|
||||
}
|
||||
|
||||
return ret_s;
|
||||
73
meta/recipes-connectivity/avahi/files/CVE-2023-38471-1.patch
Normal file
73
meta/recipes-connectivity/avahi/files/CVE-2023-38471-1.patch
Normal file
@@ -0,0 +1,73 @@
|
||||
From 9cd4ea89b3ac89b7bb0196fda1aa88cd51b106b6 Mon Sep 17 00:00:00 2001
|
||||
From: Michal Sekletar <msekleta@redhat.com>
|
||||
Date: Mon, 23 Oct 2023 13:38:35 +0200
|
||||
Subject: [PATCH] core: extract host name using avahi_unescape_label()
|
||||
|
||||
Previously we could create invalid escape sequence when we split the
|
||||
string on dot. For example, from valid host name "foo\\.bar" we have
|
||||
created invalid name "foo\\" and tried to set that as the host name
|
||||
which crashed the daemon.
|
||||
|
||||
Fixes #453
|
||||
|
||||
Upstream-Status: Backport [https://github.com/lathiat/avahi/commit/894f085f402e023a98cbb6f5a3d117bd88d93b09]
|
||||
CVE: CVE-2023-38471
|
||||
|
||||
Signed-off-by: Meenali Gupta <meenali.gupta@windriver.com>
|
||||
---
|
||||
avahi-core/server.c | 27 +++++++++++++++++++++------
|
||||
1 file changed, 21 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/avahi-core/server.c b/avahi-core/server.c
|
||||
index e507750..40f1d68 100644
|
||||
--- a/avahi-core/server.c
|
||||
+++ b/avahi-core/server.c
|
||||
@@ -1295,7 +1295,11 @@ static void update_fqdn(AvahiServer *s) {
|
||||
}
|
||||
|
||||
int avahi_server_set_host_name(AvahiServer *s, const char *host_name) {
|
||||
- char *hn = NULL;
|
||||
+ char label_escaped[AVAHI_LABEL_MAX*4+1];
|
||||
+ char label[AVAHI_LABEL_MAX];
|
||||
+ char *hn = NULL, *h;
|
||||
+ size_t len;
|
||||
+
|
||||
assert(s);
|
||||
|
||||
AVAHI_CHECK_VALIDITY(s, !host_name || avahi_is_valid_host_name(host_name), AVAHI_ERR_INVALID_HOST_NAME);
|
||||
@@ -1305,17 +1309,28 @@ int avahi_server_set_host_name(AvahiServer *s, const char *host_name) {
|
||||
else
|
||||
hn = avahi_normalize_name_strdup(host_name);
|
||||
|
||||
- hn[strcspn(hn, ".")] = 0;
|
||||
+ h = hn;
|
||||
+ if (!avahi_unescape_label((const char **)&hn, label, sizeof(label))) {
|
||||
+ avahi_free(h);
|
||||
+ return AVAHI_ERR_INVALID_HOST_NAME;
|
||||
+ }
|
||||
+
|
||||
+ avahi_free(h);
|
||||
+
|
||||
+ h = label_escaped;
|
||||
+ len = sizeof(label_escaped);
|
||||
+ if (!avahi_escape_label(label, strlen(label), &h, &len))
|
||||
+ return AVAHI_ERR_INVALID_HOST_NAME;
|
||||
|
||||
- if (avahi_domain_equal(s->host_name, hn) && s->state != AVAHI_SERVER_COLLISION) {
|
||||
- avahi_free(hn);
|
||||
+ if (avahi_domain_equal(s->host_name, label_escaped) && s->state != AVAHI_SERVER_COLLISION)
|
||||
return avahi_server_set_errno(s, AVAHI_ERR_NO_CHANGE);
|
||||
- }
|
||||
|
||||
withdraw_host_rrs(s);
|
||||
|
||||
avahi_free(s->host_name);
|
||||
- s->host_name = hn;
|
||||
+ s->host_name = avahi_strdup(label_escaped);
|
||||
+ if (!s->host_name)
|
||||
+ return AVAHI_ERR_NO_MEMORY;
|
||||
|
||||
update_fqdn(s);
|
||||
|
||||
--
|
||||
2.40.0
|
||||
52
meta/recipes-connectivity/avahi/files/CVE-2023-38471-2.patch
Normal file
52
meta/recipes-connectivity/avahi/files/CVE-2023-38471-2.patch
Normal file
@@ -0,0 +1,52 @@
|
||||
From b675f70739f404342f7f78635d6e2dcd85a13460 Mon Sep 17 00:00:00 2001
|
||||
From: Evgeny Vereshchagin <evvers@ya.ru>
|
||||
Date: Tue, 24 Oct 2023 22:04:51 +0000
|
||||
Subject: [PATCH] core: return errors from avahi_server_set_host_name properly
|
||||
|
||||
It's a follow-up to 894f085f402e023a98cbb6f5a3d117bd88d93b09
|
||||
|
||||
Upstream-Status: Backport [import from ubuntu https://git.launchpad.net/ubuntu/+source/avahi/tree/debian/patches/CVE-2023-38471-2.patch?h=ubuntu/jammy-security
|
||||
Upstream commit https://github.com/lathiat/avahi/commit/b675f70739f404342f7f78635d6e2dcd85a13460]
|
||||
CVE: CVE-2023-38471 #Follow-up Patch
|
||||
Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
|
||||
---
|
||||
avahi-core/server.c | 9 ++++++---
|
||||
1 file changed, 6 insertions(+), 3 deletions(-)
|
||||
|
||||
Index: avahi-0.8/avahi-core/server.c
|
||||
===================================================================
|
||||
--- avahi-0.8.orig/avahi-core/server.c
|
||||
+++ avahi-0.8/avahi-core/server.c
|
||||
@@ -1309,10 +1309,13 @@ int avahi_server_set_host_name(AvahiServ
|
||||
else
|
||||
hn = avahi_normalize_name_strdup(host_name);
|
||||
|
||||
+ if (!hn)
|
||||
+ return avahi_server_set_errno(s, AVAHI_ERR_NO_MEMORY);
|
||||
+
|
||||
h = hn;
|
||||
if (!avahi_unescape_label((const char **)&hn, label, sizeof(label))) {
|
||||
avahi_free(h);
|
||||
- return AVAHI_ERR_INVALID_HOST_NAME;
|
||||
+ return avahi_server_set_errno(s, AVAHI_ERR_INVALID_HOST_NAME);
|
||||
}
|
||||
|
||||
avahi_free(h);
|
||||
@@ -1320,7 +1323,7 @@ int avahi_server_set_host_name(AvahiServ
|
||||
h = label_escaped;
|
||||
len = sizeof(label_escaped);
|
||||
if (!avahi_escape_label(label, strlen(label), &h, &len))
|
||||
- return AVAHI_ERR_INVALID_HOST_NAME;
|
||||
+ return avahi_server_set_errno(s, AVAHI_ERR_INVALID_HOST_NAME);
|
||||
|
||||
if (avahi_domain_equal(s->host_name, label_escaped) && s->state != AVAHI_SERVER_COLLISION)
|
||||
return avahi_server_set_errno(s, AVAHI_ERR_NO_CHANGE);
|
||||
@@ -1330,7 +1333,7 @@ int avahi_server_set_host_name(AvahiServ
|
||||
avahi_free(s->host_name);
|
||||
s->host_name = avahi_strdup(label_escaped);
|
||||
if (!s->host_name)
|
||||
- return AVAHI_ERR_NO_MEMORY;
|
||||
+ return avahi_server_set_errno(s, AVAHI_ERR_NO_MEMORY);
|
||||
|
||||
update_fqdn(s);
|
||||
|
||||
46
meta/recipes-connectivity/avahi/files/CVE-2023-38472.patch
Normal file
46
meta/recipes-connectivity/avahi/files/CVE-2023-38472.patch
Normal file
@@ -0,0 +1,46 @@
|
||||
From b024ae5749f4aeba03478e6391687c3c9c8dee40 Mon Sep 17 00:00:00 2001
|
||||
From: Michal Sekletar <msekleta@redhat.com>
|
||||
Date: Thu, 19 Oct 2023 17:36:44 +0200
|
||||
Subject: [PATCH] core: make sure there is rdata to process before parsing it
|
||||
|
||||
Fixes #452
|
||||
|
||||
CVE-2023-38472
|
||||
|
||||
Upstream-Status: Backport [import from ubuntu https://git.launchpad.net/ubuntu/+source/avahi/tree/debian/patches/CVE-2023-38472.patch?h=ubuntu/jammy-security
|
||||
Upstream commit https://github.com/lathiat/avahi/commit/b024ae5749f4aeba03478e6391687c3c9c8dee40]
|
||||
CVE: CVE-2023-38472
|
||||
Signed-off-by: Meenali Gupta <meenali.gupta@windriver.com>
|
||||
Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
|
||||
---
|
||||
avahi-client/client-test.c | 3 +++
|
||||
avahi-daemon/dbus-entry-group.c | 2 +-
|
||||
2 files changed, 4 insertions(+), 1 deletion(-)
|
||||
|
||||
Index: avahi-0.8/avahi-client/client-test.c
|
||||
===================================================================
|
||||
--- avahi-0.8.orig/avahi-client/client-test.c
|
||||
+++ avahi-0.8/avahi-client/client-test.c
|
||||
@@ -272,6 +272,9 @@ int main (AVAHI_GCC_UNUSED int argc, AVA
|
||||
assert(error == AVAHI_ERR_INVALID_RECORD);
|
||||
avahi_string_list_free(txt);
|
||||
|
||||
+ error = avahi_entry_group_add_record (group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, 0, "TestX", 0x01, 0x10, 120, "", 0);
|
||||
+ assert(error != AVAHI_OK);
|
||||
+
|
||||
avahi_entry_group_commit (group);
|
||||
|
||||
domain = avahi_domain_browser_new (avahi, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, NULL, AVAHI_DOMAIN_BROWSER_BROWSE, 0, avahi_domain_browser_callback, (char*) "omghai3u");
|
||||
Index: avahi-0.8/avahi-daemon/dbus-entry-group.c
|
||||
===================================================================
|
||||
--- avahi-0.8.orig/avahi-daemon/dbus-entry-group.c
|
||||
+++ avahi-0.8/avahi-daemon/dbus-entry-group.c
|
||||
@@ -340,7 +340,7 @@ DBusHandlerResult avahi_dbus_msg_entry_g
|
||||
if (!(r = avahi_record_new_full (name, clazz, type, ttl)))
|
||||
return avahi_dbus_respond_error(c, m, AVAHI_ERR_NO_MEMORY, NULL);
|
||||
|
||||
- if (avahi_rdata_parse (r, rdata, size) < 0) {
|
||||
+ if (!rdata || avahi_rdata_parse (r, rdata, size) < 0) {
|
||||
avahi_record_unref (r);
|
||||
return avahi_dbus_respond_error(c, m, AVAHI_ERR_INVALID_RDATA, NULL);
|
||||
}
|
||||
108
meta/recipes-connectivity/avahi/files/CVE-2023-38473.patch
Normal file
108
meta/recipes-connectivity/avahi/files/CVE-2023-38473.patch
Normal file
@@ -0,0 +1,108 @@
|
||||
From b448c9f771bada14ae8de175695a9729f8646797 Mon Sep 17 00:00:00 2001
|
||||
From: Michal Sekletar <msekleta@redhat.com>
|
||||
Date: Wed, 11 Oct 2023 17:45:44 +0200
|
||||
Subject: [PATCH]common: derive alternative host name from its
|
||||
unescaped version
|
||||
|
||||
Normalization of input makes sure we don't have to deal with special
|
||||
cases like unescaped dot at the end of label.
|
||||
|
||||
Upstream-Status: Backport [https://github.com/lathiat/avahi/commit/b448c9f771bada14ae8de175695a9729f8646797]
|
||||
CVE: CVE-2023-38473
|
||||
|
||||
Signed-off-by: Meenali Gupta <meenali.gupta@windriver.com>
|
||||
---
|
||||
avahi-common/alternative-test.c | 3 +++
|
||||
avahi-common/alternative.c | 27 +++++++++++++++++++--------
|
||||
2 files changed, 22 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/avahi-common/alternative-test.c b/avahi-common/alternative-test.c
|
||||
index 9255435..681fc15 100644
|
||||
--- a/avahi-common/alternative-test.c
|
||||
+++ b/avahi-common/alternative-test.c
|
||||
@@ -31,6 +31,9 @@ int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) {
|
||||
const char* const test_strings[] = {
|
||||
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
|
||||
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXüüüüüüü",
|
||||
+ ").",
|
||||
+ "\\.",
|
||||
+ "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\\\\",
|
||||
"gurke",
|
||||
"-",
|
||||
" #",
|
||||
diff --git a/avahi-common/alternative.c b/avahi-common/alternative.c
|
||||
index b3d39f0..a094e6d 100644
|
||||
--- a/avahi-common/alternative.c
|
||||
+++ b/avahi-common/alternative.c
|
||||
@@ -49,15 +49,20 @@ static void drop_incomplete_utf8(char *c) {
|
||||
}
|
||||
|
||||
char *avahi_alternative_host_name(const char *s) {
|
||||
+ char label[AVAHI_LABEL_MAX], alternative[AVAHI_LABEL_MAX*4+1];
|
||||
+ char *alt, *r, *ret;
|
||||
const char *e;
|
||||
- char *r;
|
||||
+ size_t len;
|
||||
|
||||
assert(s);
|
||||
|
||||
if (!avahi_is_valid_host_name(s))
|
||||
return NULL;
|
||||
|
||||
- if ((e = strrchr(s, '-'))) {
|
||||
+ if (!avahi_unescape_label(&s, label, sizeof(label)))
|
||||
+ return NULL;
|
||||
+
|
||||
+ if ((e = strrchr(label, '-'))) {
|
||||
const char *p;
|
||||
|
||||
e++;
|
||||
@@ -74,19 +79,18 @@ char *avahi_alternative_host_name(const char *s) {
|
||||
|
||||
if (e) {
|
||||
char *c, *m;
|
||||
- size_t l;
|
||||
int n;
|
||||
|
||||
n = atoi(e)+1;
|
||||
if (!(m = avahi_strdup_printf("%i", n)))
|
||||
return NULL;
|
||||
|
||||
- l = e-s-1;
|
||||
+ len = e-label-1;
|
||||
|
||||
- if (l >= AVAHI_LABEL_MAX-1-strlen(m)-1)
|
||||
- l = AVAHI_LABEL_MAX-1-strlen(m)-1;
|
||||
+ if (len >= AVAHI_LABEL_MAX-1-strlen(m)-1)
|
||||
+ len = AVAHI_LABEL_MAX-1-strlen(m)-1;
|
||||
|
||||
- if (!(c = avahi_strndup(s, l))) {
|
||||
+ if (!(c = avahi_strndup(label, len))) {
|
||||
avahi_free(m);
|
||||
return NULL;
|
||||
}
|
||||
@@ -100,7 +104,7 @@ char *avahi_alternative_host_name(const char *s) {
|
||||
} else {
|
||||
char *c;
|
||||
|
||||
- if (!(c = avahi_strndup(s, AVAHI_LABEL_MAX-1-2)))
|
||||
+ if (!(c = avahi_strndup(label, AVAHI_LABEL_MAX-1-2)))
|
||||
return NULL;
|
||||
|
||||
drop_incomplete_utf8(c);
|
||||
@@ -109,6 +113,13 @@ char *avahi_alternative_host_name(const char *s) {
|
||||
avahi_free(c);
|
||||
}
|
||||
|
||||
+ alt = alternative;
|
||||
+ len = sizeof(alternative);
|
||||
+ ret = avahi_escape_label(r, strlen(r), &alt, &len);
|
||||
+
|
||||
+ avahi_free(r);
|
||||
+ r = avahi_strdup(ret);
|
||||
+
|
||||
assert(avahi_is_valid_host_name(r));
|
||||
|
||||
return r;
|
||||
--
|
||||
2.40.0
|
||||
@@ -20,7 +20,7 @@ SRC_URI = "https://ftp.isc.org/isc/bind9/${PV}/${BPN}-${PV}.tar.xz \
|
||||
file://0001-avoid-start-failure-with-bind-user.patch \
|
||||
"
|
||||
|
||||
SRC_URI[sha256sum] = "bde1c5017b81d1d79c69eb8f537f2e5032fd3623acdd5ee830d4f74bc2483458"
|
||||
SRC_URI[sha256sum] = "115e09c05439bebade1d272eda08fa88eb3b60129edef690588c87a4d27612cc"
|
||||
|
||||
UPSTREAM_CHECK_URI = "https://ftp.isc.org/isc/bind9/"
|
||||
# follow the ESV versions divisible by 2
|
||||
@@ -54,6 +54,7 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/bluetooth/bluez-${PV}.tar.xz \
|
||||
${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '', 'file://0001-Allow-using-obexd-without-systemd-in-the-user-sessio.patch', d)} \
|
||||
file://0001-tests-add-a-target-for-building-tests-without-runnin.patch \
|
||||
file://0001-test-gatt-Fix-hung-issue.patch \
|
||||
file://CVE-2023-45866.patch \
|
||||
"
|
||||
S = "${WORKDIR}/bluez-${PV}"
|
||||
|
||||
|
||||
56
meta/recipes-connectivity/bluez5/bluez5/CVE-2023-45866.patch
Normal file
56
meta/recipes-connectivity/bluez5/bluez5/CVE-2023-45866.patch
Normal file
@@ -0,0 +1,56 @@
|
||||
From 25a471a83e02e1effb15d5a488b3f0085eaeb675 Mon Sep 17 00:00:00 2001
|
||||
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
|
||||
Date: Tue, 10 Oct 2023 13:03:12 -0700
|
||||
Subject: [PATCH] input.conf: Change default of ClassicBondedOnly
|
||||
|
||||
This changes the default of ClassicBondedOnly since defaulting to false
|
||||
is not inline with HID specification which mandates the of Security Mode
|
||||
4:
|
||||
|
||||
BLUETOOTH SPECIFICATION Page 84 of 123
|
||||
Human Interface Device (HID) Profile:
|
||||
|
||||
5.4.3.4.2 Security Modes
|
||||
Bluetooth HID Hosts shall use Security Mode 4 when interoperating with
|
||||
Bluetooth HID devices that are compliant to the Bluetooth Core
|
||||
Specification v2.1+EDR[6].
|
||||
|
||||
Upstream-Status: Backport
|
||||
[https://git.kernel.org/pub/scm/bluetooth/bluez.git/commit/profiles/input?id=25a471a83e02e1effb15d5a488b3f0085eaeb675]
|
||||
|
||||
CVE: CVE-2023-45866
|
||||
|
||||
Signed-off-by: Archana Polampalli <archana.polampalli@windriver.com>
|
||||
---
|
||||
profiles/input/device.c | 2 +-
|
||||
profiles/input/input.conf | 2 +-
|
||||
2 files changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/profiles/input/device.c b/profiles/input/device.c
|
||||
index 4a50ea9..4310dd1 100644
|
||||
--- a/profiles/input/device.c
|
||||
+++ b/profiles/input/device.c
|
||||
@@ -81,7 +81,7 @@ struct input_device {
|
||||
|
||||
static int idle_timeout = 0;
|
||||
static bool uhid_enabled = false;
|
||||
-static bool classic_bonded_only = false;
|
||||
+static bool classic_bonded_only = true;
|
||||
|
||||
void input_set_idle_timeout(int timeout)
|
||||
{
|
||||
diff --git a/profiles/input/input.conf b/profiles/input/input.conf
|
||||
index 4c70bc5..d8645f3 100644
|
||||
--- a/profiles/input/input.conf
|
||||
+++ b/profiles/input/input.conf
|
||||
@@ -17,7 +17,7 @@
|
||||
# platforms may want to make sure that input connections only come from bonded
|
||||
# device connections. Several older mice have been known for not supporting
|
||||
# pairing/encryption.
|
||||
-# Defaults to false to maximize device compatibility.
|
||||
+# Defaults to true for security.
|
||||
#ClassicBondedOnly=true
|
||||
|
||||
# LE upgrade security
|
||||
--
|
||||
2.40.0
|
||||
@@ -5,7 +5,7 @@ export SKIP_UNIT=1
|
||||
|
||||
cd regress
|
||||
sed -i "/\t\tagent-ptrace /d" Makefile
|
||||
make -k BUILDDIR=`pwd`/.. .OBJDIR=`pwd` .CURDIR=`pwd` SUDO="sudo" tests \
|
||||
make -k BUILDDIR=`pwd`/.. .OBJDIR=`pwd` .CURDIR=`pwd` SUDO="" tests \
|
||||
| sed -u -e 's/^skipped/SKIP: /g' -e 's/^ok /PASS: /g' -e 's/^failed/FAIL: /g'
|
||||
|
||||
SSHAGENT=`which ssh-agent`
|
||||
|
||||
@@ -170,7 +170,7 @@ RDEPENDS:${PN}-sshd += "${PN}-keygen ${@bb.utils.contains('DISTRO_FEATURES', 'pa
|
||||
# conflict with each other
|
||||
RDEPENDS:${PN}-dev = ""
|
||||
# gdb would make attach-ptrace test pass rather than skip but not worth the build dependencies
|
||||
RDEPENDS:${PN}-ptest += "${PN}-sftp ${PN}-misc ${PN}-sftp-server make sed sudo coreutils"
|
||||
RDEPENDS:${PN}-ptest += "${PN}-sftp ${PN}-misc ${PN}-sftp-server make sed coreutils"
|
||||
|
||||
RPROVIDES:${PN}-ssh = "ssh"
|
||||
RPROVIDES:${PN}-sshd = "sshd"
|
||||
|
||||
180
meta/recipes-connectivity/openssl/openssl/CVE-2023-5678.patch
Normal file
180
meta/recipes-connectivity/openssl/openssl/CVE-2023-5678.patch
Normal file
@@ -0,0 +1,180 @@
|
||||
From db925ae2e65d0d925adef429afc37f75bd1c2017 Mon Sep 17 00:00:00 2001
|
||||
From: Richard Levitte <levitte@openssl.org>
|
||||
Date: Fri, 20 Oct 2023 09:18:19 +0200
|
||||
Subject: [PATCH] Make DH_check_pub_key() and DH_generate_key() safer yet
|
||||
|
||||
We already check for an excessively large P in DH_generate_key(), but not in
|
||||
DH_check_pub_key(), and none of them check for an excessively large Q.
|
||||
|
||||
This change adds all the missing excessive size checks of P and Q.
|
||||
|
||||
It's to be noted that behaviours surrounding excessively sized P and Q
|
||||
differ. DH_check() raises an error on the excessively sized P, but only
|
||||
sets a flag for the excessively sized Q. This behaviour is mimicked in
|
||||
DH_check_pub_key().
|
||||
|
||||
Reviewed-by: Tomas Mraz <tomas@openssl.org>
|
||||
Reviewed-by: Matt Caswell <matt@openssl.org>
|
||||
Reviewed-by: Hugo Landau <hlandau@openssl.org>
|
||||
(Merged from https://github.com/openssl/openssl/pull/22518)
|
||||
|
||||
(cherry picked from commit ddeb4b6c6d527e54ce9a99cba785c0f7776e54b6)
|
||||
|
||||
Upstream-Status: Backport [https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=db925ae2e65d0d925adef429afc37f75bd1c2017]
|
||||
CVE: CVE-2023-5678
|
||||
Signed-off-by: Vivek Kumbhar <vkumbhar@mvista.com>
|
||||
---
|
||||
crypto/dh/dh_check.c | 12 ++++++++++++
|
||||
crypto/dh/dh_err.c | 3 ++-
|
||||
crypto/dh/dh_key.c | 12 ++++++++++++
|
||||
crypto/err/openssl.txt | 1 +
|
||||
include/crypto/dherr.h | 2 +-
|
||||
include/openssl/dh.h | 6 +++---
|
||||
include/openssl/dherr.h | 3 ++-
|
||||
7 files changed, 33 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/crypto/dh/dh_check.c b/crypto/dh/dh_check.c
|
||||
index 7ba2bea..e20eb62 100644
|
||||
--- a/crypto/dh/dh_check.c
|
||||
+++ b/crypto/dh/dh_check.c
|
||||
@@ -249,6 +249,18 @@ int DH_check_pub_key_ex(const DH *dh, const BIGNUM *pub_key)
|
||||
*/
|
||||
int DH_check_pub_key(const DH *dh, const BIGNUM *pub_key, int *ret)
|
||||
{
|
||||
+ /* Don't do any checks at all with an excessively large modulus */
|
||||
+ if (BN_num_bits(dh->params.p) > OPENSSL_DH_CHECK_MAX_MODULUS_BITS) {
|
||||
+ ERR_raise(ERR_LIB_DH, DH_R_MODULUS_TOO_LARGE);
|
||||
+ *ret = DH_MODULUS_TOO_LARGE | DH_CHECK_PUBKEY_INVALID;
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ if (dh->params.q != NULL && BN_ucmp(dh->params.p, dh->params.q) < 0) {
|
||||
+ *ret |= DH_CHECK_INVALID_Q_VALUE | DH_CHECK_PUBKEY_INVALID;
|
||||
+ return 1;
|
||||
+ }
|
||||
+
|
||||
return ossl_ffc_validate_public_key(&dh->params, pub_key, ret);
|
||||
}
|
||||
|
||||
diff --git a/crypto/dh/dh_err.c b/crypto/dh/dh_err.c
|
||||
index 4152397..f76ac0d 100644
|
||||
--- a/crypto/dh/dh_err.c
|
||||
+++ b/crypto/dh/dh_err.c
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Generated by util/mkerr.pl DO NOT EDIT
|
||||
- * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
|
||||
+ * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
@@ -54,6 +54,7 @@ static const ERR_STRING_DATA DH_str_reasons[] = {
|
||||
{ERR_PACK(ERR_LIB_DH, 0, DH_R_PARAMETER_ENCODING_ERROR),
|
||||
"parameter encoding error"},
|
||||
{ERR_PACK(ERR_LIB_DH, 0, DH_R_PEER_KEY_ERROR), "peer key error"},
|
||||
+ {ERR_PACK(ERR_LIB_DH, 0, DH_R_Q_TOO_LARGE), "q too large"},
|
||||
{ERR_PACK(ERR_LIB_DH, 0, DH_R_SHARED_INFO_ERROR), "shared info error"},
|
||||
{ERR_PACK(ERR_LIB_DH, 0, DH_R_UNABLE_TO_CHECK_GENERATOR),
|
||||
"unable to check generator"},
|
||||
diff --git a/crypto/dh/dh_key.c b/crypto/dh/dh_key.c
|
||||
index d84ea99..afc49f5 100644
|
||||
--- a/crypto/dh/dh_key.c
|
||||
+++ b/crypto/dh/dh_key.c
|
||||
@@ -49,6 +49,12 @@ int ossl_dh_compute_key(unsigned char *key, const BIGNUM *pub_key, DH *dh)
|
||||
goto err;
|
||||
}
|
||||
|
||||
+ if (dh->params.q != NULL
|
||||
+ && BN_num_bits(dh->params.q) > OPENSSL_DH_MAX_MODULUS_BITS) {
|
||||
+ ERR_raise(ERR_LIB_DH, DH_R_Q_TOO_LARGE);
|
||||
+ goto err;
|
||||
+ }
|
||||
+
|
||||
if (BN_num_bits(dh->params.p) < DH_MIN_MODULUS_BITS) {
|
||||
ERR_raise(ERR_LIB_DH, DH_R_MODULUS_TOO_SMALL);
|
||||
return 0;
|
||||
@@ -267,6 +273,12 @@ static int generate_key(DH *dh)
|
||||
return 0;
|
||||
}
|
||||
|
||||
+ if (dh->params.q != NULL
|
||||
+ && BN_num_bits(dh->params.q) > OPENSSL_DH_MAX_MODULUS_BITS) {
|
||||
+ ERR_raise(ERR_LIB_DH, DH_R_Q_TOO_LARGE);
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
if (BN_num_bits(dh->params.p) < DH_MIN_MODULUS_BITS) {
|
||||
ERR_raise(ERR_LIB_DH, DH_R_MODULUS_TOO_SMALL);
|
||||
return 0;
|
||||
diff --git a/crypto/err/openssl.txt b/crypto/err/openssl.txt
|
||||
index e51504b..36de321 100644
|
||||
--- a/crypto/err/openssl.txt
|
||||
+++ b/crypto/err/openssl.txt
|
||||
@@ -500,6 +500,7 @@ DH_R_NO_PARAMETERS_SET:107:no parameters set
|
||||
DH_R_NO_PRIVATE_VALUE:100:no private value
|
||||
DH_R_PARAMETER_ENCODING_ERROR:105:parameter encoding error
|
||||
DH_R_PEER_KEY_ERROR:111:peer key error
|
||||
+DH_R_Q_TOO_LARGE:130:q too large
|
||||
DH_R_SHARED_INFO_ERROR:113:shared info error
|
||||
DH_R_UNABLE_TO_CHECK_GENERATOR:121:unable to check generator
|
||||
DSA_R_BAD_FFC_PARAMETERS:114:bad ffc parameters
|
||||
diff --git a/include/crypto/dherr.h b/include/crypto/dherr.h
|
||||
index bb24d13..519327f 100644
|
||||
--- a/include/crypto/dherr.h
|
||||
+++ b/include/crypto/dherr.h
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Generated by util/mkerr.pl DO NOT EDIT
|
||||
- * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
|
||||
+ * Copyright 2020-2023 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
diff --git a/include/openssl/dh.h b/include/openssl/dh.h
|
||||
index 6533260..50e0cf5 100644
|
||||
--- a/include/openssl/dh.h
|
||||
+++ b/include/openssl/dh.h
|
||||
@@ -141,7 +141,7 @@ DECLARE_ASN1_ITEM(DHparams)
|
||||
# define DH_GENERATOR_3 3
|
||||
# define DH_GENERATOR_5 5
|
||||
|
||||
-/* DH_check error codes */
|
||||
+/* DH_check error codes, some of them shared with DH_check_pub_key */
|
||||
/*
|
||||
* NB: These values must align with the equivalently named macros in
|
||||
* internal/ffc.h.
|
||||
@@ -151,10 +151,10 @@ DECLARE_ASN1_ITEM(DHparams)
|
||||
# define DH_UNABLE_TO_CHECK_GENERATOR 0x04
|
||||
# define DH_NOT_SUITABLE_GENERATOR 0x08
|
||||
# define DH_CHECK_Q_NOT_PRIME 0x10
|
||||
-# define DH_CHECK_INVALID_Q_VALUE 0x20
|
||||
+# define DH_CHECK_INVALID_Q_VALUE 0x20 /* +DH_check_pub_key */
|
||||
# define DH_CHECK_INVALID_J_VALUE 0x40
|
||||
# define DH_MODULUS_TOO_SMALL 0x80
|
||||
-# define DH_MODULUS_TOO_LARGE 0x100
|
||||
+# define DH_MODULUS_TOO_LARGE 0x100 /* +DH_check_pub_key */
|
||||
|
||||
/* DH_check_pub_key error codes */
|
||||
# define DH_CHECK_PUBKEY_TOO_SMALL 0x01
|
||||
diff --git a/include/openssl/dherr.h b/include/openssl/dherr.h
|
||||
index 5d2a762..074a701 100644
|
||||
--- a/include/openssl/dherr.h
|
||||
+++ b/include/openssl/dherr.h
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Generated by util/mkerr.pl DO NOT EDIT
|
||||
- * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
|
||||
+ * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
@@ -50,6 +50,7 @@
|
||||
# define DH_R_NO_PRIVATE_VALUE 100
|
||||
# define DH_R_PARAMETER_ENCODING_ERROR 105
|
||||
# define DH_R_PEER_KEY_ERROR 111
|
||||
+# define DH_R_Q_TOO_LARGE 130
|
||||
# define DH_R_SHARED_INFO_ERROR 113
|
||||
# define DH_R_UNABLE_TO_CHECK_GENERATOR 121
|
||||
|
||||
--
|
||||
2.40.1
|
||||
@@ -12,13 +12,14 @@ SRC_URI = "http://www.openssl.org/source/openssl-${PV}.tar.gz \
|
||||
file://0001-buildinfo-strip-sysroot-and-debug-prefix-map-from-co.patch \
|
||||
file://afalg.patch \
|
||||
file://0001-Configure-do-not-tweak-mips-cflags.patch \
|
||||
file://CVE-2023-5678.patch \
|
||||
"
|
||||
|
||||
SRC_URI:append:class-nativesdk = " \
|
||||
file://environment.d-openssl.sh \
|
||||
"
|
||||
|
||||
SRC_URI[sha256sum] = "1761d4f5b13a1028b9b6f3d4b8e17feb0cedc9370f6afe61d7193d2cdce83323"
|
||||
SRC_URI[sha256sum] = "f93c9e8edde5e9166119de31755fc87b4aa34863662f67ddfcba14d0b6b69b61"
|
||||
|
||||
inherit lib_package multilib_header multilib_script ptest perlnative
|
||||
MULTILIB_SCRIPTS = "${PN}-bin:${bindir}/c_rehash"
|
||||
@@ -1,6 +1,6 @@
|
||||
SRCBRANCH ?= "release/2.35/master"
|
||||
PV = "2.35"
|
||||
SRCREV_glibc ?= "561e9dadc02f46a7ba2190c0a04259583479f6c9"
|
||||
SRCREV_glibc ?= "c84018a05aec80f5ee6f682db0da1130b0196aef"
|
||||
SRCREV_localedef ?= "794da69788cbf9bf57b59a852f9f11307663fa87"
|
||||
|
||||
GLIBC_GIT_URI ?= "git://sourceware.org/git/glibc.git"
|
||||
|
||||
@@ -16,6 +16,16 @@ CVE_CHECK_IGNORE += "CVE-2019-1010022 CVE-2019-1010023 CVE-2019-1010024"
|
||||
# Potential patch at https://sourceware.org/bugzilla/show_bug.cgi?id=22853
|
||||
CVE_CHECK_IGNORE += "CVE-2019-1010025"
|
||||
|
||||
# glibc https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2023-4527
|
||||
# This vulnerability was introduced in 2.36 by commit
|
||||
# f282cdbe7f436c75864e5640a409a10485e9abb2 resolv: Implement no-aaaa stub resolver option
|
||||
# so our version is not yet vulnerable
|
||||
# See https://sourceware.org/bugzilla/show_bug.cgi?id=30842
|
||||
CVE_CHECK_IGNORE += "CVE-2023-4527"
|
||||
|
||||
# To avoid these in cve-check reports since the recipe version did not change
|
||||
CVE_CHECK_IGNORE += "CVE-2023-4813 CVE-2023-4806 CVE-2023-4911 CVE-2023-5156"
|
||||
|
||||
DEPENDS += "gperf-native bison-native"
|
||||
|
||||
NATIVESDKFIXES ?= ""
|
||||
|
||||
@@ -24,7 +24,7 @@ IMAGE_FSTYPES = "wic.vmdk wic.vhd wic.vhdx"
|
||||
|
||||
inherit core-image setuptools3
|
||||
|
||||
SRCREV ?= "989cd671cba392b07e48057f02e0b4dd090b48d2"
|
||||
SRCREV ?= "387d01b0a46bf0adb3f4cb2188299f88ac58db2f"
|
||||
SRC_URI = "git://git.yoctoproject.org/poky;branch=kirkstone \
|
||||
file://Yocto_Build_Appliance.vmx \
|
||||
file://Yocto_Build_Appliance.vmxf \
|
||||
|
||||
49
meta/recipes-core/libxml/libxml2/CVE-2023-45322-1.patch
Normal file
49
meta/recipes-core/libxml/libxml2/CVE-2023-45322-1.patch
Normal file
@@ -0,0 +1,49 @@
|
||||
From a22bd982bf10291deea8ba0c61bf75b898c604ce Mon Sep 17 00:00:00 2001
|
||||
From: Nick Wellnhofer <wellnhofer@aevum.de>
|
||||
Date: Wed, 2 Nov 2022 15:44:42 +0100
|
||||
Subject: [PATCH] malloc-fail: Fix memory leak in xmlStaticCopyNodeList
|
||||
|
||||
Found with libFuzzer, see #344.
|
||||
|
||||
Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/libxml2/-/commit/a22bd982bf10291deea8ba0c61bf75b898c604ce]
|
||||
|
||||
Signed-off-by: Peter Marko <peter.marko@siemens.com>
|
||||
---
|
||||
tree.c | 7 +++++--
|
||||
1 file changed, 5 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/tree.c b/tree.c
|
||||
index 507869efe..647288ce3 100644
|
||||
--- a/tree.c
|
||||
+++ b/tree.c
|
||||
@@ -4461,7 +4461,7 @@ xmlStaticCopyNodeList(xmlNodePtr node, xmlDocPtr doc, xmlNodePtr parent) {
|
||||
}
|
||||
if (doc->intSubset == NULL) {
|
||||
q = (xmlNodePtr) xmlCopyDtd( (xmlDtdPtr) node );
|
||||
- if (q == NULL) return(NULL);
|
||||
+ if (q == NULL) goto error;
|
||||
q->doc = doc;
|
||||
q->parent = parent;
|
||||
doc->intSubset = (xmlDtdPtr) q;
|
||||
@@ -4473,7 +4473,7 @@ xmlStaticCopyNodeList(xmlNodePtr node, xmlDocPtr doc, xmlNodePtr parent) {
|
||||
} else
|
||||
#endif /* LIBXML_TREE_ENABLED */
|
||||
q = xmlStaticCopyNode(node, doc, parent, 1);
|
||||
- if (q == NULL) return(NULL);
|
||||
+ if (q == NULL) goto error;
|
||||
if (ret == NULL) {
|
||||
q->prev = NULL;
|
||||
ret = p = q;
|
||||
@@ -4486,6 +4486,9 @@ xmlStaticCopyNodeList(xmlNodePtr node, xmlDocPtr doc, xmlNodePtr parent) {
|
||||
node = node->next;
|
||||
}
|
||||
return(ret);
|
||||
+error:
|
||||
+ xmlFreeNodeList(ret);
|
||||
+ return(NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
--
|
||||
GitLab
|
||||
|
||||
79
meta/recipes-core/libxml/libxml2/CVE-2023-45322-2.patch
Normal file
79
meta/recipes-core/libxml/libxml2/CVE-2023-45322-2.patch
Normal file
@@ -0,0 +1,79 @@
|
||||
From d39f78069dff496ec865c73aa44d7110e429bce9 Mon Sep 17 00:00:00 2001
|
||||
From: Nick Wellnhofer <wellnhofer@aevum.de>
|
||||
Date: Wed, 23 Aug 2023 20:24:24 +0200
|
||||
Subject: [PATCH] tree: Fix copying of DTDs
|
||||
|
||||
- Don't create multiple DTD nodes.
|
||||
- Fix UAF if malloc fails.
|
||||
- Skip DTD nodes if tree module is disabled.
|
||||
|
||||
Fixes #583.
|
||||
|
||||
CVE: CVE-2023-45322
|
||||
Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/libxml2/-/commit/d39f78069dff496ec865c73aa44d7110e429bce9]
|
||||
|
||||
Signed-off-by: Peter Marko <peter.marko@siemens.com>
|
||||
---
|
||||
tree.c | 31 ++++++++++++++++---------------
|
||||
1 file changed, 16 insertions(+), 15 deletions(-)
|
||||
|
||||
diff --git a/tree.c b/tree.c
|
||||
index 6c8a875b9..02c1b5791 100644
|
||||
--- a/tree.c
|
||||
+++ b/tree.c
|
||||
@@ -4471,29 +4471,28 @@ xmlNodePtr
|
||||
xmlStaticCopyNodeList(xmlNodePtr node, xmlDocPtr doc, xmlNodePtr parent) {
|
||||
xmlNodePtr ret = NULL;
|
||||
xmlNodePtr p = NULL,q;
|
||||
+ xmlDtdPtr newSubset = NULL;
|
||||
|
||||
while (node != NULL) {
|
||||
-#ifdef LIBXML_TREE_ENABLED
|
||||
if (node->type == XML_DTD_NODE ) {
|
||||
- if (doc == NULL) {
|
||||
+#ifdef LIBXML_TREE_ENABLED
|
||||
+ if ((doc == NULL) || (doc->intSubset != NULL)) {
|
||||
node = node->next;
|
||||
continue;
|
||||
}
|
||||
- if (doc->intSubset == NULL) {
|
||||
- q = (xmlNodePtr) xmlCopyDtd( (xmlDtdPtr) node );
|
||||
- if (q == NULL) goto error;
|
||||
- q->doc = doc;
|
||||
- q->parent = parent;
|
||||
- doc->intSubset = (xmlDtdPtr) q;
|
||||
- xmlAddChild(parent, q);
|
||||
- } else {
|
||||
- q = (xmlNodePtr) doc->intSubset;
|
||||
- xmlAddChild(parent, q);
|
||||
- }
|
||||
- } else
|
||||
+ q = (xmlNodePtr) xmlCopyDtd( (xmlDtdPtr) node );
|
||||
+ if (q == NULL) goto error;
|
||||
+ q->doc = doc;
|
||||
+ q->parent = parent;
|
||||
+ newSubset = (xmlDtdPtr) q;
|
||||
+#else
|
||||
+ node = node->next;
|
||||
+ continue;
|
||||
#endif /* LIBXML_TREE_ENABLED */
|
||||
+ } else {
|
||||
q = xmlStaticCopyNode(node, doc, parent, 1);
|
||||
- if (q == NULL) goto error;
|
||||
+ if (q == NULL) goto error;
|
||||
+ }
|
||||
if (ret == NULL) {
|
||||
q->prev = NULL;
|
||||
ret = p = q;
|
||||
@@ -4505,6 +4504,8 @@ xmlStaticCopyNodeList(xmlNodePtr node, xmlDocPtr doc, xmlNodePtr parent) {
|
||||
}
|
||||
node = node->next;
|
||||
}
|
||||
+ if (newSubset != NULL)
|
||||
+ doc->intSubset = newSubset;
|
||||
return(ret);
|
||||
error:
|
||||
xmlFreeNodeList(ret);
|
||||
--
|
||||
GitLab
|
||||
|
||||
@@ -29,6 +29,8 @@ SRC_URI += "http://www.w3.org/XML/Test/xmlts20080827.tar;subdir=${BP};name=testt
|
||||
file://CVE-2023-29469.patch \
|
||||
file://CVE-2023-39615-0001.patch \
|
||||
file://CVE-2023-39615-0002.patch \
|
||||
file://CVE-2023-45322-1.patch \
|
||||
file://CVE-2023-45322-2.patch \
|
||||
"
|
||||
|
||||
SRC_URI[archive.sha256sum] = "60d74a257d1ccec0475e749cba2f21559e48139efba6ff28224357c7c798dfee"
|
||||
|
||||
42
meta/recipes-core/zlib/zlib/CVE-2023-45853.patch
Normal file
42
meta/recipes-core/zlib/zlib/CVE-2023-45853.patch
Normal file
@@ -0,0 +1,42 @@
|
||||
From 73331a6a0481067628f065ffe87bb1d8f787d10c Mon Sep 17 00:00:00 2001
|
||||
From: Hans Wennborg <hans@chromium.org>
|
||||
Date: Fri, 18 Aug 2023 11:05:33 +0200
|
||||
Subject: [PATCH] Reject overflows of zip header fields in minizip.
|
||||
|
||||
This checks the lengths of the file name, extra field, and comment
|
||||
that would be put in the zip headers, and rejects them if they are
|
||||
too long. They are each limited to 65535 bytes in length by the zip
|
||||
format. This also avoids possible buffer overflows if the provided
|
||||
fields are too long.
|
||||
|
||||
CVE: CVE-2023-45853
|
||||
Upstream-Status: Backport [https://github.com/madler/zlib/commit/73331a6a0481067628f065ffe87bb1d8f787d10c]
|
||||
|
||||
Signed-off-by: Peter Marko <peter.marko@siemens.com>
|
||||
|
||||
---
|
||||
contrib/minizip/zip.c | 11 +++++++++++
|
||||
1 file changed, 11 insertions(+)
|
||||
|
||||
diff --git a/contrib/minizip/zip.c b/contrib/minizip/zip.c
|
||||
index 3d3d4cadd..0446109b2 100644
|
||||
--- a/contrib/minizip/zip.c
|
||||
+++ b/contrib/minizip/zip.c
|
||||
@@ -1043,6 +1043,17 @@ extern int ZEXPORT zipOpenNewFileInZip4_64(zipFile file, const char* filename, c
|
||||
return ZIP_PARAMERROR;
|
||||
#endif
|
||||
|
||||
+ // The filename and comment length must fit in 16 bits.
|
||||
+ if ((filename!=NULL) && (strlen(filename)>0xffff))
|
||||
+ return ZIP_PARAMERROR;
|
||||
+ if ((comment!=NULL) && (strlen(comment)>0xffff))
|
||||
+ return ZIP_PARAMERROR;
|
||||
+ // The extra field length must fit in 16 bits. If the member also requires
|
||||
+ // a Zip64 extra block, that will also need to fit within that 16-bit
|
||||
+ // length, but that will be checked for later.
|
||||
+ if ((size_extrafield_local>0xffff) || (size_extrafield_global>0xffff))
|
||||
+ return ZIP_PARAMERROR;
|
||||
+
|
||||
zi = (zip64_internal*)file;
|
||||
|
||||
if (zi->in_opened_file_inzip == 1)
|
||||
@@ -12,6 +12,7 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/libpng/${BPN}/${PV}/${BPN}-${PV}.tar.xz \
|
||||
file://CVE-2018-25032.patch \
|
||||
file://run-ptest \
|
||||
file://CVE-2022-37434.patch \
|
||||
file://CVE-2023-45853.patch \
|
||||
"
|
||||
UPSTREAM_CHECK_URI = "http://zlib.net/"
|
||||
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
From 960d10e89cf60d39998dae6fdcd4f0866b753a79 Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Mon, 23 Jan 2023 12:31:35 -0800
|
||||
Subject: [PATCH] add missing <cstdint> for uint16_t
|
||||
|
||||
This fixes build problems with gcc 13 snapshot [1]
|
||||
|
||||
Fixes
|
||||
| include/apt-pkg/pkgcache.h:257:23: warning: cast from 'char*' to 'const uint16_t*' {aka 'const short unsigned int*'} increases required alignment of target type [-Wcast-align]
|
||||
| 257 | uint16_t len = *reinterpret_cast<const uint16_t*>(name - sizeof(uint16_t));
|
||||
| | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
[1] https://www.gnu.org/software/gcc/gcc-13/porting_to.html
|
||||
|
||||
Upstream-Status: Submitted [https://salsa.debian.org/apt-team/apt/-/merge_requests/276]
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
apt-pkg/contrib/mmap.cc | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/apt-pkg/contrib/mmap.cc b/apt-pkg/contrib/mmap.cc
|
||||
index 642e20473..0568e1cd0 100644
|
||||
--- a/apt-pkg/contrib/mmap.cc
|
||||
+++ b/apt-pkg/contrib/mmap.cc
|
||||
@@ -23,6 +23,7 @@
|
||||
#include <apt-pkg/macros.h>
|
||||
#include <apt-pkg/mmap.h>
|
||||
|
||||
+#include <cstdint>
|
||||
#include <cstring>
|
||||
#include <string>
|
||||
#include <errno.h>
|
||||
--
|
||||
2.39.1
|
||||
|
||||
@@ -13,6 +13,7 @@ SRC_URI = "${DEBIAN_MIRROR}/main/a/apt/${BPN}_${PV}.tar.xz \
|
||||
file://0001-cmake-Do-not-build-po-files.patch \
|
||||
file://0001-Hide-fstatat64-and-prlimit64-defines-on-musl.patch \
|
||||
file://0001-aptwebserver.cc-Include-array.patch \
|
||||
file://0001-add-missing-cstdint-for-uint16_t.patch \
|
||||
"
|
||||
|
||||
SRC_URI:append:class-native = " \
|
||||
|
||||
@@ -56,8 +56,18 @@ SRC_URI = "\
|
||||
file://0023-CVE-2023-25585.patch \
|
||||
file://0026-CVE-2023-1972.patch \
|
||||
file://0025-CVE-2023-25588.patch \
|
||||
file://0027-CVE-2022-47008.patch \
|
||||
file://0028-CVE-2022-47011.patch \
|
||||
file://0029-CVE-2022-48065-1.patch \
|
||||
file://0029-CVE-2022-48065-2.patch \
|
||||
file://0029-CVE-2022-48065-3.patch \
|
||||
file://0030-CVE-2022-44840.patch \
|
||||
file://0031-CVE-2022-45703-1.patch \
|
||||
file://0031-CVE-2022-45703-2.patch \
|
||||
file://0031-CVE-2022-47695.patch \
|
||||
file://CVE-2022-48063.patch \
|
||||
file://0032-CVE-2022-47010.patch \
|
||||
file://0033-CVE-2022-47007.patch \
|
||||
file://0034-CVE-2022-48064.patch \
|
||||
"
|
||||
S = "${WORKDIR}/git"
|
||||
|
||||
@@ -35,8 +35,10 @@ Lack of bounds checking in vms-alpha.c parse_module
|
||||
Upstream-Status: Backport [https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff_plain;h=77c225bdeb410cf60da804879ad41622f5f1aa44]
|
||||
|
||||
CVE: CVE-2023-25584
|
||||
CVE: CVE-2022-47673
|
||||
|
||||
Signed-off-by: Deepthi Hemraj <Deepthi.Hemraj@windriver.com>
|
||||
Signed-off-by: Chaitanya Vadrevu <chaitanya.vadrevu@ni.com>
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -17,8 +17,10 @@ anyway, so get rid of them. Also, simplify and correct sanity checks.
|
||||
Upstream-Status: Backport [https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff_plain;h=d12f8998d2d086f0a6606589e5aedb7147e6f2f1]
|
||||
|
||||
CVE: CVE-2023-25588
|
||||
CVE: CVE-2022-47696
|
||||
|
||||
Signed-off-by: Deepthi Hemraj <Deepthi.Hemraj@windriver.com>
|
||||
Signed-off-by: Chaitanya Vadrevu <chaitanya.vadrevu@ni.com>
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
From: Alan Modra <amodra@gmail.com>
|
||||
Date: Thu, 16 Jun 2022 23:43:38 +0000 (+0930)
|
||||
Subject: PR29255, memory leak in make_tempdir
|
||||
X-Git-Tag: binutils-2_39~236
|
||||
X-Git-Url: https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff_plain;h=d6e1d48c83b165c129cb0aa78905f7ca80a1f682
|
||||
|
||||
PR29255, memory leak in make_tempdir
|
||||
|
||||
PR 29255
|
||||
* bucomm.c (make_tempdir, make_tempname): Free template on all
|
||||
failure paths.
|
||||
|
||||
Upstream-Status: Backport [https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff_plain;h=d6e1d48c83b165c129cb0aa78905f7ca80a1f682]
|
||||
|
||||
CVE: CVE-2022-47008
|
||||
|
||||
Signed-off-by: Deepthi Hemraj <Deepthi.Hemraj@windriver.com>
|
||||
|
||||
---
|
||||
|
||||
diff --git a/binutils/bucomm.c b/binutils/bucomm.c
|
||||
index fdc2209df9c..4395cb9f7f5 100644
|
||||
--- a/binutils/bucomm.c
|
||||
+++ b/binutils/bucomm.c
|
||||
@@ -537,8 +537,9 @@ make_tempname (const char *filename, int *ofd)
|
||||
#else
|
||||
tmpname = mktemp (tmpname);
|
||||
if (tmpname == NULL)
|
||||
- return NULL;
|
||||
- fd = open (tmpname, O_RDWR | O_CREAT | O_EXCL, 0600);
|
||||
+ fd = -1;
|
||||
+ else
|
||||
+ fd = open (tmpname, O_RDWR | O_CREAT | O_EXCL, 0600);
|
||||
#endif
|
||||
if (fd == -1)
|
||||
{
|
||||
@@ -556,22 +557,23 @@ char *
|
||||
make_tempdir (const char *filename)
|
||||
{
|
||||
char *tmpname = template_in_dir (filename);
|
||||
+ char *ret;
|
||||
|
||||
#ifdef HAVE_MKDTEMP
|
||||
- return mkdtemp (tmpname);
|
||||
+ ret = mkdtemp (tmpname);
|
||||
#else
|
||||
- tmpname = mktemp (tmpname);
|
||||
- if (tmpname == NULL)
|
||||
- return NULL;
|
||||
+ ret = mktemp (tmpname);
|
||||
#if defined (_WIN32) && !defined (__CYGWIN32__)
|
||||
if (mkdir (tmpname) != 0)
|
||||
- return NULL;
|
||||
+ ret = NULL;
|
||||
#else
|
||||
if (mkdir (tmpname, 0700) != 0)
|
||||
- return NULL;
|
||||
+ ret = NULL;
|
||||
#endif
|
||||
- return tmpname;
|
||||
#endif
|
||||
+ if (ret == NULL)
|
||||
+ free (tmpname);
|
||||
+ return ret;
|
||||
}
|
||||
|
||||
/* Parse a string into a VMA, with a fatal error if it can't be
|
||||
@@ -0,0 +1,35 @@
|
||||
From: Alan Modra <amodra@gmail.com>
|
||||
Date: Mon, 20 Jun 2022 01:09:13 +0000 (+0930)
|
||||
Subject: PR29261, memory leak in parse_stab_struct_fields
|
||||
X-Git-Tag: binutils-2_39~225
|
||||
X-Git-Url: https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff_plain;h=8a24927bc8dbf6beac2000593b21235c3796dc35
|
||||
|
||||
PR29261, memory leak in parse_stab_struct_fields
|
||||
|
||||
PR 29261
|
||||
* stabs.c (parse_stab_struct_fields): Free "fields" on failure path.
|
||||
|
||||
Upstream-Status: Backport [https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff_plain;h=8a24927bc8dbf6beac2000593b21235c3796dc35]
|
||||
|
||||
CVE: CVE-2022-47011
|
||||
|
||||
Signed-off-by: Deepthi Hemraj <Deepthi.Hemraj@windriver.com>
|
||||
|
||||
---
|
||||
|
||||
diff --git a/binutils/stabs.c b/binutils/stabs.c
|
||||
index 796ff85b86a..bf3f578cbcc 100644
|
||||
--- a/binutils/stabs.c
|
||||
+++ b/binutils/stabs.c
|
||||
@@ -2367,7 +2367,10 @@ parse_stab_struct_fields (void *dhandle,
|
||||
|
||||
if (! parse_stab_one_struct_field (dhandle, info, pp, p, fields + c,
|
||||
staticsp, p_end))
|
||||
- return false;
|
||||
+ {
|
||||
+ free (fields);
|
||||
+ return false;
|
||||
+ }
|
||||
|
||||
++c;
|
||||
}
|
||||
@@ -0,0 +1,151 @@
|
||||
From: Alan Modra <amodra@gmail.com>
|
||||
Date: Sun, 30 Oct 2022 08:38:51 +0000 (+1030)
|
||||
Subject: Pool section entries for DWP version 1
|
||||
X-Git-Tag: gdb-13-branchpoint~664
|
||||
X-Git-Url: https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff_plain;h=28750e3b967da2207d51cbce9fc8be262817ee59
|
||||
|
||||
Pool section entries for DWP version 1
|
||||
|
||||
Ref: https://gcc.gnu.org/wiki/DebugFissionDWP?action=recall&rev=3
|
||||
|
||||
Fuzzers have found a weakness in the code stashing pool section
|
||||
entries. With random nonsensical values in the index entries (rather
|
||||
than each index pointing to its own set distinct from other sets),
|
||||
it's possible to overflow the space allocated, losing the NULL
|
||||
terminator. Without a terminator, find_section_in_set can run off the
|
||||
end of the shndx_pool buffer. Fix this by scanning the pool directly.
|
||||
|
||||
binutils/
|
||||
* dwarf.c (add_shndx_to_cu_tu_entry): Delete range check.
|
||||
(end_cu_tu_entry): Likewise.
|
||||
(process_cu_tu_index): Fill shndx_pool by directly scanning
|
||||
pool, rather than indirectly from index entries.
|
||||
|
||||
Upstream-Status: Backport [https://sourceware.org/git/?p=binutils-gdb.git;a=blobdiff_plain;f=binutils/dwarf.c;h=7730293326ac1049451eb4a037ac86d827030700;hp=c6340a28906114e9df29d7401472c7dc0a98c2b1;hb=28750e3b967da2207d51cbce9fc8be262817ee59;hpb=60095ba3b8f8ba26a6389dded732fa446422c98f]
|
||||
|
||||
CVE: CVE-2022-44840
|
||||
|
||||
Signed-off-by: yash shinde <yash.shinde@windriver.com>
|
||||
|
||||
diff --git a/binutils/dwarf.c b/binutils/dwarf.c
|
||||
index c6340a28906..7730293326a 100644
|
||||
--- a/binutils/dwarf.c
|
||||
+++ b/binutils/dwarf.c
|
||||
@@ -10652,22 +10652,12 @@ prealloc_cu_tu_list (unsigned int nshndx)
|
||||
static void
|
||||
add_shndx_to_cu_tu_entry (unsigned int shndx)
|
||||
{
|
||||
- if (shndx_pool_used >= shndx_pool_size)
|
||||
- {
|
||||
- error (_("Internal error: out of space in the shndx pool.\n"));
|
||||
- return;
|
||||
- }
|
||||
shndx_pool [shndx_pool_used++] = shndx;
|
||||
}
|
||||
|
||||
static void
|
||||
end_cu_tu_entry (void)
|
||||
{
|
||||
- if (shndx_pool_used >= shndx_pool_size)
|
||||
- {
|
||||
- error (_("Internal error: out of space in the shndx pool.\n"));
|
||||
- return;
|
||||
- }
|
||||
shndx_pool [shndx_pool_used++] = 0;
|
||||
}
|
||||
|
||||
@@ -10773,53 +10763,55 @@ process_cu_tu_index (struct dwarf_section *section, int do_display)
|
||||
|
||||
if (version == 1)
|
||||
{
|
||||
+ unsigned char *shndx_list;
|
||||
+ unsigned int shndx;
|
||||
+
|
||||
if (!do_display)
|
||||
- prealloc_cu_tu_list ((limit - ppool) / 4);
|
||||
- for (i = 0; i < nslots; i++)
|
||||
{
|
||||
- unsigned char *shndx_list;
|
||||
- unsigned int shndx;
|
||||
-
|
||||
- SAFE_BYTE_GET (signature, phash, 8, limit);
|
||||
- if (signature != 0)
|
||||
+ prealloc_cu_tu_list ((limit - ppool) / 4);
|
||||
+ for (shndx_list = ppool + 4; shndx_list <= limit - 4; shndx_list += 4)
|
||||
{
|
||||
- SAFE_BYTE_GET (j, pindex, 4, limit);
|
||||
- shndx_list = ppool + j * 4;
|
||||
- /* PR 17531: file: 705e010d. */
|
||||
- if (shndx_list < ppool)
|
||||
- {
|
||||
- warn (_("Section index pool located before start of section\n"));
|
||||
- return 0;
|
||||
- }
|
||||
+ shndx = byte_get (shndx_list, 4);
|
||||
+ add_shndx_to_cu_tu_entry (shndx);
|
||||
+ }
|
||||
+ end_cu_tu_entry ();
|
||||
+ }
|
||||
+ else
|
||||
+ for (i = 0; i < nslots; i++)
|
||||
+ {
|
||||
+ SAFE_BYTE_GET (signature, phash, 8, limit);
|
||||
+ if (signature != 0)
|
||||
+ {
|
||||
+ SAFE_BYTE_GET (j, pindex, 4, limit);
|
||||
+ shndx_list = ppool + j * 4;
|
||||
+ /* PR 17531: file: 705e010d. */
|
||||
+ if (shndx_list < ppool)
|
||||
+ {
|
||||
+ warn (_("Section index pool located before start of section\n"));
|
||||
+ return 0;
|
||||
+ }
|
||||
|
||||
- if (do_display)
|
||||
printf (_(" [%3d] Signature: 0x%s Sections: "),
|
||||
i, dwarf_vmatoa ("x", signature));
|
||||
- for (;;)
|
||||
- {
|
||||
- if (shndx_list >= limit)
|
||||
- {
|
||||
- warn (_("Section %s too small for shndx pool\n"),
|
||||
- section->name);
|
||||
- return 0;
|
||||
- }
|
||||
- SAFE_BYTE_GET (shndx, shndx_list, 4, limit);
|
||||
- if (shndx == 0)
|
||||
- break;
|
||||
- if (do_display)
|
||||
+ for (;;)
|
||||
+ {
|
||||
+ if (shndx_list >= limit)
|
||||
+ {
|
||||
+ warn (_("Section %s too small for shndx pool\n"),
|
||||
+ section->name);
|
||||
+ return 0;
|
||||
+ }
|
||||
+ SAFE_BYTE_GET (shndx, shndx_list, 4, limit);
|
||||
+ if (shndx == 0)
|
||||
+ break;
|
||||
printf (" %d", shndx);
|
||||
- else
|
||||
- add_shndx_to_cu_tu_entry (shndx);
|
||||
- shndx_list += 4;
|
||||
- }
|
||||
- if (do_display)
|
||||
+ shndx_list += 4;
|
||||
+ }
|
||||
printf ("\n");
|
||||
- else
|
||||
- end_cu_tu_entry ();
|
||||
- }
|
||||
- phash += 8;
|
||||
- pindex += 4;
|
||||
- }
|
||||
+ }
|
||||
+ phash += 8;
|
||||
+ pindex += 4;
|
||||
+ }
|
||||
}
|
||||
else if (version == 2)
|
||||
{
|
||||
@@ -0,0 +1,147 @@
|
||||
From: Alan Modra <amodra@gmail.com>
|
||||
Date: Tue, 24 May 2022 00:02:14 +0000 (+0930)
|
||||
Subject: PR29169, invalid read displaying fuzzed .gdb_index
|
||||
X-Git-Tag: binutils-2_39~530
|
||||
X-Git-Url: https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff_plain;h=244e19c79111eed017ee38ab1d44fb2a6cd1b636
|
||||
|
||||
PR29169, invalid read displaying fuzzed .gdb_index
|
||||
|
||||
PR 29169
|
||||
* dwarf.c (display_gdb_index): Combine sanity checks. Calculate
|
||||
element counts, not word counts.
|
||||
Upstream-Status: Backport [https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff_plain;h=244e19c79111eed017ee38ab1d44fb2a6cd1b636]
|
||||
|
||||
CVE: CVE-2022-45703
|
||||
|
||||
Signed-off-by: yash shinde <yash.shinde@windriver.com>
|
||||
|
||||
---
|
||||
|
||||
diff --git a/binutils/dwarf.c b/binutils/dwarf.c
|
||||
index 7de6f28161f..c855972a12f 100644
|
||||
--- a/binutils/dwarf.c
|
||||
+++ b/binutils/dwarf.c
|
||||
@@ -10406,7 +10406,7 @@ display_gdb_index (struct dwarf_section *section,
|
||||
uint32_t cu_list_offset, tu_list_offset;
|
||||
uint32_t address_table_offset, symbol_table_offset, constant_pool_offset;
|
||||
unsigned int cu_list_elements, tu_list_elements;
|
||||
- unsigned int address_table_size, symbol_table_slots;
|
||||
+ unsigned int address_table_elements, symbol_table_slots;
|
||||
unsigned char *cu_list, *tu_list;
|
||||
unsigned char *address_table, *symbol_table, *constant_pool;
|
||||
unsigned int i;
|
||||
@@ -10454,48 +10454,19 @@ display_gdb_index (struct dwarf_section *section,
|
||||
|| tu_list_offset > section->size
|
||||
|| address_table_offset > section->size
|
||||
|| symbol_table_offset > section->size
|
||||
- || constant_pool_offset > section->size)
|
||||
+ || constant_pool_offset > section->size
|
||||
+ || tu_list_offset < cu_list_offset
|
||||
+ || address_table_offset < tu_list_offset
|
||||
+ || symbol_table_offset < address_table_offset
|
||||
+ || constant_pool_offset < symbol_table_offset)
|
||||
{
|
||||
warn (_("Corrupt header in the %s section.\n"), section->name);
|
||||
return 0;
|
||||
}
|
||||
|
||||
- /* PR 17531: file: 418d0a8a. */
|
||||
- if (tu_list_offset < cu_list_offset)
|
||||
- {
|
||||
- warn (_("TU offset (%x) is less than CU offset (%x)\n"),
|
||||
- tu_list_offset, cu_list_offset);
|
||||
- return 0;
|
||||
- }
|
||||
-
|
||||
- cu_list_elements = (tu_list_offset - cu_list_offset) / 8;
|
||||
-
|
||||
- if (address_table_offset < tu_list_offset)
|
||||
- {
|
||||
- warn (_("Address table offset (%x) is less than TU offset (%x)\n"),
|
||||
- address_table_offset, tu_list_offset);
|
||||
- return 0;
|
||||
- }
|
||||
-
|
||||
- tu_list_elements = (address_table_offset - tu_list_offset) / 8;
|
||||
-
|
||||
- /* PR 17531: file: 18a47d3d. */
|
||||
- if (symbol_table_offset < address_table_offset)
|
||||
- {
|
||||
- warn (_("Symbol table offset (%x) is less then Address table offset (%x)\n"),
|
||||
- symbol_table_offset, address_table_offset);
|
||||
- return 0;
|
||||
- }
|
||||
-
|
||||
- address_table_size = symbol_table_offset - address_table_offset;
|
||||
-
|
||||
- if (constant_pool_offset < symbol_table_offset)
|
||||
- {
|
||||
- warn (_("Constant pool offset (%x) is less than symbol table offset (%x)\n"),
|
||||
- constant_pool_offset, symbol_table_offset);
|
||||
- return 0;
|
||||
- }
|
||||
-
|
||||
+ cu_list_elements = (tu_list_offset - cu_list_offset) / 16;
|
||||
+ tu_list_elements = (address_table_offset - tu_list_offset) / 24;
|
||||
+ address_table_elements = (symbol_table_offset - address_table_offset) / 20;
|
||||
symbol_table_slots = (constant_pool_offset - symbol_table_offset) / 8;
|
||||
|
||||
cu_list = start + cu_list_offset;
|
||||
@@ -10504,31 +10475,25 @@ display_gdb_index (struct dwarf_section *section,
|
||||
symbol_table = start + symbol_table_offset;
|
||||
constant_pool = start + constant_pool_offset;
|
||||
|
||||
- if (address_table_offset + address_table_size > section->size)
|
||||
- {
|
||||
- warn (_("Address table extends beyond end of section.\n"));
|
||||
- return 0;
|
||||
- }
|
||||
-
|
||||
printf (_("\nCU table:\n"));
|
||||
- for (i = 0; i < cu_list_elements; i += 2)
|
||||
+ for (i = 0; i < cu_list_elements; i++)
|
||||
{
|
||||
- uint64_t cu_offset = byte_get_little_endian (cu_list + i * 8, 8);
|
||||
- uint64_t cu_length = byte_get_little_endian (cu_list + i * 8 + 8, 8);
|
||||
+ uint64_t cu_offset = byte_get_little_endian (cu_list + i * 16, 8);
|
||||
+ uint64_t cu_length = byte_get_little_endian (cu_list + i * 16 + 8, 8);
|
||||
|
||||
- printf (_("[%3u] 0x%lx - 0x%lx\n"), i / 2,
|
||||
+ printf (_("[%3u] 0x%lx - 0x%lx\n"), i,
|
||||
(unsigned long) cu_offset,
|
||||
(unsigned long) (cu_offset + cu_length - 1));
|
||||
}
|
||||
|
||||
printf (_("\nTU table:\n"));
|
||||
- for (i = 0; i < tu_list_elements; i += 3)
|
||||
+ for (i = 0; i < tu_list_elements; i++)
|
||||
{
|
||||
- uint64_t tu_offset = byte_get_little_endian (tu_list + i * 8, 8);
|
||||
- uint64_t type_offset = byte_get_little_endian (tu_list + i * 8 + 8, 8);
|
||||
- uint64_t signature = byte_get_little_endian (tu_list + i * 8 + 16, 8);
|
||||
+ uint64_t tu_offset = byte_get_little_endian (tu_list + i * 24, 8);
|
||||
+ uint64_t type_offset = byte_get_little_endian (tu_list + i * 24 + 8, 8);
|
||||
+ uint64_t signature = byte_get_little_endian (tu_list + i * 24 + 16, 8);
|
||||
|
||||
- printf (_("[%3u] 0x%lx 0x%lx "), i / 3,
|
||||
+ printf (_("[%3u] 0x%lx 0x%lx "), i,
|
||||
(unsigned long) tu_offset,
|
||||
(unsigned long) type_offset);
|
||||
print_dwarf_vma (signature, 8);
|
||||
@@ -10536,12 +10501,11 @@ display_gdb_index (struct dwarf_section *section,
|
||||
}
|
||||
|
||||
printf (_("\nAddress table:\n"));
|
||||
- for (i = 0; i < address_table_size && i <= address_table_size - (2 * 8 + 4);
|
||||
- i += 2 * 8 + 4)
|
||||
+ for (i = 0; i < address_table_elements; i++)
|
||||
{
|
||||
- uint64_t low = byte_get_little_endian (address_table + i, 8);
|
||||
- uint64_t high = byte_get_little_endian (address_table + i + 8, 8);
|
||||
- uint32_t cu_index = byte_get_little_endian (address_table + i + 16, 4);
|
||||
+ uint64_t low = byte_get_little_endian (address_table + i * 20, 8);
|
||||
+ uint64_t high = byte_get_little_endian (address_table + i * 20 + 8, 8);
|
||||
+ uint32_t cu_index = byte_get_little_endian (address_table + i + 20 + 16, 4);
|
||||
|
||||
print_dwarf_vma (low, 8);
|
||||
print_dwarf_vma (high, 8);
|
||||
@@ -0,0 +1,31 @@
|
||||
From 69bfd1759db41c8d369f9dcc98a135c5a5d97299 Mon Sep 17 00:00:00 2001
|
||||
From: Alan Modra <amodra@gmail.com>
|
||||
Date: Fri, 18 Nov 2022 11:29:13 +1030
|
||||
Subject: [PATCH] PR29799 heap buffer overflow in display_gdb_index
|
||||
dwarf.c:10548
|
||||
|
||||
PR 29799
|
||||
* dwarf.c (display_gdb_index): Typo fix.
|
||||
Upstream-Status: Backport [https://sourceware.org/git/?p=binutils-gdb.git;a=blobdiff_plain;f=binutils/dwarf.c;h=4bba8dfb81a6df49f5e61b3fae99dd545cc5c7dd;hp=7730293326ac1049451eb4a037ac86d827030700;hb=69bfd1759db41c8d369f9dcc98a135c5a5d97299;hpb=7828dfa93b210b6bbc6596e6e096cc150a9f8aa4]
|
||||
|
||||
CVE: CVE-2022-45703
|
||||
|
||||
Signed-off-by: yash shinde <yash.shinde@windriver.com>
|
||||
|
||||
---
|
||||
binutils/dwarf.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/binutils/dwarf.c b/binutils/dwarf.c
|
||||
index 7730293326a..4bba8dfb81a 100644
|
||||
--- a/binutils/dwarf.c
|
||||
+++ b/binutils/dwarf.c
|
||||
@@ -10562,7 +10562,7 @@ display_gdb_index (struct dwarf_section
|
||||
{
|
||||
uint64_t low = byte_get_little_endian (address_table + i * 20, 8);
|
||||
uint64_t high = byte_get_little_endian (address_table + i * 20 + 8, 8);
|
||||
- uint32_t cu_index = byte_get_little_endian (address_table + i + 20 + 16, 4);
|
||||
+ uint32_t cu_index = byte_get_little_endian (address_table + i * 20 + 16, 4);
|
||||
|
||||
print_dwarf_vma (low, 8);
|
||||
print_dwarf_vma (high, 8);
|
||||
@@ -0,0 +1,58 @@
|
||||
From 2f7426b9bb2d2450b32cad3d79fab9abe3ec42bb Mon Sep 17 00:00:00 2001
|
||||
From: Alan Modra <amodra@gmail.com>
|
||||
Date: Sun, 4 Dec 2022 22:15:40 +1030
|
||||
Subject: [PATCH] PR29846, segmentation fault in objdump.c compare_symbols
|
||||
|
||||
Fixes a fuzzed object file problem where plt relocs were manipulated
|
||||
in such a way that two synthetic symbols were generated at the same
|
||||
plt location. Won't occur in real object files.
|
||||
|
||||
PR 29846
|
||||
PR 20337
|
||||
* objdump.c (compare_symbols): Test symbol flags to exclude
|
||||
section and synthetic symbols before attempting to check flavour.
|
||||
|
||||
Upstream-Status: Backport [https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=3d3af4ba39e892b1c544d667ca241846bc3df386]
|
||||
|
||||
CVE: CVE-2022-47695
|
||||
|
||||
Signed-off-by: Chaitanya Vadrevu <chaitanya.vadrevu@ni.com>
|
||||
---
|
||||
binutils/objdump.c | 23 ++++++++++-------------
|
||||
1 file changed, 10 insertions(+), 13 deletions(-)
|
||||
|
||||
diff --git a/binutils/objdump.c b/binutils/objdump.c
|
||||
index 08a0fe521d8..21f75f4db40 100644
|
||||
--- a/binutils/objdump.c
|
||||
+++ b/binutils/objdump.c
|
||||
@@ -1165,20 +1165,17 @@ compare_symbols (const void *ap, const void *bp)
|
||||
return 1;
|
||||
}
|
||||
|
||||
- if (bfd_get_flavour (bfd_asymbol_bfd (a)) == bfd_target_elf_flavour
|
||||
+ /* Sort larger size ELF symbols before smaller. See PR20337. */
|
||||
+ bfd_vma asz = 0;
|
||||
+ if ((a->flags & (BSF_SECTION_SYM | BSF_SYNTHETIC)) == 0
|
||||
+ && bfd_get_flavour (bfd_asymbol_bfd (a)) == bfd_target_elf_flavour)
|
||||
+ asz = ((elf_symbol_type *) a)->internal_elf_sym.st_size;
|
||||
+ bfd_vma bsz = 0;
|
||||
+ if ((b->flags & (BSF_SECTION_SYM | BSF_SYNTHETIC)) == 0
|
||||
&& bfd_get_flavour (bfd_asymbol_bfd (b)) == bfd_target_elf_flavour)
|
||||
- {
|
||||
- bfd_vma asz, bsz;
|
||||
-
|
||||
- asz = 0;
|
||||
- if ((a->flags & (BSF_SECTION_SYM | BSF_SYNTHETIC)) == 0)
|
||||
- asz = ((elf_symbol_type *) a)->internal_elf_sym.st_size;
|
||||
- bsz = 0;
|
||||
- if ((b->flags & (BSF_SECTION_SYM | BSF_SYNTHETIC)) == 0)
|
||||
- bsz = ((elf_symbol_type *) b)->internal_elf_sym.st_size;
|
||||
- if (asz != bsz)
|
||||
- return asz > bsz ? -1 : 1;
|
||||
- }
|
||||
+ bsz = ((elf_symbol_type *) b)->internal_elf_sym.st_size;
|
||||
+ if (asz != bsz)
|
||||
+ return asz > bsz ? -1 : 1;
|
||||
|
||||
/* Symbols that start with '.' might be section names, so sort them
|
||||
after symbols that don't start with '.'. */
|
||||
@@ -0,0 +1,38 @@
|
||||
From: Alan Modra <amodra@gmail.com>
|
||||
Date: Mon, 20 Jun 2022 01:09:31 +0000 (+0930)
|
||||
Subject: PR29262, memory leak in pr_function_type
|
||||
X-Git-Tag: binutils-2_39~224
|
||||
X-Git-Url: https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff_plain;h=0d02e70b197c786f26175b9a73f94e01d14abdab
|
||||
|
||||
PR29262, memory leak in pr_function_type
|
||||
|
||||
PR 29262
|
||||
* prdbg.c (pr_function_type): Free "s" on failure path.
|
||||
|
||||
Upstream-Status: Backport [https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff_plain;h=0d02e70b197c786f26175b9a73f94e01d14abdab]
|
||||
|
||||
CVE: CVE-2022-47010
|
||||
|
||||
Signed-off-by: Sanjana Venkatesh <Sanjana.Venkatesh@windriver.com>
|
||||
|
||||
---
|
||||
|
||||
diff --git a/binutils/prdbg.c b/binutils/prdbg.c
|
||||
index c1e41628d26..bb42a5b6c2d 100644
|
||||
--- a/binutils/prdbg.c
|
||||
+++ b/binutils/prdbg.c
|
||||
@@ -742,12 +742,9 @@ pr_function_type (void *p, int argcount, bool varargs)
|
||||
|
||||
strcat (s, ")");
|
||||
|
||||
- if (! substitute_type (info, s))
|
||||
- return false;
|
||||
-
|
||||
+ bool ret = substitute_type (info, s);
|
||||
free (s);
|
||||
-
|
||||
- return true;
|
||||
+ return ret;
|
||||
}
|
||||
|
||||
/* Turn the top type on the stack into a reference to that type. */
|
||||
@@ -0,0 +1,34 @@
|
||||
From: Alan Modra <amodra@gmail.com>
|
||||
Date: Thu, 16 Jun 2022 23:30:41 +0000 (+0930)
|
||||
Subject: PR29254, memory leak in stab_demangle_v3_arg
|
||||
X-Git-Tag: binutils-2_39~237
|
||||
X-Git-Url: https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff_plain;h=0ebc886149c22aceaf8ed74267821a59ca9d03eb
|
||||
|
||||
PR29254, memory leak in stab_demangle_v3_arg
|
||||
|
||||
PR 29254
|
||||
* stabs.c (stab_demangle_v3_arg): Free dt on failure path.
|
||||
|
||||
Upstream-Status: Backport [https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff_plain;h=0ebc886149c22aceaf8ed74267821a59ca9d03eb]
|
||||
|
||||
CVE: CVE-2022-47007
|
||||
|
||||
Signed-off-by: Deepthi Hemraj <Deepthi.Hemraj@windriver.com>
|
||||
---
|
||||
|
||||
diff --git a/binutils/stabs.c b/binutils/stabs.c
|
||||
index 2b5241637c1..796ff85b86a 100644
|
||||
--- a/binutils/stabs.c
|
||||
+++ b/binutils/stabs.c
|
||||
@@ -5467,7 +5467,10 @@ stab_demangle_v3_arg (void *dhandle, struct stab_handle *info,
|
||||
dc->u.s_binary.right,
|
||||
&varargs);
|
||||
if (pargs == NULL)
|
||||
- return NULL;
|
||||
+ {
|
||||
+ free (dt);
|
||||
+ return NULL;
|
||||
+ }
|
||||
|
||||
return debug_make_function_type (dhandle, dt, pargs, varargs);
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
From: Alan Modra <amodra@gmail.com>
|
||||
Date: Tue, 20 Dec 2022 13:17:03 +0000 (+1030)
|
||||
Subject: PR29922, SHT_NOBITS section avoids section size sanity check
|
||||
X-Git-Tag: binutils-2_40~202
|
||||
X-Git-Url: https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff_plain;h=8f2c64de86bc3d7556121fe296dd679000283931
|
||||
|
||||
PR29922, SHT_NOBITS section avoids section size sanity check
|
||||
|
||||
PR 29922
|
||||
* dwarf2.c (find_debug_info): Ignore sections without
|
||||
SEC_HAS_CONTENTS.
|
||||
|
||||
Upstream-Status: Backport [https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff_plain;h=8f2c64de86bc3d7556121fe296dd679000283931]
|
||||
|
||||
CVE: CVE-2022-48064
|
||||
|
||||
Signed-off-by: Deepthi Hemraj <Deepthi.Hemraj@windriver.com>
|
||||
|
||||
---
|
||||
|
||||
diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c
|
||||
index 95f45708e9d..0cd8152ee6e 100644
|
||||
--- a/bfd/dwarf2.c
|
||||
+++ b/bfd/dwarf2.c
|
||||
@@ -4831,16 +4831,19 @@ find_debug_info (bfd *abfd, const struct dwarf_debug_section *debug_sections,
|
||||
{
|
||||
look = debug_sections[debug_info].uncompressed_name;
|
||||
msec = bfd_get_section_by_name (abfd, look);
|
||||
- if (msec != NULL)
|
||||
+ /* Testing SEC_HAS_CONTENTS is an anti-fuzzer measure. Of
|
||||
+ course debug sections always have contents. */
|
||||
+ if (msec != NULL && (msec->flags & SEC_HAS_CONTENTS) != 0)
|
||||
return msec;
|
||||
|
||||
look = debug_sections[debug_info].compressed_name;
|
||||
msec = bfd_get_section_by_name (abfd, look);
|
||||
- if (msec != NULL)
|
||||
+ if (msec != NULL && (msec->flags & SEC_HAS_CONTENTS) != 0)
|
||||
return msec;
|
||||
|
||||
for (msec = abfd->sections; msec != NULL; msec = msec->next)
|
||||
- if (startswith (msec->name, GNU_LINKONCE_INFO))
|
||||
+ if ((msec->flags & SEC_HAS_CONTENTS) != 0
|
||||
+ && startswith (msec->name, GNU_LINKONCE_INFO))
|
||||
return msec;
|
||||
|
||||
return NULL;
|
||||
@@ -4848,6 +4851,9 @@ find_debug_info (bfd *abfd, const struct dwarf_debug_section *debug_sections,
|
||||
|
||||
for (msec = after_sec->next; msec != NULL; msec = msec->next)
|
||||
{
|
||||
+ if ((msec->flags & SEC_HAS_CONTENTS) == 0)
|
||||
+ continue;
|
||||
+
|
||||
look = debug_sections[debug_info].uncompressed_name;
|
||||
if (strcmp (msec->name, look) == 0)
|
||||
return msec;
|
||||
48
meta/recipes-devtools/binutils/binutils/CVE-2022-48063.patch
Normal file
48
meta/recipes-devtools/binutils/binutils/CVE-2022-48063.patch
Normal file
@@ -0,0 +1,48 @@
|
||||
From 75393a2d54bcc40053e5262a3de9d70c5ebfbbfd Mon Sep 17 00:00:00 2001
|
||||
From: Nick Clifton <nickc@redhat.com>
|
||||
Date: Wed, 21 Dec 2022 11:51:23 +0000
|
||||
Subject: [PATCH] Fix an attempt to allocate an unreasonably large amount of
|
||||
memory when parsing a corrupt ELF file.
|
||||
|
||||
PR 29924
|
||||
* objdump.c (load_specific_debug_section): Check for excessively
|
||||
large sections.
|
||||
|
||||
Upstream-Status: Backport
|
||||
CVE: CVE-2022-48063
|
||||
Signed-off-by: Armin Kuster <akuster@mvista.com>
|
||||
|
||||
---
|
||||
binutils/ChangeLog | 6 ++++++
|
||||
binutils/objdump.c | 4 +++-
|
||||
2 files changed, 9 insertions(+), 1 deletion(-)
|
||||
|
||||
Index: git/binutils/objdump.c
|
||||
===================================================================
|
||||
--- git.orig/binutils/objdump.c
|
||||
+++ git/binutils/objdump.c
|
||||
@@ -3768,7 +3768,9 @@ load_specific_debug_section (enum dwarf_
|
||||
section->size = bfd_section_size (sec);
|
||||
/* PR 24360: On 32-bit hosts sizeof (size_t) < sizeof (bfd_size_type). */
|
||||
alloced = amt = section->size + 1;
|
||||
- if (alloced != amt || alloced == 0)
|
||||
+ if (alloced != amt
|
||||
+ || alloced == 0
|
||||
+ || (bfd_get_size (abfd) != 0 && alloced >= bfd_get_size (abfd)))
|
||||
{
|
||||
section->start = NULL;
|
||||
free_debug_section (debug);
|
||||
Index: git/binutils/ChangeLog
|
||||
===================================================================
|
||||
--- git.orig/binutils/ChangeLog
|
||||
+++ git/binutils/ChangeLog
|
||||
@@ -1,3 +1,9 @@
|
||||
+2022-12-21 Nick Clifton <nickc@redhat.com>
|
||||
+
|
||||
+ PR 29924
|
||||
+ * objdump.c (load_specific_debug_section): Check for excessively
|
||||
+ large sections.
|
||||
+
|
||||
2022-03-23 Nick Clifton <nickc@redhat.com>
|
||||
|
||||
Import patch from mainline:
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user