lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c084ddbd-04ee-9033-5ec9-9d13cab05311@gmail.com>
Date:   Thu, 19 Aug 2021 12:31:35 +0300
From:   Pavel Skripkin <paskripkin@...il.com>
To:     Sean Young <sean@...s.org>
Cc:     mkrufky@...uxtv.org, mchehab@...nel.org, crope@....fi,
        linux-media@...r.kernel.org, linux-kernel@...r.kernel.org,
        syzbot+5ca0bf339f13c4243001@...kaller.appspotmail.com
Subject: Re: [PATCH] media: mxl111sf: change mutex_init() location

On 8/19/21 12:29 PM, Sean Young wrote:
> On Sun, Aug 15, 2021 at 12:06:16PM +0300, Pavel Skripkin wrote:
>> On 8/15/21 11:49 AM, Pavel Skripkin wrote:
>> > On 8/15/21 11:37 AM, Sean Young wrote:
>> > > On Sat, Jul 31, 2021 at 12:38:29AM +0300, Pavel Skripkin wrote:
>> > > > 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.
>> > > 
>> > Good point. I see, that all other frontends also call
>> > mxl111sf_ctrl_msg() inside ->frontend_attach() call.
>> > 
>> > I think, that fixing dvb-usb core is not good idea, so, I will add
>> > mutex_init() call inside all frontends, which use mxl111sf_init().
>> > 
>> > What do you think about it?
>> > 
>> > 
>> 
>> 
>> Something like this should work. Helper is just to not copy-paste code
>> parts. Build tested against v5.14-rc5
> 
> How about creating a dvb_usb_device_properties probe function and
> initializing the mutex init there?
> 
> 

Sounds reasonable. Will do it in v2, thank you!



With regards,
Pavel Skripkin

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