]> www.infradead.org Git - users/jedix/linux-maple.git/commit
net: libwx: fix the using of Rx buffer DMA
authorJiawen Wu <jiawenwu@trustnetic.com>
Mon, 14 Jul 2025 02:47:54 +0000 (10:47 +0800)
committerJakub Kicinski <kuba@kernel.org>
Wed, 16 Jul 2025 00:28:23 +0000 (17:28 -0700)
commit5fd77cc6bd9b368431a815a780e407b7781bcca0
tree07b0aefb30302581c6aa4bfd24bc05d93ca76f12
parent1b7e585c04cd5f0731dd25ffd396277e55fae0e6
net: libwx: fix the using of Rx buffer DMA

The wx_rx_buffer structure contained two DMA address fields: 'dma' and
'page_dma'. However, only 'page_dma' was actually initialized and used
to program the Rx descriptor. But 'dma' was uninitialized and used in
some paths.

This could lead to undefined behavior, including DMA errors or
use-after-free, if the uninitialized 'dma' was used. Althrough such
error has not yet occurred, it is worth fixing in the code.

Fixes: 3c47e8ae113a ("net: libwx: Support to receive packets in NAPI")
Cc: stable@vger.kernel.org
Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250714024755.17512-3-jiawenwu@trustnetic.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/wangxun/libwx/wx_lib.c
drivers/net/ethernet/wangxun/libwx/wx_type.h