summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2025-01-31 09:40:31 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2025-01-31 09:40:31 -0800
commit69b8923f5003664e3ffef102e73333edfa2abdcf (patch)
tree2e309e1cd363b845691b35b1752889facfe35ccd
parentb2fde87318f3d77314334b8bfe93846f36ae1708 (diff)
parentf7c848431632598ff9bce57a659db6af60d75b39 (diff)
Merge tag 'for-linus-6.14-ofs4' of git://git.kernel.org/pub/scm/linux/kernel/git/hubcap/linux
Pull orangefs fix from Mike Marshall: "Fix a oob in orangefs_debug_write I got a syzbot report: "slab-out-of-bounds Read in orangefs_debug_write" Several people suggested fixes, I tested Al Viro's suggestion and made this patch" * tag 'for-linus-6.14-ofs4' of git://git.kernel.org/pub/scm/linux/kernel/git/hubcap/linux: orangefs: fix a oob in orangefs_debug_write
-rw-r--r--fs/orangefs/orangefs-debugfs.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/orangefs/orangefs-debugfs.c b/fs/orangefs/orangefs-debugfs.c
index 9729f071c5aa..f52073022fae 100644
--- a/fs/orangefs/orangefs-debugfs.c
+++ b/fs/orangefs/orangefs-debugfs.c
@@ -392,9 +392,9 @@ static ssize_t orangefs_debug_write(struct file *file,
* Thwart users who try to jamb a ridiculous number
* of bytes into the debug file...
*/
- if (count > ORANGEFS_MAX_DEBUG_STRING_LEN + 1) {
+ if (count > ORANGEFS_MAX_DEBUG_STRING_LEN) {
silly = count;
- count = ORANGEFS_MAX_DEBUG_STRING_LEN + 1;
+ count = ORANGEFS_MAX_DEBUG_STRING_LEN;
}
buf = kzalloc(ORANGEFS_MAX_DEBUG_STRING_LEN, GFP_KERNEL);