Skip to content

Commit f7c8484

Browse files
committed
orangefs: 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. Signed-off-by: Mike Marshall <hubcap@omnibond.com> Reported-by: syzbot+fc519d7875f2d9186c1f@syzkaller.appspotmail.com
1 parent 9d89551 commit f7c8484

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fs/orangefs/orangefs-debugfs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,9 +393,9 @@ static ssize_t orangefs_debug_write(struct file *file,
393393
* Thwart users who try to jamb a ridiculous number
394394
* of bytes into the debug file...
395395
*/
396-
if (count > ORANGEFS_MAX_DEBUG_STRING_LEN + 1) {
396+
if (count > ORANGEFS_MAX_DEBUG_STRING_LEN) {
397397
silly = count;
398-
count = ORANGEFS_MAX_DEBUG_STRING_LEN + 1;
398+
count = ORANGEFS_MAX_DEBUG_STRING_LEN;
399399
}
400400

401401
buf = kzalloc(ORANGEFS_MAX_DEBUG_STRING_LEN, GFP_KERNEL);

0 commit comments

Comments
 (0)