<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/vdpa, branch v6.1.87</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.1.87</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.1.87'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2024-03-26T22:21:00+00:00</updated>
<entry>
<title>vdpa/mlx5: Allow CVQ size changes</title>
<updated>2024-03-26T22:21:00+00:00</updated>
<author>
<name>Jonah Palmer</name>
<email>jonah.palmer@oracle.com</email>
</author>
<published>2024-02-16T14:25:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=07b6891ca62ebd532f4d4d4d0eed76ab607c2334'/>
<id>urn:sha1:07b6891ca62ebd532f4d4d4d0eed76ab607c2334</id>
<content type='text'>
[ Upstream commit 749a4016839270163efc36ecddddd01de491a16b ]

The MLX driver was not updating its control virtqueue size at set_vq_num
and instead always initialized to MLX5_CVQ_MAX_ENT (16) at
setup_cvq_vring.

Qemu would try to set the size to 64 by default, however, because the
CVQ size always was initialized to 16, an error would be thrown when
sending &gt;16 control messages (as used-ring entry 17 is initialized to 0).
For example, starting a guest with x-svq=on and then executing the
following command would produce the error below:

 # for i in {1..20}; do ifconfig eth0 hw ether XX:xx:XX:xx:XX:XX; done

 qemu-system-x86_64: Insufficient written data (0)
 [  435.331223] virtio_net virtio0: Failed to set mac address by vq command.
 SIOCSIFHWADDR: Invalid argument

Acked-by: Dragos Tatulea &lt;dtatulea@nvidia.com&gt;
Acked-by: Eugenio Pérez &lt;eperezma@redhat.com&gt;
Signed-off-by: Jonah Palmer &lt;jonah.palmer@oracle.com&gt;
Message-Id: &lt;20240216142502.78095-1-jonah.palmer@oracle.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Tested-by: Lei Yang &lt;leiyang@redhat.com&gt;
Fixes: 5262912ef3cf ("vdpa/mlx5: Add support for control VQ and MAC setting")
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>vdpa_sim: reset must not run</title>
<updated>2024-03-26T22:21:00+00:00</updated>
<author>
<name>Steve Sistare</name>
<email>steven.sistare@oracle.com</email>
</author>
<published>2024-02-09T22:30:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=80fc9b9c626b7be00b5fb9b0aa025901e1488ea7'/>
<id>urn:sha1:80fc9b9c626b7be00b5fb9b0aa025901e1488ea7</id>
<content type='text'>
[ Upstream commit 9588e7fc511f9c55b9835f14916e90ab940061b7 ]

vdpasim_do_reset sets running to true, which is wrong, as it allows
vdpasim_kick_vq to post work requests before the device has been
configured.  To fix, do not set running until VIRTIO_CONFIG_S_DRIVER_OK
is set.

Fixes: 0c89e2a3a9d0 ("vdpa_sim: Implement suspend vdpa op")
Signed-off-by: Steve Sistare &lt;steven.sistare@oracle.com&gt;
Reviewed-by: Eugenio Pérez &lt;eperezma@redhat.com&gt;
Acked-by: Jason Wang &lt;jasowang@redhat.com&gt;
Message-Id: &lt;1707517807-137331-1-git-send-email-steven.sistare@oracle.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>vdpa: Fix an error handling path in eni_vdpa_probe()</title>
<updated>2024-01-25T23:27:47+00:00</updated>
<author>
<name>Christophe JAILLET</name>
<email>christophe.jaillet@wanadoo.fr</email>
</author>
<published>2022-10-20T19:21:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=8ed3eb92a56e335fd601593d0db4b39a234a42a7'/>
<id>urn:sha1:8ed3eb92a56e335fd601593d0db4b39a234a42a7</id>
<content type='text'>
[ Upstream commit c1b9f2c66eed3261db76cccd8a22a9affae8dcbf ]

After a successful vp_legacy_probe() call, vp_legacy_remove() should be
called in the error handling path, as already done in the remove function.

Add the missing call.

