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 A4D21C2D0DB for ; Thu, 30 Jan 2020 14:43:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 77659206D3 for ; Thu, 30 Jan 2020 14:43:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580395437; bh=olDrg09TyPzW4bRT3azLKEcVJWtZdmREf6bjzZSIceA=; h=Subject:To:Cc:From:Date:List-ID:From; b=XqC+SzQgFbdCeuKxPjICxvE4JqTfSjnjlB3KYBxySzeTppsPN1CCqPwfajmPrKqUe /cJ0qHmgR0/RgkRqBuH84QdNfyNntuPsrGLtu1dAnDefAs0083Xar7w5KyoaRg8J60 QK6ZZPF7JuFl0RITGO4ouxYVMixRqNpSx2Mtj7DU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727191AbgA3On5 (ORCPT ); Thu, 30 Jan 2020 09:43:57 -0500 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]:36083 "EHLO wout1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727158AbgA3On4 (ORCPT ); Thu, 30 Jan 2020 09:43:56 -0500 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.west.internal (Postfix) with ESMTP id 3C23830C; Thu, 30 Jan 2020 09:43:56 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Thu, 30 Jan 2020 09:43:56 -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=zhf7t+ WMMiMELHks6uXJz3qvUbg4G7xYDuz9623dr24=; b=ECYq3M9tERRwAt6wm6MQD+ S21FgWkAktT5RrPsOpxfJ0bEJRMFsxoVFjZMiRZ6SWMmrWktaTIjRl/+UogbVtaG gXDJ7+p/rWHRgvrFRIIhN2C3Q6qSbb8wsA43+uYsSJrXEAexF9OgzKDD4Wfona7p /eF8FKp/FhNgh7+tzZAFOvs4d5zjT+yrmuim+/teQit/gHBlyDc4qM1WSkmK1YOX cHuRyKlZGzk5XQhiHu2K32hAF7FEf3hQf250z8jjYyvVJqdX48jMPJH1kPcIiWYV B57L4BuE/BcqzxFzz9F1xyfxXqVKKCBOArpRTd4QSq3uzEZrl+j6VXVKUMglypVw == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrfeekgdeijecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepuffvhfffkfggtgfgsehtkeertddttd flnecuhfhrohhmpeeoghhrvghgkhhhsehlihhnuhigfhhouhhnuggrthhiohhnrdhorhhg qeenucfkphepkeegrddvgedurdduleekrddukedunecuvehluhhsthgvrhfuihiivgepje enucfrrghrrghmpehmrghilhhfrhhomhepghhrvghgsehkrhhorghhrdgtohhm X-ME-Proxy: Received: from localhost (unknown [84.241.198.181]) by mail.messagingengine.com (Postfix) with ESMTPA id 6C1E03060986; Thu, 30 Jan 2020 09:43:55 -0500 (EST) Subject: FAILED: patch "[PATCH] crypto: pcrypt - Fix user-after-free on module unload" failed to apply to 4.9-stable tree To: herbert@gondor.apana.org.au, stable@vger.kernel.org Cc: From: Date: Thu, 30 Jan 2020 15:40:10 +0100 Message-ID: <158039521025123@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.9-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);