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 X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 87C68C33CB3 for ; Thu, 30 Jan 2020 14:43:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5E073206D3 for ; Thu, 30 Jan 2020 14:43:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580395435; bh=aNKHFYfBVmi+Bj/G/FaKs7yGQGGzrbwGYoKUUWqrb1E=; h=Subject:To:Cc:From:Date:List-ID:From; b=xznmnkVlfuXr9DPNBoEwT9PHdsK64sEGAi3MK6fkJvOq7TclEg9QQp4Xw5jCLy684 UY862v/7Lgzmtu/PQdaV/FrEIJB4pYD3vxpObR31QIIRsc8P4lIPYzy9wb/yOmwRt/ o+Rda2fs9PnQgejqzRedh8hy/DuZ4I07VpcNku9k= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727190AbgA3Ony (ORCPT ); Thu, 30 Jan 2020 09:43:54 -0500 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]:36793 "EHLO wout1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727158AbgA3Ony (ORCPT ); Thu, 30 Jan 2020 09:43:54 -0500 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.west.internal (Postfix) with ESMTP id D955148D; Thu, 30 Jan 2020 09:43:53 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Thu, 30 Jan 2020 09:43:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=rKgx6U yfJlQXVDAcccosMPmi3gX2YQBeORCr95GYIEA=; b=qfL4SOmmKg+XaoXxWNm1g/ 5DtsPUV7zqxlmjrWgWWi5VHPp0PxCZY4oDVNC4tBv8KQj1Qg0qsNdkI5zp+PImUu b4CmXJvRI/zoB4+YkOrfWiLlJ/Xg7mrtv08qhfv5RtIbNJP1AWEC2pGA777GWL55 LsAU5ILSM7KZ+n3zl7VFDnR1kwTvK2Xb6RMUsRU7c+SoEf7XjipCnGBaebq27NDL m39mNuM1Q2XMcIkvQli2RgOPCUUNY7OdsSHOwp8UpCw+WZliPv3l+I7BeMnLTcW6 Mjkcw6x8IPmifl23kVkV0T1hgd0s41UF1uua9cUldxml9c7ZwONZ2iLe0d/ZDwbw == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrfeekgdeijecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepuffvhfffkfggtgfgsehtkeertddttd flnecuhfhrohhmpeeoghhrvghgkhhhsehlihhnuhigfhhouhhnuggrthhiohhnrdhorhhg qeenucfkphepkeegrddvgedurdduleekrddukedunecuvehluhhsthgvrhfuihiivgephe enucfrrghrrghmpehmrghilhhfrhhomhepghhrvghgsehkrhhorghhrdgtohhm X-ME-Proxy: Received: from localhost (unknown [84.241.198.181]) by mail.messagingengine.com (Postfix) with ESMTPA id E284D3280065; Thu, 30 Jan 2020 09:43:52 -0500 (EST) Subject: FAILED: patch "[PATCH] crypto: pcrypt - Fix user-after-free on module unload" failed to apply to 4.4-stable tree To: herbert@gondor.apana.org.au, stable@vger.kernel.org Cc: From: Date: Thu, 30 Jan 2020 15:40:09 +0100 Message-ID: <15803952099186@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org The patch below does not apply to the 4.4-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 07bfd9bdf568a38d9440c607b72342036011f727 Mon Sep 17 00:00:00 2001 From: Herbert Xu Date: Tue, 19 Nov 2019 17:41:31 +0800 Subject: [PATCH] crypto: pcrypt - Fix user-after-free on module unload On module unload of pcrypt we must unregister the crypto algorithms first and then tear down the padata structure. As otherwise the crypto algorithms are still alive and can be used while the padata structure is being freed. Fixes: 5068c7a883d1 ("crypto: pcrypt - Add pcrypt crypto...") Cc: Signed-off-by: Herbert Xu diff --git a/crypto/pcrypt.c b/crypto/pcrypt.c index 543792e0ebf0..81bbea7f2ba6 100644 --- a/crypto/pcrypt.c +++ b/crypto/pcrypt.c @@ -362,11 +362,12 @@ static int __init pcrypt_init(void) static void __exit pcrypt_exit(void) { + crypto_unregister_template(&pcrypt_tmpl); + pcrypt_fini_padata(pencrypt); pcrypt_fini_padata(pdecrypt); kset_unregister(pcrypt_kset); - crypto_unregister_template(&pcrypt_tmpl); } subsys_initcall(pcrypt_init);