linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: mst@redhat.com, virtualization@lists.linux-foundation.org
Cc: linux-kernel@vger.kernel.org, f.hetzelt@tu-berlin.de,
	david.kaplan@amd.com, konrad.wilk@oracle.com,
	Jason Wang <jasowang@redhat.com>
Subject: [PATCH V4 2/4] virtio-net: don't let virtio core to validate used length
Date: Tue, 26 Oct 2021 15:19:58 +0800	[thread overview]
Message-ID: <20211026072000.8699-3-jasowang@redhat.com> (raw)
In-Reply-To: <20211026072000.8699-1-jasowang@redhat.com>

For RX virtuqueue, the used length is validated in all the three paths
(big, small and mergeable). For control vq, we never tries to use used
length. So this patch forbids the core to validate the used length.

Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 drivers/net/virtio_net.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 6d8c8745bf24..7c43bfc1ce44 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -3385,6 +3385,7 @@ static struct virtio_driver virtio_net_driver = {
 	.feature_table_size = ARRAY_SIZE(features),
 	.feature_table_legacy = features_legacy,
 	.feature_table_size_legacy = ARRAY_SIZE(features_legacy),
+	.suppress_used_validation = true,
 	.driver.name =	KBUILD_MODNAME,
 	.driver.owner =	THIS_MODULE,
 	.id_table =	id_table,
-- 
2.25.1


  parent reply	other threads:[~2021-10-26  7:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-26  7:19 [PATCH V4 0/4] Validate used buffer length Jason Wang
2021-10-26  7:19 ` [PATCH V4 1/4] virtio_ring: validate " Jason Wang
2021-10-26  9:43   ` Michael S. Tsirkin
2021-10-26 10:21     ` Jason Wang
2021-10-26 10:32       ` Michael S. Tsirkin
2021-10-26  7:19 ` Jason Wang [this message]
2021-10-26  7:19 ` [PATCH V4 3/4] virtio-blk: don't let virtio core to validate used length Jason Wang
2021-10-26  7:20 ` [PATCH V4 4/4] virtio-scsi: don't let virtio core to validate used buffer length Jason Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211026072000.8699-3-jasowang@redhat.com \
    --to=jasowang@redhat.com \
    --cc=david.kaplan@amd.com \
    --cc=f.hetzelt@tu-berlin.de \
    --cc=konrad.wilk@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=virtualization@lists.linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).