Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 16 Jun 2021 14:02:31 GMT
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: bc6a2267fffe - main - ipfw: Update the pfil mbuf pointer in ipfw_check_frame()
Message-ID:  <202106161402.15GE2V6w021795@gitrepo.freebsd.org>

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

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

commit bc6a2267fffeafd3946637607a74cfd639398f9d
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2021-06-16 13:46:56 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2021-06-16 13:46:56 +0000

    ipfw: Update the pfil mbuf pointer in ipfw_check_frame()
    
    ipfw_chk() might call m_pullup() and thus can change the mbuf chain
    head.  In this case, the new chain head has to be returned to the pfil
    hook caller, otherwise the pfil hook caller is left with a dangling
    pointer.
    
    Note that this affects only the link-layer hooks installed when the
    net.link.ether.ipfw sysctl is set to 1.
    
    PR:             256439, 254015, 255069, 255104
    Fixes:          f355cb3e6
    Reviewed by:    ae
    MFC after:      3 days
    Sponsored by:   The FreeBSD Foundation
    Differential Revision:  https://reviews.freebsd.org/D30764
---
 sys/netpfil/ipfw/ip_fw_pfil.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sys/netpfil/ipfw/ip_fw_pfil.c b/sys/netpfil/ipfw/ip_fw_pfil.c
index e21831c80ec6..01a44df47180 100644
--- a/sys/netpfil/ipfw/ip_fw_pfil.c
+++ b/sys/netpfil/ipfw/ip_fw_pfil.c
@@ -371,6 +371,8 @@ again:
 	}
 
 	ipfw = ipfw_chk(&args);
+	if (!mem)
+		*p.m = args.m;
 
 	ret = PFIL_PASS;
 	switch (ipfw) {



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