Fixes: e85087beedca ("eni_vdpa: add vDPA driver for Alibaba ENI")
Signed-off-by: Christophe JAILLET &lt;christophe.jaillet@wanadoo.fr&gt;
Message-Id: &lt;a7b0ef1eabd081f1c7c894e9b11de01678e85dee.1666293559.git.christophe.jaillet@wanadoo.fr&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Acked-by: Jason Wang &lt;jasowang@redhat.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>vdpa/mlx5: preserve CVQ vringh index</title>
<updated>2023-12-13T17:39:03+00:00</updated>
<author>
<name>Steve Sistare</name>
<email>steven.sistare@oracle.com</email>
</author>
<published>2023-11-03T12:26:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=8ea2b4ba9ba2e255447d799b2bb56b581b9b8ec1'/>
<id>urn:sha1:8ea2b4ba9ba2e255447d799b2bb56b581b9b8ec1</id>
<content type='text'>
[ Upstream commit 480b3e73720f6b5d76bef2387b1f9d19ed67573b ]

mlx5_vdpa does not preserve userland's view of vring base for the control
queue in the following sequence:

ioctl VHOST_SET_VRING_BASE
ioctl VHOST_VDPA_SET_STATUS VIRTIO_CONFIG_S_DRIVER_OK
  mlx5_vdpa_set_status()
    setup_cvq_vring()
      vringh_init_iotlb()
        vringh_init_kern()
          vrh-&gt;last_avail_idx = 0;
ioctl VHOST_GET_VRING_BASE

To fix, restore the value of cvq-&gt;vring.last_avail_idx after calling
vringh_init_iotlb.

Fixes: 5262912ef3cf ("vdpa/mlx5: Add support for control VQ and MAC setting")

Signed-off-by: Steve Sistare &lt;steven.sistare@oracle.com&gt;
Acked-by: Eugenio Pérez &lt;eperezma@redhat.com&gt;
Acked-by: Jason Wang &lt;jasowang@redhat.com&gt;
Message-Id: &lt;1699014387-194368-1-git-send-email-steven.sistare@oracle.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>vdpa: Enable strict validation for netlinks ops</title>
<updated>2023-08-23T15:52:31+00:00</updated>
<author>
<name>Dragos Tatulea</name>
<email>dtatulea@nvidia.com</email>
</author>
<published>2023-07-27T17:57:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d6aa03bda8c0ce5a340e33d37e0cb480b40fde08'/>
<id>urn:sha1:d6aa03bda8c0ce5a340e33d37e0cb480b40fde08</id>
<content type='text'>
commit f46c1e1620c6bbc9aad5693082efd1b80822e97c upstream.

The previous patches added the missing nla policies that were required for
validation to work.

Now strict validation on netlink ops can be enabled. This patch does it.

Signed-off-by: Dragos Tatulea &lt;dtatulea@nvidia.com&gt;
Cc: stable@vger.kernel.org
Message-Id: &lt;20230727175757.73988-9-dtatulea@nvidia.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>vdpa: Add max vqp attr to vdpa_nl_policy for nlattr length check</title>
<updated>2023-08-23T15:52:30+00:00</updated>
<author>
<name>Lin Ma</name>
<email>linma@zju.edu.cn</email>
</author>
<published>2023-07-27T17:57:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ff71709445ac033e6e250d971683110e4781c068'/>
<id>urn:sha1:ff71709445ac033e6e250d971683110e4781c068</id>
<content type='text'>
commit 5d6ba607d6cb5c58a4ddf33381e18c83dbb4098f upstream.

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-&gt;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: ad69dd0bf26b ("vdpa: Introduce query of device config layout")
Signed-off-by: Lin Ma &lt;linma@zju.edu.cn&gt;
Cc: stable@vger.kernel.org
Message-Id: &lt;20230727175757.73988-7-dtatulea@nvidia.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>vdpa: Add queue index attr to vdpa_nl_policy for nlattr length check</title>
<updated>2023-08-23T15:52:30+00:00</updated>
<author>
<name>Lin Ma</name>
<email>linma@zju.edu.cn</email>
</author>
<published>2023-07-27T17:57:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=8ad9bc25cbdcec72e7ca43dd8281decb69ea9a70'/>
<id>urn:sha1:8ad9bc25cbdcec72e7ca43dd8281decb69ea9a70</id>
<content type='text'>
commit b3003e1b54e057f5f3124e437b80c3bef26ed3fe upstream.

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-&gt;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 queue index attr to avoid
such bugs.

Fixes: 13b00b135665 ("vdpa: Add support for querying vendor statistics")
Signed-off-by: Lin Ma &lt;linma@zju.edu.cn&gt;
Cc: stable@vger.kernelorg
Message-Id: &lt;20230727175757.73988-5-dtatulea@nvidia.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>vdpa: Add features attr to vdpa_nl_policy for nlattr length check</title>
<updated>2023-08-23T15:52:30+00:00</updated>
<author>
<name>Lin Ma</name>
<email>linma@zju.edu.cn</email>
</author>
<published>2023-07-27T17:57:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=44b508cc96889e61799cc0fc6c00766a54f3ab5a'/>
<id>urn:sha1:44b508cc96889e61799cc0fc6c00766a54f3ab5a</id>
<content type='text'>
commit 79c8651587504ba263d2fd67fd4406240fb21f69 upstream.

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-&gt;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 features attr to avoid
such bugs.

Fixes: 90fea5a800c3 ("vdpa: device feature provisioning")
Signed-off-by: Lin Ma &lt;linma@zju.edu.cn&gt;
Cc: stable@vger.kernel.org
Message-Id: &lt;20230727175757.73988-3-dtatulea@nvidia.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>vdpa/mlx5: Delete control vq iotlb in destroy_mr only when necessary</title>
<updated>2023-08-23T15:52:29+00:00</updated>
<author>
<name>Eugenio Pérez</name>
<email>eperezma@redhat.com</email>
</author>
<published>2023-08-02T17:12:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=cba26abc3f9485871eadd4c8015be3dd4f739a73'/>
<id>urn:sha1:cba26abc3f9485871eadd4c8015be3dd4f739a73</id>
<content type='text'>
[ Upstream commit ad03a0f44cdb97b46e5c84ed353dac9b8ae2c276 ]

mlx5_vdpa_destroy_mr can be called from .set_map with data ASID after
the control virtqueue ASID iotlb has been populated. The control vq
iotlb must not be cleared, since it will not be populated again.

So call the ASID aware destroy function which makes sure that the
right vq resource is destroyed.

Fixes: 8fcd20c30704 ("vdpa/mlx5: Support different address spaces for control and data")
Signed-off-by: Eugenio Pérez &lt;eperezma@redhat.com&gt;
Reviewed-by: Gal Pressman &lt;gal@nvidia.com&gt;
Message-Id: &lt;20230802171231.11001-5-dtatulea@nvidia.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Acked-by: Jason Wang &lt;jasowang@redhat.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>vdpa/mlx5: Fix mr-&gt;initialized semantics</title>
<updated>2023-08-23T15:52:29+00:00</updated>
<author>
<name>Dragos Tatulea</name>
<email>dtatulea@nvidia.com</email>
</author>
<published>2023-08-02T17:12:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=bb4983ec9e752c4cb73b76e6d6e904feac371205'/>
<id>urn:sha1:bb4983ec9e752c4cb73b76e6d6e904feac371205</id>
<content type='text'>
[ Upstream commit 9ee811009ad8f87982b69e61d07447d12233ad01 ]

The mr-&gt;initialized flag is shared between the control vq and data vq
part of the mr init/uninit. But if the control vq and data vq get placed
in different ASIDs, it can happen that initializing the control vq will
prevent the data vq mr from being initialized.

This patch consolidates the control and data vq init parts into their
own init functions. The mr-&gt;initialized will now be used for the data vq
only. The control vq currently doesn't need a flag.

The uninitializing part is also taken care of: mlx5_vdpa_destroy_mr got
split into data and control vq functions which are now also ASID aware.

Fixes: 8fcd20c30704 ("vdpa/mlx5: Support different address spaces for control and data")
Signed-off-by: Dragos Tatulea &lt;dtatulea@nvidia.com&gt;
Reviewed-by: Eugenio Pérez &lt;eperezma@redhat.com&gt;
Reviewed-by: Gal Pressman &lt;gal@nvidia.com&gt;
Message-Id: &lt;20230802171231.11001-3-dtatulea@nvidia.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Acked-by: Jason Wang &lt;jasowang@redhat.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
</feed>
