git: 945500c6ddc5 - releng/15.0 - exec: Check for errors when mapping the shared object
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 22 Oct 2025 20:15:23 UTC
The branch releng/15.0 has been updated by cperciva:
URL: https://cgit.FreeBSD.org/src/commit/?id=945500c6ddc5f670c76e9fe390d8919c897fa8de
commit 945500c6ddc5f670c76e9fe390d8919c897fa8de
Author: Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2025-10-14 13:33:33 +0000
Commit: Colin Percival <cperciva@FreeBSD.org>
CommitDate: 2025-10-22 20:12:18 +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.
Approved by: re (cperciva)
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
(cherry picked from commit 7117c86fcb7ebee4483097cefa9b143de8d78ee0)
(cherry picked from commit 6a5f0dc705c4401454d4fcd61e7301b992bfea13)
---
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 0fc2d0e7f1bc..b2c09b47f103 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,