[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] arm/ioreq: clean data field in ioreq struct on read operations


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Andrii Chepurnyi <Andrii_Chepurnyi@xxxxxxxx>
  • Date: Tue, 3 Oct 2023 13:19:28 +0000
  • Accept-language: uk-UA, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=KvHWBTV3qInXaP1KeKLliPIbtWRnBWcHHbJeVQAPXFU=; b=Jyiqol+WMW90zHmXgal6/oSEicAUTuw9FCSru7ZMcLL5H2v0WHvXBktOiI6bI4fX3lXL4iX0gTI4SjutDeeu9m0qnoHe0tJeo5ZKuvYnKqaxYOxxh2M4eKzoUjltB134/QsxB91JXzYMS6Mz2Bg3FTow2a/L5D3DWibEgLR8v/OmjrxSaqTUK7QmNej22Xj2b9BSdayV5AIOnYVGa9m29vrxVWOLUtwgJmlDX/LPRH8MnOi1snFOzONeST0XY5ZEmntA8pX+KRLuBDuf4yU7CX686M0mrufqHrzPcZseCLICSuZxH7Pe+sjk41gVrosB1Yk3lrInyrpUHBRlWHNukQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FcCUuTR4Cx7UOo4UeYTZNc4lOShvWiE3g2Ns9kth/Mun9By+p9xUz17FMauoiB+eTMJXzDvuUEZdFnb4aw00TbWT70XJxZq2dq0AKpSeHQ7kcmFUDKnX5tIf5kJ2hMPj1Bud3BYWYyAvNXIKfkwvWe9HsehbmLAy9pGEEKmPBrEg8NDbExeh4DdK0yjk2Jy8sAKGtsxVjwHvjZYkS5WDiynqIkiSqW9jTD2SZ2X6qotdPhn+1/6l43tJQCllicluQbcMUn3MXadO4ycKBt+f+8KYLIh7Jihh0TRHkSsu9kpere1q51aRkZqbahGuNt3KNtzJCvi5SBfUYNukfUASIQ==
  • Cc: Oleksandr Tyshchenko <Oleksandr_Tyshchenko@xxxxxxxx>, "andrii.chepurnyi82@xxxxxxxxx" <andrii.chepurnyi82@xxxxxxxxx>, Andrii Chepurnyi <Andrii_Chepurnyi@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Wed, 04 Oct 2023 13:54:59 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHZ9fw82LZSu4lXwEi+r3jS4xqDmw==
  • Thread-topic: [PATCH] arm/ioreq: clean data field in ioreq struct on read operations

For read operations, there's a potential issue when the data field
of the ioreq struct is partially updated in the response. To address
this, zero data field during read operations. This modification
serves as a safeguard against implementations that may inadvertently
partially update the data field in response to read requests.
For instance, consider an 8-bit read operation. In such cases, QEMU,
returns the same content of the data field with only 8 bits of
updated data. This behavior could potentially result in the
propagation of incorrect or unintended data to user-space applications.

Signed-off-by: Andrii Chepurnyi <andrii_chepurnyi@xxxxxxxx>
---
 xen/arch/arm/ioreq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/arm/ioreq.c b/xen/arch/arm/ioreq.c
index 3bed0a14c0..aaa2842acc 100644
--- a/xen/arch/arm/ioreq.c
+++ b/xen/arch/arm/ioreq.c
@@ -80,7 +80,7 @@ enum io_state try_fwd_ioserv(struct cpu_user_regs *regs,
 
     ASSERT(dabt.valid);
 
-    p.data = get_user_reg(regs, info->dabt.reg);
+    p.data = (p.dir) ? 0 : get_user_reg(regs, info->dabt.reg);
     vio->req = p;
     vio->suspended = false;
     vio->info.dabt_instr = instr;
-- 
2.25.1



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.