Commit 90e2ea6d authored by Paul Meyer's avatar Paul Meyer Committed by Greg Kroah-Hartman
Browse files

hv: kvp: Avoid reading past allocated blocks from KVP file



commit 297d6b6e upstream.

While reading in more than one block (50) of KVP records, the allocation
goes per block, but the reads used the total number of allocated records
(without resetting the pointer/stream). This causes the records buffer to
overrun when the refresh reads more than one block over the previous
capacity (e.g. reading more than 100 KVP records whereas the in-memory
database was empty before).

Fix this by reading the correct number of KVP records from file each time.

Signed-off-by: default avatarPaul Meyer <Paul.Meyer@microsoft.com>
Signed-off-by: default avatarLong Li <longli@microsoft.com>
Signed-off-by: default avatarK. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 94739ddf
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment