git: 42e71f0bafc2 - stable/15 - procctl: Zero the output structure for the compat32 syscall

From: Mark Johnston <markj_at_FreeBSD.org>
Date: Thu, 26 Nov 2026 14:20:22 UTC
The branch stable/15 has been updated by markj:

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

commit 42e71f0bafc23c0707752381d0b25649d12ae8c4
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2026-11-13 19:44:59 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2026-11-26 14:20:03 +0000

    procctl: Zero the output structure for the compat32 syscall
    
    Otherwise the freebsd32 implementation of PROC_REAP_STATUS leaks
    uninitialized kernel stack memory.
    
    Reviewed by:    kib
    Reported by:    Dennys Kaluzny Pereira <dennyskaluzny@gmail.com>
    MFC after:      1 week
    Sponsored by:   The FreeBSD Foundation
    Differential Revision:  https://reviews.freebsd.org/D61510
    
    (cherry picked from commit 5a834ad15f1f09d43a6840c74da194db6f890aa2)
---
 sys/compat/freebsd32/freebsd32_misc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sys/compat/freebsd32/freebsd32_misc.c b/sys/compat/freebsd32/freebsd32_misc.c
index b3debca0e351..0fb4c5fd1113 100644
--- a/sys/compat/freebsd32/freebsd32_misc.c
+++ b/sys/compat/freebsd32/freebsd32_misc.c
@@ -3955,6 +3955,7 @@ freebsd32_procctl(struct thread *td, struct freebsd32_procctl_args *uap)
 		return (cpu_procctl(td, uap->idtype, PAIR32TO64(id_t, uap->id),
 		    uap->com, PTRIN(uap->data)));
 
+	bzero(&x, sizeof(x));
 	switch (uap->com) {
 	case PROC_ASLR_CTL:
 	case PROC_PROTMAX_CTL: