RDMA/efa: Clear the admin command buffer prior to its submission
authorGal Pressman <galpress@amazon.com>
Tue, 12 Nov 2019 09:26:08 +0000 (11:26 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 31 Dec 2019 15:45:28 +0000 (16:45 +0100)
commita672f38f5fb67e70408453e5918aa51883959694
tree62f7c46d35b90b787120b3b25a171649ee0e9e9e
parenta9f6525550644a29306facdfa23b4ee4bc05cc89
RDMA/efa: Clear the admin command buffer prior to its submission

[ Upstream commit 64c264872b8879e2ab9017eefe9514d4c045c60e ]

We cannot rely on the entry memcpy as we only copy the actual size of the
command, the rest of the bytes must be memset to zero.

Currently providing non-zero memory will not have any user visible impact.
However, since admin commands are extendable (in a backwards compatible
way) everything beyond the size of the command must be cleared to prevent
issues in the future.

Fixes: 0420e542569b ("RDMA/efa: Implement functions that submit and complete admin commands")
Link: https://lore.kernel.org/r/20191112092608.46964-1-galpress@amazon.com
Reviewed-by: Daniel Kranzdorf <dkkranzd@amazon.com>
Reviewed-by: Firas JahJah <firasj@amazon.com>
Signed-off-by: Gal Pressman <galpress@amazon.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/infiniband/hw/efa/efa_com.c