Article View: linux.kernel.netdev
Article #19330[PATCH iproute2-next 0/7] bpf: fix mount point parsing and drop the legacy loader
From: Stephen Hemminger
Date: Thu, 19 Nov 2026 19:02
Date: Thu, 19 Nov 2026 19:02
90 lines
14702 bytes
14702 bytes
While looking at OSS Scanner reports noticed a pattern of issues
around the BPF loader. The first set related to parsing of
mount points with fscanf("%s").
The next part were issues from the legacy BPF loader which
is no longer needed. This series rips the band-aid off
and related parts no longer needed.
There were also some bugs in error handling found
while changing all this.
Note: lib/bpf_legacy.c becomes lib/bpf_util.c. "ar rcs" does not
drop members that are no longer built, so a stale bpf_legacy.o and
sha1.o stay in lib/libutil.a and are picked up by the link. The
build still succeeds, but run "make distclean" to be rid of them.
The libbpf build options are gone: libbpf is now always required,
and pkg-config is the only way it is found. Both --libbpf_force and
--libbpf_dir are now rejected rather than silently ignored.
The last patch adds a tc bpf test, there was none before. It caught
a regression in this series that the build did not: the tc/ pin
subdirectory quietly went missing.
Since v1: squashed the four libbpf configure patches into one,
dropped the bpf_pinning fallback fix since the loader removal
deletes that code anyway, moved the tc-bpf(8) update next to the
change it documents, and reworded the export removal after Jamal
pointed out that LIBBPF_FORCE=off builds did have a working
import/run. Dropped Toke's Reviewed-by from the mount point check:
it now also restores the pin subdirectory, so it is not the patch
he reviewed.
Stephen Hemminger (7):
lib/bpf: parse /proc/mounts with getmntent and check fs magic
lib/fs: parse /proc/mounts with getmntent and check fs magic
tc: remove eBPF map export and exec bpf import
man: tc-bpf: drop references to the removed eBPF agent
lib/bpf: require libbpf 1.0 and remove legacy ELF loader
lib/bpf: check for missing bpf fs mount point
testsuite: add tc bpf test
bash-completion/tc | 18 +-
configure | 129 +-
etc/iproute2/bpf_pinning | 6 -
examples/bpf/README | 18 +-
examples/bpf/bpf_map_in_map.c | 4 +-
examples/bpf/bpf_shared.c | 14 +-
examples/bpf/legacy/bpf_cyclic.c | 35 -
examples/bpf/legacy/bpf_graft.c | 66 -
examples/bpf/legacy/bpf_map_in_map.c | 56 -
examples/bpf/legacy/bpf_shared.c | 53 -
examples/bpf/legacy/bpf_tailcall.c | 117 -
include/bpf_api.h | 7 +-
include/bpf_elf.h | 35 +-
include/bpf_scm.h | 77 -
include/bpf_util.h | 41 +-
include/sha1.h | 18 -
ip/iplink.c | 4 -
lib/Makefile | 10 +-
lib/bpf_glue.c | 15 +-
lib/bpf_legacy.c | 3306 --------------------------
lib/bpf_libbpf.c | 260 +-
lib/bpf_util.c | 1105 +++++++++
lib/fs.c | 33 +-
lib/sha1.c | 108 -
man/man8/ip-link.8.in | 5 +-
man/man8/tc-bpf.8 | 173 +-
misc/ss.c | 946 +++++---
tc/e_bpf.c | 157 +-
tc/f_bpf.c | 12 +-
tc/m_bpf.c | 13 +-
testsuite/tests/tc/bpf.t | 153 ++
31 files changed, 2095 insertions(+), 4899 deletions(-)
delete mode 100644 etc/iproute2/bpf_pinning
delete mode 100644 examples/bpf/legacy/bpf_cyclic.c
delete mode 100644 examples/bpf/legacy/bpf_graft.c
delete mode 100644 examples/bpf/legacy/bpf_map_in_map.c
delete mode 100644 examples/bpf/legacy/bpf_shared.c
delete mode 100644 examples/bpf/legacy/bpf_tailcall.c
delete mode 100644 include/bpf_scm.h
delete mode 100644 include/sha1.h
delete mode 100644 lib/bpf_legacy.c
create mode 100644 lib/bpf_util.c
delete mode 100644 lib/sha1.c
create mode 100755 testsuite/tests/tc/bpf.t
--
2.53.0
Technical Details
Message-ID:
<20261119190312.578885-1-stephen@networkplumber.org>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-367260-linux-kernel-netdev=dewy.ruShow Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-367260-linux-kernel-netdev=dewy.ru
From: stephen@networkplumber.org (Stephen Hemminger)
Newsgroups: linux.kernel.netdev
Subject: [PATCH iproute2-next 0/7] bpf: fix mount point parsing and drop the legacy loader
Date: Thu, 19 Nov 2026 11:02:35 -0800
Organization: Usenet Network
Message-ID: <20261119190312.578885-1-stephen@networkplumber.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
logging-data="2957914"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:0KcXHFOPBFu0RIWscGPfKtcHxUw= sha256:2z+LXL1yM+aOJpaqSR6f6Bi2X28dI64bTStDRKOrWPQ=
sha1:/EPUOHnAujYMgjpaAPsRtCZPeS0= sha256:w2bb/tJkDP6eorNFHYufBr9BFrdS2EPjojTDH0WVL1A=
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 3F5F111574E; Thu, 19 Nov 2026 22:03:45 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -2.95
X-Spam-Status: No, score=-2.95 tagged_above=-9999 required=6.31
tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
HEADER_FROM_DIFFERENT_DOMAINS=0.249, 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=networkplumber-org.20260707.gappssmtp.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 NjuNs89_127k;
Thu, 19 Nov 2026 22:03:42 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-367260-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=fail (p=quarantine dis=none) header.from=networkplumber.org
X-Received: from sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4])
by mail.dewy.ru (Postfix) with ESMTPS id D65C4115747; Thu, 19 Nov 2026 22:03:28 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
by sin.lore.kernel.org (Postfix) with ESMTP id 490BB1A089D; Thu, 19 Nov 2026 19:03:20 +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=1795114997;
b=LssllUBA8fC/QDFEOcIvlHuF14csLK5+U3h4ft1b1btL02JDdxDWvjrrrC/0u4wpotHn
SKKu397dKoGXszxh5hR8/6F1Ku74GnboMjimnACpjOPJFv/D35dPcN8yHUJKWeEp7Dw39
S8ges82wz3bslsxy2EtzUqCtlwx+U7L/AuGBTy1KAzn00AoE64zsH/YAjJrVllp+cZ3dT
piRIDt5L4HpgpI3RuJIMVIRnqm6VIN4KcQ2H+41wLi+ZPWKce8Pjf8GUAKW7mfKBaTE5t
cGN6yWwF5gESvGmVNGgYhZjIO05lpz3I7p7XOKAOwLzsqOaF098+onQPIH3sZAJtYsQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1795114997;
h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
X-Google-DKIM-Signature: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=yGFvb8N9U4YFec1+J2L9SxsAwyGtd5uIvbctO3Neuc8=;
b=Rw6CpK4gNrmaJpX57Ne6kCvz1Ka0vfGB+ulEMDwZBqNJgsC7g42gXsPJx59U3XgTLVfT
83yQhbR25g5ujXZ0WvrIXfJw5ZaADQn2OeRX6c9HopR5bCrVvCtnc33yJjC0iLtEDAt8g
9Bc3rD4ynWW8YKz51JQWwiFGPooKJLsVnFVKNUxytjOAgksyhtnHEk8hu24lBnrWNKrUA
4JuOzXurtFqTe5F77HOTkSgXvfT3fRWlH5FuAiHCWLWcp5gXoT0zo49mAFB1p99QDSWgP
0YylJMINqX3kC/VQFbHHy6qg/7D7IbnXA7r51MBSps1mmlMhTiZQpeoQ123vfWqzUCg==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org;
dkim=pass header.d=networkplumber-org.20260707.gappssmtp.com header.i=@networkplumber-org.20260707.gappssmtp.com header.a=rsa-sha256 header.s=20260707 header.b=ctt7UgI1;
dmarc=pass header.from=networkplumber.org;
spf=pass smtp.mailfrom=networkplumber.org;
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 0727B606A333;
Thu, 19 Nov 2026 19:03:17 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=networkplumber-org.20260707.gappssmtp.com header.i=@networkplumber-org.20260707.gappssmtp.com header.a=rsa-sha256 header.s=20260707 header.b=ctt7UgI1
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.214.179
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
t=1795114996;
b=1UjvKHo8ZX+QzJioCUm9ZcdtkzL4xUZ76f3G8MaUS8JdC2PofkEJYcGzegc83Xm1A6/L
y1wElAcV35ZsWBWOMDXVIgvSK+dSkG0uvAt3WGycZCM6BaWRXzSMpfUdQvcMeormHNQAc
VOL6ot3Y6QiRp57zgJ5tJyowKr/oJjhGiWOxL6kFdSPH0HJTAQjnAzKeLkvVQkSa0uSBc
N4cWwUrXk2YDEZZyHQokgWQNJH/PNfH3kCbABc+TOlzmLO2nqNbSVOL0KwIxfuqnHxhjX
KSBZNDtRavC/+8iN3GO10tTu0MlJdzPhphUha7bkbRgpxDGXxBFATMqZcD87tmhUdmw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1795114996;
h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
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=yGFvb8N9U4YFec1+J2L9SxsAwyGtd5uIvbctO3Neuc8=;
b=X/+X72OudiBwJ29E7Hy3Lbx2Av2Mxpyb+LMUPeahzc+ttevkPFuJdX5iX84Xu1IQ4NGt
VgiZ+9uITwzKs92me9PpslbJrx8mBEGTf+4MfhRrC/ud/6H5nBE+qhbLMmgfiHhd6UVSp
Xd07MucADSfn8EZomOiM3RtFOedd1SgCXGhzKLbi6jKm3S4lkzZ79Umal51ZCIMqy+qyD
IkL36W5qPyncTqRMAWFRNLmD83w9k7lhvAotI8HbHrjnDuaHA15yS8QyerMOmTTXXYFoC
xk/Q3ApohY2T08uOIbhIYbq/brJ88LESXSJhGQHUiEmYM6VTedROflLclx1qAsFOvKw==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
dmarc=pass header.from=networkplumber.org;
spf=pass smtp.mailfrom=networkplumber.org;
dkim=pass header.d=networkplumber-org.20260707.gappssmtp.com header.i=@networkplumber-org.20260707.gappssmtp.com header.a=rsa-sha256 header.s=20260707 header.b=ctt7UgI1;
arc=none smtp.remote-ip=209.85.214.179
X-Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179])
(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 9D493606A320
for <netdev@vger.kernel.org>; Thu, 19 Nov 2026 19:03:15 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 9D493606A320
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=networkplumber.org
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=networkplumber.org
X-Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-2f0414c1062so389345ad.2
for <netdev@vger.kernel.org>; Thu, 19 Nov 2026 11:03:15 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=networkplumber-org.20260707.gappssmtp.com; s=20260707; t=1795114995; x=1795719795; 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=yGFvb8N9U4YFec1+J2L9SxsAwyGtd5uIvbctO3Neuc8=;
b=ctt7UgI1wyOAZoF+fViYViwHUigQAGcTyZ8P5Ur1pOr4da3HAqUbgfb5oaw8ckVOCp
UiFNS4BXEHsbsXXi22pW+YpoziASppwu5ds+L7B08/JvjwHW+f6AVNXcfk8QX9FhuoZZ
0idhE9/p8b+cn7sKVEgOji3gj7gj2AhO+KayaUr/zgVGJ7vAPCOSQ/x/7RpIYrBlVDR/
TjmUVuieM0ukYMkmdaUf/2juImk0mtXm6Ju8DQbp9X86mIx+kU86YmJdJL9+YFj5Gh1m
MbrBlzpgLXlQmiQKJZQTpCZevP2yGBpd8BMYzUGXZRB7ivw/JgoGCxOR8J1nFsF4l1dL
56fQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1795114995; x=1795719795;
h=content-transfer-encoding:mime-version:message-id:date:subject:cc
:to:from:x-gm-gg:x-gm-message-state:from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52uI9ruJ6WPnp8/h3870//VmL8rBCSY/doWStuV9lvJ4zVJC
ost7rzpmdZB9Fuo6HbNzAHNtjmKlktB3x8mFKghVuGyqP2YuYr6Dda58fD4qRZpTE0Sle/EhsJf
in289PvCdIC44Ogw9TyFpdv/VCDTnxVF/0PbtJeSkvubkO3MRJ1/Q/f01PkeJ9KBbFI0
X-Received: by 2002:a17:903:2442:b0:2f0:2aca:6795 with SMTP id d9443c01a7336-2f040ddd6eemr3760025ad.18.1795114994711;
Thu, 19 Nov 2026 11:03:14 -0800 (PST)
X-Received: from phoenix.lan (204-195-112-43.wavecable.com. [204.195.112.43])
by smtp.gmail.com with ESMTPSA id d9443c01a7336-2f03f0de00asm3750225ad.35.2026.11.19.11.03.14
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Thu, 19 Nov 2026 11:03:14 -0800 (PST)
X-Cc: dsahern@kernel.org,
Stephen Hemminger <stephen@networkplumber.org>
X-Mailer: git-send-email 2.53.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