Re: [PATCH] crypto: chelsio - Fix wrcount leak in chcr_aes_decrypt()

From: Krzysztof Kozlowski

Date: Fri Nov 06 2026 - 02:54:56 EST


On 23/09/2026 07:34, Herbert Xu wrote:
> On Wed, Sep 16, 2026 at 09:23:59AM +0000, Wentao Liang wrote:
>> chcr_aes_decrypt() increments the device inflight count with
>> chcr_inc_wrcount() before building the work request, but it returns
>> early without dropping the count when the tx queue is full or when
>> process_cipher() fails and returns no skb. The count is only dropped
>> by the completion handlers, so every failed request permanently skews
>> the count and eventually blocks the device from being detached, with
>> the detach worker warning "CHCR:request Still Pending".
>>
>> Add an error label that calls chcr_dec_wrcount(), mirroring
>> chcr_aes_encrypt(), and jump to it on the failure paths.
>>
>> Fixes: fef4912b66d6 ("crypto: chelsio - Handle PCI shutdown event")
>> Cc: stable@xxxxxxxxxxxxxxx
>> Signed-off-by: Wentao Liang <vulab@xxxxxxxxxxx>
>> ---
>> drivers/crypto/chelsio/chcr_algo.c | 13 +++++++++----
>> 1 file changed, 9 insertions(+), 4 deletions(-)
>
> Plesae combine this with the encrypt patch and repost.

After further discussions/postings it is likely that vulab@ is not a
real person, but a bot. It is also possible that it hides intentional
bugs among good looking patches, thus please be cautious and thoroughly
review the patch.

Best regards,
Krzysztof