]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 24 Jul 2025 06:53:14 +0000 (08:53 +0200)
commit027701180a7bcb64c42eab291133ef0c87b5b6c5
tree05944d2643cabbf6845c091f09c582a36e46fef7
parent3c91a56762b1f0d1e4af2d86c2cba83b61ed9eaa
net: libwx: fix the using of Rx buffer DMA

commit 5fd77cc6bd9b368431a815a780e407b7781bcca0 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/wangxun/libwx/wx_lib.c
drivers/net/ethernet/wangxun/libwx/wx_type.h