linux-yocto/include
Breno Leitao 5d646a7632 crypto: sha256 - fix crash at kexec
Loading a large (~2.1G) files with kexec crashes the host with when
running:

  # kexec --load kernel --initrd initrd_with_2G_or_more

  UBSAN: signed-integer-overflow in ./include/crypto/sha256_base.h:64:19
  34152083 * 64 cannot be represented in type 'int'
  ...
  BUG: unable to handle page fault for address: ff9fffff83b624c0
  sha256_update (lib/crypto/sha256.c:137)
  crypto_sha256_update (crypto/sha256_generic.c:40)
  kexec_calculate_store_digests (kernel/kexec_file.c:769)
  __se_sys_kexec_file_load (kernel/kexec_file.c:397 kernel/kexec_file.c:332)
  ...

(Line numbers based on commit da274362a7 ("Linux 6.12.49")

This started happening after commit f4da7afe07
("kexec_file: increase maximum file size to 4G") that landed in v6.0,
which increased the file size for kexec.

This is not happening upstream (v6.16+), given that `block` type was
upgraded from "int" to "size_t" in commit 74a43a2cf5 ("crypto:
lib/sha256 - Move partial block handling out")

Upgrade the block type similar to the commit above, avoiding hitting the
overflow.

This patch is only suitable for the stable tree, and before 6.16, which
got commit 74a43a2cf5 ("crypto: lib/sha256 - Move partial block
handling out"). This is not required before f4da7afe07 ("kexec_file:
increase maximum file size to 4G"). In other words, this fix is required
between versions v6.0 and v6.16.

Signed-off-by: Breno Leitao <leitao@debian.org>
Fixes: f4da7afe07 ("kexec_file: increase maximum file size to 4G") # Before v6.16
Reported-by: Michael van der Westhuizen <rmikey@meta.com>
Reported-by: Tobias Fleig <tfleig@meta.com>
Reviewed-by: Eric Biggers <ebiggers@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-10-06 11:16:59 +02:00
..
acpi ACPICA: Avoid sequence overread in call to strncmp() 2025-06-27 11:08:52 +01:00
asm-generic mm: hugetlb: Add huge page size param to huge_ptep_get_and_clear() 2025-03-13 12:58:38 +01:00
clocksource x86/hyperv: Fix hv tsc page based sched_clock for hibernation 2025-01-10 14:31:36 +01:00
crypto crypto: sha256 - fix crash at kexec 2025-10-06 11:16:59 +02:00
drm drm/framebuffer: Acquire internal references on GEM handles 2025-07-17 18:35:14 +02:00
dt-bindings dt-bindings: clock: sunxi: Export PLL_VIDEO_2X and PLL_MIPI 2025-02-08 09:51:55 +01:00
keys integrity: PowerVM support for loading third party code signing keys 2023-08-17 20:12:35 +00:00
kunit
kvm KVM: arm64: Fix host-programmed guest events in nVHE 2024-04-10 16:35:48 +02:00
linux minmax.h: remove some #defines that are only expanded once 2025-10-02 13:42:56 +02:00
math-emu powerpc/math-emu: Remove -w build flag and fix warnings 2022-09-05 17:28:25 +10:00
media media: v4l: Memset argument to 0 before calling get_mbus_config pad op 2025-06-04 14:42:09 +02:00
memory memory: renesas-rpc-if: Remove Runtime PM wrappers 2023-01-23 11:48:00 +01:00
misc cxl: fix typo in comment 2022-11-24 23:12:19 +11:00
net Bluetooth: hci_event: Fix UAF in hci_acl_create_conn_sync 2025-10-02 13:42:51 +02:00
pcmcia ARM: pxa/sa1100: move I/O space to PCI_IOBASE 2022-05-07 22:56:17 +02:00
ras mm, hwpoison: enable memory error handling on 1GB hugepage 2022-08-08 18:06:44 -07:00
rdma RDMA/uverbs: Propagate errors from rdma_lookup_get_uobject() 2025-06-04 14:41:59 +02:00
rv rv: Reset per-task monitors also for idle tasks 2025-02-17 09:40:32 +01:00
scsi scsi: Remove scsi device no_start_on_resume flag 2024-10-17 15:24:11 +02:00
soc net: mscc: ocelot: treat 802.1ad tagged traffic as 802.1Q-untagged 2025-05-09 09:43:58 +02:00
sound ALSA: pcm: Fix race of buffer access at PCM OSS layer 2025-06-04 14:42:19 +02:00
target
trace btrfs: constify more pointer parameters 2025-08-28 16:28:41 +02:00
uapi mptcp: pm: nl: announce deny-join-id0 flag 2025-09-25 11:00:09 +02:00
ufs scsi: ufs: core: Add OPP support for scaling clocks and regulators 2025-07-10 16:03:14 +02:00
vdso
video fbdev: stifb: Make the STI next font pointer a 32-bit signed offset 2023-11-28 17:19:58 +00:00
xen xen/mcelog: Add __nonstring annotations for unterminated strings 2025-04-25 10:45:11 +02:00