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]
Date:   Mon, 3 Sep 2018 16:49:50 +0800
From:   Bing Bu Cao <bingbu.cao@...ux.intel.com>
To:     Javier Martinez Canillas <javierm@...hat.com>,
        linux-kernel@...r.kernel.org
Cc:     Mauro Carvalho Chehab <mchehab@...nel.org>,
        Tian Shu Qiu <tian.shu.qiu@...el.com>,
        Jian Xu Zheng <jian.xu.zheng@...el.com>,
        Sakari Ailus <sakari.ailus@...ux.intel.com>,
        Yong Zhi <yong.zhi@...el.com>,
        Bingbu Cao <bingbu.cao@...el.com>, linux-media@...r.kernel.org
Subject: Re: [PATCH] media: intel-ipu3: cio2: register the mdev on v4l2 async
 notifier complete



On 09/03/2018 03:35 PM, Javier Martinez Canillas wrote:
> Hi,
>
> Thanks a lot your feedback.
>
> On 09/03/2018 09:25 AM, Bing Bu Cao wrote:
>>
>> On 08/31/2018 11:20 PM, Javier Martinez Canillas wrote:
>>> Commit 9832e155f1ed ("[media] media-device: split media initialization and
>>> registration") split the media_device_register() function in two, to avoid
>>> a race condition that can happen when the media device node is accessed by
>>> userpace before the pending subdevices have been asynchronously registered.
>>>
>>> But the ipu3-cio2 driver calls the media_device_register() function right
>>> after calling media_device_init() which defeats the purpose of having two
>>> separate functions.
>>>
>>> In that case, userspace could have a partial view of the media device if
>>> it opened the media device node before all the pending devices have been
>>> bound. So instead, only register the media device once all pending v4l2
>>> subdevices have been registered.
>> Javier, Thanks for your patch.
>> IMHO, there are no big differences for registering the cio2 before and after all the subdevices are ready.
>> User may see a partial view of media graph but it presents what it really is then.
>> It indicate that device is not available currently not it is not there.
> I disagree that there are no differences. The media graph shouldn't be exposed
> until its complete. That's the reason why we have a v4l2 async notifier .bound
> and .complete callbacks (otherwise the .bound would be enough).
>
> It's also the reason why media register was split in _init and _register, as I
> mentioned in the commit message.
I revisit the commit 9832e155f1ed and understand and agree that.
Seems like there are some other drivers (such as rcar-vin and omap4iss) still have similar issues.
>> Could you help tell more details about your problem? The full context is helpful for me to reproduce your problem.
> If an application opens the media device node, how it would know that has an
> incomplete media graph? how it would know once the subdevice has been .bound
> and that has to query the media graph again?
>
> AFAIK there's no way to notify that information to user-space currenctly but
> I may be wrong.
>
> Best regards,

Powered by blists - more mailing lists