mirror of
https://github.com/FEX-Emu/linux.git
synced 2025-02-25 23:17:03 +00:00
nfsd: don't allow zero length strings in cache_parse()
There is no point in passing a zero length string here and quite a few of that cache_parse() implementations will Oops if count is zero. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Cc: stable@kernel.org Signed-off-by: J. Bruce Fields <bfields@redhat.com>
This commit is contained in:
parent
62aa2b537c
commit
6d8d174998
@ -828,6 +828,8 @@ static ssize_t cache_do_downcall(char *kaddr, const char __user *buf,
|
|||||||
{
|
{
|
||||||
ssize_t ret;
|
ssize_t ret;
|
||||||
|
|
||||||
|
if (count == 0)
|
||||||
|
return -EINVAL;
|
||||||
if (copy_from_user(kaddr, buf, count))
|
if (copy_from_user(kaddr, buf, count))
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
kaddr[count] = '\0';
|
kaddr[count] = '\0';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user