On 07/04/20(Tue) 17:14, Vitaliy Makkoveev wrote: > As Claudio Jeker noticed, NET_LOCK() can release KERNEL_LOCK(). pppx(4) > code has some NET_LOCK() dances which make it unsafe. [...]
The easiest way to fix that is to move if_detach() out of pppx_if_destroy(). It generally makes sense to call if_detach() first then free/close the descriptor of a driver. However some drivers have callbacks and in that case you might want to teardown those first then call if_detach(). if_detach() will require the NET_LOCK() for some time. However pseudo-driver should start protecting their own data structure with different locks.