linux/drivers/vdpa
Lin Ma baed19c108 vdpa: Add max vqp attr to vdpa_nl_policy for nlattr length check
[ Upstream commit 5d6ba607d6 ]

The vdpa_nl_policy structure is used to validate the nlattr when parsing
the incoming nlmsg. It will ensure the attribute being described produces
a valid nlattr pointer in info->attrs before entering into each handler
in vdpa_nl_ops.

That is to say, the missing part in vdpa_nl_policy may lead to illegal
nlattr after parsing, which could lead to OOB read just like CVE-2023-3773.

This patch adds the missing nla_policy for vdpa max vqp attr to avoid
such bugs.

Fixes: ad69dd0bf2 ("vdpa: Introduce query of device config layout")
Signed-off-by: Lin Ma <linma@zju.edu.cn>
Cc: stable@vger.kernel.org
Message-Id: <20230727175757.73988-7-dtatulea@nvidia.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
[ Minor context conflict resolved. ]
Signed-off-by: Alva Lan <alvalan9@foxmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2026-06-01 17:35:11 +02:00
..
ifcvf vDPA/ifcvf: Fix pci_read_config_byte() return code handling 2024-11-17 15:06:25 +01:00
mlx5 vdpa/mlx5: Fix oversized null mkey longer than 32bit 2025-05-02 07:44:02 +02:00
vdpa_sim vdpa_sim: set last_used_idx as last_avail_idx in vdpasim_queue_ready 2023-03-22 13:31:24 +01:00
vdpa_user vduse: Temporarily fail if control queue feature requested 2024-07-05 09:14:42 +02:00
virtio_pci vdpa: fix use-after-free on vp_vdpa_remove 2022-03-16 14:23:36 +01:00
Kconfig vduse: Introduce VDUSE - vDPA Device in Userspace 2021-09-06 07:20:58 -04:00
Makefile vduse: Introduce VDUSE - vDPA Device in Userspace 2021-09-06 07:20:58 -04:00
vdpa.c vdpa: Add max vqp attr to vdpa_nl_policy for nlattr length check 2026-06-01 17:35:11 +02:00