1
0
Fork 0

cifs: smbd: Return -EINVAL when the number of iovs exceeds SMBDIRECT_MAX_SGE

commit 37941ea17d upstream.

While it's not friendly to fail user processes that issue more iovs
than we support, at least we should return the correct error code so the
user process gets a chance to retry with smaller number of iovs.

Signed-off-by: Long Li <longli@microsoft.com>
Cc: stable@vger.kernel.org
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5.4-rM2-2.2.x-imx-squashed
Long Li 2019-10-16 13:51:52 -07:00 committed by Greg Kroah-Hartman
parent 418968973e
commit 68dcbbd067
1 changed files with 1 additions and 1 deletions

View File

@ -1069,7 +1069,7 @@ static int smbd_post_send_data(
if (n_vec > SMBDIRECT_MAX_SGE) {
cifs_dbg(VFS, "Can't fit data to SGL, n_vec=%d\n", n_vec);
return -ENOMEM;
return -EINVAL;
}
sg_init_table(sgl, n_vec);