android_kernel_motorola_sm6375/include
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Jakub Sitnicki 885e5d2532
UPSTREAM: bpf: Add link-based BPF program attachment to network namespace
Extend bpf() syscall subcommands that operate on bpf_link, that is
LINK_CREATE, LINK_UPDATE, OBJ_GET_INFO, to accept attach types tied to
network namespaces (only flow dissector at the moment).

Link-based and prog-based attachment can be used interchangeably, but only
one can exist at a time. Attempts to attach a link when a prog is already
attached directly, and the other way around, will be met with -EEXIST.
Attempts to detach a program when link exists result in -EINVAL.

Attachment of multiple links of same attach type to one netns is not
supported with the intention to lift the restriction when a use-case
presents itself. Because of that link create returns -E2BIG when trying to
create another netns link, when one already exists.

Link-based attachments to netns don't keep a netns alive by holding a ref
to it. Instead links get auto-detached from netns when the latter is being
destroyed, using a pernet pre_exit callback.

When auto-detached, link lives in defunct state as long there are open FDs
for it. -ENOLINK is returned if a user tries to update a defunct link.

Because bpf_link to netns doesn't hold a ref to struct net, special care is
taken when releasing, updating, or filling link info. The netns might be
getting torn down when any of these link operations are in progress. That
is why auto-detach and update/release/fill_info are synchronized by the
same mutex. Also, link ops have to always check if auto-detach has not
happened yet and if netns is still alive (refcnt > 0).

Change-Id: I5d37351067b49c8fd029f236150c82dec7d29c4f
Signed-off-by: Jakub Sitnicki <jakub@cloudflare.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20200531082846.2117903-5-jakub@cloudflare.com
2026-01-14 17:48:09 -08:00
..
acpi ACPICA: Avoid sequence overread in call to strncmp() 2025-06-27 11:02:52 +01:00
asm-generic UPSTREAM: mm/tlb: Provide default nmi_uaccess_okay() 2025-12-23 13:35:38 -08:00
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 UPSTREAM: bpf: Add link-based BPF program attachment to network namespace 2026-01-14 17:48:09 -08:00
math-emu
media
misc
net UPSTREAM: bpf: Add link-based BPF program attachment to network namespace 2026-01-14 17:48:09 -08:00
pcmcia
ras
rdma This is the 5.4.296 stable release 2025-07-18 10:57:54 +00:00
scsi This is the 5.4.301 stable release 2025-10-30 07:52:10 +00:00
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 UPSTREAM: cgroup: use cgrp->kn->id as the cgroup ID 2025-12-23 13:36:09 -08:00
uapi UPSTREAM: bpf: Add link-based BPF program attachment to network namespace 2026-01-14 17:48:09 -08:00
vdso
video
xen
OWNERS