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
This commit is contained in:
Mark Johnston 2021-06-16 09:46:56 -04:00
parent a397b55083
commit bc6a2267ff

View File

@ -371,6 +371,8 @@ ipfw_check_frame(pfil_packet_t p, struct ifnet *ifp, int flags,
}
ipfw = ipfw_chk(&args);
if (!mem)
*p.m = args.m;
ret = PFIL_PASS;
switch (ipfw) {