can: xilinx_can: xcan_write_frame(): fix use-after-free of transmitted SKB
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 1598efe57b3e768056e4ca56cb9cf33111e68d1c · < ef79f00be72bd81d2e1e6f060d83cf7e425deee4| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
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.
[mkl: add "commit" in front of sha1 in patch description] [mkl: fix indention]
From the CVE record · Linux
The Linux kernel's xilinx_can driver can continue using a transmitted SKB after can_put_echo_skb() takes ownership of it and may free it. The input does not specify what an attacker could do, what access would be required, or whether user interaction is needed.
Anyone running a Linux kernel with the xilinx_can driver should check; affected versions are not specified.