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

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
...@@ -440,6 +440,9 @@ static ssize_t orangefs_debug_write(struct file *file, ...@@ -440,6 +440,9 @@ static ssize_t orangefs_debug_write(struct file *file,
"orangefs_debug_write: %pD\n", "orangefs_debug_write: %pD\n",
file); file);
if (count == 0)
return 0;
/* /*
* Thwart users who try to jamb a ridiculous number * Thwart users who try to jamb a ridiculous number
* of bytes into the debug file... * of bytes into the debug file...
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment