<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/net/vmxnet3, branch linux-4.19.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.19.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.19.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2022-05-25T07:10:39Z</updated>
<entry>
<title>net: vmxnet3: fix possible NULL pointer dereference in vmxnet3_rq_cleanup()</title>
<updated>2022-05-25T07:10:39Z</updated>
<author>
<name>Zixuan Fu</name>
</author>
<published>2022-05-14T05:07:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=248a37ffd81c7121d30702d8caa31db48450680d'/>
<id>urn:sha1:248a37ffd81c7121d30702d8caa31db48450680d</id>
<content type='text'>
[ Upstream commit edf410cb74dc612fd47ef5be319c5a0bcd6e6ccd ]

In vmxnet3_rq_create(), when dma_alloc_coherent() fails,
vmxnet3_rq_destroy() is called. It sets rq-&gt;rx_ring[i].base to NULL. Then
vmxnet3_rq_create() returns an error to its callers mxnet3_rq_create_all()
-&gt; vmxnet3_change_mtu(). Then vmxnet3_change_mtu() calls
vmxnet3_force_close() -&gt; dev_close() in error handling code. And the driver
calls vmxnet3_close() -&gt; vmxnet3_quiesce_dev() -&gt; vmxnet3_rq_cleanup_all()
-&gt; vmxnet3_rq_cleanup(). In vmxnet3_rq_cleanup(),
rq-&gt;rx_ring[ring_idx].base is accessed, but this variable is NULL, causing
a NULL pointer dereference.

To fix this possible bug, an if statement is added to check whether
rq-&gt;rx_ring[0].base is NULL in vmxnet3_rq_cleanup() and exit early if so.

The error log in our fault-injection testing is shown as follows:

[   65.220135] BUG: kernel NULL pointer dereference, address: 0000000000000008
...
[   65.222633] RIP: 0010:vmxnet3_rq_cleanup_all+0x396/0x4e0 [vmxnet3]
...
[   65.227977] Call Trace:
...
[   65.228262]  vmxnet3_quiesce_dev+0x80f/0x8a0 [vmxnet3]
[   65.228580]  vmxnet3_close+0x2c4/0x3f0 [vmxnet3]
[   65.228866]  __dev_close_many+0x288/0x350
[   65.229607]  dev_close_many+0xa4/0x480
[   65.231124]  dev_close+0x138/0x230
[   65.231933]  vmxnet3_force_close+0x1f0/0x240 [vmxnet3]
[   65.232248]  vmxnet3_change_mtu+0x75d/0x920 [vmxnet3]
...

Fixes: d1a890fa37f27 ("net: VMware virtual Ethernet NIC driver: vmxnet3")
Reported-by: TOTE Robot &lt;oslab@tsinghua.edu.cn&gt;
Signed-off-by: Zixuan Fu &lt;r33s3n6@gmail.com&gt;
Link: https://lore.kernel.org/r/20220514050711.2636709-1-r33s3n6@gmail.com
Signed-off-by: Paolo Abeni &lt;pabeni@redhat.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>net: vmxnet3: fix possible use-after-free bugs in vmxnet3_rq_alloc_rx_buf()</title>
<updated>2022-05-25T07:10:39Z</updated>
<author>
<name>Zixuan Fu</name>
</author>
<published>2022-05-14T05:06:56Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3adaaf3472e8ea410cb1330e5dd8372b0483dc78'/>
<id>urn:sha1:3adaaf3472e8ea410cb1330e5dd8372b0483dc78</id>
<content type='text'>
[ Upstream commit 9e7fef9521e73ca8afd7da9e58c14654b02dfad8 ]

In vmxnet3_rq_alloc_rx_buf(), when dma_map_single() fails, rbi-&gt;skb is
freed immediately. Similarly, in another branch, when dma_map_page() fails,
rbi-&gt;page is also freed. In the two cases, vmxnet3_rq_alloc_rx_buf()
returns an error to its callers vmxnet3_rq_init() -&gt; vmxnet3_rq_init_all()
-&gt; vmxnet3_activate_dev(). Then vmxnet3_activate_dev() calls
vmxnet3_rq_cleanup_all() in error handling code, and rbi-&gt;skb or rbi-&gt;page
are freed again in vmxnet3_rq_cleanup_all(), causing use-after-free bugs.

To fix these possible bugs, rbi-&gt;skb and rbi-&gt;page should be cleared after
they are freed.

The error log in our fault-injection testing is shown as follows:

[   14.319016] BUG: KASAN: use-after-free in consume_skb+0x2f/0x150
...
[   14.321586] Call Trace:
...
[   14.325357]  consume_skb+0x2f/0x150
[   14.325671]  vmxnet3_rq_cleanup_all+0x33a/0x4e0 [vmxnet3]
[   14.326150]  vmxnet3_activate_dev+0xb9d/0x2ca0 [vmxnet3]
[   14.326616]  vmxnet3_open+0x387/0x470 [vmxnet3]
...
[   14.361675] Allocated by task 351:
...
[   14.362688]  __netdev_alloc_skb+0x1b3/0x6f0
[   14.362960]  vmxnet3_rq_alloc_rx_buf+0x1b0/0x8d0 [vmxnet3]
[   14.363317]  vmxnet3_activate_dev+0x3e3/0x2ca0 [vmxnet3]
[   14.363661]  vmxnet3_open+0x387/0x470 [vmxnet3]
...
[   14.367309]
[   14.367412] Freed by task 351:
...
[   14.368932]  __dev_kfree_skb_any+0xd2/0xe0
[   14.369193]  vmxnet3_rq_alloc_rx_buf+0x71e/0x8d0 [vmxnet3]
[   14.369544]  vmxnet3_activate_dev+0x3e3/0x2ca0 [vmxnet3]
[   14.369883]  vmxnet3_open+0x387/0x470 [vmxnet3]
[   14.370174]  __dev_open+0x28a/0x420
[   14.370399]  __dev_change_flags+0x192/0x590
[   14.370667]  dev_change_flags+0x7a/0x180
[   14.370919]  do_setlink+0xb28/0x3570
[   14.371150]  rtnl_newlink+0x1160/0x1740
[   14.371399]  rtnetlink_rcv_msg+0x5bf/0xa50
[   14.371661]  netlink_rcv_skb+0x1cd/0x3e0
[   14.371913]  netlink_unicast+0x5dc/0x840
[   14.372169]  netlink_sendmsg+0x856/0xc40
[   14.372420]  ____sys_sendmsg+0x8a7/0x8d0
[   14.372673]  __sys_sendmsg+0x1c2/0x270
[   14.372914]  do_syscall_64+0x41/0x90
[   14.373145]  entry_SYSCALL_64_after_hwframe+0x44/0xae
...

Fixes: 5738a09d58d5a ("vmxnet3: fix checks for dma mapping errors")
Reported-by: TOTE Robot &lt;oslab@tsinghua.edu.cn&gt;
Signed-off-by: Zixuan Fu &lt;r33s3n6@gmail.com&gt;
Link: https://lore.kernel.org/r/20220514050656.2636588-1-r33s3n6@gmail.com
Signed-off-by: Paolo Abeni &lt;pabeni@redhat.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>vmxnet3: do not stop tx queues after netif_device_detach()</title>
<updated>2021-11-26T10:35:59Z</updated>
<author>
<name>Dongli Zhang</name>
</author>
<published>2021-10-26T21:50:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4204182fd504968b5be596c8ac377dfba2c0effd'/>
<id>urn:sha1:4204182fd504968b5be596c8ac377dfba2c0effd</id>
<content type='text'>
[ Upstream commit 9159f102402a64ac85e676b75cc1f9c62c5b4b73 ]

The netif_device_detach() conditionally stops all tx queues if the queues
are running. There is no need to call netif_tx_stop_all_queues() again.

Signed-off-by: Dongli Zhang &lt;dongli.zhang@oracle.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>net: vmxnet3: fix possible buffer overflow caused by bad DMA value in vmxnet3_get_rss()</title>
<updated>2020-06-22T07:05:12Z</updated>
<author>
<name>Jia-Ju Bai</name>
</author>
<published>2020-05-30T02:41:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=38b5dc60dffc85d4779fdb4c634862c28b78136c'/>
<id>urn:sha1:38b5dc60dffc85d4779fdb4c634862c28b78136c</id>
<content type='text'>
[ Upstream commit 3e1c6846b9e108740ef8a37be80314053f5dd52a ]

The value adapter-&gt;rss_conf is stored in DMA memory, and it is assigned
to rssConf, so rssConf-&gt;indTableSize can be modified at anytime by
malicious hardware. Because rssConf-&gt;indTableSize is assigned to n,
buffer overflow may occur when the code "rssConf-&gt;indTable[n]" is
executed.

To fix this possible bug, n is checked after being used.

