linux-yocto/fs/orangefs
Amir Mohammad Jahangirzad b1ab2c75a4 fs/orangefs: use snprintf() instead of sprintf()
[ Upstream commit cdfa130465 ]

sprintf() is discouraged for use with bounded destination buffers
as it does not prevent buffer overflows when the formatted output
exceeds the destination buffer size. snprintf() is a safer
alternative as it limits the number of bytes written and ensures
NUL-termination.

Replace sprintf() with snprintf() for copying the debug string
into a temporary buffer, using ORANGEFS_MAX_DEBUG_STRING_LEN as
the maximum size to ensure safe formatting and prevent memory
corruption in edge cases.

EDIT: After this patch sat on linux-next for a few days, Dan
Carpenter saw it and suggested that I use scnprintf instead of
snprintf. I made the change and retested.

Signed-off-by: Amir Mohammad Jahangirzad <a.jahangirzad@gmail.com>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-08-20 18:41:22 +02:00
..
acl.c
dcache.c orangefs_d_revalidate(): use stable parent inode and name passed by caller 2025-01-27 19:25:24 -05:00
devorangefs-req.c
dir.c orangefs: saner arguments passing in readdir guts 2023-12-21 12:53:36 -05:00
downcall.h
file.c orangefs: make open_for_read and open_for_write boolean 2025-03-06 09:26:06 +01:00
inode.c orangefs: adjust counting code to recover from 665575cf 2025-05-20 11:07:00 -04:00
Kconfig
Makefile
namei.c Change inode_operations.mkdir to return struct dentry * 2025-02-27 20:00:17 +01:00
orangefs-bufmap.c orangefs: Bufmap deadcoding 2025-03-18 19:39:19 -04:00
orangefs-bufmap.h orangefs: Bufmap deadcoding 2025-03-18 19:39:19 -04:00
orangefs-cache.c fs/orangefs: remove ORANGEFS_CACHE_CREATE_FLAGS 2024-02-14 15:54:50 -05:00
orangefs-debug.h orangefs: Move s_kmod_keyword_mask_map to orangefs-debugfs.c 2025-03-06 09:26:06 +01:00
orangefs-debugfs.c fs/orangefs: use snprintf() instead of sprintf() 2025-08-20 18:41:22 +02:00
orangefs-debugfs.h
orangefs-dev-proto.h
orangefs-kernel.h orangefs: Convert to use the new mount API 2025-05-14 18:04:45 -04:00
orangefs-mod.c orangefs: Convert to use the new mount API 2025-05-14 18:04:45 -04:00
orangefs-sysfs.c orangefs: Constify struct kobj_type 2024-09-06 10:18:17 -04:00
orangefs-sysfs.h
orangefs-utils.c orangefs: convert to new timestamp accessors 2023-10-18 14:08:25 +02:00
protocol.h
super.c orangefs: Convert to use the new mount API 2025-05-14 18:04:45 -04:00
symlink.c
upcall.h
waitqueue.c
xattr.c orangefs: move orangefs_xattr_handlers to .rodata 2023-10-09 16:24:21 +02:00