Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mISDN: fix use-after-free bugs in l1oip timer handlers
jira VULN-168 cve CVE-2022-3565 commit-author Duoming Zhou <[email protected]> commit 2568a7e The l1oip_cleanup() traverses the l1oip_ilist and calls release_card() to cleanup module and stack. However, release_card() calls del_timer() to delete the timers such as keep_tl and timeout_tl. If the timer handler is running, the del_timer() will not stop it and result in UAF bugs. One of the processes is shown below: (cleanup routine) | (timer handler) release_card() | l1oip_timeout() ... | del_timer() | ... ... | kfree(hc) //FREE | | hc->timeout_on = 0 //USE Fix by calling del_timer_sync() in release_card(), which makes sure the timer handlers have finished before the resources, such as l1oip and so on, have been deallocated. What's more, the hc->workq and hc->socket_thread can kick those timers right back in. We add a bool flag to show if card is released. Then, check this flag in hc->workq and hc->socket_thread. Fixes: 3712b42 ("Add layer1 over IP support") Signed-off-by: Duoming Zhou <[email protected]> Reviewed-by: Leon Romanovsky <[email protected]> Signed-off-by: David S. Miller <[email protected]> (cherry picked from commit 2568a7e) Signed-off-by: Greg Rose <[email protected]>
- Loading branch information