Received: by 2002:a05:7208:13ce:b0:7f:395a:35b6 with SMTP id r14csp79698rbe; Wed, 28 Feb 2024 12:48:40 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWblkB/M3d3aW5vc5r/U4Jb15ZDuli2gcovOzinOeGSQWtfu95RsGwD6uw4/nao4hN/ikrqTZQgNUHb2VI4LOhnwPPPHfn/NO8wBCgb2A== X-Google-Smtp-Source: AGHT+IHPFkYLlKMEAfQD1OQ/alNNPtT6EhU/12fmnhY8WXFBYvGX9+UcUJmv5VzfoqXft36+HImh X-Received: by 2002:a17:902:cec6:b0:1dc:3ab7:cc78 with SMTP id d6-20020a170902cec600b001dc3ab7cc78mr118128plg.29.1709153320428; Wed, 28 Feb 2024 12:48:40 -0800 (PST) Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id lv3-20020a1709032a8300b001dccf78c7dasi1104876plb.485.2024.02.28.12.48.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 12:48:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-85684-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20230601 header.b=NmQaJjp0; arc=fail (body hash mismatch); spf=pass (google.com: domain of linux-kernel+bounces-85684-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85684-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 2334528BB9B for ; Wed, 28 Feb 2024 20:48:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9C4F915DBC3; Wed, 28 Feb 2024 20:48:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="NmQaJjp0" Received: from mail-lj1-f171.google.com (mail-lj1-f171.google.com [209.85.208.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3287571ECC; Wed, 28 Feb 2024 20:48:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709153311; cv=none; b=k65WI+qVmGn/uuh8S1Wvc2uiA0QH9Ha/jMU28z33BjnJQ2BCQDhzfKmGR8ekwjf+FgrLhqVi6N+rhSmCz0ofOZJSCtXva1Pt+7Ieo03x4yWUrOttVRgENmuEhCWRtwSsRCZqewprJklJupaSzwTmzLGX0C9yc1ZH/8s31S+HhXU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709153311; c=relaxed/simple; bh=sc9lmdVdnWjzr9GXmsOHgqaQTFY20puZMxHYxFdT+V4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=UiBacJGN5ok2rGQnEk0VwloX656msZcq931Uu0r2425guz1fXzNa0G6TtPMwLhjAcV9RWvbnT/SfT0dcar8HfU/DClHaARq/TI3K1ApRcWRoemJ9Dseg8rxk4pX4+lvFaJ8ShQI5vcW8MdSkJmLQ1g3hrYjwtJ2wAF2qs57gxCY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=NmQaJjp0; arc=none smtp.client-ip=209.85.208.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lj1-f171.google.com with SMTP id 38308e7fff4ca-2d208be133bso1956011fa.2; Wed, 28 Feb 2024 12:48:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709153308; x=1709758108; darn=vger.kernel.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=NmQaJjp0cOwow5W6YgLybJlJKigpdWbUUOPR/nYJLV82vYAbGog9x96xzup52swkR8 8AV/2C1mLN7Rs+9D639nr954G+pFvr5u/UXom0TtyFjlm146P45vxb3ZPs0JBoZNGEPZ EdgLj5fJkePnVUnHHA6aSxVJ+Ha/YmeDp0pewSH7Wt/2LT/6Yr/27XgWsMwAvziRcrG9 t/8GNDNGTX4bQYFOXjfWFQgkDKL11AVs9YcVEEjbBoSzWdskMVtel8kGXBDmNhcgH3T0 gRREUOfeiSwNmaZcQbgejkxy+X0H6lf7pQjZ/XylVLbTZ+NO5db8a2SLCwbDhGmlPlRc gx8Q== 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=PHNakAN55NP7kL3drtpIDhBgQ3ByMJG/Fr2Jh32UVebaiZJWfQxtcQQxptFWGh44tP SAhLJsrK2xPtLh1g/Xlpyxa1NnlEnxr+QGAqlDqtCDd/WPQlCnZSEXZ3h+lEzoOTDmao 8aQcYzAP8ljBmqd9nZsJGymzaIDPiHSJYy7GZgG/MgPchV2KSOgVIpr43EV3A41YgB/L NmP+0dKwn3o6sztbhN662WeB3XAdJ/fleOCRRRuQ3qcmaFsmTHRqJm35Dp6ZCkpas60S Rw9dH6DvTrBjM/nXKKKbvO5EdhRKw1tF9PlWpCkhZq308yKRmF9Zdw8x6ElFq+IsHmFV vj3g== X-Forwarded-Encrypted: i=1; AJvYcCWLdTZxyHIBaWQSZ6ud4VbfRcskqx3NZ8DyQYMemjIcLnWdrgSIo1fewaKKyMmVLH+DvUUbHg8TUwxzpr6Dmb84keZ0C9yKBrDrrFf473BOTkrfBPlQ+cP7QdJan0kj6jY30Ew7Zo5TElvX X-Gm-Message-State: AOJu0YyXAHxdQKMJsLrktMngw30RNEsDOdvG52zmhBRt14di4MpVkX03 x+jF2sT9yAtlLQFBR+e3HLUvojwjHeWeb7oS0GtJTQgrcxigiJzF 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: 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