git: 7117c86fcb7e - main - exec: Check for errors when mapping the shared object
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 14 Oct 2025 13:51:26 UTC
The branch main has been updated by markj:
URL: https://cgit.FreeBSD.org/src/commit/?id=7117c86fcb7ebee4483097cefa9b143de8d78ee0
commit 7117c86fcb7ebee4483097cefa9b143de8d78ee0
Author: Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2025-10-14 13:33:33 +0000
Commit: Mark Johnston <markj@FreeBSD.org>
CommitDate: 2025-10-14 13:41:20 +0000
exec: Check for errors when mapping the shared object
In the non-ASLR case, there is no check for an error from
vm_map_fixed(). Restore it, it was dropped in commit 939f0b6323e0a.
This bug could result in a refcount leak of the object used to map the
VDSO page.
Reviewed by: kib
Reported by: Ilja Van Sprundel <ivansprundel@ioactive.com>
MFC after: 1 week
Fixes: 939f0b6323e0 ("Implement shared page address randomization")
Differential Revision: https://reviews.freebsd.org/D53065
---
sys/kern/kern_exec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c
index 70a9a419a674..2bdd6faa025a 100644
--- a/sys/kern/kern_exec.c
+++ b/sys/kern/kern_exec.c
@@ -1314,7 +1314,7 @@ exec_map_stack(struct image_params *imgp)
MAP_INHERIT_SHARE | MAP_ACC_NO_CHARGE);
} else {
sharedpage_addr = sv->sv_shared_page_base;
- vm_map_fixed(map, obj, 0,
+ error = vm_map_fixed(map, obj, 0,
sharedpage_addr, sv->sv_shared_page_len,
VM_PROT_READ | VM_PROT_EXECUTE,
VM_PROT_READ | VM_PROT_EXECUTE,