From patchwork Sun Dec 3 13:58:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gilad Ben-Yossef X-Patchwork-Id: 120462 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp3361345qgn; Sun, 3 Dec 2017 06:00:04 -0800 (PST) X-Google-Smtp-Source: AGs4zMbzA5bcpWxv0WQDKo8m29jclHAW2zfUwqB85HwaPhrNWHJamibsuQBkTWA428B17G6r1TsK X-Received: by 10.159.198.134 with SMTP id g6mr11775605plo.42.1512309604658; Sun, 03 Dec 2017 06:00:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512309604; cv=none; d=google.com; s=arc-20160816; b=oqu68kt93d8UnfLDaL7aBc4KM5QqpSsuhy4757FjsMSlJwPsu6nPtmbz5kPdUZe0So 7qZoGUeTCQPNRzBvx/5hW2iO/tIsEP+7nHse0XqKqsrWU+yx8EFJXvtEFMXKYzINPGbt JaiGjV/riUD9EZOmAnP/tPNafp8ud06/ehVEeMeOMLX16jurQulbyudFOQmFa2XRkMjb JARr5v11P5rLS/uIG5xD47Qn21m9dzRJaT3s0Obb8gj5zct0U0h9ZMb1zQpI1gNuUA6k vZllcudFbqGsqvLu0tHAScLDrkw5GZ6p3C8JfAtRZ093y28RXBXPCnyaoR+5czO/SBjL GGTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=nld4jAm1EGyD4c/IovAn0l8jAfFL9iqwPzqDB9cfMhM=; b=HtoDk5IkO3CwaaTFjdHl8px0AdoHwTEcX8BYg+klC5dWG96tMIr7mPxG+45mQFxbp1 uOUwGKdn7V/FWekAJJFOyzWtWQxKmSLkSvC3hjpfM51r2pP51f7aUe1wFePBmgOOkQAy cf/O8BfqcLz0pThLzm/J+NAsUUZI+g19VOX50UfnSMg1a50uE2ryZ+VAL5A5nJe/D5P/ jzp7Ek1gFltGcbUAyYeDluHzuXr4aZuhCpG+Z9oQQxOlKdCfW5EoknrDAt/vVH5jMrp3 gNDfy59O/yXHQfO1huXYxhzh9MWDTftvttX4FklVPNBPoYsRMPj45ZhfLtvERjZFNZYj 2q9g== ARC-Authentication-Results: i=1; mx.google.com; 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 d3si7773936pgq.709.2017.12.03.06.00.04; Sun, 03 Dec 2017 06:00:04 -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; 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 S1752209AbdLCOAD (ORCPT + 28 others); Sun, 3 Dec 2017 09:00:03 -0500 Received: from foss.arm.com ([217.140.101.70]:55214 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752501AbdLCN7z (ORCPT ); Sun, 3 Dec 2017 08:59:55 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 592601529; Sun, 3 Dec 2017 05:59:55 -0800 (PST) Received: from localhost.localdomain (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 3CBF83F24A; Sun, 3 Dec 2017 05:59:53 -0800 (PST) From: Gilad Ben-Yossef To: Greg Kroah-Hartman Cc: Ofir Drang , stable@vger.kernel.org, linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org, driverdev-devel@linuxdriverproject.org, devel@driverdev.osuosl.org Subject: [PATCH 08/10] staging: ccree: NULLify backup_info when unused Date: Sun, 3 Dec 2017 13:58:19 +0000 Message-Id: <1512309503-29766-9-git-send-email-gilad@benyossef.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1512309503-29766-1-git-send-email-gilad@benyossef.com> References: <1512309503-29766-1-git-send-email-gilad@benyossef.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org backup_info field is only allocated for decrypt code path. The field was not nullified when not used causing a kfree in an error handling path to attempt to free random addresses as uncovered in stress testing. Fixes: 737aed947f9b ("staging: ccree: save ciphertext for CTS IV") Cc: stable@vger.kernel.org Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_cipher.c | 1 + 1 file changed, 1 insertion(+) -- 2.7.4 diff --git a/drivers/staging/ccree/ssi_cipher.c b/drivers/staging/ccree/ssi_cipher.c index 9019615..7b484f1 100644 --- a/drivers/staging/ccree/ssi_cipher.c +++ b/drivers/staging/ccree/ssi_cipher.c @@ -907,6 +907,7 @@ static int ssi_ablkcipher_encrypt(struct ablkcipher_request *req) unsigned int ivsize = crypto_ablkcipher_ivsize(ablk_tfm); req_ctx->is_giv = false; + req_ctx->backup_info = NULL; return ssi_blkcipher_process(tfm, req_ctx, req->dst, req->src, req->nbytes, req->info, ivsize,