[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210121170705.08ecb23d@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>
Date: Thu, 21 Jan 2021 17:07:05 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: Ronak Doshi <doshir@...are.com>
Cc: <netdev@...r.kernel.org>, Petr Vandrovec <petr@...are.com>,
"maintainer:VMWARE VMXNET3 ETHERNET DRIVER" <pv-drivers@...are.com>,
"David S. Miller" <davem@...emloft.net>,
open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH net-next] vmxnet3: Remove buf_info from device
accessible structures
On Tue, 19 Jan 2021 18:19:40 -0800 Ronak Doshi wrote:
> From: Petr Vandrovec <petr@...are.com>
>
> vmxnet3: Remove buf_info from device accessible structures
Something happened to the posting, looks like the subject is listed
twice?
> 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@...are.com>
> Signed-off-by: Ronak Doshi <doshir@...are.com>
> @@ -534,11 +530,13 @@ vmxnet3_tq_create(struct vmxnet3_tx_queue *tq,
> goto err;
> }
>
> - sz = tq->tx_ring.size * sizeof(tq->buf_info[0]);
> - tq->buf_info = dma_alloc_coherent(&adapter->pdev->dev, sz,
> - &tq->buf_info_pa, GFP_KERNEL);
> - if (!tq->buf_info)
> + tq->buf_info = kmalloc_array_node(tq->tx_ring.size, sizeof(tq->buf_info[0]),
> + GFP_KERNEL | __GFP_ZERO,
> + dev_to_node(&adapter->pdev->dev));
kcalloc_node()
> + if (!tq->buf_info) {
> + netdev_err(adapter->netdev, "failed to allocate tx buffer info\n");
Please drop the message, OOM splat will be visible enough. checkpatch
usually points this out
> goto err;
> + }
Same comments for vmxnet3_rq_create()
Powered by blists - more mailing lists