Re: [PATCH backport 5.15 v2] optee: use driver internal tee_context for some rpc

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

 



On Tue, Feb 22, 2022 at 06:48:32AM +0100, Greg KH wrote:
> On Mon, Feb 21, 2022 at 11:31:05PM +0100, Jens Wiklander wrote:
> > commit aceeafefff736057e8f93f19bbfbef26abd94604 upstream
> > 
> > Adds a driver private tee_context to struct optee.
> > 
> > The new driver internal tee_context is used when allocating driver
> > private shared memory. This decouples the shared memory object from its
> > original tee_context. This is needed when the life time of such a memory
> > allocation outlives the client tee_context.
> > 
> > This patch fixes the problem described below:
> > 
> > The addition of a shutdown hook by commit f25889f93184 ("optee: fix tee out
> > of memory failure seen during kexec reboot") introduced a kernel shutdown
> > regression that can be triggered after running the OP-TEE xtest suites.
> > 
> > Once the shutdown hook is called it is not possible to communicate any more
> > with the supplicant process because the system is not scheduling task any
> > longer. Thus if the optee driver shutdown path receives a supplicant RPC
> > request from the OP-TEE we will deadlock the kernel's shutdown.
> > 
> > Fixes: f25889f93184 ("optee: fix tee out of memory failure seen during kexec reboot")
> > Fixes: 217e0250cccb ("tee: use reference counting for tee_context")
> > Reported-by: Lars Persson <larper@xxxxxxxx>
> > Cc: stable@xxxxxxxxxxxxxxx # 1e2c3ef0496e tee: export teedev_open() and teedev_close_context()
> > Cc: stable@xxxxxxxxxxxxxxx
> > Reviewed-by: Sumit Garg <sumit.garg@xxxxxxxxxx>
> > [JW: backport to 5.15-stable + update commit message]
> > Signed-off-by: Jens Wiklander <jens.wiklander@xxxxxxxxxx>
> > ---
> > Hi,
> > 
> > This is an update to the previous patch posted with the same name.
> 
> What changed in v2?
> 

I'm going to drop the existing tee patches in the stable -rcs and wait
another round to take these, as hopefully they are better.

thanks,

greg k-h



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux