Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp4896049imm; Tue, 18 Sep 2018 00:36:29 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdbp8/TLd4DCfn4kElH8wO1A4S9Dw8qL50h4Ur7/UXbKQkpsbMdV59POA8JEt1sBsffGpGge X-Received: by 2002:a62:6a01:: with SMTP id f1-v6mr29366899pfc.156.1537256189028; Tue, 18 Sep 2018 00:36:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537256189; cv=none; d=google.com; s=arc-20160816; b=Zt1aDxLb/2qx72Bvp+qB0DeXoDgE9xDsyPaWWakWpaZctdJVrX1PXl3hjJ5UTbJodm lWXOqu7v0tYA+lhr8Ksp9Io+ZJP70dC0Y/W5bQ06lLyoWlnkPHXVjZ0RT/EzccXYcXyM lAXIY+s5Pz+H7CpRehSkhIhstPjZHadNEd14cKJS16ddWuIJlHe9u3JRzD2SS5z5z8M4 WEVI9MJjGQvD5j7wAOJV50iGPvLvIiWSBv5Bof49lyBbQroGp65UosN8Mfeenk2XzuUz j45mGkwufjoY+xLzdzIKBcq90T5MovGJW6w7tWLEZpyk5zFXmnQoKmVuim8nAmyMLFgh tzSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=ffw/HXRfspIhS55KnIddr573jQ355/9BCvsZdzsfC0M=; b=ogqy26+HbvMDBpMxz9WrKGFGkdHDHjVAkZIy8a/znn2aP1bv/b02SRcuBksZSsxRWF TbWtW3+Vuw85OqiwutAPFpzJCfO485CU5myEe91jRDlIqGR8PUzbyLpN4E3ycP57s6bZ Gc6EUjLhiM5aDpyE1jisZh1bXjREFIVv/frqYyHSZOfp5dVGQvMfSHZthn9zmz0cQA68 HSkOF2jsk/NOtQlIR75XO2omV66+L+yQV1bf3Gg0p1IIq96UllLf7I7+x6HynWXS0yV4 1vzPynwWtcDswSENK25F6xhPtgsq2y8HZ5Xzc9VRo+MOTwfL1ybyI0h+EzU04zu0AR8E UfuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=nO4G2M5g; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y9-v6si17923055pgs.521.2018.09.18.00.36.13; Tue, 18 Sep 2018 00:36:28 -0700 (PDT) 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=nO4G2M5g; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729250AbeIRNFJ (ORCPT + 99 others); Tue, 18 Sep 2018 09:05:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:60848 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727475AbeIRNFI (ORCPT ); Tue, 18 Sep 2018 09:05:08 -0400 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D73B9214D5; Tue, 18 Sep 2018 07:33:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1537256028; bh=SUYU+9qc1rJSOn8u4MTA2unX+kdFQnaoaxMHQ0Gf2X0=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=nO4G2M5g33QLK/MlBXW9PIz9la65pXBMrBJ1WRUfRRXRVYCjJYd3qRxuKce72didm GBhmJbnonUVHvKaLgEUc8AMHzcvtF6hBmQZomwbi0Op7zUV9l+0p/8pFqqWHpNa3WM v/YmvLPe3nzV9CIJui1iqmjGl7+Dr3CN4Dqe1qiM= Received: by mail-wm1-f49.google.com with SMTP id j25-v6so6309183wmc.1; Tue, 18 Sep 2018 00:33:47 -0700 (PDT) X-Gm-Message-State: APzg51BuSjobKDAJHQJDCuTg1MhfiSIzOE4f22/1F5s2Iw+LvnyewOe/ XMIkd6XngjakV7f3qx2jZHXpCbydF2gHXDL8QUA= X-Received: by 2002:a1c:dc1:: with SMTP id 184-v6mr15022146wmn.145.1537256026240; Tue, 18 Sep 2018 00:33:46 -0700 (PDT) MIME-Version: 1.0 References: <1537196970-5987-1-git-send-email-c.manszewski@samsung.com> <20180917151006eucas1p2226806b94605b061bc1bc3e9b5a6c495~VOIhXssSK0729007290eucas1p25@eucas1p2.samsung.com> In-Reply-To: <20180917151006eucas1p2226806b94605b061bc1bc3e9b5a6c495~VOIhXssSK0729007290eucas1p25@eucas1p2.samsung.com> From: Krzysztof Kozlowski Date: Tue, 18 Sep 2018 09:33:35 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 1/4] crypto: s5p-sss: Fix race in error handling To: c.manszewski@samsung.com Cc: linux-crypto@vger.kernel.org, vz@mleia.com, k.konieczny@partner.samsung.com, herbert@gondor.apana.org.au, davem@davemloft.net, "linux-samsung-soc@vger.kernel.org" , linux-kernel@vger.kernel.org, =?UTF-8?B?QmFydMWCb21pZWogxbtvxYJuaWVya2lld2ljeg==?= 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 On Mon, 17 Sep 2018 at 17:10, Christoph Manszewski wrote: > > Remove a race condition introduced by error path in functions: > s5p_aes_interrupt and s5p_aes_crypt_start. Setting the busy field of > struct s5p_aes_dev to false made it possible for s5p_tasklet_cb to > change the req field, before s5p_aes_complete was called. > > Change the first parameter of s5p_aes_complete to struct > ablkcipher_request. Before spin_unlock, make a copy of the currently > handled request, to ensure s5p_aes_complete function call with the > correct request. > > Signed-off-by: Christoph Manszewski > --- > drivers/crypto/s5p-sss.c | 12 +++++++----- > 1 file changed, 7 insertions(+), 5 deletions(-) Reviewed-by: Krzysztof Kozlowski Best regards, Krzysztof