aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEd Maste <emaste@FreeBSD.org>2026-05-12 16:25:01 +0000
committerEd Maste <emaste@FreeBSD.org>2026-05-12 17:59:51 +0000
commite68433e1990d5f1bcc1bdd270d65f1e4792a8e1b (patch)
treebf696648cd66b1eff631a8e0989c73578a2b843a
parenta6add87b5e174702261f3b8e8022791ed4ab9898 (diff)
sys: Fix heap disclosure in compat7 kern.proc.filedesc sysctl
Reported by: Yuxiang Yang, Yizhou Zhao, Ao Wang, Xuewei Feng, Qi Li, and Ke Xu from Tsinghua University using GLM-5.1 from Z.ai Reviewed by: markj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D56976
-rw-r--r--sys/kern/kern_descrip.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c
index 48303926759b..349ebb5702a5 100644
--- a/sys/kern/kern_descrip.c
+++ b/sys/kern/kern_descrip.c
@@ -5135,7 +5135,7 @@ sysctl_kern_proc_ofiledesc(SYSCTL_HANDLER_ARGS)
return (ENOENT);
}
kif = malloc(sizeof(*kif), M_TEMP, M_WAITOK);
- okif = malloc(sizeof(*okif), M_TEMP, M_WAITOK);
+ okif = malloc(sizeof(*okif), M_TEMP, M_WAITOK | M_ZERO);
PWDDESC_XLOCK(pdp);
pwd = pwd_hold_pwddesc(pdp);
if (pwd != NULL) {