]> git.baikalelectronics.ru Git - kernel.git/commit
vdpa/mlx5: Fix pointer math in mlx5_vdpa_get_config()
authorDan Carpenter <dan.carpenter@oracle.com>
Sat, 8 Aug 2020 09:32:41 +0000 (12:32 +0300)
committerMichael S. Tsirkin <mst@redhat.com>
Mon, 10 Aug 2020 13:01:21 +0000 (09:01 -0400)
commitd4fe19194ea2097df16a68032c06959873f2056c
tree051f16c6d1cf569dae8360287149970ed365b78a
parent51217e02866517380891faf2fe107027664267ed
vdpa/mlx5: Fix pointer math in mlx5_vdpa_get_config()

There is a pointer math bug here so if "offset" is non-zero then this
will copy memory from beyond the end of the array.

Fixes: 89495935b0eb ("vdpa/mlx5: Add VDPA driver for supported mlx5 devices")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20200808093241.GB115053@mwanda
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Eli Cohen <elic@nvidia.com>
Cc: Jason Wang <jasowang@redhat.com>; Parav Pandit <parav@mellanox.com>; virtualization@lists.linux-foundation.org; linux-kernel@vger.kernel.org; kernel-janitors@vger.kernel.org
Fixes: 89495935b0eb ("vdpa/mlx5: Add VDPA driver for supported mlx5 devices")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
drivers/vdpa/mlx5/net/mlx5_vnet.c