Article View: linux.kernel.netdev
Article #5575[PATCH bpf-next v2 0/3] bpf: Add bpf_ksock_sendto() kfunc
From: Mahe Tardy
Date: Tue, 20 Oct 2026 15:58
Date: Tue, 20 Oct 2026 15:58
34 lines
12320 bytes
12320 bytes
This patch series improves the bpf_ksock infrastructure in line with the work proposed during Prague Plumbers 2026 presentation[^1] by adding the bpf_ksock_sendto() kfunc to complement the bpf_ksock_send(). This is useful when using ksock to reply to differents peers while reusing the same UDP socket and generally works toward the goal of ksock to support the basic socket operations. [^1]: https://lpc.events/event/20/contributions/2430/ v2 updates: - remove the LSM verifier filter refinements (alexei) - remove allowing calling connect() from the send path (alexei) - change order of the tests patches for signature definition (sashiko) v1: https://lore.kernel.org/bpf/DM9RCU3BDWEG.1C32ZIVU95S76@gmail.com/ Mahe Tardy (3): bpf: add bpf_ksock_sendto() kfunc selftests/bpf: Test ksock sendto() selftests/bpf: Test forbidden bpf_ksock_sendto() LSM attach net/core/bpf_ksock.c | 96 +++++++++++----- .../selftests/bpf/prog_tests/ksock_sendto.c | 108 ++++++++++++++++++ .../selftests/bpf/progs/ksock_common.h | 2 + .../selftests/bpf/progs/ksock_lsm_verifier.c | 25 +++- .../selftests/bpf/progs/ksock_sendto.c | 59 ++++++++++ 5 files changed, 262 insertions(+), 28 deletions(-) create mode 100644 tools/testing/selftests/bpf/prog_tests/ksock_sendto.c create mode 100644 tools/testing/selftests/bpf/progs/ksock_sendto.c -- 2.43.0
Technical Details
Message-ID:
<20261020155848.75711-1-mahe.tardy@gmail.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-349381-linux-kernel-netdev=dewy.ruShow Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-349381-linux-kernel-netdev=dewy.ru
From: mahe.tardy@gmail.com (Mahe Tardy)
Newsgroups: linux.kernel.netdev
Subject: [PATCH bpf-next v2 0/3] bpf: Add bpf_ksock_sendto() kfunc
Date: Tue, 20 Oct 2026 15:58:45 +0000
Organization: Usenet Network
Message-ID: <20261020155848.75711-1-mahe.tardy@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
logging-data="3890153"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:hQVpGZLn4tyFyq5b00D1CRtUpAs= sha256:b+tw+lvk0oiab+vXaCBEw/1Bzi4mCWQUyW6b4MnieLU=
sha1:/n7atnoBJ/mWF0lo976oywHA0k0= sha256:XYJSQPFnTHcRsbIkimwo8YFZlSOZqnUOPkwwD5+QjbU=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
by mail.dewy.ru (Postfix) with ESMTP id 4D57D110D6C; Tue, 20 Oct 2026 19:03:59 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.047
X-Spam-Status: No, score=-3.047 tagged_above=-9999 required=6.31
tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
DKIM_VALID_AU=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001,
FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25,
MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
header.d=gmail.com
X-Received: from mail.dewy.ru ([127.0.0.1])
by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
with ESMTP id IDixGDGRAhgM;
Tue, 20 Oct 2026 19:03:56 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-349381-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=gmail.com
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
by mail.dewy.ru (Postfix) with ESMTPS id B9BDC110D64; Tue, 20 Oct 2026 19:03:47 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
by sea.lore.kernel.org (Postfix) with ESMTP id CF71933264; Tue, 20 Oct 2026 15:59:04 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
t=1792511942;
b=OzhqTovE2EcPIpGHe/TN2gUWQ/6mcNKLyXvr9jbpEisR+OXobshjBBxXX0g1AwZbbD0P
0zn4JaRaxshsGtNxCPnDu5KNX8O8I62Bt9R5SEJuZTNnvfaj3IHizUifnKUtpUftWPaTF
//zdNuFzcELNvIr1NkPJmLQgrlyUqY6vf6Upe91F1Ny9LX8inw9odt9IAwq7kdamXPtGC
Hx75Yr8EmWYwsX0iMC32mz0p5FyR2Zr41BzCfhv3xvJoTApnXNVqfLKuXFHhc68Aoi1cm
MjvvtXyb6YBUpzJbccX7IiwWPfmakD/OGjiFwFxvkORFuuuHb8oZnJ4n6/MugkQaikA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1792511942;
h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
X-Google-DKIM-Signature:X-Forwarded-Encrypted:X-Gm-Message-State:
X-Gm-Gg:X-Received:Received:From:To:Cc:Subject:Date:Message-ID:
X-Mailer:X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
List-Unsubscribe:List-Owner:Precedence:MIME-Version:
Content-Transfer-Encoding;
bh=H4H7iRSUlsSj9ifdlVtDp+ziRohA+ewp4DyoXrJPO6Q=;
b=CiNAoMOvfFQeslT8o4NPkvQi2EMgGLNW3pRnVNa6w7+PMBNxZiyTfwgOdVxYWfBrH9hO
lv4CKR69Psi0yUpjBtfLxvGd/oVko6UC7lrlE6QKBB0KrgTORxsdUoEjbnpvkcnU49LBV
GAcylqFkbbCRUtj9DtzcP+/Wm/9inVZQG9GmWjEmsEa2UfrCrjCAmbWA7KoYRSl9uor7+
8p9OgOfxhsFxuYeXXvpdoq26xgt0PPPcFCmFGgUPhuK1ynaYCZdKQJIRleJSExlBlh5+u
JgnsdUHFWhT3w1Xk2HvObTnNjHv9Q5TiY6lvGsS0e+LHToSBnaMES9i2xiiKv07CMxQ==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org;
dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=R8iBNnGY;
dmarc=pass header.from=gmail.com;
spf=pass smtp.mailfrom=gmail.com;
arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id 0C541606A319;
Tue, 20 Oct 2026 15:59:02 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=R8iBNnGY
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.128.44
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
t=1792511941;
b=XViBnU/u76bwr+KWivabJZKHhisEYrYU9TLOSvFWQp/wIP4P97nxghIxGxZgUckp3HJn
MyEmW5OIkQlGkd/LoEVN6broFgZybjsZYQL1fvgj4PPzy5Xr2i2No2ryaVMwv+W1RNcYL
et5fWRS6AdIvpYPG3aObc+ooRPX2xJlZgoS/fDf/E/EpouPK5wE8r4CyVd5fXee/JQa4U
LR7b5LZvhfe69Akgj51Oex3fMa95HQaMn9bgNm7AX1ZFgRDuS1ch3YdEymiiqMAyttfZ2
onaegkdtsyEYhHfIRf1UX3gC0Jqprl4MQoDGa9jQvP7M3NvkfsszmUmzLwjPp3U8JcQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1792511941;
h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received:
From:To:Cc:Subject:Date:Message-ID:X-Mailer:MIME-Version:
Content-Transfer-Encoding;
bh=H4H7iRSUlsSj9ifdlVtDp+ziRohA+ewp4DyoXrJPO6Q=;
b=UKkrKp+bENbQWDRvRxru0yhDQlSLRV2uwP1ymu8SXYPGG104E7U4iZmrVXTuptoMX5XL
IGLdu7MCLNROaUgwNkDUEwvoZVwklZt9MABDPRQ+TPE1+yXeXurZj+Ofl1s5McTgAq8Mg
hJ1FKU3tem4anjq/pY62eI45GXAKvdcti+m7Qtpkz1KY+baJf9ek1fIvZj5jHCxCGhox4
akfZqU20HIbwuKA4kCUDgE/elJfXw7galRR0VCEn8XRvlYIQGrlafT6013Ner8ftCERRA
k+aBESiac8f1P1WYvo+188SDB6atINQTwfiBWQsGdmES/V1vOyFvYqMJgwvaNRWR9lg==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
dmarc=pass header.from=gmail.com;
spf=pass smtp.mailfrom=gmail.com;
dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=R8iBNnGY;
arc=none smtp.remote-ip=209.85.128.44
X-Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44])
(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1DB97606A327
for <netdev@vger.kernel.org>; Tue, 20 Oct 2026 15:58:59 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 1DB97606A327
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
X-Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-4a1e2957d7eso24580215e9.2
for <netdev@vger.kernel.org>; Tue, 20 Oct 2026 08:58:59 -0700 (PDT)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20251104; t=1792511938; x=1793116738; darn=vger.kernel.org;
h=content-transfer-encoding:mime-version:message-id:date:subject:cc
:to:from:from:to:cc:subject:date:message-id:reply-to:content-type;
bh=H4H7iRSUlsSj9ifdlVtDp+ziRohA+ewp4DyoXrJPO6Q=;
b=R8iBNnGYaqT/wGTjR7wkqrvY+S3fvytGSkjEUzOmFr8dCGfdqjyLMjhUjrzdLPNQar
Qly8fNmIxnutCyFiTuBB9EZMl/5V3qTDS/UzBpZtriUgp1ryjFgaA1xM5JEXXSKPz+6W
Iy6REj4P5u+N+0MX1VxxtNtesU9/+cTibZixvOYM5tawFdR8NuBDGj1lahLxq61D/Pte
MkG4RP71Ysjh4yQoLQ07bDUCbEmbTQZYvRnvLzlEq3mGWa5E76ZUKrgA20C605xF1hjF
3SOI5B7T4BIv0zDBqTa8WOHDjqQ0NiMNNuoLirHSLMmrKGL/VqmA5DSrxfChWBGkJXtQ
x61Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1792511938; x=1793116738;
h=content-transfer-encoding:mime-version:message-id:date:subject:cc
:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
:message-id:reply-to:content-type;
bh=H4H7iRSUlsSj9ifdlVtDp+ziRohA+ewp4DyoXrJPO6Q=;
b=jwk873c3Q7jx/OGdRjIIbmrGVEjATUHnDOA7THmCXwRwtGusl//9hydwHb7PeccqgS
wNKd6tokY73C1jQtDEQQjxyXwAwYGx/oo5Hihz/0oGLMStQ3xShEn1sTQtbYXioUWL/p
9lkO/HZ4727Oet7rKNm54UL8Cy6zUVKr/WNlZqBbZTH+LMpdNuMkVhlvOrqTwREbRX/0
04S8ucZ+UzmYjF74GED9WKL5DnXvqwWuLwEwV0SpYwahEw9fsSZ0XtailiDSvhsDU+r2
mhfABpad79QKjSY0RrpHp9U2dOAgA4PYTIjlvkVaMWZkwZ53iz+TTjn52WYM/dZ5CBED
BweQ==
X-Forwarded-Encrypted: i=1; AKwUvBx5BRuddXtFbx4rKQ99Kd7fkjFrE926ZQAfe7Zujf6a8h8kP/XdL22UepFMIbnStAvKItJsAMA=@vger.kernel.org
X-Gm-Message-State: AFq9FYK+/Xmk529S+IPl337JF199gEsR9P+P+vRio5wKQB1DqAb7yXGX
RNshaBUEajUqkkTRB0AGQxlMbfqRhuUANrDo4K+vrLfSyj8bN3DoLeg7
X-Gm-Gg: AYBFou0iG0YuVHlE24u6wfAal9rMjM0Urzp6vHfzg8R4JIiLziqQ3nV25IQ3mtTYxni
Ei5MD7hjdLWCw2ZTXP3qYNRSx/FiZfFsJnekAmwDQlRzgMcjT5OXsrijvBFb/GByR0CgRIDqZJz
mfTXfhsZmjr1zQsEWvyT5C1a02WhFoVvY6FChgtYzjE8vf/soSw6DfZX0SA4++4ob9iFYTgnnLP
mGLLaL5FUsxzWmExov9u2FjaQLiWsvynWPD2i/Sqa9/+XWS/eW66YvU+GugW6m8kB9RVQ2QREpt
kpPHIS4sFq4BMRMTDhedO2GWxEC87Bpygjx4HV8m+xMmCwhWlC5rclY8tBM2qzVnv2m9h0tHm+B
FIBpFZWAe+J/aF3e1l2nsvknQdM7GAJoAz4mRJ6xyFws9xh2JhFPP+XKtZH8mwkKVDMxLy91V4Z
K9sfTzYMg2glTW6udXYpVKOiLx5T3b53Paf2wMeqPDPBXbb06IVgWelgLGHDbdpW2qVQBcsqcyM
caJZE+q8kf1VBofSPk8KIgNFMBTkA9YtHhdz7hZKPIAyA==
X-Received: by 2002:a05:600c:4fd4:b0:4a1:cd83:f027 with SMTP id 5b1f17b1804b1-4a1d7634bf5mr214566405e9.27.1792511938310;
Tue, 20 Oct 2026 08:58:58 -0700 (PDT)
X-Received: from mtardy-friendly-lvh-runner.europe-west1-c.c.cilium-dev.internal ([2600:1900:4010:1a8::])
by smtp.googlemail.com with ESMTPSA id 5b1f17b1804b1-4a1fb83ff02sm5627335e9.6.2026.10.20.08.58.57
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Tue, 20 Oct 2026 08:58:57 -0700 (PDT)
X-Cc: andrii@kernel.org,
ast@kernel.org,
daniel@iogearbox.net,
davem@davemloft.net,
willemb@google.com,
eddyz87@gmail.com,
edumazet@google.com,
john.fastabend@gmail.com,
kuba@kernel.org,
horms@kernel.org,
liamwisehart@meta.com,
martin.lau@linux.dev,
pabeni@redhat.com,
song@kernel.org,
netdev@vger.kernel.org,
sdf.kernel@gmail.com,
yonghong.song@linux.dev,
jolsa@kernel.org,
kuniyu@google.com,
memxor@gmail.com,
emil@etsalapatis.com,
almagui@kernel.org,
Mahe Tardy <mahe.tardy@gmail.com>
X-Mailer: git-send-email 2.43.0
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list