Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 8 Jun 2021 13:37:56 GMT
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 1adf2f76c0c8 - stable/12 - pf: Avoid leaking pad bytes in struct pfr_astats when copying out
Message-ID:  <202106081337.158Dbuii074746@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/12 has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=1adf2f76c0c89db1beb2de4ac03a0b70db84bb6a

commit 1adf2f76c0c89db1beb2de4ac03a0b70db84bb6a
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2021-06-01 14:56:23 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2021-06-08 13:37:48 +0000

    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
    Sponsored by:   The FreeBSD Foundation
    
    (cherry picked from commit 60a38abb8982e11ee71559057dd7128bd097043e)
---
 sys/netpfil/pf/pf_table.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sys/netpfil/pf/pf_table.c b/sys/netpfil/pf/pf_table.c
index 58b453cd550c..e9fd5f133c3f 100644
--- a/sys/netpfil/pf/pf_table.c
+++ b/sys/netpfil/pf/pf_table.c
@@ -1029,6 +1029,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;
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202106081337.158Dbuii074746>