linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Ronak Doshi <doshir@vmware.com>
Cc: <netdev@vger.kernel.org>, Petr Vandrovec <petr@vmware.com>,
	"maintainer:VMWARE VMXNET3 ETHERNET DRIVER"
	<pv-drivers@vmware.com>, "David S. Miller" <davem@davemloft.net>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v4 net-next] vmxnet3: Remove buf_info from device accessible structures
Date: Wed, 27 Jan 2021 16:10:17 -0800	[thread overview]
Message-ID: <20210127161017.2d9adf4a@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> (raw)
In-Reply-To: <20210126190640.26942-1-doshir@vmware.com>

On Tue, 26 Jan 2021 11:06:40 -0800 Ronak Doshi wrote:
> buf_info structures in RX & TX queues are private driver data that
> do not need to be visible to the device.  Although there is physical
> address and length in the queue descriptor that points to these
> structures, their layout is not standardized, and device never looks
> at them.
> 
> So lets allocate these structures in non-DMA-able memory, and fill
> physical address as all-ones and length as zero in the queue
> descriptor.
> 
> That should alleviate worries brought by Martin Radev in
> https://lists.osuosl.org/pipermail/intel-wired-lan/Week-of-Mon-20210104/022829.html
> that malicious vmxnet3 device could subvert SVM/TDX guarantees.
> 
> Signed-off-by: Petr Vandrovec <petr@vmware.com>
> Signed-off-by: Ronak Doshi <doshir@vmware.com>

Checkpatch says:

WARNING: kfree(NULL) is safe and this check is probably not required
#39: FILE: drivers/net/vmxnet3/vmxnet3_drv.c:455:
 	if (tq->buf_info) {
+		kfree(tq->buf_info);

WARNING: kfree(NULL) is safe and this check is probably not required
#73: FILE: drivers/net/vmxnet3/vmxnet3_drv.c:1737:
 	if (rq->buf_info[0]) {
+		kfree(rq->buf_info[0]);


You can remove those ifs as well.

      reply	other threads:[~2021-01-28  0:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-26 19:06 [PATCH v4 net-next] vmxnet3: Remove buf_info from device accessible structures Ronak Doshi
2021-01-28  0:10 ` Jakub Kicinski [this message]

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=20210127161017.2d9adf4a@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com \
    --to=kuba@kernel.org \
    --cc=davem@davemloft.net \
    --cc=doshir@vmware.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=petr@vmware.com \
    --cc=pv-drivers@vmware.com \
    /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).