FAILED: patch "[PATCH] dm vdo indexer: validate record page numbers better" failed to apply to 6.6-stable tree
Subsystems (2)
Sasha Levin
maintainerThe patch below does not apply to the 6.6-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-6.6.y
git checkout FETCH_HEAD
git cherry-pick -x e3683a76a313a81f3f7bc7f65e4fc1e61232838b
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '[email protected]' --subject-prefix 'PATCH 6.6.y' 'HEAD^..'
Thanks,
Sasha
------------------ original commit in Linus's tree ------------------
From e3683a76a313a81f3f7bc7f65e4fc1e61232838b Mon Sep 17 00:00:00 2001
From: Matthew Sakai <[email protected]>
Date: Tue, 11 Aug 2026 15:02:34 -0400
Subject: [PATCH] dm vdo indexer: validate record page numbers better
Move the record_page_number validation check into the chapter index lookup function in order to detect (and discard) corrupted values on all paths.
--- drivers/md/dm-vdo/indexer/chapter-index.c | 15 +++++++++++---- drivers/md/dm-vdo/indexer/volume.c | 6 ------ 2 files changed, 11 insertions(+), 10 deletions(-)
drivers/md/dm-vdo/indexer/chapter-index.c +11 -4
@@ -284,10 +284,17 @@ int uds_search_chapter_index_page(struct delta_index_page *index_page,if (result !=UDS_SUCCESS )return result; -if (was_entry_found (&entry, address)) - *record_page_ptr =uds_get_delta_entry_value (&entry); -else +if (!was_entry_found (&entry, address)) { *record_page_ptr =NO_CHAPTER_INDEX_ENTRY ; +return UDS_SUCCESS ; + } -return UDS_SUCCESS ; + *record_page_ptr =uds_get_delta_entry_value (&entry); + result =VDO_ASSERT (*record_page_ptr < geometry->record_pages_per_chapter, +"0 <= %d < %u" , *record_page_ptr, + geometry->record_pages_per_chapter); +if (result !=VDO_SUCCESS ) + *record_page_ptr =NO_CHAPTER_INDEX_ENTRY ; + +return result; }
drivers/md/dm-vdo/indexer/volume.c +0 -6
@@ -891,12 +891,6 @@ int uds_search_cached_record_page(struct volume *volume, struct uds_request *reqif (record_page_number ==NO_CHAPTER_INDEX_ENTRY )return UDS_SUCCESS ; - result =VDO_ASSERT (record_page_number < geometry->record_pages_per_chapter, -"0 <= %d < %u" , record_page_number, - geometry->record_pages_per_chapter); -if (result !=VDO_SUCCESS ) -return result; - page_number = geometry->index_pages_per_chapter + record_page_number; physical_page =map_to_physical_page (&volume->geometry, chapter, page_number);
Signature · 1 line
2.53.0