<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/sys/net, branch release/13.5.0-p3</title>
<subtitle>FreeBSD source tree</subtitle>
<id>https://cgit-dev.freebsd.org/src/atom?h=release%2F13.5.0-p3</id>
<link rel='self' href='https://cgit-dev.freebsd.org/src/atom?h=release%2F13.5.0-p3'/>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/'/>
<updated>2025-02-06T19:06:42Z</updated>
<entry>
<title>ifnet: Detach BPF descriptors on interface vmove event</title>
<updated>2025-02-06T19:06:42Z</updated>
<author>
<name>Zhenlei Huang</name>
<email>zlei@FreeBSD.org</email>
</author>
<published>2025-02-04T15:04:59Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=6b81815307b00d37b81f71d68a51f67c72a2edb0'/>
<id>urn:sha1:6b81815307b00d37b81f71d68a51f67c72a2edb0</id>
<content type='text'>
When an interface is moving to/from a vnet jail, it may still have BPF
descriptors attached. The userland (e.g. tcpdump) does not get noticed
that the interface is departing and still opens BPF descriptors thus
may result in leaking sensitive traffic (e.g. an interface is moved
back to parent jail but a user is still sniffing traffic over it in
the child jail).

Detach BPF descriptors so that the userland will be signaled.

Reviewed by:	ae
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D45727

(cherry picked from commit 1ed9b381d4701fc9f66741256e93b96e22273217)

ifnet: Fix build without BPF

The newly introduced function bpf_ifdetach() is only available when
device bpf is enabled.

Fixes:	1ed9b381d470 ifnet: Detach BPF descriptors on interface vmove event
(cherry picked from commit d8413a1c3ba235a79ae6b8cc35767a861855c7e2)
(cherry picked from commit 2e4eaf3c13d2b5aa76f9759e51e35faf29d56993)
</content>
</entry>
<entry>
<title>ifnet: Make if_detach_internal() and if_vmove() void</title>
<updated>2025-02-06T18:59:58Z</updated>
<author>
<name>Zhenlei Huang</name>
<email>zlei@FreeBSD.org</email>
</author>
<published>2025-02-04T15:04:59Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=e0b2b8fa16a13abb1ea8326c6ff311d0d94108db'/>
<id>urn:sha1:e0b2b8fa16a13abb1ea8326c6ff311d0d94108db</id>
<content type='text'>
if_detach_internal() never fail since change [1]. As a consequence,
also does its caller if_vmove(). While here, remove a stall comment.

No functional change intended.

This reverts commit c7bab2a7ca9a6dae79f970c6730a19b65a1ed86e.

[1] a779388f8bb3 if: Protect V_ifnet in vnet_if_return()

Reviewed by:	glebius
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D48820

(cherry picked from commit bb0348a17974d83671becbd32ea0e4bd2ea61906)
(cherry picked from commit 700880a13566193b853f75c87ba5c37d395f6a1e)
</content>
</entry>
<entry>
<title>bpf: Fix potential race conditions</title>
<updated>2025-02-06T18:49:48Z</updated>
<author>
<name>Zhenlei Huang</name>
<email>zlei@FreeBSD.org</email>
</author>
<published>2025-02-03T12:13:19Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=19142d2a9600589d57df3b1a983b51b43065c0c1'/>
<id>urn:sha1:19142d2a9600589d57df3b1a983b51b43065c0c1</id>
<content type='text'>
There're two possible race conditions,

1. Concurrent bpfattach() and bpf_setif(), i.e., BIOCSETIF ioctl,
2. Concurrent bpfdetach() and bpf_setif().

For the first case, userland may see BPF interface attached but it has
not been in the attached interfaces list `bpf_iflist` yet. Well it
will eventually be so this case does not matter.

For the second one, bpf_setif() may reference `dead_bpf_if` and the
kernel will panic (spotted by change [1], without the change we will
end up silently corrupted memory).

A simple fix could be that, we add additional check for `dead_bpf_if`
in the function `bpf_setif()`. But that requires to extend protection
of global lock (BPF_LOCK), i.e., BPF_LOCK should also protect the
assignment of `ifp-&gt;if_bpf`. That simple fix works but is apparently
not a good design. Since the attached interfaces list `bpf_iflist` is
the single source of truth, we look through it rather than check
against the interface's side, aka `ifp-&gt;if_bpf`.

