git: e4624465c16a - stable/13 - vm_page: Fix loading bad memory addresses from file
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 02 Aug 2025 05:32:01 UTC
The branch stable/13 has been updated by romain:
URL: https://cgit.FreeBSD.org/src/commit/?id=e4624465c16adb0e60a6b0edeb570dc103b40831
commit e4624465c16adb0e60a6b0edeb570dc103b40831
Author: Romain Tartière <romain@FreeBSD.org>
AuthorDate: 2025-07-25 18:31:57 +0000
Commit: Romain Tartière <romain@FreeBSD.org>
CommitDate: 2025-08-02 05:31:38 +0000
vm_page: Fix loading bad memory addresses from file
When loading bad memory addresses from a file, we are passed an end
pointer that points on the first byte after the buffer. We want the
buffer to be null-terminated (by changing the last byte to \0 if it is
reasonable to do so), so adjust the end pointer to be on that byte.
Approved by: kib, markj
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D51433
(cherry picked from commit 202f8bde836dc86627be2b5b98174d9a0fb2eaba)
---
sys/vm/vm_page.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c
index d21022930396..ed43a05f0e64 100644
--- a/sys/vm/vm_page.c
+++ b/sys/vm/vm_page.c
@@ -393,7 +393,7 @@ vm_page_blacklist_load(char **list, char **end)
}
*list = ptr;
if (ptr != NULL)
- *end = ptr + len;
+ *end = ptr + len - 1;
else
*end = NULL;
return;