Patch "tee: fix put order in teedev_close_context()" has been added to the 5.10-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

    tee: fix put order in teedev_close_context()

to the 5.10-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:
     tee-fix-put-order-in-teedev_close_context.patch
and it can be found in the queue-5.10 subdirectory.

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



commit 1bc155d52e36c194bbf36fce405b14696ba15158
Author: Jens Wiklander <jens.wiklander@xxxxxxxxxx>
Date:   Tue Jun 15 22:23:50 2021 +0200

    tee: fix put order in teedev_close_context()
    
    [ Upstream commit f18397ab3ae23e8e43bba9986e66af6d4497f2ad ]
    
    Prior to this patch was teedev_close_context() calling tee_device_put()
    before teedev_ctx_put() leading to teedev_ctx_release() accessing
    ctx->teedev just after the reference counter was decreased on the
    teedev. Fix this by calling teedev_ctx_put() before tee_device_put().
    
    Fixes: 217e0250cccb ("tee: use reference counting for tee_context")
    Reviewed-by: Sumit Garg <sumit.garg@xxxxxxxxxx>
    Signed-off-by: Jens Wiklander <jens.wiklander@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/tee/tee_core.c b/drivers/tee/tee_core.c
index 6ade4a5c48407..dfc239c64ce3c 100644
--- a/drivers/tee/tee_core.c
+++ b/drivers/tee/tee_core.c
@@ -98,8 +98,10 @@ void teedev_ctx_put(struct tee_context *ctx)
 
 static void teedev_close_context(struct tee_context *ctx)
 {
-	tee_device_put(ctx->teedev);
+	struct tee_device *teedev = ctx->teedev;
+
 	teedev_ctx_put(ctx);
+	tee_device_put(teedev);
 }
 
 static int tee_open(struct inode *inode, struct file *filp)



[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