git: 73117931984a - main - sysvsem: Plug another place where we leak __sem_base to userspace
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 11 Nov 2026 16:49:51 UTC
The branch main has been updated by markj:
URL: https://cgit.FreeBSD.org/src/commit/?id=73117931984add2f1e9a763de11be847ad872658
commit 73117931984add2f1e9a763de11be847ad872658
Author: Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2026-11-11 14:14:01 +0000
Commit: Mark Johnston <markj@FreeBSD.org>
CommitDate: 2026-11-11 16:49:42 +0000
sysvsem: Plug another place where we leak __sem_base to userspace
Leaking this pointer isn't harmful, but other places take care to clear
it, so handle this in SEM_STAT too.
Reviewed by: imp, kib
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D61396
---
sys/kern/sysv_sem.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sys/kern/sysv_sem.c b/sys/kern/sysv_sem.c
index 1f37cd8781d7..375dd54edae4 100644
--- a/sys/kern/sysv_sem.c
+++ b/sys/kern/sysv_sem.c
@@ -746,6 +746,8 @@ kern_semctl(struct thread *td, int semid, int semnum, int cmd,
arg->buf->sem_perm.key = IPC_PRIVATE;
*rval = IXSEQ_TO_IPCID(semid, semakptr->u.sem_perm);
mtx_unlock(sema_mtxp);
+
+ arg->buf->__sem_base = NULL;
return (0);
}