aboutsummaryrefslogtreecommitdiffstats
path: root/rust/helpers/bug.c
diff options
context:
space:
mode:
authorAnssi Hannula <[email protected]>2025-08-22 09:50:02 +0000
committerMarc Kleine-Budde <[email protected]>2025-09-10 15:12:05 +0000
commitef79f00be72bd81d2e1e6f060d83cf7e425deee4 (patch)
treebee29abea0cf676381551e89cbbd263c0cf3f821 /rust/helpers/bug.c
parentcan: j1939: j1939_local_ecu_get(): undo increment when j1939_local_ecu_get() ... (diff)
downloadkernel-ef79f00be72bd81d2e1e6f060d83cf7e425deee4.tar.gz
kernel-ef79f00be72bd81d2e1e6f060d83cf7e425deee4.zip
can: xilinx_can: xcan_write_frame(): fix use-after-free of transmitted SKB
can_put_echo_skb() takes ownership of the SKB and it may be freed during or after the call. However, xilinx_can xcan_write_frame() keeps using SKB after the call. Fix that by only calling can_put_echo_skb() after the code is done touching the SKB. The tx_lock is held for the entire xcan_write_frame() execution and also on the can_get_echo_skb() side so the order of operations does not matter. An earlier fix commit 3d3c817c3a40 ("can: xilinx_can: Fix usage of skb memory") did not move the can_put_echo_skb() call far enough. Signed-off-by: Anssi Hannula <[email protected]> Fixes: 1598efe57b3e ("can: xilinx_can: refactor code in preparation for CAN FD support") Link: https://patch.msgid.link/[email protected] [mkl: add "commit" in front of sha1 in patch description] [mkl: fix indention] Signed-off-by: Marc Kleine-Budde <[email protected]>
Diffstat (limited to 'rust/helpers/bug.c')
0 files changed, 0 insertions, 0 deletions