mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
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: Dan Carpenter <[email protected]> Signed-off-by: Mike Marshall <[email protected]>
This commit is contained in:
parent
b5a9d61eeb
commit
907bfcd8d8
1 changed files with 3 additions and 0 deletions
|
|
@ -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...
|
||||
|
|
|
|||
Loading…
Reference in a new issue