net: hns: fix KASAN: use-after-free in hns_nic_net_xmit_hw()
driver inclusion category: bugfix bugzilla: NA CVE: NA ------------------------------------------------------------------------- This patch is trying to fix the issue due to: [27237.844750] BUG: KASAN: use-after-free in hns_nic_net_xmit_hw+0x708/0xa18[hns_enet_drv] After hnae_queue_xmit() in hns_nic_net_xmit_hw(), can be interrupted by interruptions, and than call hns_nic_tx_poll_one() to handle the new packets, and free the skb. So, when turn back to hns_nic_net_xmit_hw(), calling skb->len will cause use-after-free. This patch update tx ring statistics in hns_nic_tx_poll_one() to fix the bug. Signed-off-by:Liubin Shu <shuliubin@huawei.com> Signed-off-by:
Zhitao Yu <yuzhitao@huawei.com> Reviewed-by:
Weiwei Deng <dengweiwei@huawei.com> Signed-off-by:
Zhen Lei <thunder.leizhen@huawei.com> Signed-off-by:
Yonglong Liu <liuyonglong@huawei.com> Reviewed-by:
Xie XiuQi <xiexiuqi@huawei.com> Signed-off-by:
Yang Yingliang <yangyingliang@huawei.com>
Loading
Please sign in to comment