Received: by 10.223.176.5 with SMTP id f5csp993775wra; Fri, 2 Feb 2018 09:23:30 -0800 (PST) X-Google-Smtp-Source: AH8x227rJkTYE0hPGPFwj8KGjjn4TJNFK3oaOzJR2EcO9D3h2CC2X9YzORLu/aQdgw/Wpq5ILlyb X-Received: by 2002:a17:902:bd4b:: with SMTP id b11-v6mr26509420plx.313.1517592210197; Fri, 02 Feb 2018 09:23:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517592210; cv=none; d=google.com; s=arc-20160816; b=l1xyCL7/z25+jpieb171Ld6P6B/6NJY62bkYWpXZ8Vweil/x66OSycA45hLHy2tPcs raffFb7+H6CGz1mKnNx7bVHg2jo7dioPsYJeqckp/RtUAx0n10d332OrFThP/TSGxYBs MdqbsuMedJyOI5RSspKdHFnABWOqTM+vIphnd348NUyitDxbA4CPBnAM9WAEsnxniHPU J5SFqGjWPdoPPEXC2q7w+AqL9RnvbY72pOHPW6/kr81BFJqQc3e4avomQKdCCghb4LQa rhkbvrQmk/Kh8qCHBQxcIKBhvxf3DohbNf6iaYX39YePLLFUfykXT8ECXtsi3R2yQ3Lf MZAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=aaaxlkwsEV6o7QUiHDxfMKRbUlyU9Fol50rBN32AVbM=; b=ArGCHq1oMTUxJ1AkA7sSxYSZNhcbm3H1biZh+iDIzZgW6lb2ZoZB6GZG+hSiFwL2O3 XBuhkms3PTotyGsTaNxEGEtuSKG9W3iowKtGAScUu/rSFAb8mwk4L2u43satxP1b0uOc KXOx00nFuNt0NmgnlGqYe50V5Cw/eWXGjpibeKkdVRVRpCONjmI/nvDvg/tD0NPUu5U9 mYX1gM5qHK9vBF4SydSonlRyZwlcKVCA6KS4hUhEU+pSD22Nup30Jrua6v88+ZqSecGi 6I0379yb3s5q1M8XjzCGzBstskNwyBkI7GNtk8pFnOvGH+xGZc7mpMu5/Y5Y0FeNXRku 0uHg== 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 l9si2100396pff.155.2018.02.02.09.23.14; Fri, 02 Feb 2018 09:23:30 -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 S1752542AbeBBRV7 (ORCPT + 99 others); Fri, 2 Feb 2018 12:21:59 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:39218 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752910AbeBBRNH (ORCPT ); Fri, 2 Feb 2018 12:13:07 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 9E826E27; Fri, 2 Feb 2018 17:13:06 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Gilad Ben-Yossef Subject: [PATCH 4.14 130/156] staging: ccree: NULLify backup_info when unused Date: Fri, 2 Feb 2018 17:58:31 +0100 Message-Id: <20180202140846.258179410@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180202140840.242829545@linuxfoundation.org> References: <20180202140840.242829545@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Gilad Ben-Yossef commit 46df8824982e4fb0198776078d4a8c3e2d531464 upstream. 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") Signed-off-by: Gilad Ben-Yossef Signed-off-by: Greg Kroah-Hartman --- drivers/staging/ccree/ssi_cipher.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/staging/ccree/ssi_cipher.c +++ b/drivers/staging/ccree/ssi_cipher.c @@ -904,6 +904,7 @@ static int ssi_ablkcipher_decrypt(struct scatterwalk_map_and_copy(req_ctx->backup_info, req->src, (req->nbytes - ivsize), ivsize, 0); 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, (void *)req, DRV_CRYPTO_DIRECTION_DECRYPT); }