Repository navigation
plugins/micron: clamp num_entries in vs-fw-activate-history to the table size - #4025
Merged
Merged
Conversation
num_entries in the fw activation history log page is device-supplied. Both printers used it as the loop bound (without even le32_to_cpu) against the fixed 20-entry table inside the 4096-byte page: a device reporting a count above 20 runs the loops past the array, printing or JSON-emitting bytes past the log buffer. Clamp the count to the array size right after the version/log-page check so both the plain and the JSON view see a bounded value, and apply little-endian conversion at the clamp point. Hostile-input ASan/UBSan harness: pre-fix loop reads past the 4096-byte allocation; post-fix walk completes and exits 0. Signed-off-by: Prabhakar Pujeri <prabhakar.pujeri@dell.com>
prabhakarpujeri
force-pushed
the
micron-fw-hist-clamp
branch
from
September 15, 2026 14:56
ebe2edf to
f2ecea1
Compare
Collaborator
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
num_entriesin the micron fw activation history log page is device-supplied.Both printers used it as the loop bound (without even
le32_to_cpu()) againstthe fixed
entries[20]table instruct micron_fw_activation_history_table,which lives inside the 4096-byte log page:
A device reporting a count above 20 runs both loops past the array, emitting
bytes past the log buffer into stdout or into the JSON envelope.
This is the exact same pattern as #3993 (seagate fw-activate-history entry-count
clamp) that igaw merged on 2026-09-08.
Fix
Clamp
table->num_entriestoARRAY_SIZE(table->entries)right after theexisting version/log-page validation, so both views see the bounded value. The
clamp also applies
le32_to_cpu/cpu_to_le32at that point.Testing
meson setup build-main && ninja -C build-main: clean.num_entries = 0xFFFFFFFF:heap-buffer-overflow— read of size 1 at 52 bytes past a4116-byte allocation;