linux/include
Xin Long 0528485f27 sctp: fix auth_hmacs array size in struct sctp_cookie
[ Upstream commit e0b5252a59 ]

The auth_hmacs array in struct sctp_cookie is supposed to store a complete
SCTP_AUTH_HMAC_ALGO parameter, which consists of a struct sctp_paramhdr
followed by N HMAC identifiers.

However, the array size was calculated using an extra 2 bytes instead of
sizeof(struct sctp_paramhdr), which is 4 bytes. When four HMAC identifiers
are configured, the HMAC-ALGO parameter stored in the endpoint is larger
than the auth_hmacs buffer in the cookie.

As a result, sctp_association_init() copies beyond the end of auth_hmacs
when initializing the association, corrupting the adjacent auth_chunks
field. This can lead to an invalid HMAC identifier being accepted and later
cause an out-of-bounds read in sctp_auth_get_hmac().

Fix the array size calculation by including the full SCTP parameter header
size.

Fixes: 1f485649f5 ("[SCTP]: Implement SCTP-AUTH internals")
Reported-by: Yuan Tan <yuantan098@gmail.com>
Reported-by: Xin Liu <dstsmallbird@foxmail.com>
Reported-by: Zihan Xi <xizh2024@lzu.edu.cn>
Reported-by: Ren Wei <enjou1224z@gmail.com>
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Link: https://patch.msgid.link/634a0de0d5de29532915e6d47c92a0cbc206e03f.1783707155.git.lucien.xin@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2026-08-19 17:13:54 +02:00
..
acpi ACPICA: Allow address_space_handler Install and _REG execution as 2 separate steps 2026-04-18 10:33:26 +02:00
asm-generic mm/hugetlb: fix excessive IPI broadcasts when unsharing PMD tables using mmu_gather 2026-04-18 10:33:18 +02:00
clocksource x86/hyperv: Fix hv tsc page based sched_clock for hibernation 2025-01-09 13:28:42 +01:00
crypto crypto: drbg - Fix drbg_max_addtl() on 64-bit kernels 2026-07-24 15:51:25 +02:00
drm drm/dp: Add eDP 1.5 bit definition 2026-06-19 13:33:25 +02:00
dt-bindings dt-bindings: clock: qcom,dispcc-sc7180: Define MDSS resets 2026-06-01 17:35:37 +02:00
keys keys: Pin request_key_auth payload in instantiate paths 2026-07-04 13:39:39 +02:00
kunit kunit: fix kernel-doc warnings due to mismatched arg names 2021-10-06 17:54:07 -06:00
kvm KVM: arm64: vgic-v4: Make the doorbell request robust w.r.t preemption 2024-07-05 09:14:51 +02:00
linux powerpc/time: Prepare to stop elapsing in dynticks-idle 2026-08-19 17:13:54 +02:00
math-emu math-emu: Fix fall-through warning 2021-07-13 13:57:44 -05:00
media media: dvb-core: dmxdevfilter must always flush bufs 2026-03-04 07:20:01 -05:00
memory memory: renesas-rpc-if: Fix HF/OSPI data transfer in Manual Mode 2022-05-09 09:14:34 +02:00
misc ocxl: Update the Process Element Entry 2020-12-04 01:01:30 +11:00
net sctp: fix auth_hmacs array size in struct sctp_cookie 2026-08-19 17:13:54 +02:00
pcmcia pcmcia: Replace zero-length array with flexible-array 2020-05-18 10:28:31 +02:00
ras Revert "mm/memory-failure.c: fix race with changing page compound again" 2022-07-12 16:35:17 +02:00
rdma RDMA: Move DMA block iterator logic into dedicated files 2026-06-19 13:33:49 +02:00
scsi scsi: libsas: Add sas_task_find_rq() 2025-10-19 16:21:40 +02:00
soc soc: qcom: rpmh-rsc: Enhance check for VRM in-flight request 2024-06-16 13:39:55 +02:00
sound ALSA: seq: Add UMP support 2026-07-24 15:51:33 +02:00
target scsi: target: Fix multiple LUN_RESET handling 2023-05-11 23:00:26 +09:00
trace btrfs: tracepoints: fix sleep while in atomic context in btrfs_sync_file() 2026-06-01 17:35:43 +02:00
uapi ALSA: seq: Add UMP support 2026-07-24 15:51:33 +02:00
vdso time64.h: Consolidated PSEC_PER_SEC definition 2021-04-06 16:32:17 -07:00
video fbdev: udlfb: add vm_ops to dlfb_ops_mmap to prevent use-after-free 2026-06-01 17:35:19 +02:00
xen xen: replace xen_remap() with memremap() 2025-07-17 18:30:48 +02:00