The branch stable/12 has been updated by kib:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=f40b0295b5c6ef73f1560459b44f39d46ad67e00

commit f40b0295b5c6ef73f1560459b44f39d46ad67e00
Author:     Konstantin Belousov <[email protected]>
AuthorDate: 2021-07-14 23:40:04 +0000
Commit:     Konstantin Belousov <[email protected]>
CommitDate: 2021-07-18 00:30:31 +0000

    procctl(PROC_ASLR_STATUS): fix vmspace leak
    
    (cherry picked from commit 0bdb2cbf9d7c4366a0668b4563c8630538a50086)
---
 sys/kern/kern_procctl.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/sys/kern/kern_procctl.c b/sys/kern/kern_procctl.c
index 6e841b0fcaaa..c87f2bd060ca 100644
--- a/sys/kern/kern_procctl.c
+++ b/sys/kern/kern_procctl.c
@@ -463,8 +463,9 @@ aslr_status(struct thread *td, struct proc *p, int *data)
                _PHOLD(p);
                PROC_UNLOCK(p);
                vm = vmspace_acquire_ref(p);
-               if (vm != NULL && (vm->vm_map.flags & MAP_ASLR) != 0) {
-                       d |= PROC_ASLR_ACTIVE;
+               if (vm != NULL) {
+                       if ((vm->vm_map.flags & MAP_ASLR) != 0)
+                               d |= PROC_ASLR_ACTIVE;
                        vmspace_free(vm);
                }
                PROC_LOCK(p);
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to