android_kernel_motorola_sm6375/include
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Jason A. Donenfeld d418d61ae0
UPSTREAM: wireguard: device: reset peer src endpoint when netns exits
Each peer's endpoint contains a dst_cache entry that takes a reference
to another netdev. When the containing namespace exits, we take down the
socket and prevent future sockets from being created (by setting
creating_net to NULL), which removes that potential reference on the
netns. However, it doesn't release references to the netns that a netdev
cached in dst_cache might be taking, so the netns still might fail to
exit. Since the socket is gimped anyway, we can simply clear all the
dst_caches (by way of clearing the endpoint src), which will release all
references.

However, the current dst_cache_reset function only releases those
references lazily. But it turns out that all of our usages of
wg_socket_clear_peer_endpoint_src are called from contexts that are not
exactly high-speed or bottle-necked. For example, when there's
connection difficulty, or when userspace is reconfiguring the interface.
And in particular for this patch, when the netns is exiting. So for
those cases, it makes more sense to call dst_release immediately. For
that, we add a small helper function to dst_cache.

This patch also adds a test to netns.sh from Hangbin Liu to ensure this
doesn't regress.

Tested-by: Hangbin Liu <liuhangbin@gmail.com>
Reported-by: Xiumei Mu <xmu@redhat.com>
Cc: Toke Høiland-Jørgensen <toke@redhat.com>
Cc: Paolo Abeni <pabeni@redhat.com>
Fixes: 900575aa33a3 ("wireguard: device: avoid circular netns references")
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
(cherry picked from commit 20ae1d6aa159eb91a9bf09ff92ccaa94dbea92c2)
Bug: 187129171
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: I8238af8e27da0f33797e7a3120a714f3902335f0
2025-09-24 12:16:39 +02:00
..
acpi ACPICA: Avoid sequence overread in call to strncmp() 2025-06-27 11:02:52 +01:00
asm-generic
clocksource
crypto UPSTREAM: crypto: poly1305 - fix poly1305_core_setkey() declaration 2025-09-24 12:16:39 +02:00
drm This is the 5.4.296 stable release 2025-07-18 10:57:54 +00:00
dt-bindings
keys
kvm
linux Merge tag 'ASB-2025-09-05_11-5.4' of https://android.googlesource.com/kernel/common into android13-5.4-lahaina 2025-09-12 18:48:05 +03:00
math-emu
media
misc
net UPSTREAM: wireguard: device: reset peer src endpoint when netns exits 2025-09-24 12:16:39 +02:00
pcmcia
ras
rdma This is the 5.4.296 stable release 2025-07-18 10:57:54 +00:00
scsi
soc
sound Merge tag 'ASB-2025-08-05_11-5.4' of https://android.googlesource.com/kernel/common into android13-5.4-lahaina 2025-09-01 13:17:46 +03:00
target
trace Merge tag 'ASB-2025-08-05_11-5.4' of https://android.googlesource.com/kernel/common into android13-5.4-lahaina 2025-09-01 13:17:46 +03:00
uapi UPSTREAM: wireguard: global: fix spelling mistakes in comments 2025-09-24 12:16:34 +02:00
vdso
video
xen xen/mcelog: Add __nonstring annotations for unterminated strings 2025-05-02 07:39:09 +02:00
OWNERS