9p/xen: check logical size for buffer size
authorDominique Martinet <asmadeus@codewreck.org>
Fri, 18 Nov 2022 13:44:41 +0000 (22:44 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Dec 2022 10:37:17 +0000 (11:37 +0100)
commit029a7f1c5d703f5a59a8d95226cb177d7b641b46
treeff306bebd5a1212a55b79335bdfaaf249c9f3909
parentb398832893c895f348801a29db6b2cfd1f67438f
9p/xen: check logical size for buffer size

[ Upstream commit 391c18cf776eb4569ecda1f7794f360fe0a45a26 ]

trans_xen did not check the data fits into the buffer before copying
from the xen ring, but we probably should.
Add a check that just skips the request and return an error to
userspace if it did not fit

Tested-by: Stefano Stabellini <sstabellini@kernel.org>
Reviewed-by: Christian Schoenebeck <linux_oss@crudebyte.com>
Link: https://lkml.kernel.org/r/20221118135542.63400-1-asmadeus@codewreck.org
Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/9p/trans_xen.c