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] [day] [month] [year] [list]
Message-ID: <0c859144bb1570331853d6eaf441fad9@codeaurora.org>
Date:   Mon, 28 Jun 2021 15:16:52 +0800
From:   Can Guo <cang@...eaurora.org>
To:     Bart Van Assche <bvanassche@....org>
Cc:     asutoshd@...eaurora.org, nguyenb@...eaurora.org,
        hongwus@...eaurora.org, ziqichen@...eaurora.org,
        linux-scsi@...r.kernel.org, kernel-team@...roid.com,
        Alim Akhtar <alim.akhtar@...sung.com>,
        Avri Altman <avri.altman@....com>,
        "James E.J. Bottomley" <jejb@...ux.ibm.com>,
        "Martin K. Petersen" <martin.petersen@...cle.com>,
        Adrian Hunter <adrian.hunter@...el.com>,
        Bean Huo <beanhuo@...ron.com>,
        Stanley Chu <stanley.chu@...iatek.com>,
        Keoseong Park <keosung.park@...sung.com>,
        "Gustavo A. R. Silva" <gustavoars@...nel.org>,
        Jaegeuk Kim <jaegeuk@...nel.org>,
        Kiwoong Kim <kwmad.kim@...sung.com>,
        Satya Tangirala <satyat@...gle.com>,
        open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v4 10/10] scsi: ufs: Apply more limitations to user access

On 2021-06-25 06:25, Bart Van Assche wrote:
> On 6/23/21 7:23 PM, Can Guo wrote:
>> On 2021-06-24 05:51, Bart Van Assche wrote:
>>> On 6/23/21 12:35 AM, Can Guo wrote:
>>> - During system suspend, user space software is paused before the 
>>> device
>>>   driver freeze callbacks are invoked. Hence, the 
>>> hba->is_sys_suspended
>>>   check can be left out.
>> 
>> is_sys_suspended indicates that system resume failed (power/clk is 
>> OFF).
>> 
>>> - If a LUN is runtime suspended, it should be resumed if accessed 
>>> from
>>>   user space instead of failing user space accesses. In other words, 
>>> the
>>>   hba->is_wlu_sys_suspended check seems inappropriate to me.
>> 
>> hba->is_wlu_sys_suspended indicates that wl system resume failed, 
>> device
>> is not operational.
> 
> Hi Can,
> 
> Thanks for the clarification. How about converting the above two 
> answers
> into comments inside ufshcd_is_user_access_allowed()?
> 

Sure.

> Should ufshcd_is_user_access_allowed() perhaps be called after
> ufshcd_rpm_get_sync() instead of before to prevent that the value of
> hba->is_sys_suspended or hba->is_wlu_sys_suspended changes after having
> been checked and before the UFS device is accessed?
> 

is_sys_suspended and is_wlu_sys_suspended only represent system PM 
status,
not runtime PM status.

My understanding is that user threads are frozen before system PM 
starts,
so it does not matter we call  ufshcd_is_user_access_allowed() before or
after ufshcd_rpm_get_sync().

If my understanding is wrong, then we need to either call 
lock_system_sleep()
in get_user_access() or wrap 
ufshcd_suspend_prepare/ufshcd_resume_complete()
with host_sem.

Thanks,

Can Guo.

> Thanks,
> 
> Bart.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