Patch "crypto: qat - fix mutex ordering in adf_rl" has been added to the 6.7-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    crypto: qat - fix mutex ordering in adf_rl

to the 6.7-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     crypto-qat-fix-mutex-ordering-in-adf_rl.patch
and it can be found in the queue-6.7 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 0d05a889cc181f44207cab27bca39ed857fdb11f
Author: Damian Muszynski <damian.muszynski@xxxxxxxxx>
Date:   Tue Nov 28 18:39:30 2023 +0100

    crypto: qat - fix mutex ordering in adf_rl
    
    [ Upstream commit 487caa8d5ef9a9a27b092c5790d529a7a0c24f8b ]
    
    If the function validate_user_input() returns an error, the error path
    attempts to unlock an unacquired mutex.
    Acquire the mutex before calling validate_user_input(). This is not
    strictly necessary but simplifies the code.
    
    Fixes: d9fb8408376e ("crypto: qat - add rate limiting feature to qat_4xxx")
    Signed-off-by: Damian Muszynski <damian.muszynski@xxxxxxxxx>
    Reviewed-by: Giovanni Cabiddu <giovanni.cabiddu@xxxxxxxxx>
    Signed-off-by: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/crypto/intel/qat/qat_common/adf_rl.c b/drivers/crypto/intel/qat/qat_common/adf_rl.c
index f2de3cd7d05d..de1b214dba1f 100644
--- a/drivers/crypto/intel/qat/qat_common/adf_rl.c
+++ b/drivers/crypto/intel/qat/qat_common/adf_rl.c
@@ -815,13 +815,13 @@ static int add_update_sla(struct adf_accel_dev *accel_dev,
 		return -EFAULT;
 	}
 
+	mutex_lock(&rl_data->rl_lock);
+
 	/* Input validation */
 	ret = validate_user_input(accel_dev, sla_in, is_update);
 	if (ret)
 		goto ret_err;
 
-	mutex_lock(&rl_data->rl_lock);
-
 	if (is_update) {
 		ret = validate_sla_id(accel_dev, sla_in->sla_id);
 		if (ret)




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux