<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/net/wireless/marvell, branch linux-5.16.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.16.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.16.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2022-01-27T11:02:18Z</updated>
<entry>
<title>mwifiex: Fix skb_over_panic in mwifiex_usb_recv()</title>
<updated>2022-01-27T11:02:18Z</updated>
<author>
<name>Zekun Shen</name>
</author>
<published>2021-10-31T02:42:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9d3989c5050f10ae9bbec9f32492b500420d04a1'/>
<id>urn:sha1:9d3989c5050f10ae9bbec9f32492b500420d04a1</id>
<content type='text'>
[ Upstream commit 04d80663f67ccef893061b49ec8a42ff7045ae84 ]

Currently, with an unknown recv_type, mwifiex_usb_recv
just return -1 without restoring the skb. Next time
mwifiex_usb_rx_complete is invoked with the same skb,
calling skb_put causes skb_over_panic.

The bug is triggerable with a compromised/malfunctioning
usb device. After applying the patch, skb_over_panic
no longer shows up with the same input.

Attached is the panic report from fuzzing.
skbuff: skb_over_panic: text:000000003bf1b5fa
 len:2048 put:4 head:00000000dd6a115b data:000000000a9445d8
 tail:0x844 end:0x840 dev:&lt;NULL&gt;
kernel BUG at net/core/skbuff.c:109!
invalid opcode: 0000 [#1] SMP KASAN NOPTI
CPU: 0 PID: 198 Comm: in:imklog Not tainted 5.6.0 #60
RIP: 0010:skb_panic+0x15f/0x161
Call Trace:
 &lt;IRQ&gt;
 ? mwifiex_usb_rx_complete+0x26b/0xfcd [mwifiex_usb]
 skb_put.cold+0x24/0x24
 mwifiex_usb_rx_complete+0x26b/0xfcd [mwifiex_usb]
 __usb_hcd_giveback_urb+0x1e4/0x380
 usb_giveback_urb_bh+0x241/0x4f0
 ? __hrtimer_run_queues+0x316/0x740
 ? __usb_hcd_giveback_urb+0x380/0x380
 tasklet_action_common.isra.0+0x135/0x330
 __do_softirq+0x18c/0x634
 irq_exit+0x114/0x140
 smp_apic_timer_interrupt+0xde/0x380
 apic_timer_interrupt+0xf/0x20
 &lt;/IRQ&gt;

Reported-by: Brendan Dolan-Gavitt &lt;brendandg@nyu.edu&gt;
Signed-off-by: Zekun Shen &lt;bruceshenzk@gmail.com&gt;
Signed-off-by: Kalle Valo &lt;kvalo@codeaurora.org&gt;
Link: https://lore.kernel.org/r/YX4CqjfRcTa6bVL+@Zekuns-MBP-16.fios-router.home
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>mwifiex: Fix possible ABBA deadlock</title>
<updated>2022-01-27T11:01:43Z</updated>
<author>
<name>Brian Norris</name>
</author>
<published>2021-11-30T00:47:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b30e4c2788ac718bdbb5f729aea9d0581958b71c'/>
<id>urn:sha1:b30e4c2788ac718bdbb5f729aea9d0581958b71c</id>
<content type='text'>
[ Upstream commit 1b8bb8919ef81bfc8873d223b9361f1685f2106d ]

Quoting Jia-Ju Bai &lt;baijiaju1990@gmail.com&gt;:

  mwifiex_dequeue_tx_packet()
     spin_lock_bh(&amp;priv-&gt;wmm.ra_list_spinlock); --&gt; Line 1432 (Lock A)
     mwifiex_send_addba()
       spin_lock_bh(&amp;priv-&gt;sta_list_spinlock); --&gt; Line 608 (Lock B)

  mwifiex_process_sta_tx_pause()
     spin_lock_bh(&amp;priv-&gt;sta_list_spinlock); --&gt; Line 398 (Lock B)
     mwifiex_update_ralist_tx_pause()
       spin_lock_bh(&amp;priv-&gt;wmm.ra_list_spinlock); --&gt; Line 941 (Lock A)

Similar report for mwifiex_process_uap_tx_pause().

While the locking expectations in this driver are a bit unclear, the
Fixed commit only intended to protect the sta_ptr, so we can drop the
lock as soon as we're done with it.

IIUC, this deadlock cannot actually happen, because command event
processing (which calls mwifiex_process_sta_tx_pause()) is
sequentialized with TX packet processing (e.g.,
mwifiex_dequeue_tx_packet()) via the main loop (mwifiex_main_process()).
But it's good not to leave this potential issue lurking.

Fixes: f0f7c2275fb9 ("mwifiex: minor cleanups w/ sta_list_spinlock in cfg80211.c")
Cc: Douglas Anderson &lt;dianders@chromium.org&gt;
Reported-by: TOTE Robot &lt;oslab@tsinghua.edu.cn&gt;
Link: https://lore.kernel.org/linux-wireless/0e495b14-efbb-e0da-37bd-af6bd677ee2c@gmail.com/
Signed-off-by: Brian Norris &lt;briannorris@chromium.org&gt;
Reviewed-by: Douglas Anderson &lt;dianders@chromium.org&gt;
Signed-off-by: Kalle Valo &lt;kvalo@kernel.org&gt;
Link: https://lore.kernel.org/r/YaV0pllJ5p/EuUat@google.com
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>mwifiex: fix division by zero in fw download path</title>
<updated>2021-10-28T13:27:25Z</updated>
<author>
<name>Johan Hovold</name>
</author>
<published>2021-10-27T08:08:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=89f8765a11d8df49296d92c404067f9b5c58ee26'/>
<id>urn:sha1:89f8765a11d8df49296d92c404067f9b5c58ee26</id>
<content type='text'>
Add the missing endpoint sanity checks to probe() to avoid division by
zero in mwifiex_write_data_sync() in case a malicious device has broken
descriptors (or when doing descriptor fuzz testing).

Only add checks for the firmware-download boot stage, which require both
command endpoints, for now. The driver looks like it will handle a
missing endpoint during normal operation without oopsing, albeit not
very gracefully as it will try to submit URBs to the default pipe and
fail.

Note that USB core will reject URBs submitted for endpoints with zero
wMaxPacketSize but that drivers doing packet-size calculations still
need to handle this (cf. commit 2548288b4fb0 ("USB: Fix: Don't skip
endpoint descriptors with maxpacket=0")).

Fixes: 4daffe354366 ("mwifiex: add support for Marvell USB8797 chipset")
Cc: stable@vger.kernel.org      # 3.5
Cc: Amitkumar Karwar &lt;akarwar@marvell.com&gt;
Signed-off-by: Johan Hovold &lt;johan@kernel.org&gt;
Reviewed-by: Brian Norris &lt;briannorris@chromium.org&gt;
Signed-off-by: Kalle Valo &lt;kvalo@codeaurora.org&gt;
Link: https://lore.kernel.org/r/20211027080819.6675-4-johan@kernel.org
</content>
</entry>
<entry>
<title>libertas: replace snprintf in show functions with sysfs_emit</title>
<updated>2021-10-27T07:38:29Z</updated>
<author>
<name>Ye Guojin</name>
</author>
<published>2021-10-22T09:04:38Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d3c6daa174ff53b61215d8e67c85d466adf57cad'/>
<id>urn:sha1:d3c6daa174ff53b61215d8e67c85d466adf57cad</id>
<content type='text'>
coccicheck complains about the use of snprintf() in sysfs show
functions:
WARNING  use scnprintf or sprintf

Use sysfs_emit instead of scnprintf or sprintf makes more sense.

Reported-by: Zeal Robot &lt;zealci@zte.com.cn&gt;
Signed-off-by: Ye Guojin &lt;ye.guojin@zte.com.cn&gt;
Signed-off-by: Kalle Valo &lt;kvalo@codeaurora.org&gt;
Link: https://lore.kernel.org/r/20211022090438.1065286-1-ye.guojin@zte.com.cn
</content>
</entry>
<entry>
<title>libertas: Fix possible memory leak in probe and disconnect</title>
<updated>2021-10-27T07:32:21Z</updated>
<author>
<name>Wang Hai</name>
</author>
<published>2021-10-20T12:03:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9692151e2fe7a326bafe99836fd1f20a2cc3a049'/>
<id>urn:sha1:9692151e2fe7a326bafe99836fd1f20a2cc3a049</id>
<content type='text'>
I got memory leak as follows when doing fault injection test:

unreferenced object 0xffff88812c7d7400 (size 512):
  comm "kworker/6:1", pid 176, jiffies 4295003332 (age 822.830s)
  hex dump (first 32 bytes):
    00 68 1e 04 81 88 ff ff 01 00 00 00 00 00 00 00  .h..............
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [&lt;ffffffff8167939c&gt;] slab_post_alloc_hook+0x9c/0x490
    [&lt;ffffffff8167f627&gt;] kmem_cache_alloc_trace+0x1f7/0x470
    [&lt;ffffffffa02c9873&gt;] if_usb_probe+0x63/0x446 [usb8xxx]
    [&lt;ffffffffa022668a&gt;] usb_probe_interface+0x1aa/0x3c0 [usbcore]
    [&lt;ffffffff82b59630&gt;] really_probe+0x190/0x480
    [&lt;ffffffff82b59a19&gt;] __driver_probe_device+0xf9/0x180
    [&lt;ffffffff82b59af3&gt;] driver_probe_device+0x53/0x130
    [&lt;ffffffff82b5a075&gt;] __device_attach_driver+0x105/0x130
    [&lt;ffffffff82b55949&gt;] bus_for_each_drv+0x129/0x190
    [&lt;ffffffff82b593c9&gt;] __device_attach+0x1c9/0x270
    [&lt;ffffffff82b5a250&gt;] device_initial_probe+0x20/0x30
    [&lt;ffffffff82b579c2&gt;] bus_probe_device+0x142/0x160
    [&lt;ffffffff82b52e49&gt;] device_add+0x829/0x1300
    [&lt;ffffffffa02229b1&gt;] usb_set_configuration+0xb01/0xcc0 [usbcore]
    [&lt;ffffffffa0235c4e&gt;] usb_generic_driver_probe+0x6e/0x90 [usbcore]
    [&lt;ffffffffa022641f&gt;] usb_probe_device+0x6f/0x130 [usbcore]

cardp is missing being freed in the error handling path of the probe
and the path of the disconnect, which will cause memory leak.

This patch adds the missing kfree().

Fixes: 876c9d3aeb98 ("[PATCH] Marvell Libertas 8388 802.11b/g USB driver")
Reported-by: Hulk Robot &lt;hulkci@huawei.com&gt;
Signed-off-by: Wang Hai &lt;wanghai38@huawei.com&gt;
Signed-off-by: Kalle Valo &lt;kvalo@codeaurora.org&gt;
Link: https://lore.kernel.org/r/20211020120345.2016045-3-wanghai38@huawei.com
</content>
</entry>
<entry>
<title>libertas_tf: Fix possible memory leak in probe and disconnect</title>
<updated>2021-10-27T07:32:21Z</updated>
<author>
<name>Wang Hai</name>
</author>
<published>2021-10-20T12:03:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d549107305b4634c81223a853701c06bcf657bc3'/>
<id>urn:sha1:d549107305b4634c81223a853701c06bcf657bc3</id>
<content type='text'>
I got memory leak as follows when doing fault injection test:

unreferenced object 0xffff88810a2ddc00 (size 512):
  comm "kworker/6:1", pid 176, jiffies 4295009893 (age 757.220s)
  hex dump (first 32 bytes):
    00 50 05 18 81 88 ff ff 00 00 00 00 00 00 00 00  .P..............
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [&lt;ffffffff8167939c&gt;] slab_post_alloc_hook+0x9c/0x490
    [&lt;ffffffff8167f627&gt;] kmem_cache_alloc_trace+0x1f7/0x470
    [&lt;ffffffffa02a1530&gt;] if_usb_probe+0x60/0x37c [libertas_tf_usb]
    [&lt;ffffffffa022668a&gt;] usb_probe_interface+0x1aa/0x3c0 [usbcore]
    [&lt;ffffffff82b59630&gt;] really_probe+0x190/0x480
    [&lt;ffffffff82b59a19&gt;] __driver_probe_device+0xf9/0x180
    [&lt;ffffffff82b59af3&gt;] driver_probe_device+0x53/0x130
    [&lt;ffffffff82b5a075&gt;] __device_attach_driver+0x105/0x130
    [&lt;ffffffff82b55949&gt;] bus_for_each_drv+0x129/0x190
    [&lt;ffffffff82b593c9&gt;] __device_attach+0x1c9/0x270
    [&lt;ffffffff82b5a250&gt;] device_initial_probe+0x20/0x30
    [&lt;ffffffff82b579c2&gt;] bus_probe_device+0x142/0x160
    [&lt;ffffffff82b52e49&gt;] device_add+0x829/0x1300
    [&lt;ffffffffa02229b1&gt;] usb_set_configuration+0xb01/0xcc0 [usbcore]
    [&lt;ffffffffa0235c4e&gt;] usb_generic_driver_probe+0x6e/0x90 [usbcore]
    [&lt;ffffffffa022641f&gt;] usb_probe_device+0x6f/0x130 [usbcore]

cardp is missing being freed in the error handling path of the probe
and the path of the disconnect, which will cause memory leak.

This patch adds the missing kfree().

Fixes: c305a19a0d0a ("libertas_tf: usb specific functions")
Reported-by: Hulk Robot &lt;hulkci@huawei.com&gt;
Signed-off-by: Wang Hai &lt;wanghai38@huawei.com&gt;
Signed-off-by: Kalle Valo &lt;kvalo@codeaurora.org&gt;
Link: https://lore.kernel.org/r/20211020120345.2016045-2-wanghai38@huawei.com
</content>
</entry>
<entry>
<title>wireless: use eth_hw_addr_set() instead of ether_addr_copy()</title>
<updated>2021-10-20T09:39:42Z</updated>
<author>
<name>Jakub Kicinski</name>
</author>
<published>2021-10-18T23:50:08Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=fcb79f31d9068692f696e92c7fda199b37f5ee96'/>
<id>urn:sha1:fcb79f31d9068692f696e92c7fda199b37f5ee96</id>
<content type='text'>
Commit 406f42fa0d3c ("net-next: When a bond have a massive amount
of VLANs...") introduced a rbtree for faster Ethernet address look
up. To maintain netdev-&gt;dev_addr in this tree we need to make all
the writes to it got through appropriate helpers.

Convert wireless from ether_addr_copy() to eth_hw_addr_set():

  @@
  expression dev, np;
  @@
  - ether_addr_copy(dev-&gt;dev_addr, np)
  + eth_hw_addr_set(dev, np)

Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
Signed-off-by: Kalle Valo &lt;kvalo@codeaurora.org&gt;
Link: https://lore.kernel.org/r/20211018235021.1279697-3-kuba@kernel.org
</content>
</entry>
<entry>
<title>wireless: use eth_hw_addr_set()</title>
<updated>2021-10-20T09:39:42Z</updated>
<author>
<name>Jakub Kicinski</name>
</author>
<published>2021-10-18T23:50:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=708884e7f7f3adb00ddb32d1c1a772d30bf86747'/>
<id>urn:sha1:708884e7f7f3adb00ddb32d1c1a772d30bf86747</id>
<content type='text'>
Convert all WiFi drivers from memcpy(... ETH_ADDR)
to eth_hw_addr_set():

  @@
  expression dev, np;
  @@
  - memcpy(dev-&gt;dev_addr, np, ETH_ALEN)
  + eth_hw_addr_set(dev, np)

Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
Signed-off-by: Kalle Valo &lt;kvalo@codeaurora.org&gt;
Link: https://lore.kernel.org/r/20211018235021.1279697-2-kuba@kernel.org
</content>
</entry>
<entry>
<title>mwifiex: Deactive host sleep using HSCFG after it was activated manually</title>
<updated>2021-10-20T08:51:22Z</updated>
<author>
<name>Jonas Dreßler</name>
</author>
<published>2021-10-16T15:32:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5943a864fe84c1b1dcba70c8f50305496cfc2416'/>
<id>urn:sha1:5943a864fe84c1b1dcba70c8f50305496cfc2416</id>
<content type='text'>
When powersaving (so either wifi powersaving or deep sleep, depending on
which state the firmware is in) is disabled, the way the firmware goes
into host sleep is different: Usually the firmware implicitely enters
host sleep on the next SLEEP event we get when we configured host sleep
via HSCFG before. When powersaving is disabled though, there are no
SLEEP events, the way we enter host sleep in that case is different: The
firmware will send us a HS_ACT_REQ event and after that we "manually"
make the firmware enter host sleep by sending it another HSCFG command
with the action HS_ACTIVATE.

Now waking up from host sleep appears to be different depending on
whether powersaving is enabled again: When powersaving is enabled, the
firmware implicitely leaves host sleep as soon as it wakes up and sends
us an AWAKE event. When powersaving is disabled though, it apparently
doesn't implicitely leave host sleep, but instead we need to send it a
HSCFG command with the HS_CONFIGURE action and the HS_CFG_CANCEL
condition. We didn't do that so far, which is why waking up from host
sleep was broken when powersaving is disabled.

So add some additional state to mwifiex_adapter where we keep track of
whether host sleep was activated manually via HS_ACTIVATE, and if that
was the case, deactivate it manually again via HS_CFG_CANCEL.

Signed-off-by: Jonas Dreßler &lt;verdre@v0yd.nl&gt;
Signed-off-by: Kalle Valo &lt;kvalo@codeaurora.org&gt;
Link: https://lore.kernel.org/r/20211016153244.24353-6-verdre@v0yd.nl
</content>
</entry>
<entry>
<title>mwifiex: Send DELBA requests according to spec</title>
<updated>2021-10-20T08:51:21Z</updated>
<author>
<name>Jonas Dreßler</name>
</author>
<published>2021-10-16T15:32:43Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=cc8a8bc37466f79b24d972555237f3d591150602'/>
<id>urn:sha1:cc8a8bc37466f79b24d972555237f3d591150602</id>
<content type='text'>
While looking at on-air packets using Wireshark, I noticed we're never
setting the initiator bit when sending DELBA requests to the AP: While
we set the bit on our del_ba_param_set bitmask, we forget to actually
copy that bitmask over to the command struct, which means we never
actually set the initiator bit.

Fix that and copy the bitmask over to the host_cmd_ds_11n_delba command
struct.

Fixes: 5e6e3a92b9a4 ("wireless: mwifiex: initial commit for Marvell mwifiex driver")
Signed-off-by: Jonas Dreßler &lt;verdre@v0yd.nl&gt;
Acked-by: Pali Rohár &lt;pali@kernel.org&gt;
Signed-off-by: Kalle Valo &lt;kvalo@codeaurora.org&gt;
Link: https://lore.kernel.org/r/20211016153244.24353-5-verdre@v0yd.nl
</content>
</entry>
</feed>
