Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp772285ybl; Wed, 11 Dec 2019 07:17:49 -0800 (PST) X-Google-Smtp-Source: APXvYqx1MlNBg4jYLnQqBmYNtdThF1tjnYzg+sJYADfhCGAUkEjjuzsYTZPrrCkeyKPDJJDAEtz+ X-Received: by 2002:a05:6808:4cc:: with SMTP id a12mr3282482oie.115.1576077468926; Wed, 11 Dec 2019 07:17:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576077468; cv=none; d=google.com; s=arc-20160816; b=l91LXte3fuxWCwu+3ktHcPNAPzXBVaNBET9AMPGtwEG/IjRSrjPkzhqyrZD0h9751z 1DxPgfdmkzDnl5yex/tyH/77DZZJRxdVUO5hzfcn+jhkccFg+bq1Z1qGUeESal0vW+gP GVItOwivk1jYyPPv9pTNcYMgsgS5JudV1QhVyln/6PsPDjWdI+O5LJRdzaH+5NuwMOWN N4qxYw52qofpoqwELC+fRCylf3fJ0LV2+ZBxQlDE424wu5+ZVvRVBGezL+SpghNVZSjz gTnCtJi7EtjYfNx+OkAL27Dekh780JsA3ckEtwxmZJB4qCZqHpAFMl862dIydTmzZ6Zr 7arg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=+or8r5MHrCpnkZ4FTXhE3dOHuZUfmc1yYxx1GMgwuNQ=; b=wgkLqrxB/SuY3HLsAWSfppvEhJ4AEX1WnaWW7dq3fVS0IdICh6KlfS61t1T4IraqAP OSI86wZswhSgeURMp+Zc0mKU1Vtq2AS7i6qS7edxGYeMT/qbFaiM267road17Jn+FWpR UuF8l90S9v5Zn1I/toAiH2+lsg8mMXjSLx3BLBZP4xA0QGXosR5Z8okYY+ucXQMJfitX sg4VpMirjlyGb8zVPBXH3s07PqPG8GbYmtCUu+8Qqz24MZwzZVgiGhUGl1N1Q2n3+slC AoaAvGaLh+LFnC4arpKXA6xW1CqJralT1Qx9WiB/Sjg9gzbOVLx8vC8sMG3CU/pAV5IR fiQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=KsPlMqn6; 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 w4si1282362otl.214.2019.12.11.07.17.35; Wed, 11 Dec 2019 07:17:48 -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; dkim=pass header.i=@kernel.org header.s=default header.b=KsPlMqn6; 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 S1731828AbfLKPPs (ORCPT + 99 others); Wed, 11 Dec 2019 10:15:48 -0500 Received: from mail.kernel.org ([198.145.29.99]:42058 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731817AbfLKPPh (ORCPT ); Wed, 11 Dec 2019 10:15:37 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 835E524654; Wed, 11 Dec 2019 15:15:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576077337; bh=qZP2yRdgbUNSFmpXlCEF63tmGL1c3FYWJMWm9kxrw1g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KsPlMqn65ggXD2kw/h++SyvdhJyKcl0Pt3l/JaCi/d+HjNCurVDSAju3Z0BX53pvZ n7GU6GECB024xnkEpjxOkVaLnzcGKswslEnz+b5Gy+pMUMEqArqgPCWMOI6QhGbdlN KF/YfxNbRCFUeA6bDk1jqdsmtszuJA3Ngf5ebSe8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ayush Sawal , Atul Gupta , Herbert Xu Subject: [PATCH 5.3 087/105] crypto: af_alg - cast ki_complete ternary op to int Date: Wed, 11 Dec 2019 16:06:16 +0100 Message-Id: <20191211150259.785118286@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191211150221.153659747@linuxfoundation.org> References: <20191211150221.153659747@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ayush Sawal commit 64e7f852c47ce99f6c324c46d6a299a5a7ebead9 upstream. when libkcapi test is executed using HW accelerator, cipher operation return -74.Since af_alg_async_cb->ki_complete treat err as unsigned int, libkcapi receive 429467222 even though it expect -ve value. Hence its required to cast resultlen to int so that proper error is returned to libkcapi. AEAD one shot non-aligned test 2(libkcapi test) ./../bin/kcapi -x 10 -c "gcm(aes)" -i 7815d4b06ae50c9c56e87bd7 -k ea38ac0c9b9998c80e28fb496a2b88d9 -a "853f98a750098bec1aa7497e979e78098155c877879556bb51ddeb6374cbaefc" -t "c4ce58985b7203094be1d134c1b8ab0b" -q "b03692f86d1b8b39baf2abb255197c98" Fixes: d887c52d6ae4 ("crypto: algif_aead - overhaul memory management") Cc: Signed-off-by: Ayush Sawal Signed-off-by: Atul Gupta Signed-off-by: Herbert Xu Signed-off-by: Ayush Sawal Signed-off-by: Herbert Xu Signed-off-by: Greg Kroah-Hartman --- crypto/af_alg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/crypto/af_alg.c +++ b/crypto/af_alg.c @@ -1043,7 +1043,7 @@ void af_alg_async_cb(struct crypto_async af_alg_free_resources(areq); sock_put(sk); - iocb->ki_complete(iocb, err ? err : resultlen, 0); + iocb->ki_complete(iocb, err ? err : (int)resultlen, 0); } EXPORT_SYMBOL_GPL(af_alg_async_cb);