From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DFE1EC433EF for ; Fri, 18 Feb 2022 13:03:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232685AbiBRND5 (ORCPT ); Fri, 18 Feb 2022 08:03:57 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:37638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233170AbiBRND4 (ORCPT ); Fri, 18 Feb 2022 08:03:56 -0500 Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 86F532B461C for ; Fri, 18 Feb 2022 05:03:39 -0800 (PST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 783AB5C036A; Fri, 18 Feb 2022 08:03:36 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Fri, 18 Feb 2022 08:03:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kroah.com; h=cc :cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm3; bh=u1vvAbR2H1XG8E6+/dAsxERCPEjcjF/jaEmLRC KMXIk=; b=YEd1k6kXUH/h9l0ERe05QZ7doc29YMIdOawIG17rS/LZpNghudq8K9 bIjLpzUswJX9BR1OdY2TTmXye2bxX7fU/NqiGVg/6re1PElOCM3gt8y8rH0OOW/Y nWnb1GjRrbFsR2/w6AJCawxCOBUINNBe2pTL+jm8DdAufkSoE3rYan8xsZ8QDODX l75+kpK7Vcy+z7K2OzfexQOnqNUQwiwtbpTCA4MrfJZqz0PUFHkAh0uCOX340OUR BcJWq+T7fZBlpJZXmlWvqlYhgZfw0FXbc2auxfBRhzBRAOz5vgLDXZuDURNMjUwn e25HZ3hjhqMzXyMtBUalKx5FnJicqXbw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=u1vvAbR2H1XG8E6+/ dAsxERCPEjcjF/jaEmLRCKMXIk=; b=lfNq2ISASCMmyh533ed1jZyp+MG/QYegt v1AuyB5BztmjR3nqKb9Lk9bkMdSGNEo7t5XZ5oRzDAjDkyzntrYnlFrmOYM1/spw 5K5UPWcBCUYlzBupOTgr26aY5d7yNBLaHJeYBk3pSq5m5u82pb3v4hHfwv4CVbBM Y39jiXfSGXKkRW7l3P3ucXLI23ryeU8jZCUPdSX9cXV3xOffbDUn8U4r3UNjX1oz mmj4ctRfQMnAMHLiCQ8rCotgXaoyb33/kll5pveBuVq/RX/0x4t98IsKNAlVIDxb pJaxx4ED55e3eTZIBzYXdF0PCUDdphad69xhZU631/ROrcwTJHjsA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrkedtgdeghecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkfhggtggujgesthdtredttddtvdenucfhrhhomhepifhrvghgucfm jfcuoehgrhgvgheskhhrohgrhhdrtghomheqnecuggftrfgrthhtvghrnhepveeuheejgf ffgfeivddukedvkedtleelleeghfeljeeiueeggeevueduudekvdetnecuvehluhhsthgv rhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepghhrvghgsehkrhhorghhrd gtohhm X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 18 Feb 2022 08:03:35 -0500 (EST) Date: Fri, 18 Feb 2022 14:03:33 +0100 From: Greg KH To: Jens Wiklander Cc: stable@vger.kernel.org, Sumit Garg , Lars Persson Subject: Re: [PATCH backportt 5.16] optee: use driver internal tee_context for some rpc Message-ID: References: <20220218104529.436040-1-jens.wiklander@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220218104529.436040-1-jens.wiklander@linaro.org> Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org 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 > Cc: stable@vger.kernel.org # 1e2c3ef0496e tee: export teedev_open() and teedev_close_context() > Cc: stable@vger.kernel.org > Reviewed-by: Sumit Garg > [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? thanks greg k-h