linux-yocto/include
Lukas Wunner f02f0218be crypto: ecdsa - Harden against integer overflows in DIV_ROUND_UP()
commit b16510a530 upstream.

Herbert notes that DIV_ROUND_UP() may overflow unnecessarily if an ecdsa
implementation's ->key_size() callback returns an unusually large value.
Herbert instead suggests (for a division by 8):

  X / 8 + !!(X & 7)

Based on this formula, introduce a generic DIV_ROUND_UP_POW2() macro and
use it in lieu of DIV_ROUND_UP() for ->key_size() return values.

Additionally, use the macro in ecc_digits_from_bytes(), whose "nbytes"
parameter is a ->key_size() return value in some instances, or a
user-specified ASN.1 length in the case of ecdsa_get_signature_rs().

Link: https://lore.kernel.org/r/Z3iElsILmoSu6FuC@gondor.apana.org.au/
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-07-17 18:35:22 +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: ahash - Set default reqsize from ahash_alg 2025-06-04 14:42:06 +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
kunit
kvm
linux crypto: ecdsa - Harden against integer overflows in DIV_ROUND_UP() 2025-07-17 18:35:22 +02:00
math-emu
media media: v4l: Memset argument to 0 before calling get_mbus_config pad op 2025-06-04 14:42:09 +02:00
memory
misc
net netfilter: flowtable: account for Ethernet header in nf_flow_pppoe_proto() 2025-07-17 18:35:19 +02:00
pcmcia
ras
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
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 f2fs: add tracepoint for f2fs_vm_page_mkwrite() 2025-07-10 16:03:13 +02:00
uapi vsock/uapi: fix linux/vm_sockets.h userspace compilation errors 2025-07-06 11:00:12 +02:00
ufs scsi: ufs: core: Add OPP support for scaling clocks and regulators 2025-07-10 16:03:14 +02:00
vdso
video
xen xen/mcelog: Add __nonstring annotations for unterminated strings 2025-04-25 10:45:11 +02:00