pf: zero output buffer in pfioctl

Avoid potential structure padding leak.

Reported by:	Vlad Tsyrklevich <vlad@tsyrklevich.net>
Reviewed by:	kp
MFC after:	3 days
Security:	Potential kernel memory disclosure
Sponsored by:	The FreeBSD Foundation
This commit is contained in:
emaste 2019-07-24 16:51:14 +00:00
parent 8d3bb29faf
commit e6cea1ca6d

View File

@ -2169,7 +2169,7 @@ pfioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags, struct thread *td
break; break;
} }
p = pstore = malloc(ps->ps_len, M_TEMP, M_WAITOK); p = pstore = malloc(ps->ps_len, M_TEMP, M_WAITOK | M_ZERO);
nr = 0; nr = 0;
for (i = 0; i <= pf_hashmask; i++) { for (i = 0; i <= pf_hashmask; i++) {