aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2021-06-01 14:56:23 +0000
committerMark Johnston <markj@FreeBSD.org>2021-06-01 23:37:50 +0000
commit60a38abb8982e11ee71559057dd7128bd097043e (patch)
tree113f2a7766174cdb4f618fac311c779bcbce363f
parentcbe59a6475b6c36fac4073bcfc328099fc873420 (diff)
downloadsrc-60a38abb8982e11ee71559057dd7128bd097043e.tar.gz
src-60a38abb8982e11ee71559057dd7128bd097043e.zip
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
-rw-r--r--sys/netpfil/pf/pf_table.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/netpfil/pf/pf_table.c b/sys/netpfil/pf/pf_table.c
index af2f614c9e8c..f643790ff620 100644
--- a/sys/netpfil/pf/pf_table.c
+++ b/sys/netpfil/pf/pf_table.c
@@ -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;