linux/drivers/md/persistent-data
Bryam Vargas 4538a287bd dm array: reject an array block whose value size is not the caller's
array_block_check() can only compare the header against itself, so a block
with value_size 4 and max_entries 1018 is internally consistent and passes.
dm-cache keeps two arrays -- mappings at 8 bytes and hints at 4 -- and the
roots for both live in the superblock. Point the mappings root at a hint
block and __load_mappings() walks it through an info whose value size is 8,
so element_at() strides 8 bytes over 4-byte entries and reaches offset 8160
of a 4096-byte block.

get_ablock() and __shadow_ablock() are the two places that hold the block
and the caller at once. Reject there when the two value sizes disagree.
Arrays only ever read their own blocks, so this fires on crafted metadata
only.

Fixes: 6513c29f44 ("dm persistent data: add transactional array")
Suggested-by: Ming-Hung Tsai <mtsai@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: Bryam Vargas <hexlabsecurity@proton.me>
Reviewed-by: Ming-Hung Tsai <mtsai@redhat.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
2026-08-04 10:19:29 +02:00
..
dm-array.c dm array: reject an array block whose value size is not the caller's 2026-08-04 10:19:29 +02:00
dm-array.h dm: change "unsigned" to "unsigned int" 2023-02-14 14:23:06 -05:00
dm-bitset.c dm: add missing empty lines 2023-02-14 14:23:06 -05:00
dm-bitset.h dm: add missing SPDX-License-Indentifiers 2023-02-14 14:23:06 -05:00
dm-block-manager.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
dm-block-manager.h dm: Constify struct dm_block_validator 2024-07-19 12:08:15 +02:00
dm-btree-internal.h dm: Constify struct dm_block_validator 2024-07-19 12:08:15 +02:00
dm-btree-remove.c dm-thin: fix metadata refcount underflow 2026-04-20 19:56:44 +02:00
dm-btree-spine.c dm: Constify struct dm_block_validator 2024-07-19 12:08:15 +02:00
dm-btree.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
dm-btree.h dm: add missing blank line after declarations/fix those 2023-02-14 14:23:07 -05:00
dm-persistent-data-internal.h dm: change "unsigned" to "unsigned int" 2023-02-14 14:23:06 -05:00
dm-space-map-common.c dm: Fix typo in error message 2024-11-20 11:38:04 +01:00
dm-space-map-common.h dm: favour __packed versus "__attribute__ ((packed))" 2023-02-14 14:23:07 -05:00
dm-space-map-disk.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
dm-space-map-disk.h dm: add missing SPDX-License-Indentifiers 2023-02-14 14:23:06 -05:00
dm-space-map-metadata.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
dm-space-map-metadata.h dm: add missing SPDX-License-Indentifiers 2023-02-14 14:23:06 -05:00
dm-space-map.h dm thin metadata: Fix ABBA deadlock by resetting dm_bufio_client 2023-06-16 18:24:13 -04:00
dm-transaction-manager.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
dm-transaction-manager.h dm: Constify struct dm_block_validator 2024-07-19 12:08:15 +02:00
Kconfig lib/crc: remove CONFIG_LIBCRC32C 2025-04-04 11:31:42 -07:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00