From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,USER_AGENT_NEOMUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AE075C10F0E for ; Sun, 7 Apr 2019 15:40:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7226E20880 for ; Sun, 7 Apr 2019 15:40:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="SDSHEdr7" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726372AbfDGPkN (ORCPT ); Sun, 7 Apr 2019 11:40:13 -0400 Received: from mail-wr1-f47.google.com ([209.85.221.47]:43715 "EHLO mail-wr1-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726360AbfDGPkN (ORCPT ); Sun, 7 Apr 2019 11:40:13 -0400 Received: by mail-wr1-f47.google.com with SMTP id k17so13351755wrx.10 for ; Sun, 07 Apr 2019 08:40:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=qSUuEQc5RiEBZ262Ga9W0QhTpwqJn2odVL6+APsUfkc=; b=SDSHEdr7+UlGN4iNdavjN/Qr9LFvR41e1jzKXWh2onZ5d2bIiGLwdgoaJeSUFqRaMF 8bPHJJ38zwOAt/mxBUnlVIqiUpVE4Qsa74lV0zBU0kkzhP6wt7w7vsBTzmaHjuiJc2k/ 9eO5+aieelRzTf1GsqLQxrN8X+nyQlTzT9MZjvdp6mdR/lZ86GVuClhYBymwEkVm7I+u lYf7PUrhZUljEYYbAthl+Lwf5JEhtp6yD8yxWkqp0mxp0d871ca8JPF72gQpLIJ/4GBQ i8Xl7qQy6kR5JcZML12dZlpCDXyABxMICEU2DjQ+CjklVGflm0YjVPtikUew9ZMEAKUV ypkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=qSUuEQc5RiEBZ262Ga9W0QhTpwqJn2odVL6+APsUfkc=; b=gSuTxz4Nfft5PkOxm/FBWShkQ/6FqEKdkWf2pjqANIhGrR3KcAGKkFOEIdwJ6xpFJ4 r8rvBA25UwCVcHGOqAr63Cy0ZFsBK/wgPYltKxmvykKcoT8/S0GWZQSTwIEiv/EGWOQH QNuZH1pRhJrZZwsA1QgoYmxX1r903v68m5veL5ivQ7sjbYRa7OVisYept4L3CEkpZwrS rQsHq2dtVTPD4ikYohVMEe9a8yOqJT2mnBESPTfcVNHlU4T5XPEqinxEzHO3eF6J2JCQ 7hnHGMXC6Oo2klYgeSDlnUxssxm8v34kNojJfFHbKy4CrE0JQsuw2CQKCyre4ML/5Ybu Dk9g== X-Gm-Message-State: APjAAAWYyWqf9AGDEa9LQh8c6Z1JSxAXYafOd4bYVDkc5Binu3Ddpo49 UC569/ZtwgEO3Segb84tNzNxuWatu/4= X-Google-Smtp-Source: APXvYqwMYguv0ZYNXPKlKTrwD7znYjUoXa6qb4PkGfIZg3x8DyyHJFc/jI0+Ycd6U+2MxB5EVBWNJA== X-Received: by 2002:a5d:5284:: with SMTP id c4mr16085159wrv.281.1554651611579; Sun, 07 Apr 2019 08:40:11 -0700 (PDT) Received: from debian (cpc101300-bagu16-2-0-cust362.1-3.cable.virginm.net. [86.21.41.107]) by smtp.gmail.com with ESMTPSA id j22sm84941346wrd.91.2019.04.07.08.40.09 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 07 Apr 2019 08:40:10 -0700 (PDT) Date: Sun, 7 Apr 2019 16:40:08 +0100 From: Sudip Mukherjee To: Greg Kroah-Hartman Cc: stable@vger.kernel.org, Gilad Ben-Yossef Subject: request for 4.14-stable: 293edc27f8bc ("stating: ccree: revert "staging: ccree: fix leak of import() after init()"") Message-ID: <20190407154008.sd2j2tmka4akiimk@debian> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="6smmmmkjp3cqljow" Content-Disposition: inline User-Agent: NeoMutt/20170113 (1.7.2) Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org --6smmmmkjp3cqljow Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi Greg, This was missing in 4.14-stable. Please apply to your queue. -- Regards Sudip --6smmmmkjp3cqljow Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0001-stating-ccree-revert-staging-ccree-fix-leak-of-impor.patch" >From aea00e5caac52ffe575b3c94d6bd47703ab44b0e Mon Sep 17 00:00:00 2001 From: Gilad Ben-Yossef Date: Sun, 7 Jan 2018 12:14:22 +0000 Subject: [PATCH] stating: ccree: revert "staging: ccree: fix leak of import() after init()" commit 293edc27f8bc8a44978e9e95902b07b74f1c7523 upstream This reverts commit c5f39d07860c ("staging: ccree: fix leak of import() after init()") and commit aece09024414 ("staging: ccree: Uninitialized return in ssi_ahash_import()"). This is the wrong solution and ends up relying on uninitialized memory, although it was not obvious to me at the time. Cc: stable@vger.kernel.org Signed-off-by: Gilad Ben-Yossef Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sudip Mukherjee --- drivers/staging/ccree/ssi_hash.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/staging/ccree/ssi_hash.c b/drivers/staging/ccree/ssi_hash.c index e266a70a1b32..13291aeaf350 100644 --- a/drivers/staging/ccree/ssi_hash.c +++ b/drivers/staging/ccree/ssi_hash.c @@ -1781,7 +1781,7 @@ static int ssi_ahash_import(struct ahash_request *req, const void *in) struct device *dev = &ctx->drvdata->plat_dev->dev; struct ahash_req_ctx *state = ahash_request_ctx(req); u32 tmp; - int rc = 0; + int rc; memcpy(&tmp, in, sizeof(u32)); if (tmp != CC_EXPORT_MAGIC) { @@ -1790,12 +1790,9 @@ static int ssi_ahash_import(struct ahash_request *req, const void *in) } in += sizeof(u32); - /* call init() to allocate bufs if the user hasn't */ - if (!state->digest_buff) { - rc = ssi_hash_init(state, ctx); - if (rc) - goto out; - } + rc = ssi_hash_init(state, ctx); + if (rc) + goto out; dma_sync_single_for_cpu(dev, state->digest_buff_dma_addr, ctx->inter_digestsize, DMA_BIDIRECTIONAL); -- 2.11.0 --6smmmmkjp3cqljow--