From: Tristan Madani mwifiex_sdio_host_to_card() rounds up the packet length to MWIFIEX_SDIO_BLOCK_SIZE (256 bytes) for SDIO block-mode transfers. When the original skb data is shorter than the rounded-up length, the SDIO controller reads past the valid payload into uninitialized skb tailroom, transmitting stale data to the wireless device firmware. Zero the padding bytes starting at skb_tail_pointer() without extending skb->len, so that reused buffers such as adapter->sleep_cfm keep their original length across sends. When tailroom is smaller than the padding, zero whatever is available. Fixes: 5e6e3a92b9a4 ("wireless: mwifiex: initial commit for Marvell mwifiex driver") Cc: stable@vger.kernel.org Signed-off-by: Tristan Madani --- v2: use memset(skb_tail_pointer()) instead of skb_put_zero() to avoid permanently extending skb->len on reused buffers like sleep_cfm. Use min_t() to zero whatever tailroom is available when it is smaller than the padding. (Jeff Chen) Build tested: x86_64 defconfig + CONFIG_MWIFIEX=m + CONFIG_MWIFIEX_SDIO=m, gcc 14.2, W=1, 0 warnings. drivers/net/wireless/marvell/mwifiex/sdio.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/wireless/marvell/mwifiex/sdio.c b/drivers/net/wireless/marvell/mwifiex/sdio.c index 417dc2649b99c..d097efb2afbee 100644 --- a/drivers/net/wireless/marvell/mwifiex/sdio.c +++ b/drivers/net/wireless/marvell/mwifiex/sdio.c @@ -2386,6 +2386,11 @@ static int mwifiex_sdio_host_to_card(struct mwifiex_adapter *adapter, /* Transfer data to card */ pkt_len = buf_block_len * blk_size; + if (pkt_len > skb->len) + memset(skb_tail_pointer(skb), 0, + min_t(unsigned int, pkt_len - skb->len, + skb_tailroom(skb))); + if (tx_param) ret = mwifiex_host_to_card_mp_aggr(adapter, payload, pkt_len, port, tx_param->next_pkt_len -- 2.47.3