Commit 69b8923f authored by Linus Torvalds's avatar Linus Torvalds
Browse files
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
parents b2fde873 f7c84843
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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);