Message ID | 20191105140111.20285-12-t-kristo@ti.com |
---|---|
State | New |
Headers | show
Delivered-To: patch@linaro.org Received: by 2002:ac9:3c86:0:0:0:0:0 with SMTP id w6csp709790ocf; Tue, 5 Nov 2019 06:01:52 -0800 (PST) X-Google-Smtp-Source: APXvYqz9YLNWoK92QHMCZFkINwlTo2RNOQ2PYodj1cNoegsx2qSqIthRCtMargAy/sgiyPwEmza9 X-Received: by 2002:a2e:c42:: with SMTP id o2mr19445637ljd.166.1572962512316; Tue, 05 Nov 2019 06:01:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572962512; cv=none; d=google.com; s=arc-20160816; b=DvSMKcnIiWaZRo5f/U0o4zV6hoANCDRbJMlD2rZyOvyg/eCvl1Fnpn0KMbaBCGU+Bj DFRTnkFdo3mZxteda1mnxX5lqW/iuopKktP0FMe/x2QgaMWg+zZa3Y1mFcSu0/Xnv1hx ggJhNmne0QLrCvMCJjrUpdYxPlTBEA24it7TuY9u5IJmdSER5hzb7bN2wZFwgZ3mIIxw j2amheUWjBqWn6kgkxFhL8cRF//T2BFRSQdkZ02dRNiIyjykO9ocaW8GwmBfXDM/QGHa xByTFAyB9DQ1XEZR79wE8RQRHp95qhAAQ/HLq834xSWttpx16WsP/Rtl4zHcrYMK8BtR 8JbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=upit1y8CUJ/UG9U3l05ijSh8ThRDpMaSJFs1e/vfhUM=; b=yEu4Us03xgjBWgAeCEtabwZgff2zUWL02QAYxtca1WGqkwYBGcdD4YeITGGmn7+b/D GR4fpEhFQabfdhTGa0vs8ZUPriUp0btiF+vbqo9UjJNWHLDeqGDvnrkGnRPB55uFrXYe 9nD/sXrIRpFGdzFR2x7lRR+KIKn279yJgnpLiaBk8TnUOlJRb4gYXSgnDb3Yd4uHYvwB oOJllt6vA8lSLm9KUCTLYQFn0l7b75JmXLpmc3q7zhRTVUl+eu3kEyh5TtghtbGUfM8P 9pxy0GiZzSl41BOc+wP+Rlte6vh9YiR4WE+qobWPPF3vqzHZ9DSCGcV13HS1fpRuU0dO g8hw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=LCKWfEOD; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: <linux-crypto-owner@vger.kernel.org> Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id dk11si13340421ejb.97.2019.11.05.06.01.52; Tue, 05 Nov 2019 06:01:52 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-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=@ti.com header.s=ti-com-17Q1 header.b=LCKWfEOD; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389417AbfKEOBt (ORCPT <rfc822;sumit.garg@linaro.org> + 3 others); Tue, 5 Nov 2019 09:01:49 -0500 Received: from fllv0016.ext.ti.com ([198.47.19.142]:44744 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389377AbfKEOBs (ORCPT <rfc822;linux-crypto@vger.kernel.org>); Tue, 5 Nov 2019 09:01:48 -0500 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id xA5E1htl043494; Tue, 5 Nov 2019 08:01:43 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1572962503; bh=upit1y8CUJ/UG9U3l05ijSh8ThRDpMaSJFs1e/vfhUM=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=LCKWfEOD7NI4AuoaE3wiOaqgvKfsh23oVAerXggwu4NLxGozUWxcnJLTFd8EJNxtA RHAPV4GdmAu/39DhhWGw4NU4kBTxL+UO9M+TBNhxQlOwQNjTr8UvB15LXZrQrxZJM/ bz5Hvo/dcK+RY4x8ASAC3XMQegIrw4Kscqf0eyjg= Received: from DLEE107.ent.ti.com (dlee107.ent.ti.com [157.170.170.37]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTP id xA5E1hMk084677; Tue, 5 Nov 2019 08:01:43 -0600 Received: from DLEE115.ent.ti.com (157.170.170.26) by DLEE107.ent.ti.com (157.170.170.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Tue, 5 Nov 2019 08:01:43 -0600 Received: from fllv0040.itg.ti.com (10.64.41.20) by DLEE115.ent.ti.com (157.170.170.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Tue, 5 Nov 2019 08:01:43 -0600 Received: from sokoban.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id xA5E1FFo068289; Tue, 5 Nov 2019 08:01:41 -0600 From: Tero Kristo <t-kristo@ti.com> To: <herbert@gondor.apana.org.au>, <davem@davemloft.net>, <linux-crypto@vger.kernel.org> CC: <linux-omap@vger.kernel.org>, <ard.biesheuvel@kernel.org>, Ard Biesheuvel <ardb@kernel.org> Subject: [PATCHv2 11/22] crypto: omap-aes - reject invalid input sizes for block modes Date: Tue, 5 Nov 2019 16:01:00 +0200 Message-ID: <20191105140111.20285-12-t-kristo@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191105140111.20285-1-t-kristo@ti.com> References: <20191105140111.20285-1-t-kristo@ti.com> MIME-Version: 1.0 Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: <linux-crypto.vger.kernel.org> X-Mailing-List: linux-crypto@vger.kernel.org |
Series |
None
|
expand
|
diff --git a/drivers/crypto/omap-aes.c b/drivers/crypto/omap-aes.c index de05b35283bf..067f4cd7c005 100644 --- a/drivers/crypto/omap-aes.c +++ b/drivers/crypto/omap-aes.c @@ -525,6 +525,9 @@ static int omap_aes_crypt(struct skcipher_request *req, unsigned long mode) struct omap_aes_dev *dd; int ret; + if ((req->cryptlen % AES_BLOCK_SIZE) && !(mode & FLAGS_CTR)) + return -EINVAL; + pr_debug("nbytes: %d, enc: %d, cbc: %d\n", req->cryptlen, !!(mode & FLAGS_ENCRYPT), !!(mode & FLAGS_CBC));