HardenedBSD/sys/net
Mark Johnston 4a7c6d6206 pf: Fix handling of v6 loopback connections with pf syncookies enabled
The SYN|ACK generated by pf needs to inherit M_LOOP from the original
SYN, otherwise it gets dropped by ip6_input().

Fix this by adding an mbuf_flags argument to pf_build_tcp() that can be
used to set both M_SKIP_FIREWALL and M_LOOP as needed.  Set M_LOOP on
the output mbuf if it was generated in response to an mbuf with M_LOOP
set.

Add a regression test case.  The v4 case had no problems, but the v6
case fails without this change.

Reviewed by:	kp
MFC after:	1 month
Sponsored by:	Klara, Inc.
Sponsored by:	Zenarmor
Differential Revision:	https://reviews.freebsd.org/D47257
2024-10-29 15:01:20 +00:00
..
altq altq: Stop checking for failures from malloc(M_WAITOK) 2024-09-03 18:25:19 +08:00
route fibs: Suppress the WARNING message for setups with multiple fibs 2024-08-02 01:48:58 +08:00
bpf_buffer.c sys: Remove ancient SCCS tags. 2023-11-26 22:23:30 -07:00
bpf_buffer.h
bpf_filter.c sys: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:00 -07:00
bpf_jitter.c
bpf_jitter.h
bpf_zerocopy.c
bpf_zerocopy.h
bpf.c bpf: Some style and white space cleanup 2024-09-20 18:06:22 +08:00
bpf.h bpf: Some style and white space cleanup 2024-09-20 18:06:22 +08:00
bpfdesc.h sys: Remove ancient SCCS tags. 2023-11-26 22:23:30 -07:00
bridgestp.c sys: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:00 -07:00
bridgestp.h
debugnet_inet.c
debugnet_int.h
debugnet.c debugnet: Use precise types when accessing mbuf contents 2024-10-11 13:23:25 +00:00
debugnet.h
dlt.h sys: Remove ancient SCCS tags. 2023-11-26 22:23:30 -07:00
dummymbuf.c dummymbuf: Log the entire rule set if no delimiters are present 2024-10-07 11:16:44 +00:00
ethernet.h ethernet: Retire M_HASFCS 2024-07-05 00:53:51 +08:00
firewire.h
ieee8023ad_lacp.c
ieee8023ad_lacp.h
ieee_oui.h
if_arp.h Support ARP for 802 networks 2024-04-23 12:30:53 -04:00
if_bridge.c if_bridge: Mask MEXTPG if some members don't support it 2024-10-28 15:14:21 +00:00
if_bridgevar.h
if_clone.c if_clone: Allow maxunit to be zero 2024-07-03 21:14:08 +08:00
if_clone.h if_clone: Allow maxunit to be zero 2024-07-03 21:14:08 +08:00
if_dead.c sys: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:00 -07:00
if_disc.c net: Remove unneeded NULL check for the allocated ifnet 2024-06-28 18:16:29 +08:00
if_dl.h sys: Remove ancient SCCS tags. 2023-11-26 22:23:30 -07:00
if_edsc.c net: Remove unneeded NULL check for the allocated ifnet 2024-06-28 18:16:29 +08:00
if_enc.c if_enc(4): Use new KPI to create enc interface 2024-10-12 21:37:53 +08:00
if_enc.h
if_epair.c net: Remove unneeded NULL check for the allocated ifnet 2024-06-28 18:16:29 +08:00
if_ethersubr.c ethernet: Retire M_HASFCS 2024-07-05 00:53:51 +08:00
if_fwsubr.c net: bandaid for plugging a fw_com leak in fwip_detach() 2024-02-15 01:00:49 +00:00
if_gif.c bpf: Make BPF interop consistent with if_loop 2024-04-19 14:48:37 -04:00
if_gif.h
if_gre.c bpf: Make BPF interop consistent with if_loop 2024-04-19 14:48:37 -04:00
if_gre.h
if_infiniband.c sys: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:00 -07:00
if_ipsec.c ipsec_output(): add mtu argument 2024-07-12 06:29:31 +03:00
if_ipsec.h
if_lagg.c net/if_lagg.c: remove stray include is sys/cdefs.h 2024-08-20 15:42:13 +03:00
if_lagg.h
if_llatbl.c if_llatbl: Fix a typo in a KASSERT message 2024-01-20 21:00:22 +01:00
if_llatbl.h
if_llc.h sys: Remove ancient SCCS tags. 2023-11-26 22:23:30 -07:00
if_loop.c net: Remove unneeded NULL check for the allocated ifnet 2024-06-28 18:16:29 +08:00
if_me.c bpf: Make BPF interop consistent with if_loop 2024-04-19 14:48:37 -04:00
if_media.c
if_media.h
if_mib.c
if_mib.h
if_ovpn.c if_ovpn: declare our dependency on the crypto module 2024-09-12 19:32:05 +02:00
if_ovpn.h
if_pflog.h pf: move the mbuf into struct pf_pdesc too 2024-10-10 14:10:42 +02:00
if_pfsync.h
if_private.h sys/net: Add IPSEC_OFFLOAD interface cap and methods structure 2024-07-12 06:29:32 +03:00
if_stf.c net: Remove unneeded NULL check for the allocated ifnet 2024-06-28 18:16:29 +08:00
if_stf.h
if_strings.h sys/net: Add IPSEC_OFFLOAD interface cap and methods structure 2024-07-12 06:29:32 +03:00
if_tap.h
if_tun.h
if_tuntap.c if_tuntap: Enable MEXTPG support 2024-10-28 15:14:36 +00:00
if_types.h sys: Remove ancient SCCS tags. 2023-11-26 22:23:30 -07:00
if_var.h ifnet: Remove if_getamcount() 2024-09-04 14:28:28 +00:00
if_vlan_var.h
if_vlan.c if_vlan: Stop checking for failures from malloc(M_WAITOK) 2024-09-03 18:25:19 +08:00
if_vxlan.c if_vxlan(4): Plug a memory leak 2024-07-02 12:57:02 +08:00
if_vxlan.h
if.c ifnet: Assert that we are assigning network stack correctly 2024-10-22 12:32:24 +08:00
if.h ifnet: Add handling for toggling IFF_ALLMULTI in ifhwioctl() 2024-09-06 16:58:44 +00:00
ifdi_if.m
iflib.c iflib: Make iflib_stop() static 2024-10-07 22:19:02 +08:00
iflib.h iflib: Add subinterface interrupt allocation function 2024-04-18 16:14:02 -07:00
ifq.c sys: Remove ancient SCCS tags. 2023-11-26 22:23:30 -07:00
ifq.h sys: Remove ancient SCCS tags. 2023-11-26 22:23:30 -07:00
infiniband.h
mp_ring.c sys: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:00 -07:00
mp_ring.h
mppc.h
mppcc.c
mppcd.c
netisr_internal.h
netisr.c netisr: avoid ffs(0) 2024-07-26 11:51:17 -05:00
netisr.h
netmap_legacy.h
netmap_user.h
netmap_virt.h
netmap.h
paravirt.h
pfil.c pfil: PFIL_PASS never frees the mbuf 2024-01-29 14:10:19 +01:00
pfil.h
pfkeyv2.h sys/pfkeyv2.h: define extensions for ipsec inline accel control 2024-07-12 06:29:31 +03:00
pflow.h pflow: show socket status in verbose mode 2024-01-25 17:37:51 +01:00
pfvar.h pf: Fix handling of v6 loopback connections with pf syncookies enabled 2024-10-29 15:01:20 +00:00
ppp_defs.h
radix.c sys: Remove ancient SCCS tags. 2023-11-26 22:23:30 -07:00
radix.h sys: Remove ancient SCCS tags. 2023-11-26 22:23:30 -07:00
rndis.h net: Fix typo (triple S) 2023-12-27 20:24:32 -07:00
route.c net: route: convert routing statistics to a sysctl 2024-10-23 22:15:55 -05:00
route.h net: route: convert routing statistics to a sysctl 2024-10-23 22:15:55 -05:00
rss_config.c
rss_config.h
rtsock.c route: Wrap long lines 2024-07-14 14:29:15 -04:00
sff8436.h
sff8472.h
slcompress.c sys: Remove ancient SCCS tags. 2023-11-26 22:23:30 -07:00
slcompress.h
toeplitz.c sys: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:00 -07:00
toeplitz.h
vnet.c vnet: (read) lock the vnet list while iterating it 2023-12-07 13:34:47 +01:00
vnet.h vnet: remove unneeded backslash 2024-03-15 12:17:04 -07:00