Signed-off-by: Jia-Ju Bai &lt;baijiaju1990@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net</title>
<updated>2018-05-21T20:01:54Z</updated>
<author>
<name>David S. Miller</name>
</author>
<published>2018-05-21T20:01:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6f6e434aa267a6030477876d89444fe3a6b7a48d'/>
<id>urn:sha1:6f6e434aa267a6030477876d89444fe3a6b7a48d</id>
<content type='text'>
S390 bpf_jit.S is removed in net-next and had changes in 'net',
since that code isn't used any more take the removal.

TLS data structures split the TX and RX components in 'net-next',
put the new struct members from the bug fix in 'net' into the RX
part.

The 'net-next' tree had some reworking of how the ERSPAN code works in
the GRE tunneling code, overlapping with a one-line headroom
calculation fix in 'net'.

Overlapping changes in __sock_map_ctx_update_elem(), keep the bits
that read the prog members via READ_ONCE() into local variables
before using them.

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>vmxnet3: Replace msleep(1) with usleep_range()</title>
<updated>2018-05-17T19:55:38Z</updated>
<author>
<name>YueHaibing</name>
</author>
<published>2018-05-17T03:46:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=93c65d13d8a0b7c272868d4a9779f96fc973df26'/>
<id>urn:sha1:93c65d13d8a0b7c272868d4a9779f96fc973df26</id>
<content type='text'>
As documented in Documentation/timers/timers-howto.txt,
replace msleep(1) with usleep_range().

Signed-off-by: YueHaibing &lt;yuehaibing@huawei.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>vmxnet3: use DMA memory barriers where required</title>
<updated>2018-05-15T02:43:57Z</updated>
<author>
<name>hpreg@vmware.com</name>
</author>
<published>2018-05-14T12:14:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f3002c1374fb2367c9d8dbb28852791ef90d2bac'/>
<id>urn:sha1:f3002c1374fb2367c9d8dbb28852791ef90d2bac</id>
<content type='text'>
The gen bits must be read first from (resp. written last to) DMA memory.
The proper way to enforce this on Linux is to call dma_rmb() (resp.
dma_wmb()).

Signed-off-by: Regis Duchesne &lt;hpreg@vmware.com&gt;
Acked-by: Ronak Doshi &lt;doshir@vmware.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>vmxnet3: set the DMA mask before the first DMA map operation</title>
<updated>2018-05-15T02:43:57Z</updated>
<author>
<name>hpreg@vmware.com</name>
</author>
<published>2018-05-14T12:14:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=61aeecea40afb2b89933e27cd4adb10fc2e75cfd'/>
<id>urn:sha1:61aeecea40afb2b89933e27cd4adb10fc2e75cfd</id>
<content type='text'>
The DMA mask must be set before, not after, the first DMA map operation, or
the first DMA map operation could in theory fail on some systems.

Fixes: b0eb57cb97e78 ("VMXNET3: Add support for virtual IOMMU")
Signed-off-by: Regis Duchesne &lt;hpreg@vmware.com&gt;
Acked-by: Ronak Doshi &lt;doshir@vmware.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>vmxnet3: fix incorrect dereference when rxvlan is disabled</title>
<updated>2018-04-19T17:59:05Z</updated>
<author>
<name>Ronak Doshi</name>
</author>
<published>2018-04-18T19:48:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=65ec0bd1c7c14522670a5294de35710fb577a7fd'/>
<id>urn:sha1:65ec0bd1c7c14522670a5294de35710fb577a7fd</id>
<content type='text'>
vmxnet3_get_hdr_len() is used to calculate the header length which in
turn is used to calculate the gso_size for skb. When rxvlan offload is
disabled, vlan tag is present in the header and the function references
ip header from sizeof(ethhdr) and leads to incorrect pointer reference.

This patch fixes this issue by taking sizeof(vlan_ethhdr) into account
if vlan tag is present and correctly references the ip hdr.

Signed-off-by: Ronak Doshi &lt;doshir@vmware.com&gt;
Acked-by: Guolin Yang &lt;gyang@vmware.com&gt;
Acked-by: Louis Luo &lt;llouis@vmware.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>vmxnet3: remove unused flag "rxcsum" from struct vmxnet3_adapter</title>
<updated>2018-03-20T14:56:25Z</updated>
<author>
<name>Igor Pylypiv</name>
</author>
<published>2018-03-18T01:17:58Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8137a8e2190975ed9060111ce13000792360aba3'/>
<id>urn:sha1:8137a8e2190975ed9060111ce13000792360aba3</id>
<content type='text'>
Signed-off-by: Igor Pylypiv &lt;ipylypiv@silver-peak.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
