1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-10-19 02:29:40 +00:00

fd: Initialize more export_fd_buf fields in kern_proc_cwd_out()

In particular, we need to initialize efbuf->flags, since
export_vnode_to_sb() loads that field.  This was mostly harmless since
the flag only determines whether the output kinfo_file is packed, and
KERN_PROC_CWD only ever emits a single kinfo_file anyway.

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
This commit is contained in:
Mark Johnston 2021-12-16 16:53:59 -05:00
parent 8fcf230c13
commit 327060bd77

View File

@ -4660,9 +4660,11 @@ kern_proc_cwd_out(struct proc *p, struct sbuf *sb, ssize_t maxlen)
return (EINVAL);
efbuf = malloc(sizeof(*efbuf), M_TEMP, M_WAITOK);
efbuf->fdp = NULL;
efbuf->pdp = pdp;
efbuf->sb = sb;
efbuf->remainder = maxlen;
efbuf->flags = 0;
PWDDESC_XLOCK(pdp);
pwd = PWDDESC_XLOCKED_LOAD_PWD(pdp);