u-boot.git
5 months ago[PATCH] fs/squashfs: Use kcalloc when relevant
Miquel Raynal [Mon, 27 Jun 2022 10:20:03 +0000 (12:20 +0200)]
[PATCH] fs/squashfs: Use kcalloc when relevant

A crafted squashfs image could embed a huge number of empty metadata
blocks in order to make the amount of malloc()'d memory overflow and be
much smaller than expected. Because of this flaw, any random code
positioned at the right location in the squashfs image could be memcpy'd
from the squashfs structures into U-Boot code location while trying to
access the rearmost blocks, before being executed.

In order to prevent this vulnerability from being exploited in eg. a
secure boot environment, let's add a check over the amount of data
that is going to be allocated. Such a check could look like:

if (!elem_size || n > SIZE_MAX / elem_size)
        return NULL;

The right way to do it would be to enhance the calloc() implementation
but this is quite an impacting change for such a small fix. Another
solution would be to add the check before the malloc call in the
squashfs implementation, but this does not look right. So for now, let's
use the kcalloc() compatibility function from Linux, which has this
check.

Fixes: c5100613037 ("fs/squashfs: new filesystem")
Reported-by: Tatsuhiko Yasumatsu <Tatsuhiko.Yasumatsu@sony.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Tested-by: Tatsuhiko Yasumatsu <Tatsuhiko.Yasumatsu@sony.com>
Reviewed-By: Daniel Leidert <dleidert@debian.org>
Origin: https://github.com/u-boot/u-boot/commit/b6f4c757959f8850e1299a77c8e5713da78e8ec0
Bug: https://lists.denx.de/pipermail/u-boot/2022-June/487467.html
Bug-Debian-Security: https://security-tracker.debian.org/tracker/CVE-2022-33967
Bug-Freexian-Security: https://deb.freexian.com/extended-lts/tracker/CVE-2022-33967

Gbp-Pq: Name CVE-2022-33967.patch

5 months ago[PATCH] i2c: fix stack buffer overflow vulnerability in i2c md command
Nicolas Iooss [Fri, 10 Jun 2022 14:50:25 +0000 (14:50 +0000)]
[PATCH] i2c: fix stack buffer overflow vulnerability in i2c md command

When running "i2c md 0 0 80000100", the function do_i2c_md parses the
length into an unsigned int variable named length. The value is then
moved to a signed variable:

    int nbytes = length;
    #define DISP_LINE_LEN 16
    int linebytes = (nbytes > DISP_LINE_LEN) ? DISP_LINE_LEN : nbytes;
    ret = dm_i2c_read(dev, addr, linebuf, linebytes);

On systems where integers are 32 bits wide, 0x80000100 is a negative
value to "nbytes > DISP_LINE_LEN" is false and linebytes gets assigned
0x80000100 instead of 16.

The consequence is that the function which reads from the i2c device
(dm_i2c_read or i2c_read) is called with a 16-byte stack buffer to fill
but with a size parameter which is too large. In some cases, this could
trigger a crash. But with some i2c drivers, such as drivers/i2c/nx_i2c.c
(used with "nexell,s5pxx18-i2c" bus), the size is actually truncated to
a 16-bit integer. This is because function i2c_transfer expects an
unsigned short length. In such a case, an attacker who can control the
response of an i2c device can overwrite the return address of a function
and execute arbitrary code through Return-Oriented Programming.

Fix this issue by using unsigned integers types in do_i2c_md. While at
it, make also alen unsigned, as signed sizes can cause vulnerabilities
when people forgot to check that they can be negative.

Signed-off-by: Nicolas Iooss <nicolas.iooss+uboot@ledger.fr>
Reviewed-by: Heiko Schocher <hs@denx.de>
Reviewed-By: Daniel Leidert <dleidert@debian.org>
Origin: https://source.denx.de/u-boot/u-boot/-/commit/8f8c04bf1ebbd2f72f1643e7ad9617dafa6e5409
Bug: https://lists.denx.de/pipermail/u-boot/2022-June/486113.html
Bug-Debian: https://bugs.debian.org/1014529
Bug-Debian-Security: https://security-tracker.debian.org/tracker/CVE-2022-34835
Bug-Freexian-Security: https://deb.freexian.com/extended-lts/tracker/CVE-2022-34835

