Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 May 2021 10:20:29 GMT
From:      Kristof Provost <kp@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: b0829ddddb86 - stable/12 - pfctl: Fix crash on ALTQ configuration
Message-ID:  <202105271020.14RAKTdM055412@gitrepo.freebsd.org>

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

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

commit b0829ddddb86931a623d6c701b85ecbc3b36bba9
Author:     Kristof Provost <kp@FreeBSD.org>
AuthorDate: 2021-05-18 13:03:01 +0000
Commit:     Kristof Provost <kp@FreeBSD.org>
CommitDate: 2021-05-27 07:09:58 +0000

    pfctl: Fix crash on ALTQ configuration
    
    The following config could crash pfctl:
            altq on igb0 fairq bandwidth 1Gb queue { qLink }
            queue qLink fairq(default)
    
    That happens because when we're parsing the parent queue (on igb0) it
    doesn't have a parent, and the check in eval_pfqueue_fairq() checks
    pa->parent rather than parent.
    
    This was changed in eval_pfqueue_hfsc() in
    1d34c9dac8624c5c315ae39ad3ae8e5879b23256, but not for fairq.
    
    Reviewed by:    pkelsey
    MFC after:      1 week
    Sponsored by:   Rubicon Communications, LLC ("Netgate")
    Differential Revision:  https://reviews.freebsd.org/D30346
    
    (cherry picked from commit 26705a39e51eaf5b32efa98fb86df2d4ecfbdc61)
---
 sbin/pfctl/pfctl_altq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sbin/pfctl/pfctl_altq.c b/sbin/pfctl/pfctl_altq.c
index f23fe057f703..8067b0598361 100644
--- a/sbin/pfctl/pfctl_altq.c
+++ b/sbin/pfctl/pfctl_altq.c
@@ -872,7 +872,7 @@ eval_pfqueue_fairq(struct pfctl *pf __unused, struct pf_altq *pa,
 
 	opts = &pa->pq_u.fairq_opts;
 
-	if (pa->parent == NULL) {
+	if (parent == NULL) {
 		/* root queue */
 		opts->lssc_m1 = pa->ifbandwidth;
 		opts->lssc_m2 = pa->ifbandwidth;



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