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:   Thu, 2 Apr 2020 20:50:09 +0900
From:   "Wang, Jiada" <jiada_wang@...tor.com>
To:     Dmitry Osipenko <digetx@...il.com>, <nick@...anahar.org>,
        <dmitry.torokhov@...il.com>, <jikos@...nel.org>,
        <benjamin.tissoires@...hat.com>, <bsz@...ihalf.com>
CC:     <linux-input@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        <erosca@...adit-jv.com>, <Andrew_Gabbasov@...tor.com>
Subject: Re: [PATCH v10 54/55] Input: atmel_mxt_ts: Implement synchronization
 during various operation

Hi Dmitry

On 2020/04/02 1:04, Dmitry Osipenko wrote:
> 31.03.2020 13:50, Jiada Wang пишет:
>> From: Sanjeev Chugh <sanjeev_chugh@...tor.com>
>>
>> There could be scope of race conditions when sysfs is being handled
>> and at the same time, device removal is occurring. For example,
>> we don't want the device removal to begin if the Atmel device
>> cfg update is going on or firmware update is going on. In such
>> cases, wait for device update to be completed before the removal
>> continues.
>>
>>      Thread                                          Thread 2:
>> =========================                       =========================
>> mxt_update_fw_store()                           mxt_remove()
>> mutex_lock(&data->lock)                         ...
>> mxt_initialize()                                //Tries to acquire lock
>>    request_firmware_nowait()                     mutex_lock(&data->lock)
>> ...                                             ==>waits for lock()
>> ...                                             .
>> ...                                             .
>> mutex_unlock(&data->lock)                       .
>>                                                  //Gets lock and proceeds
>>                                                  mxt_free_input_device();
>>                                                  ...
>>                                                  mutex_unlock(&data->lock)
>>                                                  //Frees atmel driver data
>>                                                  kfree(data)
>>
>> If the request_firmware_nowait() completes after the driver removal,
>> and callback is triggered. But kernel crashes since the module is
>> already removed.
>>
>> This commit adds state machine to serialize such scenarios.
> 
> Won't it be easier to bump driver's module use-count by __module_get()
> while firmware is updating? Or remove sysfs during of mxt_remove()? >

thanks for your inspiration, I will replace state machine with module 
use-count.

Thanks,
Jiada

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