aboutsummaryrefslogtreecommitdiffstats
diff options
authorMike Marshall <hubcap@omnibond.com>2025-01-08 14:21:08 -0500
committerMike Marshall <hubcap@omnibond.com>2025-01-08 14:35:59 -0500
commitf7c848431632598ff9bce57a659db6af60d75b39 (patch)
tree91065c0ec176f580b65a2fdfcd140aabf0e6a63c
parent9d89551994a430b50c4fffcb1e617a057fa76e20 (diff)
downloadlinux-for-linus.tar.gz
orangefs: fix a oob in orangefs_debug_writefor-linus-6.14-ofs4for-linus-6.14-ofs1for-linus
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. Signed-off-by: Mike Marshall <hubcap@omnibond.com> Reported-by: syzbot+fc519d7875f2d9186c1f@syzkaller.appspotmail.com
-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 1b508f5433846e..fa41db08848802 100644
--- a/fs/orangefs/orangefs-debugfs.c
+++ b/fs/orangefs/orangefs-debugfs.c
@@ -393,9 +393,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);