#
f11b6505 |
| 28-Feb-2022 |
Mateusz Guzik <mjg@FreeBSD.org> |
pf: add PF_UNLNKDRULES_ASSERT
Reviewed by: kp Sponsored by: Rubicon Communications, LLC ("Netgate")
|
#
b590f17a |
| 20-Jan-2022 |
Kristof Provost <kp@FreeBSD.org> |
pf: support masking mac addresses
When filtering Ethernet packets allow rules to specify a mac address with a mask. This indicates which bits of the specified address are significant. This allows us
pf: support masking mac addresses
When filtering Ethernet packets allow rules to specify a mac address with a mask. This indicates which bits of the specified address are significant. This allows users to do things like filter based on device manufacturer.
Sponsored by: Rubicon Communications, LLC ("Netgate")
show more ...
|
Revision tags: release/12.3.0 |
|
#
c5131afe |
| 01-Oct-2021 |
Kristof Provost <kp@FreeBSD.org> |
pf: add anchor support for ether rules
Support anchors in ether rules.
Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D32482
|
#
fb330f39 |
| 27-Sep-2021 |
Kristof Provost <kp@FreeBSD.org> |
pf: support dummynet on L2 rules
Allow packets to be tagged with dummynet information. Note that we do not apply dummynet shaping on the L2 traffic, but instead mark it for dummynet processing in th
pf: support dummynet on L2 rules
Allow packets to be tagged with dummynet information. Note that we do not apply dummynet shaping on the L2 traffic, but instead mark it for dummynet processing in the L3 code. This is the same approach as we take for ALTQ.
Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D32222
show more ...
|
Revision tags: release/13.0.0 |
|
#
20c4899a |
| 10-Feb-2021 |
Kristof Provost <kp@FreeBSD.org> |
pf: Do not hold PF_RULES_RLOCK while processing Ethernet rules
Avoid the overhead of acquiring a (read) RULES lock when processing the Ethernet rules. We can get away with that because when rules ar
pf: Do not hold PF_RULES_RLOCK while processing Ethernet rules
Avoid the overhead of acquiring a (read) RULES lock when processing the Ethernet rules. We can get away with that because when rules are modified they're staged in V_pf_keth_inactive. We take care to ensure the swap to V_pf_keth is atomic, so that pf_test_eth_rule() always sees either the old rules, or the new ruleset.
We need to take care not to delete the old ruleset until we're sure no pf_test_eth_rule() is still running with those. We accomplish that by using NET_EPOCH_CALL() to actually free the old rules.
Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D31739
show more ...
|
#
e732e742 |
| 03-Feb-2021 |
Kristof Provost <kp@FreeBSD.org> |
pf: Initial Ethernet level filtering code
This is the kernel side of stateless Ethernel level filtering for pf.
The primary use case for this is to enable captive portal functionality to allow/deny
pf: Initial Ethernet level filtering code
This is the kernel side of stateless Ethernel level filtering for pf.
The primary use case for this is to enable captive portal functionality to allow/deny access by MAC address, rather than per IP address.
Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D31737
show more ...
|
#
773e3a71 |
| 31-Jan-2022 |
Mark Johnston <markj@FreeBSD.org> |
pf: Initialize pf_kpool mutexes earlier
There are some error paths in ioctl handlers that will call pf_krule_free() before the rule's rpool.mtx field is initialized, causing a panic with INVARIANTS
pf: Initialize pf_kpool mutexes earlier
There are some error paths in ioctl handlers that will call pf_krule_free() before the rule's rpool.mtx field is initialized, causing a panic with INVARIANTS enabled.
Fix the problem by introducing pf_krule_alloc() and initializing the mutex there. This does mean that the rule->krule and pool->kpool conversion functions need to stop zeroing the input structure, but I don't see a nicer way to handle this except perhaps by guarding the mtx_destroy() with a mtx_initialized() check.
Constify some related functions while here and add a regression test based on a syzkaller reproducer.
Reported by: syzbot+77cd12872691d219c158@syzkaller.appspotmail.com Reviewed by: kp MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D34115
show more ...
|
#
5f5e32f1 |
| 10-Jan-2022 |
Kristof Provost <kp@FreeBSD.org> |
pf: protect the rpool from races
The roundrobin pool stores its state in the rule, which could potentially lead to invalid addresses being returned.
For example, thread A just executed PF_AINC(&rpo
pf: protect the rpool from races
The roundrobin pool stores its state in the rule, which could potentially lead to invalid addresses being returned.
For example, thread A just executed PF_AINC(&rpool->counter) and immediately afterwards thread B executes PF_ACPY(naddr, &rpool->counter) (i.e. after the pf_match_addr() check of rpool->counter).
Lock the rpool with its own mutex to prevent these races. The performance impact of this is expected to be low, as each rule has its own lock, and the lock is also only relevant when state is being created (so only for the initial packets of a connection, not for all traffic).
See also: https://redmine.pfsense.org/issues/12660 Reviewed by: glebius MFC after: 3 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D33874
show more ...
|
#
c658610b |
| 15-Dec-2021 |
Kristof Provost <kp@FreeBSD.org> |
pf: make pfvar.h self-contained
Ensure that the pfvar.h header can be included without including any other headers.
Reviewed by: imp Sponsored by: Rubicon Communications, LLC ("Netgate") Differenti
pf: make pfvar.h self-contained
Ensure that the pfvar.h header can be included without including any other headers.
Reviewed by: imp Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D33499
show more ...
|
#
8e492101 |
| 15-Nov-2021 |
Kristof Provost <kp@FreeBSD.org> |
pf: add COMPAT_FREEBSD13 for DIOCKEEPCOUNTERS
DIOCKEEPCOUNTERS used to overlap with DIOCGIFSPEEDV0, which has been fixed in 14, but remains in stable/12 and stable/13. Support the old, overlapping,
pf: add COMPAT_FREEBSD13 for DIOCKEEPCOUNTERS
DIOCKEEPCOUNTERS used to overlap with DIOCGIFSPEEDV0, which has been fixed in 14, but remains in stable/12 and stable/13. Support the old, overlapping, call under COMPAT_FREEBSD13.
Reviewed by: jhb Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D33001
show more ...
|
#
047c4e36 |
| 14-Nov-2021 |
Kristof Provost <kp@FreeBSD.org> |
pf: renumber DIOCKEEPCOUNTERS
We accidentally had two ioctls use the same base number (DIOCKEEPCOUNTERS and DIOCGIFSPEEDV{0,1}). We get away with that on most platforms because the size of the argum
pf: renumber DIOCKEEPCOUNTERS
We accidentally had two ioctls use the same base number (DIOCKEEPCOUNTERS and DIOCGIFSPEEDV{0,1}). We get away with that on most platforms because the size of the argument structures is different. This does break CHERI, and is generally a bad idea anyway. Renumber to avoid this collision.
Reported by: jhb
show more ...
|
#
76c5eecc |
| 29-Oct-2021 |
Kristof Provost <kp@FreeBSD.org> |
pf: Introduce ridentifier
Allow users to set a number on rules which will be exposed as part of the pflog header. The intent behind this is to allow users to correlate rules across updates (remember
pf: Introduce ridentifier
Allow users to set a number on rules which will be exposed as part of the pflog header. The intent behind this is to allow users to correlate rules across updates (remember that pf rules continue to exist and match existing states, even if they're removed from the active ruleset) and pflog.
Obtained from: pfSense MFC after: 3 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D32750
show more ...
|
#
8f3d786c |
| 01-Nov-2021 |
Mateusz Guzik <mjg@FreeBSD.org> |
pf: remove the flags argument from pf_unlink_state
All consumers call it with PF_ENTER_LOCKED.
Reviewed by: kp Sponsored by: Rubicon Communications, LLC ("Netgate")
|
#
76c2e71c |
| 04-Oct-2021 |
Kristof Provost <kp@FreeBSD.org> |
pf: remove unused field from pf_kanchor
The 'match' field is only used in the userspace version of the struct (pf_anchor).
MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC ("Netgate")
|
#
5062afff |
| 13-Aug-2021 |
Kristof Provost <kp@FreeBSD.org> |
pfctl: userspace adaptive syncookies configration
Hook up the userspace bits to configure syncookies in adaptive mode.
MFC after: 1 week Sponsored by: Modirum MDPay Differential Revision: https://r
pfctl: userspace adaptive syncookies configration
Hook up the userspace bits to configure syncookies in adaptive mode.
MFC after: 1 week Sponsored by: Modirum MDPay Differential Revision: https://reviews.freebsd.org/D32136
show more ...
|
#
bf863718 |
| 24-Jul-2021 |
Kristof Provost <kp@FreeBSD.org> |
pf: implement adaptive mode
Use atomic counters to ensure that we correctly track the number of half open states and syncookie responses in-flight. This determines if we activate or deactivate synco
pf: implement adaptive mode
Use atomic counters to ensure that we correctly track the number of half open states and syncookie responses in-flight. This determines if we activate or deactivate syncookies in adaptive mode.
MFC after: 1 week Sponsored by: Modirum MDPay Differential Revision: https://reviews.freebsd.org/D32134
show more ...
|
#
63b3c1c7 |
| 15-May-2021 |
Kristof Provost <kp@FreeBSD.org> |
pf: support dummynet
Allow pf to use dummynet pipes and queues.
We re-use the currently unused IPFW_IS_DUMMYNET flag to allow dummynet to tell us that a packet is being re-injected after being dela
pf: support dummynet
Allow pf to use dummynet pipes and queues.
We re-use the currently unused IPFW_IS_DUMMYNET flag to allow dummynet to tell us that a packet is being re-injected after being delayed. This is needed to avoid endlessly looping the packet between pf and dummynet.
MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D31904
show more ...
|
#
b64f7ce9 |
| 07-Sep-2021 |
Kristof Provost <kp@FreeBSD.org> |
pf: qid and pqid can be uint16_t
tag2name() returns a uint16_t, so we don't need to use uint32_t for the qid (or pqid). This reduces the size of struct pf_kstate slightly. That in turn buys us space
pf: qid and pqid can be uint16_t
tag2name() returns a uint16_t, so we don't need to use uint32_t for the qid (or pqid). This reduces the size of struct pf_kstate slightly. That in turn buys us space to add extra fields for dummynet later.
Happily these fields are not exposed to user space (there are user space versions of them, but they can just stay uint32_t), so there's no ABI breakage in modifying this.
MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D31873
show more ...
|
#
bb25e36e |
| 07-Sep-2021 |
Kristof Provost <kp@FreeBSD.org> |
pf: remove unused function prototype
MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate")
|
#
4cab80a8 |
| 29-Aug-2021 |
Kristof Provost <kp@FreeBSD.org> |
pf: Add counters for syncookies
Count when we send a syncookie, receive a valid syncookie or detect a synflood.
Reviewed by: kbowling MFC after: 1 week Sponsored by: Modirum MDPay Differential Revi
pf: Add counters for syncookies
Count when we send a syncookie, receive a valid syncookie or detect a synflood.
Reviewed by: kbowling MFC after: 1 week Sponsored by: Modirum MDPay Differential Revision: https://reviews.freebsd.org/D31713
show more ...
|
#
2b10cf85 |
| 16-Aug-2021 |
Kristof Provost <kp@FreeBSD.org> |
pf: Introduce nvlist variant of DIOCGETSTATUS
Make it possible to extend the GETSTATUS call (e.g. when we want to add new counters, such as for syncookie support) by introducing an nvlist-based alte
pf: Introduce nvlist variant of DIOCGETSTATUS
Make it possible to extend the GETSTATUS call (e.g. when we want to add new counters, such as for syncookie support) by introducing an nvlist-based alternative.
MFC after: 1 week Sponsored by: Modirum MDPay Differential Revision: https://reviews.freebsd.org/D31694
show more ...
|
#
b69019c1 |
| 06-Jul-2021 |
Kristof Provost <kp@FreeBSD.org> |
pf: remove DIOCGETSTATESNV
While nvlists are very useful in maximising flexibility for future extensions their performance is simply unacceptably bad for the getstates feature, where we can easily w
pf: remove DIOCGETSTATESNV
While nvlists are very useful in maximising flexibility for future extensions their performance is simply unacceptably bad for the getstates feature, where we can easily want to export a million states or more.
The DIOCGETSTATESNV call has been MFCd, but has not hit a release on any branch, so we can still remove it everywhere.
Reviewed by: mjg MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D31099
show more ...
|
#
02cf67cc |
| 22-Jul-2021 |
Mateusz Guzik <mjg@FreeBSD.org> |
pf: switch rule counters to pf_counter_u64
Reviewed by: kp Sponsored by: Rubicon Communications, LLC ("Netgate")
|
#
d40d4b3e |
| 23-Jul-2021 |
Mateusz Guzik <mjg@FreeBSD.org> |
pf: switch kif counters to pf_counter_u64
Reviewed by: kp Sponsored by: Rubicon Communications, LLC ("Netgate")
|
#
fc4c42ce |
| 24-Jul-2021 |
Mateusz Guzik <mjg@FreeBSD.org> |
pf: switch pf_status.fcounters to pf_counter_u64
Reviewed by: kp Sponsored by: Rubicon Communications, LLC ("Netgate")
|