From nobody Mon Jan 29 04:46:17 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TNbNT5pJjz586c8; Mon, 29 Jan 2024 04:46:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TNbNT5BRlz4K0K; Mon, 29 Jan 2024 04:46:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706503577; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+F38aMRKYLM9zIdHwLY0NptR1E5i70sCym7ihXQdqgE=; b=fH7uqfe8xr0iF6cQ+3g+cVG1uYEAmW8tpoJ8aYLVcqDZnMqMc6lLZv/1zznTBvaRcjMPBN KyKaWtBOkIjRhIxaktXQ3/Ge0Wt3prd1v+O2WuoRN/gnhB3MAApc5RR0rMMN9Fq9748OIe xubVqYPSar6NMD/QHjUNJhpt9Q6tN9p+4Hi6cXFZs73uYwjEvGWKkrNJjxVsu6IhxlM0yU 0TKR3u11eNKBE8O+3Qd3eOk6TME7tXTFyn8RE+UhggfqYFOZHv8vNKI52wt2eJvS7VR5uE X9oAE9hUonGrPLElD8HbUhr5+XwnR+gdhX7b8IvJYrW3QwAGzR8wOmIdLFNuRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706503577; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+F38aMRKYLM9zIdHwLY0NptR1E5i70sCym7ihXQdqgE=; b=MrRgBAI8xId/JsTDJ+EGsYgIfM9qATWh01KvaC6MsqPv5GeWWbuAM8Xl4wGvo6WLVbKkZH 3zojTOp/AkjhooRTxf//poS6Uq6kMkSBYK+3pfwToSnHzkeGu63pt3L9DH/IsfD+G0jyMy Ayr75bhXKOmcSoroTqT1u6ADUfqjzGnK857tblUz3o5WuXtZkrJCfoGL6szeY/jTHWz9BJ UpAsFuCfOhARevBZgVqqB/kraycCxk5orDR48KoIPxM1YRy1QUOd6u3R9wc1XTx2z8fAYO LkHJhuyPpTHji6v8SeceYUsdClchndhw1b94tHqQIMibUDqvFcJ8Lquvk664tw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706503577; a=rsa-sha256; cv=none; b=BbVkFAOWBsrdZFFyNn36kxADkR4DyEllVUZhJVr8Ol78DvPT3HE6WkBM1MtG0gk3M54M0N /cLjaDP5whfveTrrZI1PNG68AojGO73USG9FoK/0uH0f+6e1S3bplB9aFM6Ga/Y/FKKWeJ RnQvFKFuC0wx/Uqv6hYkH5OI/eo6gHHdADQFiEIY+nzwZlHxQcmHrvQNo6zrGQwwKSI5/J PUSyaDWq+Jq33+gmtHupXDnd4RktlU4WxkP5hnnigMIJB8d/rNiCOF1hsc57JI2aW8Z9uF xe9NLdCQqLdXKNdjA/e1RD9/uCWNqHAieCcLeisugDAcT0we1ZSAMB4ltaoXBQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TNbNT4DCZzcyp; Mon, 29 Jan 2024 04:46:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40T4kHPM010964; Mon, 29 Jan 2024 04:46:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40T4kHN2010961; Mon, 29 Jan 2024 04:46:17 GMT (envelope-from git) Date: Mon, 29 Jan 2024 04:46:17 GMT Message-Id: <202401290446.40T4kHN2010961@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 2b92b754f18c - main - kldxref: Be more conservative about what we reject. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2b92b754f18ce86e11e56f91c73aae8d89be80cc Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=2b92b754f18ce86e11e56f91c73aae8d89be80cc commit 2b92b754f18ce86e11e56f91c73aae8d89be80cc Author: Warner Losh AuthorDate: 2024-01-29 04:45:03 +0000 Commit: Warner Losh CommitDate: 2024-01-29 04:45:23 +0000 kldxref: Be more conservative about what we reject. kldxref anything whose name doesn't end in .ko or that has no dots (eg the kernel). Sponsored by: Netflix Reviewed by: jrtc27, jhb Differential Revision: https://reviews.freebsd.org/D43507 --- usr.sbin/kldxref/kldxref.8 | 14 ++++++-------- usr.sbin/kldxref/kldxref.c | 7 ++++--- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/usr.sbin/kldxref/kldxref.8 b/usr.sbin/kldxref/kldxref.8 index 0b141bb18a1c..1704847592cd 100644 --- a/usr.sbin/kldxref/kldxref.8 +++ b/usr.sbin/kldxref/kldxref.8 @@ -50,14 +50,12 @@ file is created, and the preexisting hint file (if there was one in that directory) is removed. .Pp .Nm -ignores files with at least two "."s in the filename, such as -.Pa foo.ko.debug -or -.Pa bar.ko.pkgsave . -Note that this means that modules cannot have names such as -.Pa foo.bar.ko . -This limitation however, has been lived practice since the beginning of -FreeBSD's kernel modules. +only processes files that either have no dots in their name like +.Pa kernel +or that end in +.Dq .ko +like +.Pa foo.ko . .Pp The following options are available: .Bl -tag -width indent diff --git a/usr.sbin/kldxref/kldxref.c b/usr.sbin/kldxref/kldxref.c index 1694f069564b..1f06ad811d91 100644 --- a/usr.sbin/kldxref/kldxref.c +++ b/usr.sbin/kldxref/kldxref.c @@ -842,10 +842,11 @@ main(int argc, char *argv[]) continue; /* * Skip files that generate errors like .debug, .symbol and .pkgsave - * by generally skipping all files with 2 dots. + * by generally skipping all files not ending with ".ko" or that have + * no dots in the name (like kernel). */ - dot = strchr(p->fts_name, '.'); - if (dot && strchr(dot + 1, '.') != NULL) + dot = strrchr(p->fts_name, '.'); + if (dot != NULL && strcmp(dot, ".ko") != 0) continue; read_kld(p->fts_path, p->fts_name); }