This change has performance regression, that the cost of BPF interface
attach operation (BIOCSETIF ioctl) goes back from O(1) to O(N) (where
N is the number of BPF interfaces). Well we normally have sane amounts
of interfaces, an O(N) should be affordable.

[1] 7a974a649848 bpf: Make dead_bpf_if const

Fixes:		16d878cc99ef Fix the following bpf(4) race condition ...
MFC after:	4 days
Differential Revision:	https://reviews.freebsd.org/D45725

(cherry picked from commit 7def047a1ae93b3b10bd57ed1bd28e861f94b596)
(cherry picked from commit 56c93859038ff3de9041834fc798b20dc213621b)
</content>
</entry>
<entry>
<title>vnet: Fix style nits</title>
<updated>2025-02-03T12:27:05Z</updated>
<author>
<name>Zhenlei Huang</name>
<email>zlei@FreeBSD.org</email>
</author>
<published>2025-01-30T15:59:35Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=0cc5ddd0b9f20666b6f7362f4f469962b148b832'/>
<id>urn:sha1:0cc5ddd0b9f20666b6f7362f4f469962b148b832</id>
<content type='text'>
MFC after:	3 days

(cherry picked from commit 903c7cdac5b5b4b720aba7a48abffb48b2588c77)
(cherry picked from commit ceda6f83b119ab5c86478bedeefe8c0270691897)
</content>
</entry>
<entry>
<title>if_vxlan(4): Prefer SYSCTL_INT over TUNABLE_INT</title>
<updated>2025-02-03T12:27:05Z</updated>
<author>
<name>Zhenlei Huang</name>
<email>zlei@FreeBSD.org</email>
</author>
<published>2025-01-27T15:54:43Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=67e952ebaaad2f3db00c05b1fe23afdf95c32166'/>
<id>urn:sha1:67e952ebaaad2f3db00c05b1fe23afdf95c32166</id>
<content type='text'>
This driver does not need to retrieve those tunable during early boot.
Meanwhile SYSCTL_INT can provide rich info such as description.
Also `sysctl net.link.vxlan.[legacy_port|reuse_port]` can report the
current settings.

MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D48621

(cherry picked from commit 92632371b360010709fad60146f1aee0b8b99776)
(cherry picked from commit 7d2a5c78a714732f3494c7d8668b36368ed6bc39)
</content>
</entry>
<entry>
<title>if_vxlan(4): Use static initializers</title>
<updated>2025-02-03T12:27:05Z</updated>
<author>
<name>Zhenlei Huang</name>
<email>zlei@FreeBSD.org</email>
</author>
<published>2025-01-24T09:37:24Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=7a6319ece24f2c672ca074c1266364ac018b3ef2'/>
<id>urn:sha1:7a6319ece24f2c672ca074c1266364ac018b3ef2</id>
<content type='text'>
MFC after:	1 week

(cherry picked from commit 5e0dbbc238e2e935c68e293314a90f2ce6e6ef16)
(cherry picked from commit e2b6e11583eb13ee09a7cb0babc2a1d8f3bd952a)
</content>
</entry>
<entry>
<title>libpcap: Update to 1.10.3</title>
<updated>2025-01-29T19:29:28Z</updated>
<author>
<name>Joseph Mingrone</name>
<email>jrm@FreeBSD.org</email>
</author>
<published>2023-02-13T22:06:51Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=7aedea8685359fa5e914a7341ef0ef33b8227d7c'/>
<id>urn:sha1:7aedea8685359fa5e914a7341ef0ef33b8227d7c</id>
<content type='text'>
Prior to this MFC, the stable/13 libpcap was at version 1.9.1, which was
released over five years ago.  Several CVEs have been identified in that
version.  For a detailed list, see
https://www.tcpdump.org/public-cve-list.txt.

