linux/fs/debugfs
Gui-Dong Han 294690ffc1 debugfs: check for NULL pointer in debugfs_create_str()
[ Upstream commit 31de83980d ]

Passing a NULL pointer to debugfs_create_str() leads to a NULL pointer
dereference when the debugfs file is read. Following upstream
discussions, forbid the creation of debugfs string files with NULL
pointers. Add a WARN_ON() to expose offending callers and return early.

Fixes: 9af0440ec8 ("debugfs: Implement debugfs_create_str()")
Reported-by: yangshiguang <yangshiguang@xiaomi.com>
Closes: https://lore.kernel.org/lkml/2025122221-gag-malt-75ba@gregkh/
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Gui-Dong Han <hanguidong02@gmail.com>
Link: https://patch.msgid.link/20260323085930.88894-2-hanguidong02@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2026-06-01 17:35:27 +02:00
..
file.c debugfs: check for NULL pointer in debugfs_create_str() 2026-06-01 17:35:27 +02:00
inode.c debugfs: fix automount d_fsdata usage 2024-01-25 14:52:27 -08:00
internal.h debugfs: fix automount d_fsdata usage 2024-01-25 14:52:27 -08:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00