Loading
can: m_can: m_can_tx_handler(): fix use after free of skb
stable inclusion from stable-v4.19.253 commit 7728d937ec403a1ceff9483023252d2cb8777f81 category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/IBP6AL CVE: CVE-2022-49275 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=7728d937ec403a1ceff9483023252d2cb8777f81 -------------------------------- commit 2e8e79c4 upstream. can_put_echo_skb() will clone skb then free the skb. Move the can_put_echo_skb() for the m_can version 3.0.x directly before the start of the xmit in hardware, similar to the 3.1.x branch. Fixes: 80646733 ("can: m_can: update to support CAN FD features") Link: https://lore.kernel.org/all/20220317081305.739554-1-mkl@pengutronix.de Cc: stable@vger.kernel.org Reported-by:Hangyu Hua <hbh25y@gmail.com> Signed-off-by:
Marc Kleine-Budde <mkl@pengutronix.de> [sudip: adjust context] Signed-off-by:
Sudip Mukherjee <sudipm.mukherjee@gmail.com> Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by:
Xiangwei Li <liwei728@huawei.com>