On Sat, Jul 31, 2021 at 12:38:29AM +0300, Pavel Skripkin wrote:Good point. I see, that all other frontends also call mxl111sf_ctrl_msg() inside ->frontend_attach() call.
Syzbot reported, that mxl111sf_ctrl_msg() uses uninitialized
mutex. The problem was in wrong mutex_init() location.
Previous mutex_init(&state->msg_lock) call was in ->init() function, but
dvb_usbv2_init() has this order of calls:
dvb_usbv2_init()
dvb_usbv2_adapter_init()
dvb_usbv2_adapter_frontend_init()
props->frontend_attach()
props->init()
Since mxl111sf_frontend_attach_atsc_mh() calls mxl111sf_ctrl_msg()
internally we need to initialize state->msg_lock in it to make lockdep
happy.
What about the other frontends like mxl111sf_frontend_attach_dvbt? They
no longer initialize the mutex.