In the Linux kernel, the following vulnerability has been resolved:
ax25: fix use-after-free bugs caused by ax25dsdel_timer
When the ax25 device is detaching, the ax25devdevicedown() calls ax25dsdeltimer() to cleanup the slavetimer. When the timer handler is running, the ax25dsdeltimer() that calls del_timer() in it will return directly. As a result, the use-after-free bugs could happen, one of the scenarios is shown below:
(Thread 1) | (Thread 2)
| ax25_ds_timeout()
ax25devdevicedown() | ax25dsdeltimer() | deltimer() | ax25devput() //FREE | | ax25dev-> //USE
In order to mitigate bugs, when the device is detaching, use timershutdownsync() to stop the timer.