Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 15 Jul 2021 00:03:12 GMT
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 0bdb2cbf9d7c - main - procctl(PROC_ASLR_STATUS): fix vmspace leak
Message-ID:  <202107150003.16F03CFl039139@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by kib:

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

commit 0bdb2cbf9d7c4366a0668b4563c8630538a50086
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2021-07-14 23:40:04 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2021-07-15 00:02:50 +0000

    procctl(PROC_ASLR_STATUS): fix vmspace leak
    
    Reported by:    jhb
    Sponsored by:   The FreeBSD Foundation
    MFC after:      3 days
---
 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 4eb226c6b1b3..68fa4bc0c3ac 100644
--- a/sys/kern/kern_procctl.c
+++ b/sys/kern/kern_procctl.c
@@ -530,8 +530,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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202107150003.16F03CFl039139>