CVE-2023-52685
Assigner: Linux
Published: 2024-05-17T14:24:47.322Z
State: PUBLISHED
descriptions: value: In the Linux kernel, the following vulnerability has been resolved:

pstore: ram_core: fix possible overflow in persistent_ram_init_ecc()

In persistent_ram_init_ecc(), on 64-bit arches DIV_ROUND_UP() will return
64-bit value since persistent_ram_zone::buffer_size has type size_t which
is derived from the 64-bit *unsigned long*, while the ecc_blocks variable
this value gets assigned to has (always 32-bit) *int* type.  Even if that
value fits into *int* type, an overflow is still possible when calculating
the size_t typed ecc_total variable further below since there's no cast to
any 64-bit type before multiplication.  Declaring the ecc_blocks variable
as *size_t* should fix this mess...

Found by Linux Verification Center (linuxtesting.org) with the SVACE static
analysis tool.
affected: product: Linux
vendor: Linux
defaultStatus: unaffected
repo: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
versions: version: 9cc05ad97c57
lessThan: 3b333cded94f
status: affected
versionType: git
version: 9cc05ad97c57
lessThan: d1fe1aede684
status: affected
versionType: git
version: 9cc05ad97c57
lessThan: acd413da3e1f
status: affected
versionType: git
version: 9cc05ad97c57
lessThan: 8fb12524c86b
status: affected
versionType: git
version: 9cc05ad97c57
lessThan: 48dcfc42ce70
status: affected
versionType: git
version: 9cc05ad97c57
lessThan: a34946ec3de8
status: affected
versionType: git
version: 9cc05ad97c57
lessThan: f9b891a7e8fc
status: affected
versionType: git
version: 9cc05ad97c57
lessThan: 86222a8fc16e
status: affected
versionType: git
product: Linux
vendor: Linux
defaultStatus: affected
repo: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
versions: version: 3.4
status: affected
version: 0
lessThan: 3.4
status: unaffected
versionType: custom
version: 4.19.306
lessThanOrEqual: 4.19.*
status: unaffected
versionType: custom
version: 5.4.268
lessThanOrEqual: 5.4.*
status: unaffected
versionType: custom
version: 5.10.209
lessThanOrEqual: 5.10.*
status: unaffected
versionType: custom
version: 5.15.148
lessThanOrEqual: 5.15.*
status: unaffected
versionType: custom
version: 6.1.75
lessThanOrEqual: 6.1.*
status: unaffected
versionType: custom
version: 6.6.14
lessThanOrEqual: 6.6.*
status: unaffected
versionType: custom
version: 6.7.2
lessThanOrEqual: 6.7.*
status: unaffected
versionType: custom
version: 6.8
lessThanOrEqual: *
status: unaffected
versionType: original_commit_for_fix
title: pstore: ram_core: fix possible overflow in persistent_ram_init_ecc()
x_generator: engine: bippy-d175d3acf727