]> git.baikalelectronics.ru Git - kernel.git/commit
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:30:41 +0000 (11:30 +0100)
commit6c57e0c4375919a4df7045fa43ffab46a7eab676
treed694787a27e8f0353cbde54becda2c2a530c1ec5
parent970b801f5f94c5645b339da607c5452bf15118f8
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