Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 907bfcd8 authored by Dan Carpenter's avatar Dan Carpenter Committed by Mike Marshall
Browse files

orangefs: handle zero size write in debugfs



If we write zero bytes to this debugfs file, then it will cause an
underflow when we do copy_from_user(buf, ubuf, count - 1).  Debugfs can
normally only be written to by root so the impact of this is low.

Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarMike Marshall <hubcap@omnibond.com>
parent b5a9d61e
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -440,6 +440,9 @@ static ssize_t orangefs_debug_write(struct file *file,
		"orangefs_debug_write: %pD\n",
		file);

	if (count == 0)
		return 0;

	/*
	 * Thwart users who try to jamb a ridiculous number
	 * of bytes into the debug file...