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: <20250319031721.69179-1-zhanghui31@xiaomi.com>
Date: Wed, 19 Mar 2025 11:17:21 +0800
From: ZhangHui <zhanghui31@...omi.com>
To: <bvanassche@....org>
CC: <James.Bottomley@...senPartnership.com>, <alim.akhtar@...sung.com>,
	<avri.altman@....com>, <ebiggers@...gle.co>, <linux-kernel@...r.kernel.org>,
	<linux-scsi@...r.kernel.org>, <martin.petersen@...cle.com>,
	<peter.griffin@...aro.org>, <zhanghui31@...omi.com>
Subject: Re: [PATCH] ufs: crypto: add host_sem lock in ufshcd_program_key

On Mon, Mar 17, 2025 at 03:32:51PM -0700, Bart Van Assche wrote:
> On 3/17/25 4:01 AM, ZhangHui wrote:
> > On Android devices, we found that there is a probability that
> > the ufs has been shut down but the thread is still deleting the
> > key, which will cause the bus error.
> 
> How does this patch guarantee that crypto keys are evicted before the
> UFS driver has been shut down? This should be explained in detail in the
> patch description.

This modification does not guarantee that ufs has entered shutdown before
evicting the key. Drivers should not make assumptions about the behavior
of user access.

If ufs has entered shutdown, evicting key flow will return -EBUSY.

> > Let's fixed this issue by adding a lock in program_key flow.
> 
> There are multiple synchronization objects owned by the UFS driver. Why
> 'host_sem' and not any other synchronization object?
> 

The host_sem is held in suspend/resume, shutdown and err hander flow, so I
think host_sem is used to mutually exclude host controller power failure
and access.

thanks 
zhanghui

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