On Fri, Feb 18, 2022 at 2:03 PM Greg KH <greg@xxxxxxxxx> wrote: > > On Fri, Feb 18, 2022 at 11:45:29AM +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.16-stable + update commit message] > > This and 5.15 backport now queued up. > > This needs to go farther back as well, right? Correct, I'm backporting and testing for the different stable branches. Cheers, Jens > > thanks > > greg k-h