FAILED: patch "[PATCH] dm vdo indexer: prevent delta list overflow on load" failed to apply to 5.15-stable tree
Subsystems (2)
Sasha Levin
maintainerThe patch below does not apply to the 5.15-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.15.y
git checkout FETCH_HEAD
git cherry-pick -x 936293c9f3f4f2a0d1b80df9332e96c552ac3b37
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '[email protected]' --subject-prefix 'PATCH 5.15.y' 'HEAD^..'
Thanks,
Sasha
------------------ original commit in Linus's tree ------------------
From 936293c9f3f4f2a0d1b80df9332e96c552ac3b37 Mon Sep 17 00:00:00 2001
From: Matthew Sakai <[email protected]>
Date: Tue, 11 Aug 2026 15:02:33 -0400
Subject: [PATCH] dm vdo indexer: prevent delta list overflow on load
Check for corrupted delta lists sizes that overflow the memory available for the delta_lists. An overflow can cause the delta list data to be written outside the reserved delta memory space.
--- drivers/md/dm-vdo/indexer/delta-index.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-)
drivers/md/dm-vdo/indexer/delta-index.c +14 -3
@@ -800,7 +800,7 @@ static void compute_new_list_offsets(struct delta_zone *delta_zone, u32 growing_ (delta_zone->size *BITS_PER_BYTE - delta_lists[tail_guard_index].size); } -static void rebalance_lists (struct delta_zone *delta_zone) +static int rebalance_lists (struct delta_zone *delta_zone) {struct delta_list *delta_lists;u32 i;
@@ -811,9 +811,17 @@ static void rebalance_lists(struct delta_zone *delta_zone)for (i =0 ; i <= delta_zone->list_count +1 ; i++) used_space +=get_delta_list_byte_size (&delta_lists[i]); +if (delta_zone->size < used_space) { +return vdo_log_warning_strerror (UDS_CORRUPT_DATA , +"delta zone lists overflow zone size %zu" , + delta_zone->size); + } +compute_new_list_offsets (delta_zone,0 ,0 , used_space);for (i =1 ; i <= delta_zone->list_count +1 ; i++) delta_lists[i].start = delta_zone->new_offsets[i]; + +return UDS_SUCCESS ; }/* Start restoring a delta index from multiple input streams. */
@@ -941,8 +949,11 @@ int uds_start_restoring_delta_index(struct delta_index *delta_index, }/* Prepare each zone to start receiving the delta list data. */ -for (z =0 ; z < delta_index->zone_count; z++) -rebalance_lists (&delta_index->delta_zones[z]); +for (z =0 ; z < delta_index->zone_count; z++) { + result =rebalance_lists (&delta_index->delta_zones[z]); +if (result !=UDS_SUCCESS ) +return result; + }return UDS_SUCCESS ; }
Signature · 1 line
2.53.0