1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-11 09:50:12 +00:00

pf: Avoid leaking pad bytes in struct pfr_astats when copying out

There is padding between pfr_astats.pfras_a and pfras_packets that was
not getting initialized.

Reported by:	KMSAN
Reviewed by:	kp, imp
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D30585
This commit is contained in:
Mark Johnston 2021-06-01 10:56:23 -04:00
parent cbe59a6475
commit 60a38abb89

View File

@ -1028,6 +1028,7 @@ pfr_copyout_astats(struct pfr_astats *as, const struct pfr_kentry *ke,
int dir, op;
const struct pfr_kcounters *kc = &ke->pfrke_counters;
bzero(as, sizeof(*as));
pfr_copyout_addr(&as->pfras_a, ke);
as->pfras_tzero = kc->pfrkc_tzero;