]> Git Repo - linux.git/commitdiff
orangefs: fix a oob in orangefs_debug_write
authorMike Marshall <[email protected]>
Wed, 8 Jan 2025 19:21:08 +0000 (14:21 -0500)
committerMike Marshall <[email protected]>
Wed, 8 Jan 2025 19:35:59 +0000 (14:35 -0500)
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 <[email protected]>
Reported-by: [email protected]
fs/orangefs/orangefs-debugfs.c

index 1b508f5433846e8b759be4dd34c6d4c5b30e1ac8..fa41db08848802780eecc7b0fcabfc5a8444b874 100644 (file)
@@ -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);
This page took 0.05866 seconds and 4 git commands to generate.