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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8652BC5478C for ; Wed, 28 Feb 2024 20:48:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Xv2AThBjBRtoVCro3UT3DQbrcCzas2DqTK3QSNNXn3Q=; b=agKOUebY2xUlYs K720uJo0+KSyOIHmbctheybKlHbXeKYYDU4CJfcUvlseZH95ekJNdbmrSrc7NvUp4TAV3NsbX6hMF /5Ax1MOQCB2I8iDvC2mtL/6RzkA74HBKIe+zxQ5p5FYm2Yckf6U5nHM2L3bPjO8Yno3BhUHKsMRwN HJCsHSXLfA8ICXrHHvC0A0PgnttLZBApi9IyqNer/IquABLRPY3r6YmN3oECBoUdYow8VpF2Styjb xZBfrJLdreUvDj3qc72MeqUuFnP/zfswW96KNCHTZYBPrY0oooDNranXQT2T9Eyic7rj3k+qOHX/H 5zQpzv5UMiSLFdqZrl7A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rfQqw-0000000Ass1-09do; Wed, 28 Feb 2024 20:48:34 +0000 Received: from mail-lj1-x236.google.com ([2a00:1450:4864:20::236]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rfQqt-0000000Asr6-0X1Y for linux-arm-kernel@lists.infradead.org; Wed, 28 Feb 2024 20:48:32 +0000 Received: by mail-lj1-x236.google.com with SMTP id 38308e7fff4ca-2d208be133bso1956001fa.2 for ; Wed, 28 Feb 2024 12:48:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709153308; x=1709758108; darn=lists.infradead.org; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date:from:to:cc :subject:date:message-id:reply-to; bh=/BmqUGFRY/SaPBZF7+G6xmjp7oKqZJPMre8oiME7ffw=; b=mGWeSVy/G0I5Tm2F9x5T2yePMChxG9UugdAj+3up+mi2H0/vE/hvf9ZpXQqp6pgw9r UTNLYkDisqJZsoOcRclRX/w6aalrb+FVGdBcV8YVwbZ7gY0aetw9SOR444EynejMViiE SzIproc+7u74honq046pgWBQbY5cuOHTZ/7Ykr6QnZAnHiViwdWjxuSGGAqmZSEcb66D B0PHT3MBKwdT1veOlp7c1B6z2AznhkPo+6ssGUX2ZpEME9rv5hAQ6hh9TjVRxxPLPnaP bqKo9pRLdk2pDfKYzcUZ8a4qsMZBN4/IpiUCoIj/CaRDMhU1ZwESTdAoDRmD9qEcJeHe Y9jA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709153308; x=1709758108; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=/BmqUGFRY/SaPBZF7+G6xmjp7oKqZJPMre8oiME7ffw=; b=ga1muMeI+PjKvZIizsLFjXAnuWJyurkfb22sY4MTPpS9UK3yNYSaTjiKAzdhXnpEyN mArxYoX7rxWtWqA9q/Eep7IiJ+GPG2Ii8zGt54UlY4yVxEJO0z8LubM48qRJOEYCUSEP jsfCzI+qOxokSYwkLOhzyXr6Lt/Y3tk05ZshZVySVTetbG+8MscZuolkjBs1l3D0rZO2 XuT1vZSJIIyps/Wvt9gY1HX1pDGfMi0SswyxeFCC04QeAFEd4BhoeD0E325oe/mnGwwy +3GDdSZv3V347FOgo+AW7uNBfCUxOWWO5wHVN5KPYk4K+LuiecAfhOmO/pHd+ZSO6L+M WolQ== X-Forwarded-Encrypted: i=1; AJvYcCXrms/WQLKLkVjIg1LQ4aF6qow4ahKcApDPZGBq55E2iYQMPT/NW/9thgYiqhXUI97WuX69+pmtEbJgUvPPvlBObQNypbpQgyiQ+2Hd0qdxIdMaSaU= X-Gm-Message-State: AOJu0YwGD8f7bCjLB9Nx+E4Ka8H764TSuOCKM/wg81X9jLLxT22L4vb7 VskWu+YsTDBGxe+eZfkZ2UMbsfyBYBRxsnrEqLaNadUNytdZ2X2V X-Google-Smtp-Source: AGHT+IEp4+S8PJ3Iy3G8JacJ/zGYQqYRnXtYNKRVleZnT+aUT6/tQTfndsvknSO9gs11R6K4StiWhQ== X-Received: by 2002:a2e:b81a:0:b0:2d2:2ddb:28c7 with SMTP id u26-20020a2eb81a000000b002d22ddb28c7mr11257ljo.26.1709153308004; Wed, 28 Feb 2024 12:48:28 -0800 (PST) Received: from localhost ([94.19.228.143]) by smtp.gmail.com with ESMTPSA id m14-20020a2e870e000000b002d2a710f864sm36245lji.24.2024.02.28.12.48.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 12:48:27 -0800 (PST) Date: Wed, 28 Feb 2024 23:46:12 +0300 From: Andrey Skvortsov To: Herbert Xu Cc: Corentin Labbe , "David S. Miller" , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Jonathan Corbet , Ovidiu Panait , linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, Arnaud Ferraris Subject: Re: [PATCH] crypto: sun8i-ce - Fix use after free in unprepare. Message-ID: Mail-Followup-To: Andrey Skvortsov , Herbert Xu , Corentin Labbe , "David S. Miller" , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Jonathan Corbet , Ovidiu Panait , linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, Arnaud Ferraris References: <20240226215358.555234-1-andrej.skvortzov@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240228_124831_195311_5683E673 X-CRM114-Status: GOOD ( 18.91 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Herbert, On 24-02-28 17:18, Herbert Xu wrote: > On Tue, Feb 27, 2024 at 12:53:57AM +0300, Andrey Skvortsov wrote: > > sun8i_ce_cipher_unprepare should be called before > > crypto_finalize_skcipher_request, because client callbacks may > > immediately free memory, that isn't needed anymore. But it will be > > used by unprepare after free. Before removing prepare/unprepare > > callbacks it was handled by crypto engine in crypto_finalize_request. > > > > Usually that results in a pointer dereference problem during a in > > crypto selftest. > > Unable to handle kernel NULL pointer dereference at > > virtual address 0000000000000030 ... > > > > Signed-off-by: Andrey Skvortsov > > Fixes: 4136212ab18e ("crypto: sun8i-ce - Remove prepare/unprepare request") > > --- > > .../allwinner/sun8i-ce/sun8i-ce-cipher.c | 34 +++++++++---------- > > 1 file changed, 17 insertions(+), 17 deletions(-) > > Patch applied. Thanks. You marked your rockchip fix for backport to stable releases. Cc: I think it makes sense to do the same for the sun8i-ce fix as well. -- Best regards, Andrey Skvortsov _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel