Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp578404rdb; Thu, 21 Dec 2023 20:37:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IFEHmu37K/wpfDiJhoQjnJdVgli07YBIXKfUwBTcAljoVUy8xWVaR1NUtcCXhd54tozcPK6 X-Received: by 2002:a05:6a20:258b:b0:191:9d84:104e with SMTP id k11-20020a056a20258b00b001919d84104emr1036902pzd.55.1703219831313; Thu, 21 Dec 2023 20:37:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703219831; cv=none; d=google.com; s=arc-20160816; b=swIY/S6kyZqz2fgA5EKh88yhU9O0wkNYvw4p5rxrhZQGpiOrjsbe96q5r876CPBRND Roq3kVcMYwT5Ry7TI3cRnAuYzZOKvGDbjZWhr/oL2wY95CjVuDofsgm9MHqVOB9qT52v QHjUCzXWJ10R/CPIcI7zUES1w90bofcsbtCEaTZb/c7ubcXpPQKb2vcl27SftV5G4kye m1B8EQNwMJnhZQE03/5ZT3g/tL7Ac8oXIZOXxIhih6KqNQ+FWT3CAgCjwJCbRvD0PhnK Dr4ZLbK3oo1ZxXlEQzioBmUjzRMJ0FMAUFX0IucXhP4GmCPeJRgXWGncdNPZ6LPwLdkY CjSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=pH6rmqxcseGdhRE8zGrU8AC19emxV4vTWp86n8FRHOU=; fh=2Ya96d3SsGtAX2i3EBZ3ramakGQe2Xgcc2L5IJrkzjk=; b=dO4IO8CBsPES3+SEVcx+hi1qOjbgwy+Xfdzh0jYGAa9cMxDdIvxqqVEPZZ7osVKKuj yjrNGnSJFfaZlj/soQtk/fg0ga8NTAGmsc+a1cmerW3cbYYPiLcPLIwdfiiLweBVKOiz zu8JgBddbjGU9OyJsVhFpryNCVXsKPHQFQSP8JhHi3xDOz1BI/2/0alLbMYe9ZIAzmoF +xNkF6xql/TFE3/RdmcsvZ6Ru9eskd5jGCR4CbfHkUJK8K22eaQEo9yCvY3cyoexm0K9 JcOsuq5M1yxlDC7VCD0UM7oZnT1i1F5hIpjeKZTJenFrTYrqYobfm0TGfmYitY115CYr oi8g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto+bounces-965-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-crypto+bounces-965-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id g15-20020a056a0023cf00b006d97636806csi1897606pfc.156.2023.12.21.20.37.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 20:37:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto+bounces-965-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; spf=pass (google.com: domain of linux-crypto+bounces-965-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-crypto+bounces-965-linux.lists.archive=gmail.com@vger.kernel.org" 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 DA7D128841F for ; Fri, 22 Dec 2023 04:37:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 438806FD9; Fri, 22 Dec 2023 04:36:54 +0000 (UTC) X-Original-To: linux-crypto@vger.kernel.org Received: from abb.hmeau.com (abb.hmeau.com [144.6.53.87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 30590611B; Fri, 22 Dec 2023 04:36:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gondor.apana.org.au Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gondor.apana.org.au Received: from loth.rohan.me.apana.org.au ([192.168.167.2]) by formenos.hmeau.com with smtp (Exim 4.94.2 #2 (Debian)) id 1rGXH8-00DhSU-Jr; Fri, 22 Dec 2023 12:36:43 +0800 Received: by loth.rohan.me.apana.org.au (sSMTP sendmail emulation); Fri, 22 Dec 2023 12:36:53 +0800 Date: Fri, 22 Dec 2023 12:36:53 +0800 From: Herbert Xu To: Tianjia Zhang Cc: "David S. Miller" , Mimi Zohar , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] crypto: lib/mpi - Fix unexpected pointer access Message-ID: References: <20231214030834.2665-1-tianjia.zhang@linux.alibaba.com> Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231214030834.2665-1-tianjia.zhang@linux.alibaba.com> On Thu, Dec 14, 2023 at 11:08:34AM +0800, Tianjia Zhang wrote: > When the mpi_ec_ctx structure is initialized, some fields are not > cleared, causing a crash when referencing the field when the > structure was released. Initially, this issue was ignored because > memory for mpi_ec_ctx is allocated with the __GFP_ZERO flag. > For example, this error will be triggered when calculating the > Za value for SM2 separately. > > Fixes: d58bb7e55a8a ("lib/mpi: Introduce ec implementation to MPI library") > Cc: stable@vger.kernel.org # v6.5 > Signed-off-by: Tianjia Zhang > --- > lib/crypto/mpi/ec.c | 3 +++ > 1 file changed, 3 insertions(+) Patch applied. Thanks. -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt