[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aUJxiioKnDVSC34H@sumit-xelite>
Date: Wed, 17 Dec 2025 14:32:02 +0530
From: Sumit Garg <sumit.garg@...nel.org>
To: Uwe Kleine-König <u.kleine-koenig@...libre.com>
Cc: Sumit Garg <sumit.garg@....qualcomm.com>,
Jens Wiklander <jens.wiklander@...aro.org>,
Olivia Mackall <olivia@...enic.com>,
Herbert Xu <herbert@...dor.apana.org.au>,
Clément Léger <clement.leger@...tlin.com>,
Alexandre Belloni <alexandre.belloni@...tlin.com>,
Ard Biesheuvel <ardb@...nel.org>,
Maxime Coquelin <mcoquelin.stm32@...il.com>,
Alexandre Torgue <alexandre.torgue@...s.st.com>,
Ilias Apalodimas <ilias.apalodimas@...aro.org>,
Jan Kiszka <jan.kiszka@...mens.com>,
Sudeep Holla <sudeep.holla@....com>,
Christophe JAILLET <christophe.jaillet@...adoo.fr>,
Michael Chan <michael.chan@...adcom.com>,
Pavan Chebbi <pavan.chebbi@...adcom.com>,
Rafał Miłecki <zajec5@...il.com>,
James Bottomley <James.Bottomley@...senpartnership.com>,
Jarkko Sakkinen <jarkko@...nel.org>,
Mimi Zohar <zohar@...ux.ibm.com>,
David Howells <dhowells@...hat.com>,
Paul Moore <paul@...l-moore.com>, James Morris <jmorris@...ei.org>,
"Serge E. Hallyn" <serge@...lyn.com>,
Peter Huewe <peterhuewe@....de>, op-tee@...ts.trustedfirmware.org,
linux-kernel@...r.kernel.org, linux-crypto@...r.kernel.org,
linux-rtc@...r.kernel.org, linux-efi@...r.kernel.org,
linux-stm32@...md-mailman.stormreply.com,
linux-arm-kernel@...ts.infradead.org,
Cristian Marussi <cristian.marussi@....com>,
arm-scmi@...r.kernel.org, netdev@...r.kernel.org,
linux-mips@...r.kernel.org, linux-integrity@...r.kernel.org,
keyrings@...r.kernel.org, linux-security-module@...r.kernel.org,
Jason Gunthorpe <jgg@...pe.ca>
Subject: Re: [PATCH v1 00/17] tee: Use bus callbacks instead of driver
callbacks
On Wed, Dec 17, 2025 at 09:21:41AM +0100, Uwe Kleine-König wrote:
> Hello Sumit,
>
> On Wed, Dec 17, 2025 at 01:25:39PM +0530, Sumit Garg wrote:
> > On Tue, Dec 16, 2025 at 12:08:38PM +0100, Uwe Kleine-König wrote:
> > > On Tue, Dec 16, 2025 at 01:08:38PM +0530, Sumit Garg wrote:
> > > > On Mon, Dec 15, 2025 at 3:02 PM Uwe Kleine-König
> > > > <u.kleine-koenig@...libre.com> wrote:
> > > > > - Why does optee_probe() in drivers/tee/optee/smc_abi.c unregister all
> > > > > optee devices in its error path (optee_unregister_devices())?
> > > >
> > > > This is mostly to take care of if any device got registered before the
> > > > failure occured. Let me know if you have a better way to address that.
> > >
> > > Without understanding the tee stuff, I'd say: Don't bother and only undo
> > > the things that probe did before the failure.
> >
> > True, but this is special case where if there is any leftover device
> > registered from the TEE implementation then it is likely going to cause
> > the corresponding kernel client driver crash.
>
> You are aware that this is racy? So if a driver crashes e.g. after
> teedev_close_context() it might happen that it is registered just after
> optee_unregister_devices() returns.
>
I see your point about the unavoidable race. Maybe it's better to not
try anything and let the kernel client driver fail.
-Sumit
Powered by blists - more mailing lists