Gbp-Pq: Name CVE-2022-34835.patch

5 months ago[PATCH] efi_loader: switch to non-secure mode later
Heinrich Schuchardt [Sun, 24 Jan 2021 14:34:12 +0000 (14:34 +0000)]
[PATCH] efi_loader: switch to non-secure mode later

Some ARMv7 boards using PSCI require to be in secure-mode when booted via
'bootz' or 'bootm'. During distro-boot 'bootefi bootmgr' is called to check
if booting via UEFI is possible.

With the change we change the switch from secure mode to non-secure mode is
moved from the UEFI subsystem setup to just before calling StartImage().

Cc: Jernej Škrabec <jernej.skrabec@gmail.com>
Reported by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Gbp-Pq: Topic upstream
Gbp-Pq: Name 0001-efi_loader-switch-to-non-secure-mode-later.patch

5 months ago[PATCH] configs: add PineTab defconfig
Arnaud Ferraris [Wed, 2 Sep 2020 07:53:50 +0000 (09:53 +0200)]
[PATCH] configs: add PineTab defconfig

From 2c346cacb4b0841051bceb27a57058020860ab8b Mon Sep 17 00:00:00 2001
Forwarded: https://patchwork.ozlabs.org/project/uboot/list/?series=232582

The PineTab device-tree is already in u-boot, this commit adds the corresponding
defconfig, based on pinephone_defconfig.

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
Gbp-Pq: Topic pinetab
Gbp-Pq: Name 0001-configs-add-PineTab-defconfig.patch

5 months agodisable-preboot
Vagrant Cascadian [Sun, 29 Jun 2025 00:33:57 +0000 (02:33 +0200)]
disable-preboot

Disable USE_PREBOOT as a workaround to boot failure triggered by
initializing USB. (Closes: #973323, #980434)

Reported upstream:

  https://lists.denx.de/pipermail/u-boot/2021-January/438098.html

Gbp-Pq: Topic rk3399
Gbp-Pq: Name disable-preboot

5 months agobootz_and_raw_initrd
Vagrant Cascadian [Sun, 29 Jun 2025 00:33:57 +0000 (02:33 +0200)]
bootz_and_raw_initrd

Enable booting of zImage/vmlinuz and initrd without requiring the use
of mkimage to create uImage/uInitrd.

Gbp-Pq: Topic n900
Gbp-Pq: Name bootz_and_raw_initrd.patch

5 months ago[PATCH] qemu-riscv64_smode, sifive-fu540: fix extlinux (define preboot)
David Abdurachmanov [Wed, 21 Aug 2019 19:07:20 +0000 (12:07 -0700)]
[PATCH] qemu-riscv64_smode, sifive-fu540: fix extlinux (define preboot)

From 3fc056f0b9f7c26e58a1e947c8c0184e55919614 Mon Sep 17 00:00:00 2001
Forwarded: https://patchwork.ozlabs.org/patch/1151125/

Commit 37304aaf60bf92a5dc3ef222ba520698bd862a44 removed preboot
commands in RISC-V targets and broke extlinux support as reported
by Fu Wei <wefu@redhat.com>.

The patch finishes migration of CONFIG_USE_PREBOOT and CONFIG_REBOOT
to Kconfig.

Signed-off-by: David Abdurachmanov <david.abdurachmanov@sifive.com>
Gbp-Pq: Topic riscv64
Gbp-Pq: Name qemu-riscv64_smode-sifive-fu540-fix-extlinux-define-.patch

5 months ago[PATCH] arm: config: fix default console only to specify the device
Dongjin Kim [Sat, 28 Oct 2017 04:22:27 +0000 (00:22 -0400)]
[PATCH] arm: config: fix default console only to specify the device

This reverts commit 767edf0f6b3eaa0303f3fd6afdc14ddce0aca70c and restores
commit 232ed3ca534708527a9515c7c41bc3542949525c.

Debian's flash-kernel expect the console variable to just contain the device,
because it will set the bootargs to "console=${console}". So revert adding
"console=" to the console parameter, but also adjust the shipped bootscripts
for exynos boards to cope with it.

Bug-Debian: https://bugs.debian.org/920116
Signed-off-by: Benjamin Drung <bdrung@debian.org>
Gbp-Pq: Topic exynos
Gbp-Pq: Name 0001-arm-config-fix-default-console-only-to-specify-the-d.patch

5 months agotest-imagetools-test-fixes
Vagrant Cascadian [Sun, 29 Jun 2025 00:33:57 +0000 (02:33 +0200)]
test-imagetools-test-fixes

This patch allows testing in an alternate directory and also detects
failures to execute commands, treating that as a failure.

Gbp-Pq: Name test-imagetools-test-fixes

5 months agoomap5_distro_bootcmd
Vagrant Cascadian [Sun, 29 Jun 2025 00:33:57 +0000 (02:33 +0200)]
omap5_distro_bootcmd

Enable distro_bootcmd support (doc/README.distro) for omap5 targets.

Gbp-Pq: Topic am57xx
Gbp-Pq: Name omap5_distro_bootcmd

5 months agoensure-config-sandbox-for-make-env
Vagrant Cascadian [Sun, 29 Jun 2025 00:33:57 +0000 (02:33 +0200)]
ensure-config-sandbox-for-make-env

Ensure that CONFIG_SANDBOX is set when running "make env", avoiding a
failure to build caused by config_distro_bootcmd.h following the wrong
codepath...

Gbp-Pq: Name ensure-config-sandbox-for-make-env.patch

5 months agoAdd spl/arndale-spl.bin rule
Ian Campbell [Sun, 29 Jun 2025 00:33:57 +0000 (02:33 +0200)]
Add spl/arndale-spl.bin rule

Gbp-Pq: Topic arndale
Gbp-Pq: Name board-spl-rule.diff

5 months agomx53loco
Vagrant Cascadian [Sun, 29 Jun 2025 00:33:57 +0000 (02:33 +0200)]
mx53loco

Enables support for ext4, the "load" command, and using bootz with raw initrds.

Gbp-Pq: Name mx53loco

5 months agoEnable generic tools build
Hector Oron [Sun, 29 Jun 2025 00:33:57 +0000 (02:33 +0200)]
Enable generic tools build

Gbp-Pq: Name tools-generic-builds.patch

5 months agoadd-debian-revision-to-u-boot-version
Vagrant Cascadian [Sun, 29 Jun 2025 00:33:57 +0000 (02:33 +0200)]
add-debian-revision-to-u-boot-version

Add the debian revision to the U-boot version, which is displayed at
boot and can be helpful to determine which specific version is used.

Gbp-Pq: Name add-debian-revision-to-u-boot-version

5 months agou-boot (2021.01+dfsg-5+deb11u2) bullseye-security; urgency=medium
Daniel Leidert [Sun, 29 Jun 2025 00:33:57 +0000 (02:33 +0200)]
u-boot (2021.01+dfsg-5+deb11u2) bullseye-security; urgency=medium

  * Non-maintainer upload by the Debian LTS team.
  * d/patches/CVE-2021-27097-1.patch, d/patches/CVE-2021-27097-2.patch,
    d/patches/CVE-2021-27097-3.patch, d/patches/CVE-2021-27097-4.patch: Add
    patches to fix CVE-2021-27097.
    - Fix mishandling of a modified FIT (closes: #983270).
  * d/patches/CVE-2021-27138-1.patch, d/patches/CVE-2021-27138-2.patch: Add
    patches to fix CVE-2021-27138.
    - Fix mishandled use of unit addresses in a FIT (closes: #983269).

[dgit import unpatched u-boot 2021.01+dfsg-5+deb11u2]

5 months agoImport u-boot_2021.01+dfsg-5+deb11u2.debian.tar.xz
Daniel Leidert [Sun, 29 Jun 2025 00:33:57 +0000 (02:33 +0200)]
Import u-boot_2021.01+dfsg-5+deb11u2.debian.tar.xz

[dgit import tarball u-boot 2021.01+dfsg-5+deb11u2 u-boot_2021.01+dfsg-5+deb11u2.debian.tar.xz]

4 years agoImport u-boot_2021.01+dfsg.orig.tar.xz
Vagrant Cascadian [Sun, 17 Jan 2021 03:50:13 +0000 (19:50 -0800)]
Import u-boot_2021.01+dfsg.orig.tar.xz

[dgit import orig u-boot_2021.01+dfsg.orig.tar.xz]