#
8ee127ef |
| 23-Feb-2025 |
SHENGYI HONG <aokblast@FreeBSD.org> |
vm_lowmem: Fix signature mismatches in vm_lowmem callbacks
This is required for kernel CFI.
Reviewed by: rrs, jhb, glebius Differential Revision: https://reviews.freebsd.org/D49111
|
Revision tags: release/14.2.0-p2, release/14.1.0-p8, release/13.4.0-p4, release/14.1.0-p7, release/14.2.0-p1, release/13.4.0-p3, release/14.2.0, release/13.4.0, release/14.1.0, release/13.3.0 |
|
#
8d01ecd8 |
| 04-Jan-2024 |
Mark Johnston <markj@FreeBSD.org> |
frag6: Add another use of frag6_rmqueue()
No functional change intended.
Reviewed by: kp, bz MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D43256
|
#
0736a380 |
| 31-Dec-2023 |
Mark Johnston <markj@FreeBSD.org> |
frag6: Reduce code duplication
The code which removes a fragment queue from the per-VNET hash table was duplicated three times. Factor it out into a function. No functional change intended.
Revie
frag6: Reduce code duplication
The code which removes a fragment queue from the per-VNET hash table was duplicated three times. Factor it out into a function. No functional change intended.
Reviewed by: kp, bz MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D43228
show more ...
|
#
f12a9a4c |
| 31-Dec-2023 |
Mark Johnston <markj@FreeBSD.org> |
frag6: Drop unneeded casts from malloc calls
No functional change intended.
MFC after: 1 week
|
Revision tags: release/14.0.0 |
|
#
685dc743 |
| 16-Aug-2023 |
Warner Losh <imp@FreeBSD.org> |
sys: Remove $FreeBSD$: one-line .c pattern
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
|
#
ff3d1a3f |
| 01-Aug-2023 |
Jonathan T. Looney <jtl@FreeBSD.org> |
frag6: Avoid a possible integer overflow in fragment handling
Reviewed by: kp, markj, bz Approved by: so Security: FreeBSD-SA-23:06.ipv6 Security: CVE-2023-3107
|
#
e32221a1 |
| 01-Jun-2023 |
Alexander V. Chernikov <melifaro@FreeBSD.org> |
netinet6: make IPv6 fragment TTL per-VNET configurable.
Having it configurable adds more flexibility, especially for the systems with low amount of memory. Additionally, it allows to speedup frag6/
netinet6: make IPv6 fragment TTL per-VNET configurable.
Having it configurable adds more flexibility, especially for the systems with low amount of memory. Additionally, it allows to speedup frag6/ tests execution.
Reviewed by: kp, markj, bz Differential Revision: https://reviews.freebsd.org/D35755 MFC after: 2 weeks
show more ...
|
Revision tags: release/13.2.0 |
|
#
3d0d5b21 |
| 23-Jan-2023 |
Justin Hibbits <jhibbits@FreeBSD.org> |
IfAPI: Explicitly include <net/if_private.h> in netstack
Summary: In preparation of making if_t completely opaque outside of the netstack, explicitly include the header. <net/if_var.h> will stop in
IfAPI: Explicitly include <net/if_private.h> in netstack
Summary: In preparation of making if_t completely opaque outside of the netstack, explicitly include the header. <net/if_var.h> will stop including the header in the future.
Sponsored by: Juniper Networks, Inc. Reviewed by: glebius, melifaro Differential Revision: https://reviews.freebsd.org/D38200
show more ...
|
Revision tags: release/12.4.0 |
|
#
a0d7d247 |
| 17-Aug-2022 |
Gleb Smirnoff <glebius@FreeBSD.org> |
frag6: use callout(9) directly instead of pr_slowtimo
Reviewed by: melifaro Differential revision: https://reviews.freebsd.org/D36162
|
Revision tags: release/13.1.0, release/12.3.0 |
|
#
3cf59750 |
| 30-Nov-2021 |
Gordon Bergling <gbe@FreeBSD.org> |
netinet6: Fix a typo in a sysctl description
- remove a double 'a'
MFC after: 3 days
|
#
8afe9481 |
| 13-Aug-2021 |
Mateusz Guzik <mjg@FreeBSD.org> |
frag6: do less work in frag6_slowtimo if possible
frag6_slowtimo avoidably uses CPU on otherwise idle boxes
Reviewed by: kp Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revisi
frag6: do less work in frag6_slowtimo if possible
frag6_slowtimo avoidably uses CPU on otherwise idle boxes
Reviewed by: kp Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D31528
show more ...
|
#
c17ae180 |
| 13-Aug-2021 |
Mateusz Guzik <mjg@FreeBSD.org> |
frag6: drop the volatile keyword from frag6_nfrags and mark with __exclusive_cache_line
The keyword adds nothing as all operations on the var are performed through atomic_*
Reviewed by: kp Sponsore
frag6: drop the volatile keyword from frag6_nfrags and mark with __exclusive_cache_line
The keyword adds nothing as all operations on the var are performed through atomic_*
Reviewed by: kp Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D31528
show more ...
|
Revision tags: release/13.0.0 |
|
#
bb4a7d94 |
| 04-Mar-2021 |
Kristof Provost <kp@FreeBSD.org> |
net: Introduce IPV6_DSCP(), IPV6_ECN() and IPV6_TRAFFIC_CLASS() macros
Introduce convenience macros to retrieve the DSCP, ECN or traffic class bits from an IPv6 header.
Use them where appropriate.
net: Introduce IPV6_DSCP(), IPV6_ECN() and IPV6_TRAFFIC_CLASS() macros
Introduce convenience macros to retrieve the DSCP, ECN or traffic class bits from an IPv6 header.
Use them where appropriate.
Reviewed by: ae (previous version), rscheff, tuexen, rgrimes MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D29056
show more ...
|
#
8268d82c |
| 15-Feb-2021 |
Alexander V. Chernikov <melifaro@FreeBSD.org> |
Remove per-packet ifa refcounting from IPv6 fast path.
Currently ip6_input() calls in6ifa_ifwithaddr() for every local packet, in order to check if the target ip belongs to the local ifa in proper
Remove per-packet ifa refcounting from IPv6 fast path.
Currently ip6_input() calls in6ifa_ifwithaddr() for every local packet, in order to check if the target ip belongs to the local ifa in proper state and increase its counters.
in6ifa_ifwithaddr() references found ifa. With epoch changes, both `ip6_input()` and all other current callers of `in6ifa_ifwithaddr()` do not need this reference anymore, as epoch provides stability guarantee.
Given that, update `in6ifa_ifwithaddr()` to allow it to return ifa without referencing it, while preserving option for getting referenced ifa if so desired.
MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D28648
show more ...
|
Revision tags: release/12.2.0 |
|
#
662c1305 |
| 01-Sep-2020 |
Mateusz Guzik <mjg@FreeBSD.org> |
net: clean up empty lines in .c and .h files
|
Revision tags: release/11.4.0 |
|
#
75dfc66c |
| 27-Feb-2020 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r358269 through r358399.
|
#
7029da5c |
| 26-Feb-2020 |
Pawel Biernacki <kaktus@FreeBSD.org> |
Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many)
r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are still not MPSAFE (or already are but aren’t properly mark
Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many)
r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are still not MPSAFE (or already are but aren’t properly marked). Use it in preparation for a general review of all nodes.
This is non-functional change that adds annotations to SYSCTL_NODE and SYSCTL_PROC nodes using one of the soon-to-be-required flags.
Mark all obvious cases as MPSAFE. All entries that haven't been marked as MPSAFE before are by default marked as NEEDGIANT
Approved by: kib (mentor, blanket) Commented by: kib, gallatin, melifaro Differential Revision: https://reviews.freebsd.org/D23718
show more ...
|
#
a4adf6cc |
| 01-Dec-2019 |
Bjoern A. Zeeb <bz@FreeBSD.org> |
Fix m_pullup() problem after removing PULLDOWN_TESTs and KAME EXT_*macros.
r354748-354750 replaced the KAME macros with m_pulldown() calls. Contrary to the rest of the network stack m_len checks bef
Fix m_pullup() problem after removing PULLDOWN_TESTs and KAME EXT_*macros.
r354748-354750 replaced the KAME macros with m_pulldown() calls. Contrary to the rest of the network stack m_len checks before m_pulldown() were not put in placed (see r354748). Put these m_len checks in place for now (to go along with the style of the network stack since the initial commits). These are not put in for performance but to avoid an error scenario (even though it also will help performance at the moment as it avoid allocating an extra mbuf; not because of the unconditional function call).
The observed error case went like this: (1) an mbuf with M_EXT arrives and we call m_pullup() unconditionally on it. (2) m_pullup() will call m_get() unless the requested length is larger than MHLEN (in which case it'll m_freem() the perfectly fine mbuf) and migrate the requested length of data and pkthdr into the new mbuf. (3) If m_get() succeeds, a further m_pullup() call going over MHLEN will fail. This was observed with failing auto-configuration as an RA packet of 200 bytes exceeded MHLEN and the m_pullup() called from nd6_ra_input() dropped the mbuf. (Re-)adding the m_len checks before m_pullup() calls avoids this problems with mbufs using external storage for now.
MFC after: 3 weeks Sponsored by: Netflix
show more ...
|
#
a61b5cfb |
| 15-Nov-2019 |
Bjoern A. Zeeb <bz@FreeBSD.org> |
netinet6: Remove PULLDOWN_TESTs.
Remove the KAME introduced PULLDOWN_TESTs which did not even have a compile-time option in sys/conf to turn them on for a custom kernel build. They made the code a l
netinet6: Remove PULLDOWN_TESTs.
Remove the KAME introduced PULLDOWN_TESTs which did not even have a compile-time option in sys/conf to turn them on for a custom kernel build. They made the code a lot harder to read or more complicated in a few cases.
Convert the IP6_EXTHDR_CHECK() calls into FreeBSD looking code. Rather than throwing the packet away if it would not fit the KAME mbuf expectations, convert the macros to m_pullup() calls. Do not do any extra manual conditional checks upfront as to whether the m_len would suffice (*), simply let m_pullup() do its work (incl. an early check).
Remove extra m_pullup() calls where earlier in the function or the only caller has already done the pullup.
Discussed with: rwatson (*) Reviewed by: ae MFC after: 8 weeks Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D22334
show more ...
|
#
a8fe77d8 |
| 12-Nov-2019 |
Bjoern A. Zeeb <bz@FreeBSD.org> |
netinet*: update *mp to pass the proper value back
In ip6_[direct_]input() we are looping over the extension headers to deal with the next header. We pass a pointer to an mbuf pointer to the handli
netinet*: update *mp to pass the proper value back
In ip6_[direct_]input() we are looping over the extension headers to deal with the next header. We pass a pointer to an mbuf pointer to the handling functions. In certain cases the mbuf can be updated there and we need to pass the new one back. That missing in dest6_input() and route6_input(). In tcp6_input() we should also update it before we call tcp_input().
In addition to that mark the mbuf NULL all the times when we return that we are done with handling the packet and no next header should be checked (IPPROTO_DONE). This will eventually allow us to assert proper behaviour and catch the above kind of errors more easily, expecting *mp to always be set.
This change is extracted from a larger patch and not an exhaustive change across the entire stack yet.
PR: 240135 Reported by: prabhakar.lakhera gmail.com MFC after: 3 weeks Sponsored by: Netflix
show more ...
|
#
c1131de6 |
| 08-Nov-2019 |
Bjoern A. Zeeb <bz@FreeBSD.org> |
frag6: properly handle atomic fragments according to RFCs.
RFC 8200 says: "If the fragment is a whole datagram (that is, both the Fragment Offset field and the M flag are zero), then it do
frag6: properly handle atomic fragments according to RFCs.
RFC 8200 says: "If the fragment is a whole datagram (that is, both the Fragment Offset field and the M flag are zero), then it does not need any further reassembly and should be processed as a fully reassembled packet (i.e., updating Next Header, adjust Payload Length, removing the Fragment header, etc.). .."
That means we should remove the fragment header and make all the adjustments rather than just skipping over the fragment header. The difference should be noticeable in that a properly handled atomic fragment triggering an ICMPv6 message at an upper layer (e.g. dest unreach, unreachable port) will not include the fragment header.
Update the test cases to also test for an unfragmentable part. That is needed so that the next header is properly updated (not just lengths).
MFC after: 3 weeks Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D22155
show more ...
|
Revision tags: release/12.1.0 |
|
#
6e6b5143 |
| 25-Oct-2019 |
Bjoern A. Zeeb <bz@FreeBSD.org> |
Properly set VNET when nuking recvif from fragment queues.
In theory the eventhandler invoke should be in the same VNET as the the current interface. We however cannot guarantee that for all cases i
Properly set VNET when nuking recvif from fragment queues.
In theory the eventhandler invoke should be in the same VNET as the the current interface. We however cannot guarantee that for all cases in the future.
So before checking if the fragmentation handling for this VNET is active, switch the VNET to the VNET of the interface to always get the one we want.
Reviewed by: hselasky MFC after: 3 weeks Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D22153
show more ...
|
#
702828f6 |
| 25-Oct-2019 |
Bjoern A. Zeeb <bz@FreeBSD.org> |
frag6: do not leak counter in error cases
When allocating the IPv6 fragement packet queue entry we do checks against counters and if we pass we increment one of the counters to claim the spot. Righ
frag6: do not leak counter in error cases
When allocating the IPv6 fragement packet queue entry we do checks against counters and if we pass we increment one of the counters to claim the spot. Right after that we have two cases (malloc and MAC) which can both fail in which case we free the entry but never released our claim on the counter. In theory this can lead to not accepting new fragments after a long time, especially if it would be MAC "refusing" them. Rather than immediately subtracting the value in the error case, only increment it after these two cases so we can no longer leak it.
MFC after: 3 weeks Sponsored by: Netflix
show more ...
|
#
619456bb |
| 25-Oct-2019 |
Bjoern A. Zeeb <bz@FreeBSD.org> |
frag6: prevent overwriting initial fragoff=0 packet meta-data.
When we receive the packet with the first fragmented part (fragoff=0) we remember the length of the unfragmentable part and the next he
frag6: prevent overwriting initial fragoff=0 packet meta-data.
When we receive the packet with the first fragmented part (fragoff=0) we remember the length of the unfragmentable part and the next header (and should probably also remember ECN) as meta-data on the reassembly queue. Someone replying this packet so far could change these 2 (3) values. While changing the next header seems more severe, for a full size fragmented UDP packet, for example, adding an extension header to the unfragmentable part would go unnoticed (as the framented part would be considered an exact duplicate) but make reassembly fail. So do not allow updating the meta-data after we have seen the first fragmented part anymore.
The frag6_20 test case is added which failed before triggering an ICMPv6 "param prob" due to the check for each queued fragment for a max-size violation if a fragoff=0 packet was received.
MFC after: 3 weeks Sponsored by: Netflix
show more ...
|
#
cd188da2 |
| 24-Oct-2019 |
Bjoern A. Zeeb <bz@FreeBSD.org> |
frag6: handling of overlapping fragments to conform to RFC 8200
While the comment was updated in r350746, the code was not. RFC8200 says that unless fragment overlaps are exact (same fragment twice)
frag6: handling of overlapping fragments to conform to RFC 8200
While the comment was updated in r350746, the code was not. RFC8200 says that unless fragment overlaps are exact (same fragment twice) not only the current fragment but the entire reassembly queue for this packet must be silently discarded, which we now do if fragment offset and fragment length do not match.
Obtained from: jtl MFC after: 3 weeks Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D16850
show more ...
|