From patchwork Wed Jan 27 17:14:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tadeusz Struk X-Patchwork-Id: 8136001 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: X-Original-To: patchwork-linux-crypto@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 7BC2C9F818 for ; Wed, 27 Jan 2016 17:18:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7EB3F20320 for ; Wed, 27 Jan 2016 17:18:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 779ED2026D for ; Wed, 27 Jan 2016 17:18:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932833AbcA0RSA (ORCPT ); Wed, 27 Jan 2016 12:18:00 -0500 Received: from mga03.intel.com ([134.134.136.65]:20516 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754032AbcA0RR7 (ORCPT ); Wed, 27 Jan 2016 12:17:59 -0500 Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga103.jf.intel.com with ESMTP; 27 Jan 2016 09:17:59 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,355,1449561600"; d="scan'208";a="735252678" Received: from tstruk-mobl1.jf.intel.com (HELO [127.0.1.1]) ([134.134.171.59]) by orsmga003.jf.intel.com with ESMTP; 27 Jan 2016 09:17:59 -0800 Subject: [PATCH 3/3] crypto: algif_skcipher - increase private contex space for async request From: Tadeusz Struk To: herbert@gondor.apana.org.au Cc: linux-crypto@vger.kernel.org, stable@vger.kernel.org, tadeusz.struk@intel.com Date: Wed, 27 Jan 2016 09:14:06 -0800 Message-ID: <20160127171406.32579.69197.stgit@tstruk-mobl1> In-Reply-To: <20160127171350.32579.49931.stgit@tstruk-mobl1> References: <20160127171350.32579.49931.stgit@tstruk-mobl1> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The private context space that was allocated for the async request was too small. It accidentally worked fine (at least with the qat driver) because the qat driveri, by mistake, allocated too much. The problem started to show up since the qat driver issue has been fixed in commit: 7768fb2ee. We also need another version of this patch applicable to the code before skcipher conversion that adds sizeof(struct ablkcipher_request) Cc: # 4.4.x- Signed-off-by: Tadeusz Struk --- crypto/algif_skcipher.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-crypto" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/crypto/algif_skcipher.c b/crypto/algif_skcipher.c index 78529ce..298605d 100644 --- a/crypto/algif_skcipher.c +++ b/crypto/algif_skcipher.c @@ -69,10 +69,12 @@ struct skcipher_async_req { }; #define GET_SREQ(areq, ctx) (struct skcipher_async_req *)((char *)areq + \ - crypto_skcipher_reqsize(crypto_skcipher_reqtfm(&ctx->req))) + crypto_skcipher_reqsize(crypto_skcipher_reqtfm(&ctx->req)) + \ + sizeof(struct skcipher_request)) #define GET_REQ_SIZE(ctx) \ - crypto_skcipher_reqsize(crypto_skcipher_reqtfm(&ctx->req)) + crypto_skcipher_reqsize(crypto_skcipher_reqtfm(&ctx->req)) + \ + sizeof(struct skcipher_request) #define GET_IV_SIZE(ctx) \ crypto_skcipher_ivsize(crypto_skcipher_reqtfm(&ctx->req))