Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp13476513ybl; Sun, 29 Dec 2019 12:50:08 -0800 (PST) X-Google-Smtp-Source: APXvYqwFrfuHm65YfLnlW2fU1jluazCikucWoZFuFvhwjSwbonw6o9JJOVl0jX2o9JNzUOc4Wm39 X-Received: by 2002:a9d:518b:: with SMTP id y11mr67018129otg.349.1577652608042; Sun, 29 Dec 2019 12:50:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577652608; cv=none; d=google.com; s=arc-20160816; b=tXaWrJgAdA+JNKFD/nrMX4dBQEX4OjwyNNeNvcZ362a5nPuT51ax9s1sEW+gPK7UIB bWK7Z8FuF+4I2y3phVud1okxWXJ7YEbEexccRPLeugiRTX9r+jI4jy0Bl1527LKSyxUc ltearjNBjOj7SvleiDx/QlYxPtxpqmFQQqlDUeFUfAWrWu33/ui8YMZARkUul9OCLCmE 5C1c5wjyyBbNOtju0g0OfkbR7mwbxz86R02yZlR4pytbgJtku60LAjP3p47vlY/yateG zKWOPbmW4V0zlbK96z73FW/SBSS2CAKEJahM8PxOX2VP5t6mQOGcPr2dD3sWh/OreOH6 4KBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Ek4m3k3Q3oXFMt/HfyCNLJ39BOvECEUmq51TJSFgFUc=; b=HvM+NvKHR05JoAiTTQ2s9nZdY21wKrTBh7ozfpiDpuoIwep94JQchZJscQJ0Q8Zdbf yVSqfnNCEtUC/4AEuPD1mpoP3RvyBZWVwZkqE2djBG3t5BbU1emYEZf5WeF/DDm+jV6j AqU419Tx2cYNWOA91K+/i6Ff/UIhMnDf5Vc7julSjkNGqRs3FfUX178dc0SSVccTRtqX P6LwyBFHKdHkGFKtMftJUBOm4BizoSjcOBdUDakO0KiqPwuCgwIO+O80vV0b4REB5NNW 2R16LPI9SU0TG4ZYRtlNiVIx9k4OPAo7vis5jKLUjwcxTQAZV+Wn0DWPaAM0NkbTKI+4 Lo+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=VbA8v5u4; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r2si9497249oif.83.2019.12.29.12.49.57; Sun, 29 Dec 2019 12:50:08 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=VbA8v5u4; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732917AbfL2R5L (ORCPT + 99 others); Sun, 29 Dec 2019 12:57:11 -0500 Received: from mail.kernel.org ([198.145.29.99]:47372 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733199AbfL2R5I (ORCPT ); Sun, 29 Dec 2019 12:57:08 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5EA142253D; Sun, 29 Dec 2019 17:57:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577642227; bh=jEwQgvnZs/5ZtXLyjpAPNphHZZTe9nE+ApMYLsLMX+E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VbA8v5u4Tc4hG2Q92yZesbXXUlZEYJDjHh/1PBODyL/lkQQairnun4Xx5tP9LLWOe O3SgERo41NifzrfhVvOt+Up8jdkIf+PFmgIqxmhF7C0Wk/HmS6KGKEhDiqQ5Ici6T5 Vi7EALkh44PZLjdpmcr9qUIhuPhDnc6KV8on9Nfc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, James Morris , Eric Biggers , Jarkko Sakkinen Subject: [PATCH 5.4 395/434] KEYS: asymmetric: return ENOMEM if akcipher_request_alloc() fails Date: Sun, 29 Dec 2019 18:27:28 +0100 Message-Id: <20191229172728.609690615@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191229172702.393141737@linuxfoundation.org> References: <20191229172702.393141737@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Eric Biggers commit bea37414453eb08d4ceffeb60a9d490dbc930cea upstream. No error code was being set on this error path. Cc: stable@vger.kernel.org Fixes: ad4b1eb5fb33 ("KEYS: asym_tpm: Implement encryption operation [ver #2]") Fixes: c08fed737126 ("KEYS: Implement encrypt, decrypt and sign for software asymmetric key [ver #2]") Reviewed-by: James Morris Signed-off-by: Eric Biggers Reviewed-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen Signed-off-by: Greg Kroah-Hartman --- crypto/asymmetric_keys/asym_tpm.c | 1 + crypto/asymmetric_keys/public_key.c | 1 + 2 files changed, 2 insertions(+) --- a/crypto/asymmetric_keys/asym_tpm.c +++ b/crypto/asymmetric_keys/asym_tpm.c @@ -486,6 +486,7 @@ static int tpm_key_encrypt(struct tpm_ke if (ret < 0) goto error_free_tfm; + ret = -ENOMEM; req = akcipher_request_alloc(tfm, GFP_KERNEL); if (!req) goto error_free_tfm; --- a/crypto/asymmetric_keys/public_key.c +++ b/crypto/asymmetric_keys/public_key.c @@ -184,6 +184,7 @@ static int software_key_eds_op(struct ke if (IS_ERR(tfm)) return PTR_ERR(tfm); + ret = -ENOMEM; req = akcipher_request_alloc(tfm, GFP_KERNEL); if (!req) goto error_free_tfm;