Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp398112lqp; Thu, 21 Mar 2024 05:02:04 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWROtCLFgqvoGGv/YxancL7kEXPKyDyQq+XN+5cTAwzAHdD6j5m+AM1dV4NfMnxmBXU/bpHqylL2H6wBW5iyxPE2M/Q4qC79/BTItJcxw== X-Google-Smtp-Source: AGHT+IE5morvdnWxyC43zxOoUjC3kXsUWdglK8sCqj2mtrPPhxRIc33i71pZbouzKPKpXMyKblfz X-Received: by 2002:a05:6808:1688:b0:3c1:7eac:a8a8 with SMTP id bb8-20020a056808168800b003c17eaca8a8mr1805127oib.26.1711022524683; Thu, 21 Mar 2024 05:02:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711022524; cv=pass; d=google.com; s=arc-20160816; b=nlProfKftp2UcjE2uM885OUlXAXANpWFjbaJ3xrH7N6DkW04BRQrwH6bLyDgtNERs6 UvorQqhjfGKHuG1/vR3GYxbbcGxUfOG23ccAtB9O2AuxZ7GlJUi+4i/oRQfzncONTX0e Sa6ZeR+nBL4cC9KkiomSMN9IwnHCCV8PTu6M2hmQoZAZeJISiz0bWpWxz9iLPWlitqww HFbyyMfyiItafYrfftWTGr8pGZ4nhvHkbDesfORkVMcJb2lK3IeIGHqHojncZQKIGanq 5McvHcNwjn29djCPbgudtyYSxLb/+T1s/MQxbqoxy4mPkdSBmqY5gvB1c5gUOhLkQvn2 yZ1Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :content-transfer-encoding:content-language:accept-language :in-reply-to:references:message-id:date:thread-index:thread-topic :subject:cc:to:from; bh=qhXypL+pB/IiFmr2VpIeWZoc4KL8VrV0XF1dOS/EoUM=; fh=TRyskhPZWOTo1dtToj1Dvz/mUyn1/b7PW8rTzKtl+Rk=; b=y+xYEqr9PUsBFkmsWNSA+ShYI+hD7Bv5M1oKYou/bPalTUq2A/MNPzuTOvn7i387XF rD9bzllAoMWX4pLGeemMwUfRDJ7TkwYpHGSSpCm8O36hnuVlrN4UBEUdgY4q68ltdmpR A1z52ISaxHWmFtsKrODYBmQCO016nrvEAyxd3bgk0c15YnGiNai15OepAtTDsFckS2+i QR3fzvvHiL75pXc4HfWKfGPLpOP/THLBxVFqqWpJQHjViWqC880tcGe8PyyEl+Shq0Rm MEEbzX7sBJ4rcboFbqfdU7whpPK0ae9ok6kR0ctmiGuLdcY+EUThMlmiwjVapnMhnujE 8rfQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=omp.ru); spf=pass (google.com: domain of linux-crypto+bounces-2793-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-crypto+bounces-2793-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id v20-20020a67ff14000000b00474c9c561casi1728162vsp.481.2024.03.21.05.02.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Mar 2024 05:02:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto+bounces-2793-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=omp.ru); spf=pass (google.com: domain of linux-crypto+bounces-2793-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-crypto+bounces-2793-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id A05741C22622 for ; Thu, 21 Mar 2024 12:01:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 54D86762F9; Thu, 21 Mar 2024 12:01:20 +0000 (UTC) X-Original-To: linux-crypto@vger.kernel.org Received: from mx01.omp.ru (mx01.omp.ru [90.154.21.10]) (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 5DB5D762C7; Thu, 21 Mar 2024 12:01:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.154.21.10 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711022480; cv=none; b=tMyrHFKjWTVkR/QlNqj9Mdtouc3ij4fVqcHavLApaWBuDPubO1J17oM4U04OMMZC2y61dW/Dw3k4iAnL3N7Eq+tejNzDM5eZVYz3hahFBTGOqKQ+8FS70mhR+rAR/p+HMzdDfbrYyyuXurZUSJm8bQyAK0Sj5B2Zrp5jcomhvgw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711022480; c=relaxed/simple; bh=TdeHwXHZLnolNP4pruQ3Emm6FQMzC7xzcbxQhC6EuSI=; h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To: Content-Type:MIME-Version; b=ObBvh8CTD66GQ/9DlALV1zzkjQXxaLRlUHMpsEgqH66+lJamdON+EGCRluAXnTQOYvO9RR0JxirSah6OgVgiCTkMHIUOBiPmxcBfVoy9dDYfacH3Jm1PHVot/ISrr0EZn+0afPqWEw2rMErUFDc9aEliJuLiLFc8nG19TnPI1Ig= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=omp.ru; spf=pass smtp.mailfrom=omp.ru; arc=none smtp.client-ip=90.154.21.10 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=omp.ru Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=omp.ru Received: from msexch01.omp.ru (10.188.4.12) by msexch02.omp.ru (10.188.4.13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.1258.12; Thu, 21 Mar 2024 15:01:03 +0300 Received: from msexch01.omp.ru ([fe80::485b:1c4a:fb7f:c753]) by msexch01.omp.ru ([fe80::485b:1c4a:fb7f:c753%5]) with mapi id 15.02.1258.012; Thu, 21 Mar 2024 15:01:03 +0300 From: Roman Smirnov To: Herbert Xu CC: "David S. Miller" , Sergey Shtylyov , Karina Yankevich , "linux-crypto@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "lvc-project@linuxtesting.org" Subject: Re: [PATCH] crypto: ecc: fix NULL pointer dereferencing in ecc_gen_privkey() Thread-Topic: [PATCH] crypto: ecc: fix NULL pointer dereferencing in ecc_gen_privkey() Thread-Index: AQHacF8ItH6zDpkXIUCmX8XUSBZ4lbFB2JEAgABVggk= Date: Thu, 21 Mar 2024 12:01:02 +0000 Message-ID: References: <20240307071318.5206-1-r.smirnov@omp.ru>, In-Reply-To: Accept-Language: ru-RU, en-US Content-Language: ru-RU X-MS-Has-Attach: X-MS-TNEF-Correlator: x-kse-serverinfo: msexch02.omp.ru, 9 x-kse-antivirus-interceptor-info: scan successful x-kse-antivirus-info: Clean, bases: 3/21/2024 9:59:00 AM x-kse-attachment-filter-triggered-rules: Clean x-kse-attachment-filter-triggered-filters: Clean x-kse-bulkmessagesfiltering-scan-result: InTheLimit Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: quoted-printable Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 On Thu, 21 Mar 2024 17:54:44 +0800, Herbert Xu wrote: > On Thu, Mar 07, 2024 at 10:13:18AM +0300, Roman Smirnov wrote: > > ecc_get_curve() can return NULL. It is necessary to check > > for NULL before dereferencing. > >=20 > > Found by Linux Verification Center (linuxtesting.org) with Svace. > >=20 > > Signed-off-by: Roman Smirnov > > Reviewed-by: Sergey Shtylyov > > --- > > crypto/ecc.c | 7 ++++++- > > 1 file changed, 6 insertions(+), 1 deletion(-) >=20 > Please point me to the exact code path where this can happen. I didn't find a specific path. Several places in the file have this check: ecc_make_pub_key() crypto_ecdh_shared_secret() I thought it was needed in this place too.