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 F0F7DC35246 for ; Thu, 30 Jan 2020 14:51:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C6C5C206D3 for ; Thu, 30 Jan 2020 14:51:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580395877; bh=QCsjqqgqNtRt2ZAX90m7NQ7nYbkHoORQpwifmNuirhk=; h=Subject:To:Cc:From:Date:List-ID:From; b=QJc5yENxkOGwcwio/EkmORymUxV0CrYr2LCA2ZKSjWyncMkRFkhfUNoWTY1AcCK+9 T5wrtlWWTLWGk971XJK0YzQ0J6J3i31jLtWd5M4VETEo/9M7hQxwfzvkM7QWrQj0UQ Ghe032AmGbbdD1kncRmCQXr4PIqvduhWA+46T/Qk= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727261AbgA3OvR (ORCPT ); Thu, 30 Jan 2020 09:51:17 -0500 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]:41233 "EHLO wout1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727278AbgA3OvR (ORCPT ); Thu, 30 Jan 2020 09:51:17 -0500 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.west.internal (Postfix) with ESMTP id 6405245E; Thu, 30 Jan 2020 09:43:49 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Thu, 30 Jan 2020 09:43:49 -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=kfhjwZ Hn8ZMmPVhJmL8/yWZeHwVH2IcEynv9M6eo/Gg=; b=q9YLCklT0r8Gq8x3Ymw+wV WurM05OQOEzqc4hvHetbvHVSdxviVG4DwDMfyOSp4/S8SCaBvRWerVFsPsMl2T9N 8+pDt3nH6HAYJakN+RNRwbPBrMtb9t/3YzdtQ39UM2tjCte0/6WYcPZO+P4W8WcC otKuX2Kx1ZpTERTB4KUmjk+lpIRWcL6ZsvyfvbH0sJEakBoxKJLp3O38R6VUDi+e AGLQuqE+wgpcdw5srz++g6EMzl5GYevfCjWAdc/nARHg/MIegJNreA9SyNJxMkNT 2sTt8GbZZmB4zui2z3xIoQ42ZeM06FjLZVB6FUXG0kUZWf1VuXmQnpm0ktGvHnmA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrfeekgdeijecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepuffvhfffkfggtgfgsehtkeertddttd flnecuhfhrohhmpeeoghhrvghgkhhhsehlihhnuhigfhhouhhnuggrthhiohhnrdhorhhg qeenucfkphepkeegrddvgedurdduleekrddukedunecuvehluhhsthgvrhfuihiivgepvd enucfrrghrrghmpehmrghilhhfrhhomhepghhrvghgsehkrhhorghhrdgtohhm X-ME-Proxy: Received: from localhost (unknown [84.241.198.181]) by mail.messagingengine.com (Postfix) with ESMTPA id F027F3280063; Thu, 30 Jan 2020 09:43:47 -0500 (EST) Subject: FAILED: patch "[PATCH] crypto: pcrypt - Fix user-after-free on module unload" failed to apply to 4.19-stable tree To: herbert@gondor.apana.org.au, stable@vger.kernel.org Cc: From: Date: Thu, 30 Jan 2020 15:40:07 +0100 Message-ID: <1580395207158126@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.19-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);