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: <1b60e2e2-ad38-40e2-8e15-bb37f1fabd0c@huawei.com>
Date: Mon, 22 Dec 2025 11:36:20 +0800
From: huangchenghai <huangchenghai2@...wei.com>
To: Herbert Xu <herbert@...dor.apana.org.au>
CC: <davem@...emloft.net>, <linux-kernel@...r.kernel.org>,
	<linux-crypto@...r.kernel.org>, <fanghao11@...wei.com>,
	<liulongfang@...wei.com>, <qianweili@...wei.com>, <linwenkai6@...ilicon.com>,
	<wangzhou1@...ilicon.com>
Subject: Re: [PATCH 2/2] crypto: hisilicon/trng - support tfms sharing the
 device


在 2025/12/19 11:06, Herbert Xu 写道:
> On Thu, Nov 20, 2025 at 09:58:12PM +0800, Chenghai Huang wrote:
>> +static int hisi_trng_reseed(struct hisi_trng *trng)
>> +{
>> +	u8 seed[SW_DRBG_SEED_SIZE];
>> +	int size;
>>   
>> -	return ret;
>> +	/* Allow other threads to acquire the lock and execute their jobs. */
>> +	mutex_unlock(&trng->lock);
>> +	mutex_lock(&trng->lock);
> If we have a bunch threads doing generate, then they will all hit
> reseed and end up here for no reason at all.
>
> If you want to stop one thread from hogging the lock, perhaps move
> it inside the read loop in hisi_trng_generate?
>
> Cheers,

Okay, I will move the lock inside the read loop in hisi_trng_generate.


Thanks,

Chenghai


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