Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1975369pxb; Fri, 5 Mar 2021 04:33:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJxZLYypTqayO6oZJS9KoEcA6tHVfTCeqiouAuHFw1k/1uFpMat0wBWZz/qwvt6+FbGfllrJ X-Received: by 2002:a17:906:f10c:: with SMTP id gv12mr2044387ejb.53.1614947631608; Fri, 05 Mar 2021 04:33:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614947631; cv=none; d=google.com; s=arc-20160816; b=CYCesiBxi5hNs4wK5QPt0SlJ2Wv2RN+Wh0mRDSQQg+FiOIVUS2jgKlmnanu9ZBy/3x xliz37HmalmZx7xycgIPng77RvdHXLwH2QHrmNBR9qe9XvjWIVFMKhDWp5ZA9NAghHKs PWZENp6bM7i7x5YZ5LpZyvqNtGUYdMjYHqpNpxehEswbsaS55N8XwEpfSBn0XRTU2pEw Cw15NMI7JqYzidmU42oTmnJZFRIdO8w0vzxEvc36Pbdw/HJkpI2GOJ3q2vz05B7HdBPk XzwAPekIR3Jt7EnZaY9r20ZV1Xeor9/PUQKLOzxDt9JKVCyHFo7FmhHROj8//zYkseiS Bnaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=+AO6peqHlkoNacw1JF8qF4TOh/SrmtnxSOd4CRty/9M=; b=DxRNjUDoVQ5XtCfCN1v3gtdYmqeSfk8fXxvPOtGGI9wJJdTOnnLCyznOCJ+cXJ6QEV k40ozxVfo8bt55VLuYgtAesbu9cHqCKFC4h2LqF2d/o9NZaeveoxIRTi/H3HHBr1ZYJd dYadavXNKyAy+yd9I1rfTRv0sTpJfGC8XihopV1dAnuGKm7NKnplyCfUJK3VgvGqZkZO mieEXktLMLx/J2WONrCVeGR3OKiU6FTim2QXLNGPpWxY+KCjiZswR8goxvB6m156CLVA HF4wwKaV0fgs1cpiE1TgCPF0MW41zqCYgL9yjJ6jaioDR+gU9rsh5vFfCyqEMSbSiyvX sgdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=yp2PWEYo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k5si1257561ejo.356.2021.03.05.04.33.27; Fri, 05 Mar 2021 04:33:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=yp2PWEYo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231147AbhCEMax (ORCPT + 99 others); Fri, 5 Mar 2021 07:30:53 -0500 Received: from mail.kernel.org ([198.145.29.99]:40096 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231278AbhCEMaR (ORCPT ); Fri, 5 Mar 2021 07:30:17 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 36F0F6501A; Fri, 5 Mar 2021 12:30:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1614947416; bh=cbZzRmSiuyPgrg1UgPbLQq3gEeWVVBIiLbQ1sHBdyLc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yp2PWEYoafPcFgiS2gx98yTdGqR9i5aQ3NawzWOQthvnWPFHdxrx0OsYm3SnUqShZ zAjN+0t0CcVhsOl2XoUqGrdVmBFDzJ1gpdggHqSEdDwxGMWHUSjTlIVez8CUs/VeuC 3h/488390ibWRLW/VJjQ68VNvYPQzHjm3wtxLwzE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ard Biesheuvel , Herbert Xu , Sasha Levin Subject: [PATCH 5.10 058/102] crypto: tcrypt - avoid signed overflow in byte count Date: Fri, 5 Mar 2021 13:21:17 +0100 Message-Id: <20210305120906.141044818@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210305120903.276489876@linuxfoundation.org> References: <20210305120903.276489876@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ard Biesheuvel [ Upstream commit 303fd3e1c771077e32e96e5788817f025f0067e2 ] The signed long type used for printing the number of bytes processed in tcrypt benchmarks limits the range to -/+ 2 GiB, which is not sufficient to cover the performance of common accelerated ciphers such as AES-NI when benchmarked with sec=1. So switch to u64 instead. While at it, fix up a missing printk->pr_cont conversion in the AEAD benchmark. Signed-off-by: Ard Biesheuvel Signed-off-by: Herbert Xu Signed-off-by: Sasha Levin --- crypto/tcrypt.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c index eea0f453cfb6..8609174e036e 100644 --- a/crypto/tcrypt.c +++ b/crypto/tcrypt.c @@ -199,8 +199,8 @@ static int test_mb_aead_jiffies(struct test_mb_aead_data *data, int enc, goto out; } - pr_cont("%d operations in %d seconds (%ld bytes)\n", - bcount * num_mb, secs, (long)bcount * blen * num_mb); + pr_cont("%d operations in %d seconds (%llu bytes)\n", + bcount * num_mb, secs, (u64)bcount * blen * num_mb); out: kfree(rc); @@ -469,8 +469,8 @@ static int test_aead_jiffies(struct aead_request *req, int enc, return ret; } - printk("%d operations in %d seconds (%ld bytes)\n", - bcount, secs, (long)bcount * blen); + pr_cont("%d operations in %d seconds (%llu bytes)\n", + bcount, secs, (u64)bcount * blen); return 0; } @@ -760,8 +760,8 @@ static int test_mb_ahash_jiffies(struct test_mb_ahash_data *data, int blen, goto out; } - pr_cont("%d operations in %d seconds (%ld bytes)\n", - bcount * num_mb, secs, (long)bcount * blen * num_mb); + pr_cont("%d operations in %d seconds (%llu bytes)\n", + bcount * num_mb, secs, (u64)bcount * blen * num_mb); out: kfree(rc); @@ -1197,8 +1197,8 @@ static int test_mb_acipher_jiffies(struct test_mb_skcipher_data *data, int enc, goto out; } - pr_cont("%d operations in %d seconds (%ld bytes)\n", - bcount * num_mb, secs, (long)bcount * blen * num_mb); + pr_cont("%d operations in %d seconds (%llu bytes)\n", + bcount * num_mb, secs, (u64)bcount * blen * num_mb); out: kfree(rc); @@ -1435,8 +1435,8 @@ static int test_acipher_jiffies(struct skcipher_request *req, int enc, return ret; } - pr_cont("%d operations in %d seconds (%ld bytes)\n", - bcount, secs, (long)bcount * blen); + pr_cont("%d operations in %d seconds (%llu bytes)\n", + bcount, secs, (u64)bcount * blen); return 0; } -- 2.30.1