Linux: thunderbolt: Don't access a DP tunnel after its DPRX read was canceled
What fixes it
- 405a969c0b3356639116db89ab367be1d64b77c0LinuxCVE List
- 2c2fd6a7fd5e1218db7e17336fc1a0393b6949e6LinuxCVE List
- 419fa32fa5bc2d7fb9d0d15d5630b1c1090808b3LinuxCVE List
A fixed version on one release line is not the upgrade target for every line. Check your exact version and any vendor backports.
Description
In the Linux kernel, the following vulnerability has been resolved:
thunderbolt: Don't access a DP tunnel after its DPRX read was canceled
tb_dp_dprx_work() checks ->dprx_canceled before it takes tb->lock so it misses a tb_dp_dprx_stop() that could not cancel the already running work. It then polls the DPRX capabilities and runs the callback for a tunnel that has already been torn down while the domain is suspending or going away.
This can be hit by cancelling the DPRX read from outside the ordered tb->wq: During suspend tb_disconnect_and_release_dp() does just this and with a later patch tb_stop() will do it as well. The latter in combination with the Apple NHI where the DPRX read never completed is how I hit this.
Check the flag with tb->lock held instead and check it again in tb_dp_tunnel_active() because the callback runs after the lock has been dropped again.
Also clear the flag in tb_dp_dprx_start() so that it only ever describes the work that is currently in flight.
Text from CVE List
Affected versions 8
- Linuxaffected: d6d458d42e1e1544a18f37f1d5c840e00d5261b9 before 405a969c0b3356639116db89ab367be1d64b77c0CVE List
- Linuxaffected: d6d458d42e1e1544a18f37f1d5c840e00d5261b9 before 2c2fd6a7fd5e1218db7e17336fc1a0393b6949e6CVE List
- Linuxaffected: d6d458d42e1e1544a18f37f1d5c840e00d5261b9 before 419fa32fa5bc2d7fb9d0d15d5630b1c1090808b3CVE List
- Linuxaffected: 6.14CVE List
- Linuxunaffected: all versions before 6.14CVE List
- Linuxunaffected: 6.18.56 through 6.18.*CVE List
- Linuxunaffected: 7.2.10 through 7.2.*CVE List
- Linuxunaffected: 7.3CVE List