git: 4b32fdb4a614 - main - lindebugfs: check that name is set as otherwise pfs_alloc_node_flags() panics
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 29 Jan 2026 19:36:42 UTC
The branch main has been updated by bz:
URL: https://cgit.FreeBSD.org/src/commit/?id=4b32fdb4a614de602d288ac5a414cb43e9f2163e
commit 4b32fdb4a614de602d288ac5a414cb43e9f2163e
Author: Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2026-01-29 11:16:50 +0000
Commit: Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2026-01-29 19:35:23 +0000
lindebugfs: check that name is set as otherwise pfs_alloc_node_flags() panics
I have hit the case multiple times that some LinuxKPI field may not be
set during driver bringup and lindebugfs would cause a panic.
The backtrace goes like:
strlen() at strlen+0x54
pfs_create_dir() at pfs_create_dir+0x41
debugfs_create_dir() at debugfs_create_dir+0xa1
...
While the problem is clearly in LinuxKPI or the driver, we likely
should at least add an assert to pfs_create_dir() if name is NULL
like we have for pfs_add_node() but for lindebugfs at least make
this a graceful error and continue without creating the dir instead
of panicing.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D54944
---
sys/compat/lindebugfs/lindebugfs.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/sys/compat/lindebugfs/lindebugfs.c b/sys/compat/lindebugfs/lindebugfs.c
index 8cddc6f390bc..857546f61e55 100644
--- a/sys/compat/lindebugfs/lindebugfs.c
+++ b/sys/compat/lindebugfs/lindebugfs.c
@@ -272,6 +272,9 @@ debugfs_create_dir(const char *name, struct dentry *parent)
struct dentry *dnode;
struct pfs_node *pnode;
+ if (name == NULL)
+ return (NULL);
+
dm = malloc(sizeof(*dm), M_DFSINT, M_NOWAIT | M_ZERO);
if (dm == NULL)
return (NULL);