Reviewed by:	kp (pf changes)
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 6d1c946e916845d01062e146aad5395410da1e54)
(cherry picked from commit 0c59e0b4e5817f139ce28486085b2f196351c7a3)
(cherry picked from commit 512c553671bef26e93342d4ae1ec5f60d8ae112b)
(cherry picked from commit 6f9cba8f8b5efd16249633e52483ea351876b67b)
(cherry picked from commit 437f05885047c533cadf15b564729cfd0273d2fe)

Commit 437f05885047c533cadf15b564729cfd0273d2fe has been adapted to only
include the changes for the libpcap 1.10.3 update.
</content>
</entry>
<entry>
<title>if_vxlan(4): Invoke vxlan_stop event handler only when the interface is configured</title>
<updated>2025-01-28T15:26:49Z</updated>
<author>
<name>Zhenlei Huang</name>
<email>zlei@FreeBSD.org</email>
</author>
<published>2025-01-21T15:02:13Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=20374abf0ce8228972f54795bf7ac6266be190ef'/>
<id>urn:sha1:20374abf0ce8228972f54795bf7ac6266be190ef</id>
<content type='text'>
It is harmless but pointless to invoke vxlan_stop event handler when the
interface was not previously configured. This change will also prevent
an assert panic from t4_vxlan_stop_handler().

Reviewed by:	kib
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D48494

(cherry picked from commit 960c5bb0f6bf44aeb09fa14fd0f82c2e82ebe2e2)
(cherry picked from commit aa79996e605735dcd9b1bf83d6affefa404530d1)
</content>
</entry>
<entry>
<title>sppp: Fix getting wrong spppreq cmd from ioctl</title>
<updated>2025-01-14T10:56:49Z</updated>
<author>
<name>Zhenlei Huang</name>
<email>zlei@FreeBSD.org</email>
</author>
<published>2025-01-14T10:56:49Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=08ec14fecf6a93c0321c31ba1f0b04db6b888f16'/>
<id>urn:sha1:08ec14fecf6a93c0321c31ba1f0b04db6b888f16</id>
<content type='text'>
ifr-&gt;ifr_data is supposed to point to a struct spppreq. The first member
cmd of struct spppreq is int type. It was pre-read via `fueword()` before
a full fetching. Unfortunately an user space `struct spppreq spr` may not
be zeroed explicitly, on 64bit architectures `fueword()` reads 64bit word
thus the garbage (extra 4 bytes) may be read into kernel space (subcmd).

Prior to f9d8181868ee, `subcmd` was declared as int and assigned from
`fuword()` and was implicitly converted from long to int. On 64bit little
endian architectures the implicitly conversion overflows (undefined
bahavior) which happen to trash the garbage (the extra 4 bytes, high
32 bits) and worked, but no luck on 64bit big endian architectures.

Since f9d8181868ee `subcmd` was changed to u_long then there is no
conversion so we end up mismatching `subcmd` with user space's `cmd`.

It is also a bit hackish to get the value of cmd via `fueword()`, instead
we refer to it directly from spr-&gt;cmd.

This is a direct commit to stable/13 as sppp(4) no longer exists in main
and stable/14.

PR:		173002
Reviewed by:	glebius (previous version)
Fixes:	f9d8181868ee Fixed yet more ioctl breakage due to the type of ...
Differential Revision:	https://reviews.freebsd.org/D47335
</content>
</entry>
<entry>
<title>Fix failure to add an interface prefix route</title>
<updated>2025-01-11T12:34:48Z</updated>
<author>
<name>Alexander V. Chernikov</name>
<email>melifaro@FreeBSD.org</email>
</author>
<published>2024-11-12T23:36:50Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=f57df4589d3cd91dac88b2c9edb80ad0eb50979c'/>
<id>urn:sha1:f57df4589d3cd91dac88b2c9edb80ad0eb50979c</id>
<content type='text'>
when route with the same  prefix is already presented
in the routing table.

PR:		277125
Reported by:	Oleksandr Ignatyev &lt;alex@i.org.ua&gt;
Reviewed by:	ae, jlduran
Tested by:	jlduran
Differential Revision: https://reviews.freebsd.org/D47534

(cherry picked from commit 1da4954c92ea7585b352ba830d3ee64ca69ada52)
</content>
</entry>
</feed>
