lkml.org 
[lkml]   [2021]   [Jan]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v4 net-next] vmxnet3: Remove buf_info from device accessible structures
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.

\
 
 \ /
  Last update: 2021-01-28 01:15    [W:0.030 / U:0.472 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site